Bug 498303 - Contents of a window being captured/shared via Pipewire stutter, unless the mouse cursor is moving
Summary: Contents of a window being captured/shared via Pipewire stutter, unless the m...
Status: REPORTED
Alias: None
Product: kwin
Classification: Plasma
Component: screencasting (show other bugs)
Version: 6.2.5
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-01-06 04:55 UTC by Jeremi Campagna
Modified: 2025-01-17 15:26 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jeremi Campagna 2025-01-06 04:55:48 UTC
SUMMARY

When screencasting a window with pipewire (for OBS or any other application), it tends to cause stuttering for the entire desktop (whole compositor level I suppose). It seems to be most distinguishable with borderless fullscreen applications.

STEPS TO REPRODUCE
1. Run a game, either in a large window, borderless fullscreen or fullscreen
2. Using OBS or another software recording/streaming software, capture the window of the application
3. Observe the stuttering, it varies in severity with each application.

OBSERVED RESULT

Stuttering of the whole desktop, severity has varied across versions since Plasma 5.27 and varies depending on the application.

EXPECTED RESULT

No stuttering

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
(available in the Info Center app, or by running `kinfo` in a terminal window)
Linux/KDE Plasma: 
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION

As mentionned before, versions of KDE since 5.27 at least will experience this issues with a varying severity. Some applications may also exhibit this behaviour way worse than others. I have experienced a milder amount of stuttering with Art of Rally in the past and recently have had the compositor nearly freeze while capturing Dolphin Emulator's fullscreen window.
Comment 1 Jeremi Campagna 2025-01-06 04:57:14 UTC
I forgot to report system specifications. Here they are:

Operating System: Arch Linux 
KDE Plasma Version: 6.2.5
KDE Frameworks Version: 6.9.0
Qt Version: 6.8.1
Kernel Version: 6.10.9-arch1-2 (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 7700X 8-Core Processor
Memory: 31.0 GiB of RAM
Graphics Processor: AMD Radeon RX 6800 XT
Manufacturer: Gigabyte Technology Co., Ltd.
Product Name: B650 AORUS ELITE AX
Comment 2 John Kizer 2025-01-16 05:57:09 UTC
Hi - thanks for your bug report! Could I ask you to please check if moving the mouse cursor seems to be connected to the stuttering? I'm wondering if this is driven by the same cause as https://bugs.kde.org/show_bug.cgi?id=489602 .

Thanks!
Comment 3 Jeremi Campagna 2025-01-16 12:39:15 UTC
(In reply to John Kizer from comment #2)
> Hi - thanks for your bug report! Could I ask you to please check if moving
> the mouse cursor seems to be connected to the stuttering? I'm wondering if
> this is driven by the same cause as
> https://bugs.kde.org/show_bug.cgi?id=489602 .
> 
> Thanks!

I would have to trigger it again to be sure. I recall the stuttering happening even without mouse movement though mouse movement did definitely make it worse.
I will trigger it again to confirm.
Comment 4 Jeremi Campagna 2025-01-17 01:52:20 UTC
So, I tried it out again with Dolphin Emulator.

The system seems to freeze the moment the cursor is hidden when Dophin is focused. If I set my cursor on the Discord stream on my second monitor, then there are no stutters or freezes that are apparent (I did a Mario Kart race without a hitch). Moving the cursor on the window that is being captured seems to prevent stuttering? Not moving the cursor will eventually cause severe stutters and freezes.

I did update my system since the report however, so here is the new versions:
KDE Plasma : 6.2.5
KDE Frameworks : 6.10.0
Qt : 6.8.1

all else are exactly the same compared to the previous report.
Comment 5 Jeremi Campagna 2025-01-17 03:53:19 UTC
(In reply to John Kizer from comment #2)
> Hi - thanks for your bug report! Could I ask you to please check if moving
> the mouse cursor seems to be connected to the stuttering? I'm wondering if
> this is driven by the same cause as
> https://bugs.kde.org/show_bug.cgi?id=489602 .
> 
> Thanks!

It's not unlikely that what I'm encountering is related to this issue, I did not look at the stream output very closely. What I can say is what I'm reporting is about the actual desktop/application stuttering rather than the video showing stutters or dropped frames of sorts. It happens specifically with a window capture. No issues with a screen capture.
Comment 6 John Kizer 2025-01-17 15:26:59 UTC
Thanks for clarifying!