https://bugs.kde.org/show_bug.cgi?id=520443

--- Comment #11 from [email protected] ---
Im out of ideas, so went with ChatGPT. Not sure if it's helpful, but here it
is:

Title:

KWin Wayland screencast causes frametime stutter in games when a PipeWire
screencast session is active

Summary

Starting a Wayland screencast through KWin causes noticeable frametime stutter
in games, even before recording or streaming begins. The issue appears as soon
as a monitor or window is selected for capture. This affects multiple
applications using the PipeWire desktop capture portal and does not appear to
be application-specific.

Environment

Distribution: Manjaro Linux
KDE Plasma: 6.6.5
KWin: 6.6.5 (Wayland)
Qt: 6.11.1
Kernel: Linux 6.18.36
Mesa: 26.1.2
GPU: AMD Radeon RX 9070 XT (RDNA4, radeonsi)
PipeWire server: 1.6.6
xdg-desktop-portal-kde: (latest Manjaro package)

Hardware

AMD Radeon RX 9070 XT
Three monitors (also reproduced with only one monitor connected)
All displays running at approximately 60 Hz
Adaptive Sync is not supported on any connected display.

Description

Whenever a PipeWire screencast session is started through KWin, games
immediately begin exhibiting frametime stutter.

The stutter starts as soon as the capture source is selected. Recording or
streaming does not need to begin.

Average FPS remains largely unchanged, but frametime becomes uneven enough to
produce visible microstutter during gameplay.

The issue is reproducible regardless of whether the capture source is:

Entire screen
Single monitor
Individual window
Game window

The issue occurs in every game tested.

Applications tested

The issue occurs with multiple applications using the Wayland desktop capture
portal:

OBS Studio
Discord screen sharing

Because multiple independent applications reproduce the same behavior, this
does not appear to be application-specific.

Comparison with vkCapture

Using vkCapture (game capture) does not introduce any frametime stutter.

Games remain perfectly smooth while being captured through vkCapture.

This suggests that the rendering pipeline itself is functioning correctly and
that the issue is specific to KWin's desktop screencast implementation.

Troubleshooting performed

The following changes had no effect:

Disabled fractional scaling (all displays at 100%)
Disabled two monitors (tested with a single display)
Tested monitor capture, window capture and game window capture
Tested OBS and Discord
Verified that PipeWire negotiates DMA-BUF successfully (no SHM fallback)
Adaptive Sync is unavailable
Vulkan FIFO (vsync) is used, but this does not affect vkCapture

PipeWire negotiation

PipeWire successfully negotiates DMA-BUF modifiers.

Example:

Modifier: 0x200000000082305
Stream state: streaming

No PipeWire errors are reported during normal operation.

Expected result

Starting a PipeWire screencast should not affect frametime stability of running
games.

Actual result

As soon as the screencast session becomes active, games begin exhibiting
consistent frametime spikes and visible microstutter.

Additional notes

This appears to affect the KWin screencast path rather than PipeWire itself.

Since the issue reproduces with multiple applications (OBS and Discord), while
vkCapture remains unaffected, it seems likely that the problem lies somewhere
in the KWin screencast implementation or its synchronization with the graphics
driver.

If additional debug logs or traces would be useful, I would be happy to provide
them.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to