0009: Gamescope drives the TV, one compositor
- Status: Accepted (owner, 2026-11-14)
- Date: 2026-11-14
Context
Today a TV frame passes two compositors: the app's Gamescope runs nested inside Wolf's compositor (gst-wayland-display), which composites again, then the direct-mode consumer copies it to HDMI (ADR 0008). Gamescope is a full compositor with three backends: DRM (owns the display, as on the Steam Deck; game frames can flip straight to the screen), nested, and headless (frames out as a PipeWire stream). Wolf starts its own compositor per session (waylanddisplaysrc in streaming.cpp), but an app can turn that off (start_virtual_compositor = false) and give its own video.source, so Wolf can encode another program's frames without a code change. Its image has no PipeWire GStreamer plugin, so Gamescope's PipeWire stream needs a small bridge into unixfdsrc, which the image has. Moonshine, a Moonlight server, already runs every app in headless Gamescope.
Decision
The TV runs one Gamescope with --backend drm on HDMI; the shell and apps run inside it. Remote Moonlight clients get the same Gamescope through its PipeWire stream, encoded by Wolf through such an app (no Wolf code change) or by a Couchdogs encoder. Wolf stays for pairing and remote streaming until that path exists.
Consequences
- Spike on the host (2026-11-14), Gamescope from the pinned ES-DE image in a throwaway container, root,
LIBSEAT_BACKEND=noop,SYS_NICE: took the TV connector at 1920x1080@60,glxgearsvsynced at 60.0 fps, ES-DE 3.5.0 ran with ALSA audio. With ES-DE on screen the whole container used about 12% of one core (direct mode today: Wolf alone about 53%). - Gamescope spins one core for its first 15 to 20 s, even with no client; cause unknown. The GPU's Vulkan driver has no DRM format modifiers, so check that frames still flip directly.
- Supersedes ADR 0008 for the TV. Owner, 2026-11-14: the old Wolf-driven TV path (Moonlight or direct mode) left the stack with M5 instead of staying a fallback.
- TV and handheld in one game depends on the PipeWire path; until then the handheld uses Wolf as today.
- Pads go straight to the apps (no virtual pad through Wolf), so the per-emulator pad mappings made for Wolf's virtual Xbox pad need checking.