LizardByte / LizardByte/Sunshine

XWayland (KWin Wayland) "stuttering"

Open
#4,884 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
41.3k
Forks
2.1k
Avg merge
23h 47m
Merged PRs (30d)
124

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Is your issue described in the documentation?

- [x] I have read the documentation

### Is your issue present in the latest beta/pre-release?

This issue is present in the latest pre-release

### Describe the Bug

Most games running on XWayland with the latest version of KDE Plasma experience large, noticeable stutters. This does not happen when running the game through the Proton Wayland driver with `PROTON_ENABLE_WAYLAND=1`. However, this workaround is not universal, some games, like Cairn, have rendering issues when using it.
Also it doesn't look like this happens outside streaming to me.

The game I tested and confirmed is affected is Cyberpunk 2077, where the stutters are most noticeable. I did not test other desktop environments (e.g., GNOME), but I do not recall this issue occurring in previous KWin versions (prior to 6.5 or 6.6, I think).

Tested on self-built Sunshine with Vulkan encoder PR and also occurs on the master/nightly versions, happens with both Portal and KMS.
While this might be more appropriate to report to KWin, I’m reporting here as well in case a fix could be implemented on the Sunshine side.

### Expected Behavior

The stream should work smoothly without any significant issues.

### Additional Context

_No response_

### Host Operating System

Linux

### Operating System Version

CachyOS

### Architecture

amd64/x86_64

### Package

other (fork of this repo)

### GPU Type

AMD

### GPU Model

RX 6600

### GPU Driver/Mesa Version

26.0.3

### Capture Method

XDG Portal Grab (Linux)

### Apps

```json

```

### Log output

