[Guide] Multiroom audio output from Volumio with SnapCast

Looking at the config files in the Spotify plug-in directories, it appears that the Spotify plug-in does not output to MPD. Instead it uses spop. So that explains why the Spotify plug-in is not outputing through snapserver. I will need to re-configure spop to output to the /tmp/snapfifo file that snapserver reads from in order to use the Spotify Volumio plugin with snapserver.

A possible path is to change /etc/ mpd.conf to setup output to an alsa audio device named “default” and then add an /etc/asound.conf file with the settings for it to output to /tmp/snapfifo. The example of how to do that is in the link that shows how to connect mpd. alsa etc to snapserver. Then specify in the spop.conf file that SOX outputs to an alsa device to the default. The idea is that Volumio for both NAS and Webradio output to alsa, as does the Volumio Spotify plug-in. Alsa then outputs to /tmp/snapfifo.

I thought this combination of config files would route both the Volumio2 MPD output and the Spotify plug-in output to alsa. Then alsa would output to /tmp/snapfifo. Snapserver would then intake from /tmp/snapfifo like it usually does. Alas it did not work.

/etc/mpd.conf


[code]# Audio Output ################################################################

audio_output {
type “alsa”
name “alsa”
device “default”
}

#audio_output {

type “alsa”

name “alsa”

device “hw:1,0”

dop “yes”

mixer_device “hw:1”

mixer_control “Digital”

mixer_type “hardware”

#}

#audio_output {

type “fifo”

enabled “yes”

name “multiroom”

path “/tmp/snapfifo”

[/code]

/etc/asound.conf


pcm.!default {
    type plug
    slave.pcm rate48000Hz
}

pcm.rate48000Hz {
    type rate
    slave {
        pcm writeFile # Direct to the plugin which will write to a file
        format S16_LE
        rate 48000
    }
}

pcm.writeFile {
    type file
    slave.pcm null
    file "/tmp/snapfifo"
    format "raw"
}

/etc/spopd.conf


[spop]
spotify_username = note: real username not shown
spotify_password = note: real username not shown


high_bitrate = true
audio_output = sox
pretty_json = true
search_results = 50
cache_path =/run/shm

[sox]
output_type = alsa
output_name = alsa

I have Volumio 2.041 running with Snapcast on Raspberry Pi 3. I had dropout issues, but changing the audio_output format to 48000 in the mpd.conf file on the server fixed it. I am running the November 2016 Raspian version (Jesse lite) on the client. Still using the default audio (3.5 mm jack) on both the server and client until I got everything working, so now I need to buy some DACs.

Interested in this myself. My unaltered mpd.conf has:

[code]audio_output {
type “fifo”
enabled “no”
name “multiroom”
path “/tmp/snapfifo”
format “44100:16:2”
}

[/code]

So you changed:

format          "44100:16:2"

to

format "48000" ?

Obviously, I need to change “enabled” too. Just asking before trying :slight_smile:

Almost. I changed the 44100 number to 48000 and left the remaining part on. Evidently leaving it at 44100 was causing the Pi to transcode audio before sending it causing the dropouts. So my line looks like this:

format “48000:16:2”

Don’t forget to restart your mpd daemon so it rereads the mpd.conf file.
Good luck.

Yes, that solves the drop outs on the server… tyvm :smiley: .

It all works very nicely with 1 server and 2 clients. You can’t control the volume of the clients from the Volumio UI at present, but there is a volume control app here https://github.com/atoomic/snapcast-volume-ui, which I haven’t tried yet.

I’m really looking forward to seeing this implemented in Volumio, hopefully in the near future :wink:

wow this is what i’ve been waiting for!
finally a multi room audio setup.

living, kitchen, bathroom :smiley: all in sync
i hope it can be merged into volumio by default :mrgreen:

I do have Volumio2 (NAS and Web radio) on a Raspberry Pi3 with snapserver and snapclient and a USB DAC. Snapclients on a RPi2b with HiFiBerry Digi+, RPi1B with Digi+, and RPi Zero with Pimoroni Phat DAC also connect to the snapserver. All are in separate rooms for a total of four rooms. Working great to all four nodes with synchronized sound. The Android app is working well as a fifth node as well as controlling the other nodes for volume etc. I am not a node.js programmer but it appears to be fairly easy to add a page to the Volumio node so that the controls in the Android snapcast app are on a web page. Would make it easier to use from a PC or iPhone browser.

Main issue I still have is getting the Volumio Spotify plugin to output the snapserver. I finally noticed yesterday that one can specify more than one fifo /tmp pipe intake in snapserver. I will retry to attach the Spotify plugin using a multi-fifo input approach and see how that turns out.

Hi everyone,

