-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Wayland Support #11257
Wayland Support #11257
Conversation
c9517bc
to
49cbaea
Compare
Currently there's a deadlock introduced in 052354d that causes dolphin to lock up and not display a window. Something is implemented incorrectly in It appears to have something to do with UpdateInput() Any hints would be appreciated. For my own reference later
The deadlock always happens in the main thread on Inside that thread, a loop is calling
That's probably a good hint. And also going back up into
Yet another hint |
@LaserEyess Not sure if it would help but I rebased Stenzek's branch to get wayland and vulkan on the no gui version for the Jelos operating system. Works both on arm and x86_64 with latest dev commits. I didnt bother adding any of the QT stuff. |
The QT stuff would be important here, as that's where the deadlocks are happening. I would definitely appreciate and welcome any help I can get. If something looks wrong with my rebase let me know. |
Does this help? Thread Sanitizer output
|
Thanks for the thread sanitizer trace. The core of the issue seems to be that multiple threads are calling
The 2 (3?) threads that are calling this function are the Qt wayland threads for the UI, and whatever thread is running What I'm most confused about is why KeyboardMouse needs to call What I do know is that the last time someone rebased this, it was off of 3da6487, so somehow input handling or Qt has changed since then. There is a lot to check though |
Input is checked even if no game is running so hotkeys work. This is by design. I don't really understand why Wayland requires this -- this means that every single thread that ever calls an input function has to keep calling it in perpetuity, and all threads block eachother until they all call the input check, yeah? Is there a way to... not require this? It seems really strange and not useful at all. I suppose you could work around it by making a worker thread (eg with a |
It is required because there are some synchronization guarantees that wayland makes, I do not fully understand the specifics. However, it doesn't need to call it perpetually, it can also just call |
But... why is this deadlocking then? How is any thread here possibly calling https://wayland.freedesktop.org/docs/html/apb.html has a slightly different code snippet here (see |
Also: What happens if you wrap the entire UpdateInput() and ProcessEvents() functions in a (the same) mutex? (https://chromium.googlesource.com/external/wayland/wayland/+/refs/heads/master/src/wayland-client.c suggests that wl_display_dispatch() and wl_display_read_events() cannot be called at the same time by different threads) |
Nothing in Dolphin is doing this, correct. But a |
Any news about Wayland support on Dolphin ? |
Native wayland support (whether via this PR or another) may be the key to chromeos support for dolphin, although that would also require support from the graphics backends to do so. |
Are you aware of #8727 ? |
This is going to have merge conflicts with #11522 (sorry) I really don't like how It feels like there needs to be a better abstraction around surface size. I wonder if the |
Yes, I am aware, but you should read what that PR says:
Emphasis mine. This PR supports those. @phire I will be honest, though I can definitely rebase this PR and make sure it compiles, I know it won't work due to the discussion above about deadlocking. My main problem is that I don't know enough about dolphin's code base nor wayland's APIs to do real improvements to this PR. If significant refactoring is required to get this merged then it is beyond me. I can keep it rebased in case someone else wants to pick it up, but I don't think I can finish it. |
I don't know enough about Dolphin's internals nor wayland to finish this. If you want this feature implemented, it will have to be worked on by a core developer or someone much better with graphics/wayland than me. This is the open feature request for wayland support on Dolphin's issue tracker: https://bugs.dolphin-emu.org/issues/11807. This is the best way to tell devs this feature is important to you. |
Rebase of #7452
This is not ready yet, I'm only putting it up in case someone wants to help. The rebase builds, but wayland does not work, it still fails to initialize the video backend.