snapcast: add AirPlay 2 support #1294

Merged
JakeHillion merged 1 commits from jj/zooywwrmlyyw into main 2026-08-17 23:58:39 +01:00
Owner

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
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
JakeHillion added 1 commit 2026-08-17 23:48:43 +01:00
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.
2b174d569c
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
JakeHillion merged commit 2b174d569c into main 2026-08-17 23:58:39 +01:00
JakeHillion deleted branch jj/zooywwrmlyyw 2026-08-17 23:58:39 +01:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: JakeHillion/nixos#1294