Source: yuzu
Severity: normal
Tags: patch
User: [email protected]
Usertags: regression

After discussion with SDL upstream, I'm looking into what needs to 
happen for Debian (and indirectly Ubuntu) to replace "classic" SDL2 with 
sdl2-compat, following in the footsteps of other distros like Arch and 
Fedora. sdl2-compat is a reimplementation of the SDL 2 API using SDL 3.

One issue that I've noticed is that the autopkgtest for yuzu has 
regressed. I haven't looked into this in great detail, but I think the 
root cause is the same as for #1123731 in wesnoth-1.18: "classic" SDL2 
would automatically use the `offscreen` video driver if neither X11 nor 
Wayland works, but there was an upstream change in SDL3 to make the 
`offscreen` video driver only work if explicitly requested, similar to 
the behaviour that the `dummy` video driver already had. The result is 
that on a CI system with no X11 display or Wayland compositor, this test 
fails to initialize SDL video when SDL is really sdl2-compat.

The upstream change seems reasonable to me - by default, games should 
only use video drivers that actually display some pixels to the user! - 
although I've opened 
https://github.com/libsdl-org/sdl2-compat/issues/561 to query whether 
sdl2-compat should be bug-for-bug compatible with "classic" SDL2 on this 
point. So I think this is really an issue in wesnoth-1.18 and yuzu, more 
than an issue in sdl2-compat.

A workaround that I have confirmed does work is to run the test with 
SDL_VIDEODRIVER="offscreen" (or "dummy"), so in the short term please 
consider applying the attached patch, also available as a merge request 
at https://salsa.debian.org/debian/yuzu/-/merge_requests/1 (I'll update 
the MR with the bug number when I receive it).

In the longer term, for consideration upstream:

When yuzu is configured to use a no-op renderer by this test, it still 
calls SDL_InitSubSystem(SDL_INIT_VIDEO) or similar, though it has been 
asked not to have a GUI. Perhaps ideally it wouldn't? (But perhaps 
there's some feature of the video subsystem that it is relying on?)

Or perhaps yuzu could automatically call 
SDL_SetHint(SDL_HINT_VIDEODRIVER, "offscreen") 
(or "dummy") when configured to use its no-op renderer?

Thanks,
    smcv
>From 5794e899c541b849358d5f6bd6f68c4ed8ac1055 Mon Sep 17 00:00:00 2001
From: Simon McVittie <[email protected]>
Date: Sat, 20 Dec 2025 16:44:36 +0000
Subject: [PATCH] d/tests/gpu-console: Explicitly use offscreen video driver

In a CI environment we can't expect to have a working X11 display or
Wayland compositor unless we explicitly run one, which this test
does not. In "classic" SDL2 this was masked by the offscreen video
driver being enabled by default, but in SDL3 + sdl2-compat the offscreen
video driver is only used if it is specifically requested, with the
reasonable justification that video drivers that don't show any pixels
to the user are only rarely what is wanted.

Closes: #-1
---
 debian/tests/gpu-console | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/debian/tests/gpu-console b/debian/tests/gpu-console
index d0898af..eb46acb 100755
--- a/debian/tests/gpu-console
+++ b/debian/tests/gpu-console
@@ -20,5 +20,16 @@ xz --decompress --stdout "$OLDPWD/debian/tests/gpu_console.nro.xz" > gpu_console
 # Enable the "null" renderer
 printf '[Renderer]\nbackend\\default=false\nbackend=2\n' > config.ini
 
+# Use SDL's offscreen driver unless told otherwise: offscreen and dummy
+# are the only ones that can be expected to work in CI containers,
+# but neither is selected unless explicitly requested.
+#
+# Can be overridden with e.g.
+# SDL_VIDEODRIVER=wayland
+# for manual testing.
+if [ -z "${SDL_VIDEODRIVER-}" ]; then
+    export SDL_VIDEODRIVER=offscreen
+fi
+
 mkdir "$AUTOPKGTEST_TMP/run"
 XDG_RUNTIME_DIR="$AUTOPKGTEST_TMP/run" yuzu-cmd --config config.ini gpu_console.nro
-- 
2.51.0

Reply via email to