multi-room audio

audio, in rooms. multiple rooms.

last modified on

I briefly tried using PulseAudio over the network, but decided to use Snapcast instead. Snapcast seems to be more tolerant of network issues, doesn’t require installing PulseAudio on otherwise headless machines, and has pretty good synchronization between rooms.

A Snapcast installation is split into one Snapserver and multiple Snapclients. Audio comes in to the Snapserver from one or more sources, and is broadcast out to the Snapclients, with a minor delay for synchronization.

On the machine being the Snapserver, install the snapserver package from APT, and configure its audio sources. This snippet configures two sources:

$ cat /etc/default/snapserver
SNAPSERVER_OPTS="--stream pipe:///tmp/snapfifo?name=UPnP --stream process:///usr/bin/shairport-sync?name=AirPlay&sampleformat=44100:16:2&log_stderr=true"

On all the machines being Snapclients, install the snapclient package, and configure their human-readable names. For example, for the Snapclient in my living room:

$ cat /etc/default/snapcast
SNAPCLIENT_OPTS="--hostID 'Living Room'"

Control

I primarily control Snapcast using a CatBus daemon.

In addition, I have configured both shairport-sync and upmpdcli to switch Snapcast to their respective input when they start playing.