[GUIDE] Spotify Connect on Volumio 2 (with USB sound card)

Hi everyone!

I wanted to share how I set up my Raspberry Pi2 to run a Spotify Connect music player on Volumio 2, with audio output through an external USB sound card. This way, you can play music from Spotify while controlling it from the standard Spotify app on your PC, Mac, phone or tablet.

There’s nothing novel below, just thought it might be nice to have it all together in a single place to make it easy for anyone wanting to do it.

Here’s what I did:

  1. (Optional) As I already had Raspbian running on my Pi2, I took a backup using the gzip version of this answer http://raspberrypi.stackexchange.com/a/312.

  2. I then installed Volumio by following https://volumio.org/get-started

  3. (Optional) As I use my P2 with an external USB sound card, I need to set up Alsa correctly. The first step is to figure out which card number the USB sound card is. You can do this by running

cat /proc/asound/cards

where the card number is the one furthest to the left of the device you want to use. Take note of this.

As Volumio does not come with any Alsa configuration file, we first need to create and then open it:

sudo touch /etc/asound.conf
sudo nano /etc/asound.conf

Then put the following in the asound.conf file, save and close it. Please note that my card number is “5”, yours might be different.

pcm.!default {
  type hw
  card 5
}

ctl.!default {
  type hw
  card 5
}
  1. Then install and start Spotify Connect as shown here https://github.com/Fornoth/spotify-connect-web

That’s really all there is to it! I’ve seen tutorials claiming there’s a lot more to it to get the Spotify Connect part working, but if your asound.conf file is correctly set up, this should do it!

If you want Spotify Connect to start automatically on startup, here’s how. It idles at 0.3% CPU usage and 2.9% Mem usage, so it should be fine to just keep running.

Create an auto_start script somewhere, for instance “spotify_auto_start.sh” and make it look like this (obviously replace with your own username and password):

#!/bin/sh
cd /home/volumio/spotify-connect-web
./spotify-connect-web --name Volumio --username <yourUserName> --password <yourPassword> --bitrate 320 & > /dev/null 2>&1
cd -

Make the script executable:

chmod ugo+x spotify_auto_start.sh

Add the following to /etc/rc.local:

<path_to_your_script.sh> || exit 1
exit 0

And your done!

great tutorial, thank you!

according to the parameters in the startup script, I was only able to get it to work by specifying the playback device like

–playback_device sysdefault:CARD=5

otherwise there was no sound.

I’m actually running a multiroom in my house with with 5 raspberry using logitechmediaserver and picoreplayer.
Each raspberry got his own hifiberry amp +

Has I’m a spotify premium/family user, I’d like to be able to use spotify connect + multiroom syncing.

Is it actually possible with volumio 2 and spotify plugin? Does everything work ?
I had run few test only on one pi with the volumio 2 rc2 and volume control wasn’t working on hifiberry at this time.

Thanks for your help. Sorry if this is not the appropriate place to ask.
And congratulations to all developpers, testers etc… of Volumio… seels very promising !

If you want to add a menu entry to the spotify connect page, just add the following line to the “menuItems” list in /volumio/app/mainmenu.json
Replace 192.168.xxx.xxx with your address.

    {"id": "link", "name": "Spotify", "params": {"url": "http://192.168.xxx.xxx:4000"}},

If you have an older version of volumio, add a line to the dropdown-menu in /var/www/_header.php

[code]…

I just downloaded Volumio 2 for my Raspberry Pi B and it is defenitely the smoothest Volumio experience ever. Great job guys, thanks a lot for the efforts!

One issue remains though, regarding the Spotify plugin.
I can login to Spotify with my credentials and play music via the Volumio UI, but it doesn’t show up in any of my native Spotify Apps (Desktop, iPhone, iPad). As soon as I start playing a song in a native app, the music in Volumio stops. Spotify Connect works with all three devices, but not Volumio.

Do you have any idea how to solve this issue?
I would really appreciate your help on this subject.

Best regards from Munich,
Musicopath

Hi There, the Spotify plugin doesn’t support Spotify Connect, so you won’t see it as an option with your other devices. Because Spotify allows only one stream per subscription, when you start streaming it on another device it will stop the stream on Volumio.

There is a plugin under development for Spotify Connect that you can download from here:

github.com/balbuze/volumio-plug … onnect.zip

It is working for some people, but I am having issues with my it and my IQAudio DAC right now. Past versions have worked great.