From cea6913cf32400b68078472c6ba4995ec58ed4bd Mon Sep 17 00:00:00 2001 From: DannyDannyDanny Date: Mon, 30 Mar 2026 16:16:18 +0200 Subject: [PATCH] =?UTF-8?q?fix(nixos):=20route=20UxPlay=20audio=20directly?= =?UTF-8?q?=20to=20ALSA=20on=20sunken-ship=20=F0=9F=94=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Drop PipeWire (WirePlumber fails to detect ALSA cards without a graphical session). Use GStreamer alsasink with plughw:USB,0 to output directly to the Scarlett Solo. --- nixos/hosts/sunken-ship.nix | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/nixos/hosts/sunken-ship.nix b/nixos/hosts/sunken-ship.nix index 4d0ea5f..ec67ab2 100644 --- a/nixos/hosts/sunken-ship.nix +++ b/nixos/hosts/sunken-ship.nix @@ -65,16 +65,6 @@ in alsa-utils # aplay, amixer, arecord for audio debugging ]; - # PipeWire — sound server for UxPlay / GStreamer. - services.pipewire = { - enable = true; - alsa.enable = true; - pulse.enable = true; # PulseAudio compat for GStreamer pulsesink - }; - # PipeWire runs as a user service; ensure it starts for danny even without a login session. - systemd.user.services.pipewire.wantedBy = [ "default.target" ]; - systemd.user.services.pipewire-pulse.wantedBy = [ "default.target" ]; - # Avahi (mDNS) — required for AirPlay discovery. services.avahi = { enable = true; @@ -88,21 +78,21 @@ in allowedUDPPorts = [ 5353 6000 6001 7011 ]; }; - # UxPlay AirPlay receiver — audio-only, runs as a user service under danny. - # Runs inside danny's user session so it can reach PipeWire/PulseAudio. - systemd.user.services.uxplay = { + # UxPlay AirPlay receiver — audio-only, outputs directly to Scarlett Solo via ALSA. + # Runs as a system service (no PipeWire needed on a headless server). + systemd.services.uxplay = { description = "UxPlay AirPlay receiver"; - after = [ "pipewire-pulse.service" ]; - wants = [ "pipewire-pulse.service" ]; - wantedBy = [ "default.target" ]; + after = [ "network-online.target" "avahi-daemon.service" ]; + wants = [ "network-online.target" "avahi-daemon.service" ]; + wantedBy = [ "multi-user.target" ]; serviceConfig = { - ExecStart = "${pkgs.uxplay}/bin/uxplay -n sunken-ship -p -vs 0"; + ExecStart = "${pkgs.uxplay}/bin/uxplay -n sunken-ship -p -vs 0 -as alsasink device=plughw:USB,0"; Restart = "on-failure"; RestartSec = 5; + User = "danny"; + SupplementaryGroups = [ "audio" ]; }; }; - # Ensure danny's user services start at boot (not just on login). - users.users.danny.linger = true; # Pull dotfiles and rebuild if the repo has new commits. systemd.services.dotfiles-rebuild = {