Bug 450116 - Unable to record fullscreen applications with pipewire
Summary: Unable to record fullscreen applications with pipewire
Status: RESOLVED DUPLICATE of bug 450943
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: 5.23.5
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-02-13 01:13 UTC by Ian Boll
Modified: 2022-03-10 06:14 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Attempted recording of Steam Big Picture (2.04 MB, video/x-matroska)
2022-02-13 01:13 UTC, Ian Boll
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ian Boll 2022-02-13 01:13:57 UTC
Created attachment 146650 [details]
Attempted recording of Steam Big Picture

SUMMARY
When trying to record certain fullscreen applications, pipewire doesn't provide any output.


STEPS TO REPRODUCE
1. Run Steam in Big Picture mode
2. Run OBS and use pipewire to record either the entire screen or just the Steam window. You'll want to save a video recording file to observe the issue, since you can't watch the OBS window if you only have one monitor.
3. Switch back to the fullscreen window and click around a bit
4. Switch to another window
5. Switch back to the fullscreen window and click around some more
6. End the recording, and watch it back to observe the bug


OBSERVED RESULT
If you record the window instead of the screen, OBS crashes as soon as you start the window capture.

If you record the screen, OBS records a static image that's updated every time you switch away from the fullscreen window. When this static image is shown in the recording, you do still see your mouse moving around. However, it's actually the wrong mouse: Steam Big Picture uses a different mouse cursor icon, and this is not picked up in the recording. Sometimes the recording will show the Breeze mouse icon, as that's what I'm currently using, and sometimes it uses a standard black arrow.


EXPECTED RESULT
In the recording, one should see the window change as you click around inside of it.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 5.16.8-200.fc53.x86_64
(available in About System)
KDE Plasma Version: 5.23.5
KDE Frameworks Version: 5.90.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
Steam isn't the only recorded application this happens with. It happens with every game I've tested, though it doesn't happen when recording Firefox.

Additionally, OBS isn't the only recording application that has this problem. I first noticed it when trying to screenshare on Discord using the webapp from inside Chromium.

I'm not 100% sure this is the correct place to report this bug, but there seemed to be a similar bug with mutter a few months ago (https://gitlab.gnome.org/GNOME/mutter/-/issues/1940). That bug apparently also has a fix, so it might serve as a starting place for fixing the bug in kwin!

I've only tested this inside the Wayland session so far.
Comment 1 Ian Boll 2022-02-13 01:28:03 UTC
I just tested under an X11 session and didn't observe the bug. Obviously this meant I was using Xcomposite and Xshm for capturing instead of pipewire.

I also forgot to mention in the original bug report: the pipewire fullscreen recording includes the taskbar even when I'm looking at the fullscreen application. The recording even sometimes includes the titlebar for the application with a maximum width and located at the top of the screen.
Comment 2 Behzad A 2022-02-13 19:07:32 UTC
Can't reproduce with git-master, I tested Wine, Chrome, and Kmahjongg, But I remember a few months ago I had a similar issue when wanted to record Wine, but solved in git-master
Comment 3 p d 2022-02-16 17:11:53 UTC
I have this issue also. I can't record any fullscreen game (like Xonotic) with OBS and pipewire in wayland.
Comment 4 Nate Graham 2022-02-16 19:45:21 UTC
Can you check with Plasma 5.24?
Comment 5 p d 2022-02-17 19:50:29 UTC
(In reply to Nate Graham from comment #4)
> Can you check with Plasma 5.24?

This is on Plasma 5.24.1 on Fedora, using Wayland.
Comment 6 Ian Boll 2022-02-18 00:47:53 UTC
I just tested on Plasma 5.24.0 on Fedora Rawhide Kinoite and the only thing that changed was that using the window capture no longer crashed OBS. Instead, it has the same behaviour as the screen capture.
Comment 7 p d 2022-02-22 02:20:58 UTC
Seems fixed in latest OBS (flatpak) and latest Pipewire (0.3.47) so must have not been a KDE issue.
Comment 8 Nate Graham 2022-02-22 03:06:44 UTC
Cool, thanks for following up.
Comment 9 p d 2022-03-10 04:42:44 UTC
It seems this problem has came back. :/
Comment 10 p d 2022-03-10 06:14:24 UTC
Nevermind, I just upgraded to KDE 5.24.3 and it works now. I'm not sure why it worked earlier, and then stopped working.

This seems to be fixed with the commit "Backends/drm: fix recording with direct scanout. Commit. Fixes bug #450943".

*** This bug has been marked as a duplicate of bug 450943 ***