Perfect (and free) synchronous multiroom audio with Snapcast 🔊

The Sonos for tinkerers

Ever wanted multiroom audio in perfect sync, wireless, open enough to support what ever source you throw at it, while being cheap and painless to use?

A product that lasts, and won’t be bricked or lose features over time as the manufactor feels it’s time for you to get a new one?

Ah, one could dream… Wait, it exists?

Below, an image of the box of speakers and other obsolete hifi equipment you have stored, just waiting, longing for this opportune time to be used.
box-of-hope

snapcast-hass-client

Snapcast

Enter Snapcast, a fantastic project started by badaix.

“Snapcast is a multiroom client-server audio player, where all clients are time synchronized with the server to play perfectly synced audio. It’s not a standalone player, but an extension that turns your existing audio player into a Sonos-like multiroom solution.”.

Snapcast will be the main star in our setup here, and it consists of two parts. A Snapserver, and a Snapclient which will run on all of the places you want sound to play.

Both the server, and the client are able to run on all kinds of platforms, this includes smartphones, so here you might finally have a use for those dusty Android-phones you’ve horded over the decade. We will be using the Debian build here later.

Librespot (Spotify Connect), Airplay, PulseAudio, oh the possibilities…

The best thing about Snapcast is that it’s build to be extremely modular, allowing it to be configured to adapt to whatever usecase you’ll like to throw at it. The following figure from Snapcast’s readme does a good job in illustrating this:

We can use Spotify Connect to allow anyone within the household to play music on our device, Airplay for Apple users and use PulseAudio to stream audio for Linux users. This also supports anything that can play audio locally, so the possibilities for what you can play or stream to your speakers are virtually limitless.

My setup

I have Snapcast clients in four rooms of my apartment now, with two main sources to play from.

Red = Controllers, Green=Players, Yellow=Sources, Blue=Clients/Audio outputs

My Snapserver runs on Ubuntu Server 20.04 as a LXC container under Proxmox. The container is designated 15GB disk, 1 CPU (i5-2500k) core, 1GB memory and runs without a hitch.

The Snapclients all run different hardware, Hobby/Bed/Patio runs on a Raspberry Pi 2, 3 and 4 while the livingroom client runs alongside Kodi on a Intel NUC HTPC.

As for sound hardware, I used whatever I had in the room already. For the rooms that didn’t have any audio gear I invested in a HifiBerry AMP2.

HifiBerry AMP2


… and finally a use for the cheap yardsale speakers you got stashed somewhere, the ones you picked up years ago because you just could not let them go

The HifiBerry AMP2 is a audio amplifier HAT for the Raspberry Pi which allows you to connect speakers directly and adjust the amplified volume via Snapcast/ALSA.

I’ve been using the AMP2 for two of my Snapclient’s, and the experience with it has been excellent. Highly recommend it if you are looking for a amplifier to use with a small form factor, but still having enough power to fill a room with sound.

Installation

Got you convinced? Here’s some installation notes I made when configuring my own setup that might be of help:

4 Likes

The same can of course be achieved through Logitech Media Server. The Pi with an amp (or just a DAC then connected to your stereo) is a great solution.

I use this which is a cheaper (but IMHO equally good) Amp, compatible with HiFiBerry Amp. hifi-amp-hat - WIKI HOME - WIKI HOME|RPI|AUDIO|CAMERA|CAN|RS485| - available all over aliexpress and amazon. I also run with a screen to control it, in once case an official rpi 7 inch touch screen and in the other an elecrow 5 inch HDMI touch screen.

Having just looked at the HifBerry AMP2 specs, it has a higher power output than the innomaker. Depends what you need I guess. The innomaker drives to speakers next to my spa. The spa is bloody noisy, yet the volume is loud enough!

Cool! I was not aware that there were cheaper alternatives available!

I could not find anything when searching “Innomaker”, however this one looks close enough to the picture in your link: Raspberry Pi 4 Amplifier HIFI AMP Expansion Board Audio Card + Acrylic Case for Raspberry Pi 4 Model B Only|Demo Board Accessories| - AliExpress

It goes for $31.27, is that similar to the one you’ve tested?

I do the same with forked-daapd (now known as Owntone) and shairport-sync. You can see my guide here. Mainly I went this direction because I already had a well organized iTunes library that I could simply drop into Owntone. It also supports Spotify.

For streaming client hardware, I use A Pi Zero with Justboom DAC hat which manages streaming audio and Room Assistant without any issue.

But Snapcast looks like a nice solution too, as does LMS.

1 Like

Yes that is the one, and you get the acrylic case too. I was unable to find the case on Ali, although they are on Amazon. Note that the one you pointed to is a pi4 case. IMHO pi3b+ is sufficient, but I don’t know what is the difference between a pi3 case and a pi4 case other than the difference between one big hdmi port and two small ones.

That Ali vendor has some cool stuff!

1 Like

This is astonishingly similar to my setup. Indeed it is exactly the same :smiley: Or was until today. I found a new custom integration for mopidy this one. It can replace the mpd integration and offers more possibilities. With this and the Radio Browser integration, you can play all kinds of internet radios on mopidy. Even from Node Red.

3 Likes

Interesting, I want to set up a similar setup and I’m having issues with my snapserver on the HA device. Do you use your HA as snapserver or do you use another rpi for that?

Hey @_Wouter!
I’m running HA and the Snapserver on different VMs, but I can’t see that there would be any issue with running them on the same host.

What issues are you facing?

Thanks for getting back at me, it seems like it’s not using the snapserver as audioplayer but the main device. I guess that’s not too hard to figure out so it might have been a false alarm

the Snapclient instance that you run alongside Kodi, are you using HDMI as an audio output or 3.5 jack? I am struggling to get the HDMI output working in such setup on Raspberry pi 4. Thanks

Hi @PabelB!

I’m running it with HDMI output using PulseAudio. If you are running Kodi (or any other graphical session) on the host, make sure that the Snapclient runs as the same user as your graphical session for it to be able to attach to the Pulseaudio session.

Hi,
thanks for your post.

I´m using the same, have snapserver installed on the HA Instance and then have 3 wirelless snapclient instances all of them running on a rpi-zero-w with a hifiberry-dac.

I just had to play with the “delays” but works without issues and is stable.

1 Like

i googled so many post of installing snapcast, yours is one of the easiest to follow! Thanks

Thank you for this.

Now I am trying to use the esphome mediplayer as playback devices. Can that be done? I was thinking that HO would act as a snapclient and route the audio to the esphome mediplayer.

I also appreciate the write-up, @Anderen2.
This seems to be the right solution for my audible notifications.

One thing I have run into, though… the volume output on Raspberry Pis running snapclient seems to be quite low.

I have tried with both RPi (1) Model B, Rev. 2 and RPi 3 Model B+. t started as a fresh installation of Raspberry Pi OS Lite 12 (Bookworm), updated. Next, snapclient (from the repo, 0.26) was installed and configured to connect to a (dedicated) snapserver.
snapclient was set up to run as a service and volume in alsamixer was set to 95% (not sure if that impacts snapcast volume at all).
The volume of the audio output via snapclient is very low, for some reason.

I subsequently installed MPD (locally) onto the client device and it plays back as expected, with quite loud volume. No additional adjustments were made to achieve this.

Has anyone else run into this and knows how to address it? I would imagine that I am missing something obvious. Thanks.

Whatever the actual sound server you use on the “satellites” (Pulseaudio / Alsa / …), you have to be sure to adapt (set to max) the audio output there.

For me, that means using alsamixer

Thanks for the input. Yes, volume was set to 95% via alsamixer at the command line.

Turns out that the problem was on the HA side; I had programmatically set the media player output volume to the Snapcast server to 50%, and this was not reflected on the Snapcast end. Whoops. All’s well, now.

I do not think I am in the market to build a solution but I am in the market for a multi-room system that integrates well with HA and can play m3u off my NAS. Thoughts?

Has anyone managed to control Snapserver using its API on Node-Red? I’m struggling to get the post data done correctly so if you could share the flow that would be amazing.