Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
intra0 opened this issue Oct 6, 2024 · 10 comments
Closed

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

intra0 opened this issue Oct 6, 2024 · 10 comments

Comments

@intra0
Copy link
Contributor

intra0 commented Oct 6, 2024

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
Copy link
Contributor Author

intra0 commented Oct 6, 2024

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

@thesourcehim
Copy link
Contributor

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

@intra0
Copy link
Contributor Author

intra0 commented Oct 8, 2024

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

@thesourcehim
Copy link
Contributor

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.

@rofl0r
Copy link
Collaborator

rofl0r commented Oct 8, 2024

wayland vs X11 issue maybe ?

@intra0
Copy link
Contributor Author

intra0 commented Oct 8, 2024

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

@intra0
Copy link
Contributor Author

intra0 commented Oct 8, 2024

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

@thesourcehim
Copy link
Contributor

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
Copy link
Contributor

@intra0, please test PR #845

@intra0
Copy link
Contributor Author

intra0 commented Oct 11, 2024

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.

@rofl0r rofl0r closed this as completed in 0a36e96 Oct 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants