Commit Graph
4 Commits
Author SHA1 Message Date
connor eb6a42c4d7 sunshine: size the virtual output to the client
The work laptop drives two 3840x2160 panels, so a fixed 1920x1080 capture
was being upscaled 2x on the client — fine for Big Picture's large UI,
visibly soft for terminal text on the Desktop app.

A headless wlroots output has no physical size, so it can take any mode.
Both apps now set HEADLESS-1 to SUNSHINE_CLIENT_WIDTH/HEIGHT/FPS in their
prep-cmd and restore 1920x1080 on undo. SWAYSOCK joins the environment
import so Sunshine's prep-cmds can reach the compositor at all.
2026-09-14 16:28:32 -04:00
connor 425893d516 Order the environment import before Sunshine starts
The previous fix added DISPLAY to the import but left it as a separate
exec line. sway runs exec lines asynchronously and does not order them, so
Sunshine won the race every time — it started in the same second as the
compositor, before DISPLAY existed in the manager environment, and passed
no DISPLAY to the apps it launched. Steam still failed with "Unable to
open a connection to X" while Xwayland was up and the manager environment
looked correct, which is what made it confusing.

One exec with && instead of two.

The earlier verification was wrong for the same reason: I launched Steam
by hand with DISPLAY=:0 set, which tested Xwayland rather than the path
Sunshine actually uses. Re-verified properly by launching Steam in a shell
carrying only the environment read out of Sunshine's own /proc entry.
2026-09-14 16:04:13 -04:00
connor f4200b6a69 Make the headless session actually usable over the stream
Two reasons both Sunshine apps streamed a blank screen.

Steam is an X client, and sway starts Xwayland lazily. DISPLAY therefore
did not exist at the moment the config imported the environment for
Sunshine, so Steam came up with "Unable to open a connection to X" and
rendered nothing. `xwayland force` starts it at compositor launch instead,
and DISPLAY joins the import.

The Desktop app was not broken at all — the desktop was genuinely empty.
swaybg was painting #101920 on an output with no windows and no bar, which
over a stream is indistinguishable from a failed capture. There are now
keybinds for a terminal and a launcher, and kitty starts with the session
so a working capture looks obviously working.

Verified: Xwayland on :0, DISPLAY exported, xdpyinfo and zenity connect,
and Steam Big Picture Mode renders as a window on HEADLESS-1.
2026-09-14 16:01:48 -04:00
connor d5cb5f5690 Moonlight: headless compositor on the 3060, Sunshine capturing it
mainframe has no desktop and the only connected output hangs off the Intel
iGPU, while the RTX 3060 that encodes drives no monitor. Capturing the real
output would copy every frame between GPUs. So: a minimal sway session on
the headless wlroots backend, pinned to card0, with one 1920x1080 virtual
output for Sunshine to capture. Verified end to end — Sunshine finds
zwlr_screencopy_manager_v1 and creates h264_nvenc and hevc_nvenc.
(av1_nvenc fails because Ampere has no AV1 encoder; that is expected.)

Two things had to be fixed to get there. The installed sunshine-git was
built against boost 1.89 against a system now on 1.92 and could not load
five libraries — which is why the service had been enabled but never once
run. Replaced with sunshine-bin, which is current and prebuilt.

And Sunshine now gets a unit of ours rather than a drop-in: the source AUR
package ships sunshine.service while -bin ships
app-dev.lizardbyte.app.Sunshine.service, so a drop-in silently stops
applying the moment you switch between them.

apps.json replaces the stock file, whose "Low Res Desktop" entry shelled
out to xrandr and would have done nothing on Wayland.
2026-09-14 15:41:55 -04:00