Wayland: stream window destroyed/re-created every ~1.7s after "EGLRenderer: Can't create shader: 0" (sdl2-compat/SDL3); fine with QT_QPA_PLATFORM=xcb

Author: putueddyCreated Aug 25, 2026Updated Sep 10, 2026

On native Wayland (Hyprland), a few seconds after the stream connects the stream window is destroyed and re-created roughly every 1.7 s, forever. Each re-create briefly shows the desktop, so the whole screen "blinks" continuously and the stream is unusable. The compositor's event log confirms it: repeated openwindow/closewindow pairs with new window handles (all titled "arch - Moonlight") and fullscreen 0/fullscreen 1 toggles several times per second.

Moonlight's log shows the loop. The first decoder created after connect renders fine; after the first window recreation, the EGL renderer can no longer create shaders on its render thread, which triggers a reset, and the fallback chain re-creates the window again:

EGL passed preflight checks. Using EGL for GL context creation.
Using VAAPI accelerated renderer on wayland
FFmpeg-based video decoder chosen
EGLRenderer: EGLImage pixel format: 178
EGLRenderer: Can't create shader: 0
Recreating renderer by internal request: 8192        <- SDL_RENDER_TARGETS_RESET
Vulkan rendering device chosen: AMD Radeon RX Series (RADV POLARIS11)
Using Vulkan renderer
Unable to open decoder for format: 100               <- v4l2m2m / amf / cuvid attempts
Using SDL renderer                                    <- window was created with SDL_WINDOW_VULKAN,
Unable to open decoder for format: 100                  so SDL re-creates the window here (the visible blink)
...
EGL passed preflight checks. Using EGL for GL context creation.
Using VAAPI accelerated renderer on wayland
EGLRenderer: Can't create shader: 0
Recreating renderer by internal request: 8192

glCreateShader() returns 0 with glGetError() == 0, i.e. there is no current GL context on the render thread after SDL_GL_MakeCurrent() there, even though context creation/MakeCurrent on the main thread succeeded and "EGL passed preflight checks". This only happens once the window has been re-created by SDL. The system SDL2 is sdl2-compat on top of SDL3, so this may be an sdl2-compat/SDL3 Wayland issue (possibly related to libsdl-org/SDL#13888), but Moonlight's fallback chain turns it into an infinite window-recreate loop rather than a single failure.

At stream start the host also offers HEVC Main10; VAAPI decodes the test frame but pl_map_avframe_ex() failed (Polaris11), so the stream falls back to HEVC 8-bit (format 0x100). That part looks expected for this GPU and is not the cause of the loop, just visible in the log.

Steps to reproduce

  1. Arch Linux, Hyprland (Omarchy), moonlight-qt 6.1.0-7 from the Arch repos, sdl2-compat 2.32.70-1 + sdl3 3.4.14-1, Mesa 26.2.1.
  2. Run moonlight (native Wayland: QT_QPA_PLATFORM=wayland;xcb → "Detected Wayland").
  3. Connect to a Sunshine host and stream "Desktop".
  4. Within ~5–10 s the stream window starts being destroyed/re-created every ~1.7 s.

Workarounds tested:

  • QT_QPA_PLATFORM=xcb moonlight (XWayland): stable for 75 s+ with hardware decode (Format vaapi chosen … hwaccel hevc_vaapi, "Using VAAPI accelerated renderer on x11"), only the single initial "Recreating renderer for window event: 1" and no further recreation.
  • FORCE_VAAPI=1 on Wayland: avoids the "Using SDL renderer" step, but Can't create shader: 0 still occurs after the first recreation, so it only reduces the frequency.

Screenshots Not applicable (the whole screen flashes as the fullscreen window is re-created; the video itself looks fine while it is shown).

Affected games Sunshine "Desktop" app. Not game-specific.

Other Moonlight clients Not tested on iOS/Android.

Moonlight settings

  • Resolution 2880x1800, 60 FPS, ~53 Mbps, V-Sync on, frame pacing off, HDR off, video decoder/codec = automatic.
  • Same behaviour with default settings.

Client PC details

  • OS: Arch Linux (Omarchy), Hyprland, kernel 7.1.8 (T2 MacBook Pro)
  • Moonlight Version: 6.1.0 (Arch package moonlight-qt 6.1.0-7)
  • GPU: AMD Radeon Pro 560X (Polaris11, radeonsi/RADV, drives the internal display) + Intel UHD 630 (no outputs)
  • SDL: sdl2-compat 2.32.70-1 on sdl3 3.4.14-1; Mesa 26.2.1; libva 1.24 (Mesa Gallium VAAPI driver)
  • Linux package type: distro package (Arch extra/moonlight-qt)

Server PC details

  • OS: Linux (Arch)
  • Sunshine (reports GFE version 3.23.0.74 to the client; server GPU string empty)
  • Connection over Tailscale

Moonlight Logs

Additional context

  • Hyprland's DRM backend log shows no modeset/DPMS change during the loop; only the window is re-created.
  • Reset source is EGLRenderer::renderFrame()specialize() failing → SDL_RENDER_TARGETS_RESET, then Session re-runs chooseDecoder().
  • The Arch package links against libSDL2-2.0.so.0.3200.70 (sdl2-compat); there is no classic SDL2 on the system to compare against.

Source: moonlight-stream/moonlight-qt