```shell
[2026-03-22 00:37:39.510]: Info: Sunshine version: ulkan-pr commit: bcebb018995ae5a4c2d367710d5e98245ae65f5b
[2026-03-22 00:37:39.510]: Info: Package Publisher: LizardByte
[2026-03-22 00:37:39.510]: Info: Publisher Website: https://app.lizardbyte.dev
[2026-03-22 00:37:39.510]: Info: Get support: https://app.lizardbyte.dev/support
[2026-03-22 00:37:39.510]: Info: config: 'capture' = portal
[2026-03-22 00:37:39.510]: Info: config: 'vaapi_strict_rc_buffer' = enabled
[2026-03-22 00:37:39.510]: Info: config: 'wan_encryption_mode' = 0
[2026-03-22 00:37:39.510]: Info: config: 'vk_rc_mode' = 2
[2026-03-22 00:37:39.515]: Info: Loaded portal restore token from disk
[2026-03-22 00:37:39.568]: Info: // Testing for available encoders, this may generate errors. You can safely ignore those errors. //
[2026-03-22 00:37:39.568]: Info: Trying encoder [nvenc]
[2026-03-22 00:37:39.568]: Info: Screencasting with XDG portal
[2026-03-22 00:37:39.568]: Info: Requested frame rate [60/1, approx. 60 fps]
[2026-03-22 00:37:39.568]: Info: [wayland] Found display [wayland-0]
[2026-03-22 00:37:39.586]: Info: Loaded portal restore token from disk
[2026-03-22 00:37:39.621]: Info: Connected to pipewire version 1.6.2
[2026-03-22 00:37:39.627]: Info: Video format: 12
[2026-03-22 00:37:39.627]: Info: Size: 1920x1080
[2026-03-22 00:37:39.627]: Info: Framerate (from compositor): 0/1 (variable rate capture)
[2026-03-22 00:37:39.627]: Info: using memory buffers
[2026-03-22 00:37:39.631]: Info: Creating encoder [h264_nvenc]
[2026-03-22 00:37:39.631]: Info: Color coding: SDR (Rec. 601)
[2026-03-22 00:37:39.631]: Info: Color depth: 8-bit
[2026-03-22 00:37:39.631]: Info: Color range: JPEG
[2026-03-22 00:37:39.632]: Error: [CUDA @ 0x55b7437150c0] Cannot load libcuda.so.1
[2026-03-22 00:37:39.632]: Error: [CUDA @ 0x55b7437150c0] Could not dynamically load CUDA
[2026-03-22 00:37:39.632]: Error: Failed to create a CUDA device: Operation not permitted
[2026-03-22 00:37:39.632]: Info: Creating encoder [h264_nvenc]
[2026-03-22 00:37:39.632]: Info: Color coding: SDR (Rec. 601)
[2026-03-22 00:37:39.632]: Info: Color depth: 8-bit
[2026-03-22 00:37:39.632]: Info: Color range: JPEG
[2026-03-22 00:37:39.632]: Error: [CUDA @ 0x55b7437150c0] Cannot load libcuda.so.1
[2026-03-22 00:37:39.632]: Error: [CUDA @ 0x55b7437150c0] Could not dynamically load CUDA
[2026-03-22 00:37:39.632]: Error: Failed to create a CUDA device: Operation not permitted
[2026-03-22 00:37:39.632]: Info: Encoder [nvenc] failed
[2026-03-22 00:37:39.633]: Info: Trying encoder [vulkan]
[2026-03-22 00:37:39.633]: Info: Screencasting with XDG portal
[2026-03-22 00:37:39.633]: Info: Requested frame rate [60/1, approx. 60 fps]
[2026-03-22 00:37:39.633]: Info: [wayland] Found display [wayland-0]
[2026-03-22 00:37:39.655]: Info: Loaded portal restore token from disk
[2026-03-22 00:37:39.672]: Info: Connected to pipewire version 1.6.2
[2026-03-22 00:37:39.679]: Info: Video format: 12
[2026-03-22 00:37:39.679]: Info: Size: 1920x1080
[2026-03-22 00:37:39.679]: Info: Framerate (from compositor): 0/1 (variable rate capture)
[2026-03-22 00:37:39.679]: Info: using DMA-BUF buffers
[2026-03-22 00:37:39.679]: Info: Video format: 12
[2026-03-22 00:37:39.679]: Info: Size: 1920x1080
[2026-03-22 00:37:39.679]: Info: Framerate (from compositor): 0/1 (variable rate capture)
[2026-03-22 00:37:39.679]: Info: using DMA-BUF buffers
[2026-03-22 00:37:39.682]: Info: Creating encoder [h264_vulkan]
[2026-03-22 00:37:39.682]: Info: Color coding: SDR (Rec. 601)
[2026-03-22 00:37:39.682]: Info: Color depth: 8-bit
[2026-03-22 00:37:39.682]: Info: Color range: JPEG
[2026-03-22 00:37:39.781]: Info: Streaming bitrate is 1000000
[2026-03-22 00:37:39.782]: Info: Vulkan encode using GPU: AMD Radeon RX 6600 (RADV NAVI23)
[2026-03-22 00:37:39.796]: Error: Invalid value at rbsp_stop_one_bit: bitstream ended.
[2026-03-22 00:37:39.796]: Error: Failed to read unit 4 (type 12).
[2026-03-22 00:37:39.796]: Error: Couldn't read packet: Invalid data found when processing input
[2026-03-22 00:37:39.807]: Info: Creating encoder [hevc_vulkan]
[2026-03-22 00:37:39.807]: Info: Color coding: SDR (Rec. 601)
[2026-03-22 00:37:39.807]: Info: Color depth: 8-bit
[2026-03-22 00:37:39.807]: Info: Color range: JPEG
[2026-03-22 00:37:39.829]: Info: Streaming bitrate is 1000000
[2026-03-22 00:37:39.831]: Info: Vulkan encode using GPU: AMD Radeon RX 6600 (RADV NAVI23)
[2026-03-22 00:37:39.853]: Info: Creating encoder [av1_vulkan]
[2026-03-22 00:37:39.853]: Info: Color coding: SDR (Rec. 601)
[2026-03-22 00:37:39.853]: Info: Color depth: 8-bit
[2026-03-22 00:37:39.853]: Info: Color range: JPEG
[2026-03-22 00:37:39.863]: Info: Streaming bitrate is 1000000
[2026-03-22 00:37:39.863]: Error: [av1_vulkan @ 0x55b743714c40] Device does not support encoding av1!
[2026-03-22 00:37:39.868]: Error: Could not open codec [av1_vulkan]: Function not implemented
[2026-03-22 00:37:39.871]: Info: Screencasting with XDG portal
[2026-03-22 00:37:39.871]: Info: Requested frame rate [60/1, approx. 60 fps]
[2026-03-22 00:37:39.871]: Info: [wayland] Found display [wayland-0]
[2026-03-22 00:37:39.883]: Info: Loaded portal restore token from disk
[2026-03-22 00:37:39.897]: Info: Connected to pipewire version 1.6.2
[2026-03-22 00:37:39.903]: Info: Video format: 12
[2026-03-22 00:37:39.903]: Info: Size: 1920x1080
[2026-03-22 00:37:39.903]: Info: Framerate (from compositor): 0/1 (variable rate capture)
[2026-03-22 00:37:39.903]: Info: using DMA-BUF buffers
[2026-03-22 00:37:39.904]: Info: Video format: 12
[2026-03-22 00:37:39.904]: Info: Size: 1920x1080
[2026-03-22 00:37:39.904]: Info: Framerate (from compositor): 0/1 (variable rate capture)
[2026-03-22 00:37:39.904]: Info: using DMA-BUF buffers
[2026-03-22 00:37:39.907]: Info: Creating encoder [hevc_vulkan]
[2026-03-22 00:37:39.908]: Info: Color coding: SDR (Rec. 709)
[2026-03-22 00:37:39.908]: Info: Color depth: 10-bit
[2026-03-22 00:37:39.908]: Info: Color range: JPEG
[2026-03-22 00:37:39.921]: Info: Streaming bitrate is 1000000
[2026-03-22 00:37:39.923]: Info: Vulkan encode using GPU: AMD Radeon RX 6600 (RADV NAVI23)
[2026-03-22 00:37:39.934]: Warning: vulkan: h264 missing sps->vui parameters
[2026-03-22 00:37:39.936]: Info:
[2026-03-22 00:37:39.936]: Info: // Ignore any errors mentioned above, they are not relevant. //
[2026-03-22 00:37:39.936]: Info:
[2026-03-22 00:37:39.936]: Info: Found H.264 encoder: h264_vulkan [vulkan]
[2026-03-22 00:37:39.936]: Info: Found HEVC encoder: hevc_vulkan [vulkan]
[2026-03-22 00:37:39.937]: Info: Starting system tray
[2026-03-22 00:37:39.941]: Info: Adding avahi service inka102
[2026-03-22 00:37:39.941]: Info: Configuration UI available at [https://localhost:47990]
[2026-03-22 00:37:39.982]: Info: System tray created
[2026-03-22 00:37:39.983]: Info: Starting main loop
[2026-03-22 00:37:40.726]: Info: Avahi service inka102 successfully established.
[2026-03-22 00:38:56.562]: Info: // Testing for available encoders, this may generate errors. You can safely ignore those errors. //
[2026-03-22 00:38:56.562]: Info: Trying encoder [nvenc]
[2026-03-22 00:38:56.562]: Info: Screencasting with XDG portal
[2026-03-22 00:38:56.562]: Info: Requested frame rate [60/1, approx. 60 fps]
[2026-03-22 00:38:56.562]: Info: [wayland] Found display [wayland-0]
[2026-03-22 00:38:56.575]: Info: Loaded portal restore token from disk
[2026-03-22 00:38:56.588]: Info: Connected to pipewire version 1.6.2
[2026-03-22 00:38:56.591]: Info: Video format: 12
[2026-03-22 00:38:56.591]: Info: Size: 1920x1080
[2026-03-22 00:38:56.591]: Info: Framerate (from compositor): 0/1 (variable rate capture)
[2026-03-22 00:38:56.591]: Info: using memory buffers
[2026-03-22 00:38:56.598]: Info: Creating encoder [h264_nvenc]
[2026-03-22 00:38:56.598]: Info: Color coding: SDR (Rec. 601)
[2026-03-22 00:38:56.598]: Info: Color depth: 8-bit
[2026-03-22 00:38:56.598]: Info: Color range: JPEG
[2026-03-22 00:38:56.598]: Error: [CUDA @ 0x7f2dfc1f5ec0] Cannot load libcuda.so.1
[2026-03-22 00:38:56.598]: Error: [CUDA @ 0x7f2dfc1f5ec0] Could not dynamically load CUDA
[2026-03-22 00:38:56.598]: Error: Failed to create a CUDA device: Operacja niedozwolona
[2026-03-22 00:38:56.598]: Info: Encoder [nvenc] failed
[2026-03-22 00:38:56.604]: Info: Trying encoder [vulkan]
[2026-03-22 00:38:56.604]: Info: Screencasting with XDG portal
[2026-03-22 00:38:56.604]: Info: Requested frame rate [60/1, approx. 60 fps]
[2026-03-22 00:38:56.604]: Info: [wayland] Found display [wayland-0]
[2026-03-22 00:38:56.616]: Info: Loaded portal restore token from disk
[2026-03-22 00:38:56.629]: Info: Connected to pipewire version 1.6.2
[2026-03-22 00:38:56.632]: Info: Video format: 12
[2026-03-22 00:38:56.632]: Info: Size: 1920x1080
[2026-03-22 00:38:56.632]: Info: Framerate (from compositor): 0/1 (variable rate capture)
[2026-03-22 00:38:56.632]: Info: using DMA-BUF buffers
[2026-03-22 00:38:56.633]: Info: Video format: 12
[2026-03-22 00:38:56.633]: Info: Size: 1920x1080
[2026-03-22 00:38:56.633]: Info: Framerate (from compositor): 0/1 (variable rate capture)
[2026-03-22 00:38:56.633]: Info: using DMA-BUF buffers
[2026-03-22 00:38:56.638]: Info: Creating encoder [h264_vulkan]
[2026-03-22 00:38:56.638]: Info: Color coding: SDR (Rec. 601)
[2026-03-22 00:38:56.638]: Info: Color depth: 8-bit
[2026-03-22 00:38:56.638]: Info: Color range: JPEG
[2026-03-22 00:38:56.649]: Info: Streaming bitrate is 1000000
[2026-03-22 00:38:56.649]: Info: Vulkan encode using GPU: AMD Radeon RX 6600 (RADV NAVI23)
[2026-03-22 00:38:56.658]: Error: Invalid value at rbsp_stop_one_bit: bitstream ended.
[2026-03-22 00:38:56.658]: Error: Failed to read unit 4 (type 12).
[2026-03-22 00:38:56.658]: Error: Couldn't read packet: Invalid data found when processing input
[2026-03-22 00:38:56.660]: Info: Creating encoder [hevc_vulkan]
[2026-03-22 00:38:56.660]: Info: Color coding: SDR (Rec. 601)
[2026-03-22 00:38:56.660]: Info: Color depth: 8-bit
[2026-03-22 00:38:56.660]: Info: Color range: JPEG
[2026-03-22 00:38:56.670]: Info: Streaming bitrate is 1000000
[2026-03-22 00:38:56.672]: Info: Vulkan encode using GPU: AMD Radeon RX 6600 (RADV NAVI23)
[2026-03-22 00:38:56.680]: Info: Creating encoder [av1_vulkan]
[2026-03-22 00:38:56.680]: Info: Color coding: SDR (Rec. 601)
[2026-03-22 00:38:56.680]: Info: Color depth: 8-bit
[2026-03-22 00:38:56.680]: Info: Color range: JPEG
[2026-03-22 00:38:56.690]: Info: Streaming bitrate is 1000000
[2026-03-22 00:38:56.690]: Error: [av1_vulkan @ 0x7f2dfc1a2000] Device does not support encoding av1!
[2026-03-22 00:38:56.692]: Error: Could not open codec [av1_vulkan]: Niezaimplementowana funkcja
[2026-03-22 00:38:56.693]: Info: Screencasting with XDG portal
[2026-03-22 00:38:56.694]: Info: Requested frame rate [60/1, approx. 60 fps]
[2026-03-22 00:38:56.694]: Info: [wayland] Found display [wayland-0]
[2026-03-22 00:38:56.704]: Info: Loaded portal restore token from disk
[2026-03-22 00:38:56.718]: Info: Connected to pipewire version 1.6.2
[2026-03-22 00:38:56.722]: Info: Video format: 12
[2026-03-22 00:38:56.722]: Info: Size: 1920x1080
[2026-03-22 00:38:56.722]: Info: Framerate (from compositor): 0/1 (variable rate capture)
[2026-03-22 00:38:56.722]: Info: using DMA-BUF buffers
[2026-03-22 00:38:56.722]: Info: Video format: 12
[2026-03-22 00:38:56.722]: Info: Size: 1920x1080
[2026-03-22 00:38:56.722]: Info: Framerate (from compositor): 0/1 (variable rate capture)
[2026-03-22 00:38:56.722]: Info: using DMA-BUF buffers
[2026-03-22 00:38:56.728]: Info: Creating encoder [hevc_vulkan]
[2026-03-22 00:38:56.728]: Info: Color coding: SDR (Rec. 709)
[2026-03-22 00:38:56.728]: Info: Color depth: 10-bit
[2026-03-22 00:38:56.728]: Info: Color range: JPEG
[2026-03-22 00:38:56.738]: Info: Streaming bitrate is 1000000
[2026-03-22 00:38:56.740]: Info: Vulkan encode using GPU: AMD Radeon RX 6600 (RADV NAVI23)
[2026-03-22 00:38:56.749]: Warning: vulkan: h264 missing sps->vui parameters
[2026-03-22 00:38:56.751]: Info:
[2026-03-22 00:38:56.751]: Info: // Ignore any errors mentioned above, they are not relevant. //
[2026-03-22 00:38:56.751]: Info:
[2026-03-22 00:38:56.751]: Info: Found H.264 encoder: h264_vulkan [vulkan]
[2026-03-22 00:38:56.751]: Info: Found HEVC encoder: hevc_vulkan [vulkan]
[2026-03-22 00:38:56.751]: Info: Executing [Desktop]
[2026-03-22 00:38:57.122]: Info: New streaming session started [active sessions: 1]
[2026-03-22 00:38:57.213]: Info: CLIENT CONNECTED
[2026-03-22 00:38:57.216]: Info: Loaded portal restore token from disk
[2026-03-22 00:38:57.217]: Info: Screencasting with XDG portal
[2026-03-22 00:38:57.217]: Info: Requested frame rate [100fps]
[2026-03-22 00:38:57.217]: Info: [wayland] Found display [wayland-0]
[2026-03-22 00:38:57.227]: Info: Loaded portal restore token from disk
[2026-03-22 00:38:57.239]: Info: Connected to pipewire version 1.6.2
[2026-03-22 00:38:57.242]: Info: Video format: 12
[2026-03-22 00:38:57.242]: Info: Size: 1920x1080
[2026-03-22 00:38:57.242]: Info: Framerate (from compositor): 0/1 (variable rate capture)
[2026-03-22 00:38:57.242]: Info: using DMA-BUF buffers
[2026-03-22 00:38:57.243]: Info: Video format: 12
[2026-03-22 00:38:57.243]: Info: Size: 1920x1080
[2026-03-22 00:38:57.243]: Info: Framerate (from compositor): 0/1 (variable rate capture)
[2026-03-22 00:38:57.243]: Info: using DMA-BUF buffers
[2026-03-22 00:38:57.249]: Info: Creating encoder [hevc_vulkan]
[2026-03-22 00:38:57.249]: Info: Color coding: SDR (Rec. 601)
[2026-03-22 00:38:57.249]: Info: Color depth: 8-bit
[2026-03-22 00:38:57.249]: Info: Color range: MPEG
[2026-03-22 00:38:57.259]: Info: Streaming bitrate is 1988000
[2026-03-22 00:38:57.261]: Info: Vulkan encode using GPU: AMD Radeon RX 6600 (RADV NAVI23)
[2026-03-22 00:38:57.261]: Info: Minimum FPS target set to ~0.5fps (2000ms)
[2026-03-22 00:38:57.435]: Info: Setting default sink to: [sink-sunshine-stereo]
[2026-03-22 00:38:57.436]: Info: Found default monitor by name: sink-sunshine-stereo.monitor
[2026-03-22 00:38:57.451]: Info: Opus initialized: 48 kHz, 2 channels, 96 kbps (total), LOWDELAY
[2026-03-22 00:52:55.333]: Info: Opening UI from system tray
[2026-03-22 00:52:55.338]: Info: Opened url [https://localhost:47990]
[2026-03-22 00:52:55.616]: Info: Web UI: [127.0.0.1] -- not authorized
```

### Online logs

_No response_

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the stutter with XDG Portal Grab under KWin Wayland, comparing XWayland games with the PROTON_ENABLE_WAYLAND=1 path and with Portal versus KMS capture. Examine the Vulkan encoder path and the reported 60 fps variable-rate capture; done means identifying whether the regression is in Sunshine or KWin and confirming smooth streaming without rendering issues.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, linux
Domain
audio-video-rtc, desktop, operating-systems, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.