fix(audio): shield SuperDirt from the display stack — headless sclang (QT_QPA_PLATFORM=offscreen)
Root-caused the 2026-07-25 overnight-sleep crash where the music (and Ardour)
died on resume. It was NOT an audio-hardware failure — it was the *display stack*
taking down the sound.
Evidence (all at resume, ~11:17):
11:17:31 kwin_wayland (pid 2603) SIGABRT — the Wayland compositor aborted on
resume-from-suspend (deep internal assertion; core shows abort→libc).
Plasma respawned the whole session (new kwin/plasmashell/Xwayland,
confirmed by their ~1h40m uptime vs the machine's 1d+).
11:17:35 ardour9: "Fatal IO error 104 (Connection reset by peer) on X server
:1" — Ardour, an X11 client on Xwayland, died with the session.
11:17:35→44 scsynth SIGABRT via std::terminate — ~4s after kwin, in the
cascade: sclang is a Qt6/Wayland client, so it lost its display
connection when kwin died and crashed, and scsynth (which it hosts)
aborted on the broken IPC.
Why short naps survive but an overnight one didn't: a quick suspend/resume just
pauses the Wayland connection; the long/overnight cycle triggered a GPU/DRM reset
that made kwin actually crash — and a crashed compositor severs every client at
once.
Fix: sclang doesn't need a display. QT_QPA_PLATFORM=offscreen runs its Qt without
connecting to any display server, so a compositor crash/restart can no longer reach
it — the SuperDirt brain becomes immune to the entire Wayland/X lifecycle. SuperDirt
uses no GUI; the interpreter and post window still work in the terminal. Validated:
`QT_QPA_PLATFORM=offscreen sclang` compiles the class library and reaches the
SuperCollider 3.14.1 banner with zero wayland/qpa errors.
collide.sh is the only launcher (perf.sh only reprioritizes a *running* sclang, it
doesn't spawn one), so this single line closes the gap.
Not addressed here (harder, separate levers): kwin's resume-crash itself is a
Plasma/GPU-driver issue — the standing mitigation is running dGPU-off
(./gpu-mode.sh integrated), which removes the Xwayland-on-dGPU DRM reset that's the
likely abort trigger and would also spare Ardour's :1 connection.
Showing