As a longtime MPD user I was looking for a way to do synchronous multi-room audio with it. In comes Snapcast.

Installations

The AUR provides the Snapcast server application and client application in 1 package. The server accepts the output from the player - MPD in this case - and forwards it to the client. This means Snapcast needs to be installed on the device on which MPD runs as well as on all the devices you want to listen to the stream.

yaourt -S snapcast

Server configuration

1. MPD configuration

For MPD to output its stream to the Snapcast server we need to add an audio_output to mpd.conf.

audio_output {
type "fifo"
name "snapcast"
path "/tmp/snapfifo"
format "48000:16:2"
mixer_type "software"
}

As you can see at this time the audio output quality of Snapcast is limited to stereo at 48kHz in 16bit. So for surround sound and audiophile listening I use my regular MPD audio output. But for anything else Snapcast is a godsend.

2. Create the fifo file

touch /tmp/snapfifo

3. Start and enable the Snapcast server

sudo systemctl start snapserver
sudo systemctl enable snapserver

4. (Re)start MPD

When running MPD in Systemd user-mode

systemctl --user restart mpd.service

Or else

sudo systemctl restart mpd.service

Client configuration

At this point your can connect your clients to the stream with

snapclient -h IP_ADDRESS_OF_THE_SERVER

For further configuration of the Snapcast client, like daemon mode, checkout the options in /etc/default/snapclient.

To run the snapcast client as a daemon:

systemctl start snapclient.server

With the default settings I had playback problems when listening to multiple streams simultaneously. E.g. Listening to Youtube when Snapcast was playing. This was fixed by specifying a different output with the -s option. Basically I had to instruct Snapcast to use the ALSA output instead of PulseAudio. PulseAudio itself uses ALSA in my case. The following command shows the available outputs for Snapclient:

snapclient -l

Android Client

There’s an Android Snapcast Client available in the Play Store called Snapdroid. You can find it by searching for Snapcast. It allows you to control the volume of all the client streams when connected to the server as well as listening to the stream itself.