0012: Our own Moonlight server, built from Wolf's parts
- Status: Accepted (owner, 2026-11-14: "Yes our own from wolf parts")
- Date: 2026-11-14
Context
Remote devices (phone, handheld, laptop) reach Couchdogs through Moonlight. Options checked against source (survey 2026-11-14): keep Wolf whole and feed it the TV's Gamescope through one app with start_virtual_compositor=false (no Wolf change, but Wolf UI, its app list, lobbies and session model stay, and its no-compositor path swaps uinput devices for Wayland ones bound to no display); Moonshine (Vulkan video encode only, RDNA2 and up, so not this GPU; no two clients in one session); Sunshine or Apollo (one shared desktop for all clients, GPLv3, open crash report on this GPU family); our own server. Wolf's moonlight-protocol library (pairing crypto, RTSP, FEC), its rtpmoonlightpay payloaders and its pairing and control code are MIT and separate cleanly from its session model.
Decision
Write our own server in C++ around Wolf's protocol library and payloaders, copied at a pinned commit with credit. It lists one app, "Couchdogs": a device gets its own headless Gamescope screen, or joins the TV's screen. Encode is GStreamer from the screen's PipeWire node into VAAPI H.264/HEVC (superseded by ADR 0015: libpipewire capture, libavcodec encode). Pairing PINs are typed with the pad in the shell. Wolf's paired clients and server certificate are imported so no device re-pairs.
Consequences
- Wolf leaves the stack when this server has passed on the TV (M6); until then Wolf keeps serving remote devices.
- No session resume: a reconnect gets a fresh stream of a screen that never went away.
- A stock Moonlight client works; a later fork can add no-PIN pairing and pick "join the TV" before connecting.