-
-
Notifications
You must be signed in to change notification settings - Fork 7.8k
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
PipeWire captures cursor incorrectly on Linux Wayland #4766
Comments
This is almost certainly a bug in Mutter / GNOME Shell, but just to make sure, would you please run this script [xdp-screen-cast-embedded-monitor.zip] and see if it works correctly? Unpack it, and run the |
@GeorgesStavracas So I can't reproduce the issue in OBS with your script. In fact screen sharing in that script seems to work nearly perfectly. Sometimes the share is a bit laggy, and sometimes with window sharing the aspect ratio is wrong (the output gets squished) but the mouse is always perfect. Since it may actually be an OBS-specific issue I will try it out in Fedora 34 KDE wayland. Do you know if PipeWire and OBS flatpak will work in a distro running in live USB mode? |
Right. Thanks for testing it. That means Mutter / GNOME Shell is indeed sending the wrong cursor information through PipeWire. OBS Studio merely renders what it receives, and since it's receiving slightly wrong information, it ends up with a slightly wrong result. |
It's not happening in OBS. Don't worry |
On KDE with Fedora 34, OBS via RPM Fusion doesn't have the mouse displacement issue. Rather the mouse doesn't show with window sharing. Also with display sharing the cursor is too small. I made a table summarizing what I've noticed. Cursor issues in OBS with Wayland PipeWire screen sharing:
OBS is running on a exclusively HIDPI (200% scaling) setup on Fedora 34. |
Amazing. My exceptional goldfish memory forgot I was actually already reviewing a merge request against Mutter fixing this: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1866 I know this might be quite a stretch, but if you could test that merge request and let us know if it fixes the "GNOME" column of the table above, it would be fantastic. Otherwise, I'll eventually have to test it all and see if it's working, but it might take a few weeks 🙁 |
@GeorgesStavracas So I tried to run Mutter with that patch and it doesn't appear to have done anything. Every issue in the GNOME column still occurs. Since I'm on Fedora 34 Silverblue, I figured I should take the Mutter RPM, put the patch in the .spec, make sure all the patches were in the right directory and then build it. I installed the new RPM with Is there anything else I could do to help test that patch out? |
Thanks for testing it - that's really appreciated, specially when it's a non-trivial task. I'll try and reproduce this issue, and if I manage to, see what's going on. I still suspect the merge request I mentioned fixes it, but let's see. |
@GeorgesStavracas Visible preview issues in OBS with Cursor using Wayland PipeWire screen sharing with !1866.
The cursor is no longer way too large and the cursor is relatively close to where it should be (to the point where only the keen-eyed will notice). Thank you again for helping find that patch. I might test it a bit more and then report my findings to the mutter discussion upstream. If you're wondering how I managed to make this mistake, it appears that naming the patched RPM the same as the distro-provided mutter caused a problem. Simply giving my RPM a slightly different name seems to have gotten everything to work properly. I might report a bug to rpm-ostree as it should probably warn you if you try to do what I did... |
@GeorgesStavracas Does this mean we're waiting for the mutter merge request to be merged and distributed? |
@RytoEX yes. Feel free to close this, there doesn't seem to have anything else to do on OBS side. |
Closing. Upstream patches like !1866 should mostly solve the issue for Mutter (GNOME). Feel free to discuss more upstream as that’s the ideal place to fix cursor issues. |
The cursor bitmap is centered on the hotspot, so not accounting for it means PipeWire captures were positioning the cursor sprite slightly off. Properly account for the hotspot by subtracting it from the cursor position. Related: obsproject#4766
The cursor bitmap is centered on the hotspot, so not accounting for it means PipeWire captures were positioning the cursor sprite slightly off. Properly account for the hotspot by subtracting it from the cursor position. Related: #4766
Part of this issue was actually fixed by #4936 |
The cursor bitmap is centered on the hotspot, so not accounting for it means PipeWire captures were positioning the cursor sprite slightly off. Properly account for the hotspot by subtracting it from the cursor position. Related: obsproject#4766
Operating System Info
Other
Other OS
Fedora 34 Silverblue
OBS Studio Version
27.0.0-rc6
OBS Studio Version (Other)
No response
OBS Studio Log URL
https://obsproject.com/logs/88w7RayumWBJAQKA
OBS Studio Crash Log URL
No response
Expected Behavior
I expect the cursor to be positioned and sized correctly. The video OBS produces should ideally be 100% representative of what the display originally showed.
Current Behavior
PipeWire Window Capture:
The cursor is far from where it should be, and is too large.
PipeWire Display Capture:
Observer how the cursor moves slightly, relative to the red asterisk. The cursor is seemingly the correct size but is slightly off the correct position.
Steps to Reproduce
Anything else we should know?
This issue occurs most noticeably with the PipeWire Window Capturer, but also occurs (albeit subtly) with the PipeWire Display capturer. The pictures above show this.
Note I am using 2 HIDPI displays (4k and 1440p 16:9, both set to 200% GNOME scaling, no fractional scaling). Because my setup is somewhat of an edge case there's a possibility this is an upstream PipeWire/GNOME/Wayland bug.
The text was updated successfully, but these errors were encountered: