Greetings all Volumio fans!
I’ve been looking for a solution to play music through Volumio simultaneously on my living room and bedroom. After spending hours to get PulseAudio setup working without success, I bumbed into a GitHub project called SnapCast (github.com/badaix/snapcast) and I decided to give it a try. I was amazed how easy it was to setup working, and even more amazing is how well the audio sync works with it! Being so excited to get this working so nicely, I want to share my guide for all who’s interested to try it out.
I must state that I have nothing to do with the development of this awesome SnapCast software, so all the appreciation belongs to developer badaix and all the other contributors. And of course, let’s not forget the developers of Volumio
Here’s my hardware setup:
“Server”
- Raspberry Pi model 2B + Hifiberry Digi+
- Connected to wireless router via Ethernet cable
- Audio output through stereo amplifier via Toslink
- Running Volumio 1.55
- Music library at NAS in local network
- Located at living room
“Client”
- Raspberry Pi model 2B + Asus N10 Nano USB WiFi adapter
- Connected to wireless router via WiFi
- Audio output currently through Raspberry Pi’s (crappy) 3.5mm jack (the plan is to replace it with a proper DAC).
- Running Raspbian Wheezy
- Located at bedroom
Setting up the ”Server”
- Install Volumio: volumio.org/get-started/
- Setup the Volumio through WebUI
- Open up SSH connection
- Get the needed packages from repository:
sudo apt-get update
sudo apt-get install build-essential unzip
sudo apt-get install libboost-dev libboost-system-dev libboost-program-options-dev libasound2-dev libvorbis-dev libflac-dev alsa-utils libavahi-client-dev avahi-daemon
- When asked during install, opt to keep the existing config files
- Get SnapCast source code, unzip it and compile:
wget https://github.com/badaix/snapcast/archive/master.zip
unzip master.zip
cd snapcast-master
make all
- Install both snapserver and snapclient:
sudo make installserver
sudo make installclient
- snapserver and snapclient are installed as service, so they will be automatically started during boot
- Open up /etc/mpd.conf for editing:
sudo nano /etc/mpd.conf
- Comment out your current audio output (this is important!) and add a new audio output for SnapCast:
[code]#audio_output {
type “alsa”
name “Output”
device “hw:0,0”
dop “no”
#}
audio_output {
type “fifo”
name “my pipe”
path “/tmp/snapfifo”
format “44100:16:2”
mixer_type “software”
} [/code]
- NOTE! Remember that if you change the Volumio’s Playback settings through WebUI, these modifications will be overwritten and you have to do the modifications to /etc/mpd.conf again.
Setting up the ”Client”
- Install Raspbian: raspberrypi.org/documentati … /README.md
- Plugin to Ethernet and open up SSH connection
- Asus N10 Nano Wifi adapter works with Raspbian out of the box, so no driver setup is needed. Just setup your WiFi: raspberrypi.org/documentati … ess-cli.md
- Open up SSH connection
- Get the needed packages from repository:
sudo apt-get update
sudo apt-get install libboost-dev libboost-system-dev libboost-program-options-dev libasound2-dev libvorbis-dev libflac-dev alsa-utils libavahi-client-dev avahi-daemon
- Get SnapCast source code, unzip it and compile:
wget https://github.com/badaix/snapcast/archive/master.zip
unzip master.zip
cd snapcast-master
make all
- Install snapclient only:
sudo make installclient
- Restart the services:
sudo /etc/init.d/snapserver restart
sudo /etc/init.d/snapclient restart
sudo /etc/init.d/mpd restart
- Plug in your amplifier/speakers/headphones to both of the Raspberry Pi’s, browse to Volumio WebUI with your computer/tablet/phone, put some tunes playing and you should be able to hear the both outputs playing nicely in sync.
I’ve been testing my setup in a same room by playing “Server” output from the speakers connected to stereo amplifier, while listening the “Client” output from headphones. Sync is great - I really can’t notice any audible delay between the outputs. And what’s best, it works even though the “Client” is connected via Wifi, so I can move it around the house - just a power socket is needed. My next step is to get a proper DAC and active speakers for the “Client”.
It would be nice to hear if someoby else is trying this kind of setup too. If it seems to be working well enough, maybe this can be somehow implemented in Volumio - that should be pretty simple?