Setting up a headless Pi for Snapcast in 2026
Ok. So it’s been a while since I did this, and, apparently, things changed?
To set up a headless Pi, flash an
image to an sd card; in the bootfs partition, edit
cmdline.txt, appending
systemd.run=/boot/firstrun.sh systemd.run_success_action=reboot systemd.unit=kernel-command-line.target
And add a firstrun.sh with these contents:
#!/bin/bash
set +e
systemctl enable ssh
echo "pi:raspberry" | chpasswd # better to choose a non-default password
/usr/lib/raspberrypi-sys-mods/imager_custom \
set_wlan 'SSID' 'PASSWORD' 'GB' # change country
# can add more stuff here
rm -f /boot/firstrun.sh
sed -i 's| systemd.run.*||g' /boot/cmdline.txt
exit 0
The reason I’m doing this is that I have a nice speaker (Wren V5AP) which only supports AirPlay 1. As I want multiroom, and no longer use Apple devices, it’s now a dumb active speaker. I also have a Pi Zero 2 W and a Hifiberry DAC+ Zero.
There are music-focused distros for the Pi (MoOde, Volumio, PiCorePlayer), but those do strange things I don’t want. They basically run MPD/Mopidy, and also set up AirPlay and Bluetooth receivers. No multiroom optios beyond AirPlay 2. For multiroom, I need a Snapcast client, and none of this other stuff.
For completeness, snapclient is installed via
apt install snapclient, configured in
/etc/default/snapclient kinda like this;
SNAPCLIENT_OPTS="--sampleformat '48000:16:*' --soundcard sndrpihifiberry tcp://172.18.133.18:1704"
(though do use your own snapserver address; sound card name is from
aplay -l, format should match server setup), and enabled
with the usual
sudo systemctl enable snapclient
sudo systemctl start snapclient
Works really well.
I use Mopidy on a computer on my network to feed a snapserver running there, and use mopidy-iris to control it. It has volume controls for snapcast. I don’t feel like writing about that setup now.
In a rare moment of fading glory, the Gentoo wiki has an article on Snapcast, and Archwiki doesn’t. Setting up NixOs for the Pi (with an overlay for Hifiberry and all that) remains a PITA.
Davide Ambrogio’s “Mater Nullius” is fun.