snapcast: add AirPlay 2 support #1294

Merged
JakeHillion merged 1 commits from jj/zooywwrmlyyw into main 2026-08-17 23:58:39 +01:00
1 Commits
Author SHA1 Message Date
JakeHillion 2b174d569c snapcast: add AirPlay 2 support
commit-validation / validate-single-commit (pull_request) Successful in 7s
buildbot/nix-eval Build done. (636 warnings)
buildbot/nix-build Build done.
buildbot/nix-effects Build done.
Add AirPlay 2 to snapserver via a standalone shairport-sync service (built
with airplay2) that decodes to a named pipe snapserver reads as a source,
plus a meta source that follows whichever of Spotify or AirPlay is playing.
shairport runs as its own service rather than being spawned by snapserver so
it has a config file and a persistent home for its AirPlay 2 pairing
identity -- spawned by snapserver it had neither, so the identity reset on
every restart and iOS refused to reconnect. It runs under a fixed uid/gid
with /var/lib/shairport-sync persisted. nqptp provides the PTP clock. AirPlay
2 binds dynamically-assigned ephemeral ports that can't be pinned
(udp_port_base/range are AirPlay 1 only), so the kernel ephemeral range is
opened on the trusted LAN.

Test plan:
- Built stinger toplevel with `nix build '.#nixosConfigurations."stinger.pop.neb.jakehillion.me".config.system.build.toplevel'`; verified the generated shairport-sync.conf, the pipe tmpfiles rule, and the snapserver pipe source
- CI
- Deploy and verify: stinger appears as an AirPlay 2 target, pairing survives a redeploy, and audio plays through snapcast
2026-08-17 12:44:11 +01:00