System stuttering when using PipeWire screen capture on KDE Plasma

ADAMPOKE111

New Member
Hello, I'm currently running Arch Linux with KDE Plasma (specific versions below) and I've been trying to record my screen & various windows using the PipeWire screen capture source as I'm on a Wayland session. Whenever I add a PipeWire screen capture source, however, I experience stutter in anything which is in motion on my screen. I have a 144 Hz display and a 75 Hz display connected and the problem occurs no matter which display I select. I have tried recording at 60 fps, 30 fps & 48 fps (I thought since it was a factor of 144 that it might solve the issue - it didn't).

The easiest way for me to describe it is like having a bunch of frames just skip and then animation has lurched forward in time - experienced as a stutter.
I've recorded two videos on my phone to demonstrate the problem as I can't get it to show up in a screen capture. One at 1080p 60 fps & another one in slow motion to make the issue easier to spot.

Real-time footage of stutter (YouTube)
Slow-mo footage of stutter (YouTube)

Software & system specs:
Code:
Operating System: Arch Linux
KDE Plasma Version: 5.27.10
KDE Frameworks Version: 5.114.0
Qt Version: 5.15.12
Kernel Version: 6.7.1-zen1-1-zen (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 5800X 8-Core Processor
Memory: 31.3 GiB of RAM
Graphics Processor: AMD Radeon RX 6700 XT
 

bool3max

New Member
I am experiencing a similar issue on Sway and OBS 32. I'm running a primary 4K 160Hz display, and adding an active PipeWire Screen Capture source of that display instantly decreases the refreshrate/rendering performance of everything on my screen, from the mouse cursor itself to the performance of other running applications, etc... Note that this is before any recording/streaming takes place at all, just the Source being active. I'd say it goes from 160FPS to just barely above 60FPS. Though it'd be nice if there was a more scientific way to measure it.

In the meantime I've switched over to the wlrobs plugin where the issue isn't present, i.e. I can record at a smooth 4K60FPS while the stuff on my screen remains at 160FPS.
 

NoSFeRaTU

New Member
Yeah, pipewire's capture is very inefficient and cause low framerate across the board. In addition to the mentioned wlrobs plugin there is also PancakeTAS's obs-wlroots-screencopy plugin. And they both are much better. But they are using wlroots-specific wlr-screencopy-unstable-v1 protocol and also doesn't support to capture individual windows.

Recently there are seems to be some effort to add support of new ext-foreign-toplevel-list-v1, ext-image-capture-source-v1 and ext-image-copy-capture-v1 protocols in various wayland compositors. Support in wlroots and sway for them also landed recently.

I'm currently thinking to write PoC plugin for them as it should eventually be supported by majority of compositors and not be wlroots-exclusive. And that also provides a way to support toplevel captures (individual windows)...
 
Top