desmume icon indicating copy to clipboard operation
desmume copied to clipboard

[linux] editing controlls sometimes (often) freezes the emulator

Open intra0 opened this issue 1 year ago • 10 comments

Tested using the newest commit as of october 2024, built using gtk3 Screenshot from 2024-10-05 19-34-37 when editing controlls, if you are not quick enough (and 60% of the time even if you are) the emulator will hard freeze. music will still play, and the game will run, and if you already have some controls set up by the time it freezes, you can use those buttons. but when I say it hard freezes, I mean it becomes impossible to quit the program. none of the UI is interactable, and alt+f4 does nothing. only thing that works is opening up the task manager and killing the process.

intra0 avatar Oct 06 '24 07:10 intra0

a similar issue was reported for the flatpak version in #731 that issue has been fixed (at least on fedora) but this new issue happens happens on all linux versions of desmume

intra0 avatar Oct 06 '24 07:10 intra0

I tried to reproduce using my local build, but no luck so far. Is it exclusive to flatpack version?

thesourcehim avatar Oct 08 '24 07:10 thesourcehim

No I compiled the latest commit from source and reproduced the issue also happens in the fedora rpm fusion version

try opening the change A button and leaving it for like 30 seconds to a minute

intra0 avatar Oct 08 '24 08:10 intra0

I started a game, then opened 'Configure joystick controls' window, pressed a button at the top (configure A), the emulation paused, which is expected: the dialog appears waiting for the input in a loop in the main thread. I waited for a minute then pressed a button on my gamepad, input was accepted and emulation continued.

thesourcehim avatar Oct 08 '24 09:10 thesourcehim

wayland vs X11 issue maybe ?

rofl0r avatar Oct 08 '24 20:10 rofl0r

I am using wayland (gnome). what distro are you using @thesourcehim ?

intra0 avatar Oct 08 '24 21:10 intra0

and it only happens for joystick controlls, does not happen for keyboard controlls, are you using keyboard @thesourcehim ? and also try to cancle the edit joystick controlls

changing the focused window while this is up can also cause the freeze image

intra0 avatar Oct 08 '24 21:10 intra0

Yes, I'm using gamepad. My system is Fedora 40, Plasma 6 wayland. You can not press Ok or Cancel until you give some input from your gamepad because as I explained earlier application enters a loop waiting for input. This can lead to a deadlock if for example gamepad gets disconnected while app is in the loop (hotplugging is not supported). I agree this is not the best way to configure controls, I'll rework that dialog to get input asynchronously. For now you have press something on a gamepad to exit the loop.

thesourcehim avatar Oct 09 '24 06:10 thesourcehim

@intra0, please test PR #845

thesourcehim avatar Oct 10 '24 08:10 thesourcehim

I explained earlier application enters a loop waiting for input sorry I read it but didn't fully process it at the time.

Tested PR #845 and it totally and completely fixed this issue. it no longer dead loops when I press edit controlls, and the cancel button now works.

intra0 avatar Oct 11 '24 01:10 intra0