I’m quite new to raspberry’s and in this way also to linux.
Thanks for your guides in this forum, but I’m not able to install snapcast in a working enviornment.

Volumio2 as stand alone is working fine!

My equipment is like th following:
raspi 2 - with hifiberry dac+ running volumio 2 (attached via lan to the amplifier), should also run snapcast server(client)
raspi 3 - with hifiberry dac+ , amplifier and waterproofed speakers - should run snapcast client (attached via wifi - client installation for the garden)

I’ve tried several things:

  • the installation via the pre-build .deb packages from the git / snapcast download (I just get the error message that this is no debian package)
  • then I tried to do the whole “make and install” thing described on earlier posts in this forum and also on the git/snapcast site, but they are not working (I can’t find any snapclient or snapserver installation in the init.d directory and if I start them manualy I get the message, that the process is already in use.)

I’ve read several posts in this forum, that there are problems with the installation and also posts, that some of you have the system up and running.

So please can anyone of you provide me two images - one with volumio2/snapserver/snapclient - working and the other image with raspian/snapclient

thanks to all of you in advance
Stefan

I am also interested in a short tutorial how to install server&client on volumio2 with spotify connect and shairplay-sync support.
i managed to get the snapserver&client working on my NTC CHIP’s and it does play nice.
But i can’t get it working woth RPi 3 with volumio2 server and other clients.
Maybe someone can give us some help.
Thank you in advance.

Best regards,
Dominik

Hello guys,
My system is a RPi3 with Volumio 2.041 and shairport-sync as default.
I now installed an snapcastclient and snapcast server.
I would like to get the shairport-sync output through the pipe (/tmp/snapfifo)
This is my snapserver Pipe
-s “pipe:///tmp/snapfifo?name=Radio&sampleformat=44100:16:2&codec=flac”"

Or is it a better way to get it through the Airplay Pipe, supported by Snapcast.
-s “airplay:///shairport-sync?name=Airplay[&devicename=Snapcast][&port=5000]”
When i tried this solution, snapcast said shairpott sync not found (symbolic link?)
Hope anyone please can help me to get snapserver fully integrated in volumio 2?

I am as well looking for the same with shairport-sync and Spotify! If some kind soul could share it with us it would be great!

is there any plan to include this in volumio by default? and be able to switch between local volumio player and using it as a client for multiroom in the gui.

Any news about the integration of snapcast in volumio? :wink: Is anywhere a tutorial where can be find how to setup a RPi as snapserver with volumio and few RPi with volumio as snapclient?

Trying to install snapcast with this guide but gets the same error over and over again when command “make all”

Update boost package, install cmake, install swig but nothing seems to work. Does anyone know how to solve this?

I am pulling my hair with this
got everything working
steaming either nas files or spotify native to multiple clients until it stopped with an mpd error. and unable to rebuild database
I got it working by

  • patching mpd.conf from snapcast config page
  • commenting hw section
  • editing spop.conf and picking fifo output instead of hw output
    worked two days like a charm until I got my source db corrupted
    had to reset everything and cant get spotify native client working again…
    has anyone got a step by step , would be appreciated
    thks

got it finally working… hope it will hold
I think I understood there is no way to direct spop to alsa and then to fifo.
the system comes preconfigured with mpd to alsa to fifo
when installing spop plugin, spop directs to alsa
the only way I found to make it work is amend spopd.conf to output to fifo, and change mpd.conf to output to fifo directly instead of via alsa
would have been more elegant to have spop and mpd to alsa and then alsa to fifo but could not make that work
files below, lets see if database holds this time or get corrupted again
----- spopd.conf-----------
[spop]
spotify_username = xxxxx
spotify_password = yyyy
high_bitrate = true
refresh_token = undefined
audio_output = sox
pretty_json = true
search_results = 50
cache_path =/run/shm
[sox]
#output_type = raw
#output_name = /tmp/snapfifo
output_type = raw
output_name = /tmp/snapfifo
—mpd output section ---- (also amended the .tmpl file to avoid mpd.conf to be reset at each startup----
Audio Output
resampler {
plugin “soxr”
quality “high”
threads “1”
}
#audio_output {
type “alsa”
name “alsa”
device “hw:1,0”
dop “no”
#}
audio_output {
type “fifo”
enabled “yes”
name “multiroom”
path “/tmp/snapfifo”
format “44100:16:2”
}
#replaygain “album”
#replaygain_preamp “0”
volume_normalization “no”
###############################################################################

I got this errormessage when entering ‘sudo make installserver’

No rule to make installserver. Stop

Do not know what to make of that. Help anybody? Totally new to Linux btw so be gentle :wink:

//T

Hi tobnae, welcome to Volumio. :slight_smile:

You do realise that there is a snapcast plugin don’t you? :wink:

I did not. Will check it out. Thanks