# Spotify Connect on your RoonBridged Pi - the quick 'n easy way

**URL:** <https://community.roonlabs.com/t/spotify-connect-on-your-roonbridged-pi-the-quick-n-easy-way/17896>\
**Category:** Raspberry Pi\
**Created:** [January 5, 2017, 8:18pm UTC](https://community.roonlabs.com/t/spotify-connect-on-your-roonbridged-pi-the-quick-n-easy-way/17896 "2017-01-05T20:18:02Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![RBM](https://community.roonlabs.com/user_avatar/community.roonlabs.com/rbm/32/48302_2.png) [@RBM](https://community.roonlabs.com/u/RBM)\
**Post date:** [January 5, 2017, 8:18pm UTC](https://community.roonlabs.com/t/spotify-connect-on-your-roonbridged-pi-the-quick-n-easy-way/17896/1 "2017-01-05T20:18:02Z")

</div>

**UPDATE 08/20/2017: community member @Tony_Reimann kindly pointed to the existence of RaSpotify, a fully packaged librespot distribution that was released sometime after this thread was started. While the info below is technically still valid, RaSpotify is the better and easier solution.**

**Links and continued discussion here:**

**[Spotify Connect on your RoonBridged Pi - the even quicker & easier way](https://community.roonlabs.com/t/spotify-connect-on-your-roonbridged-pi-the-even-quicker-easier-way/29818)**

=====

Sometimes I like Spotify – mostly for the playlists and the way it seems to know me well enough to cater to my tastes in recommendations. For those running a Pi (or similar SBC) with a HAT, there’s an easy way to add Spotify Connect without compiling and/or getting keys.

Ten easy steps:

1. Install DietPi and RoonBridge in the [usual way](https://community.roonlabs.com/t/dietpi-creating-a-lean-and-mean-roon-bridge/13908/221)

2. Look up the most recent release of [Librespot](https://github.com/herrernst/librespot/releases) and copy the link to the latest ZIP-file

3. SSH into your Pi and get the ZIP (example; copy your own link after ‘wget’):

> wget [https://github.com/herrernst/librespot/releases/download/v20161230-7fd8503/librespot-linux-armhf-raspberry\_pi.zip](https://github.com/herrernst/librespot/releases/download/v20161230-7fd8503/librespot-linux-armhf-raspberry_pi.zip)

1. Unzip:

> unzip librespot-linux-armhf-raspberry\_pi.zip -d .

1. Create the service definition:

> nano /etc/systemd/system/spotify-connect.service

1. Paste the following into the empty file:

> [Unit]  
> Description=Spotify Connect  
> After=network-online.target  
> [Service]  
> Type=idle  
> User=root  
> ExecStart=/root/librespot --name SpotifyConnect --cache /tmp --bitrate 320 --backend alsa --device hw:0 \> /dev/null 2\>&1  
> Restart=always  
> RestartSec=10  
> StartLimitInterval=30  
> StartLimitBurst=20  
> [Install]  
> WantedBy=multi-user.target

1. Save with CTRL-X, Y

2. Reload daemons:

> systemctl daemon-reload

1. Enable your new service:

> systemctl enable spotify-connect.service

1. Enable and activate your new service:

> systemctl start spotify-connect.service

That’s all. Spotify Connect will be loaded automatically every time you boot your Pi. It will automatically release ALSA a few seconds after playing is stopped, so RoonBridge can take over (alternately, RoonBridge releases ALSA a few seconds after playing is stopped as well).

Happy listening!

_(This little guide was created from an excellent post by Ari at the [Hifiberry forums](https://support.hifiberry.com/hc/en-us/community/posts/201863051-hifiberry-digi-spotify-connect))_.

---

<div class="post-metadata">

**Author:** ![Tony\_Reimann](https://community.roonlabs.com/letter_avatar/tony_reimann/32/5_5575768a8748004e209b776fc1b2916d.png) [@Tony\_Reimann](https://community.roonlabs.com/u/Tony_Reimann)\
**Post date:** [January 6, 2017, 12:22am UTC](https://community.roonlabs.com/t/spotify-connect-on-your-roonbridged-pi-the-quick-n-easy-way/17896/2 "2017-01-06T00:22:53Z")

</div>

It didn’t work for me. I got the following when querying the status

```auto
root@DietPi:~# systemctl status spotify-connect.service
● spotify-connect.service - Spotify Connect
   Loaded: loaded (/etc/systemd/system/spotify-connect.service; enabled)
   Active: active (running) since Fri 2017-01-06 13:09:25 NZDT; 10min ago
 Main PID: 454 (librespot)
   CGroup: /system.slice/spotify-connect.service
           └─454 /root/librespot --name SpotifyConnect --cache /tmp --bitrate 320 --backend alsa --device hw:0 > /dev/null 2>&1

Jan 06 13:14:01 DietPi librespot[454]: WARN:mdns::fsm: couldn't parse packet from V6([fe80::107b:6fc5:5605:88d3]:5353): class 32769 is invalid
Jan 06 13:14:01 DietPi librespot[454]: WARN:mdns::fsm: couldn't parse packet from V6([fe80::107b:6fc5:5605:88d3]:5353): class 32769 is invalid
Jan 06 13:14:02 DietPi librespot[454]: WARN:mdns::fsm: couldn't parse packet from V6([fe80::107b:6fc5:5605:88d3]:5353): class 32769 is invalid
Jan 06 13:14:03 DietPi librespot[454]: WARN:mdns::fsm: couldn't parse packet from V6([fe80::107b:6fc5:5605:88d3]:5353): class 32769 is invalid
Jan 06 13:14:03 DietPi librespot[454]: WARN:mdns::fsm: couldn't parse packet from V6([fe80::107b:6fc5:5605:88d3]:5353): class 32769 is invalid
Jan 06 13:14:05 DietPi librespot[454]: WARN:mdns::fsm: couldn't parse packet from V6([fe80::c25:1f57:8260:6d0c]:5353): class 32769 is invalid
Jan 06 13:14:05 DietPi librespot[454]: WARN:mdns::fsm: couldn't parse packet from V6([fe80::107b:6fc5:5605:88d3]:5353): class 32769 is invalid
Jan 06 13:15:42 DietPi librespot[454]: WARN:mdns::fsm: couldn't parse packet from V6([fe80::c25:1f57:8260:6d0c]:5353): class 32769 is invalid
Jan 06 13:17:21 DietPi librespot[454]: WARN:mdns::fsm: couldn't parse packet from V6([fe80::c25:1f57:8260:6d0c]:5353): class 32769 is invalid
Jan 06 13:18:58 DietPi librespot[454]: WARN:mdns::fsm: couldn't parse packet from V6([fe80::c25:1f57:8260:6d0c]:5353): class 32769 is invalid
```

---

<div class="post-metadata">

**Author:** ![Wayne\_Bull1](https://community.roonlabs.com/user_avatar/community.roonlabs.com/wayne_bull1/32/48844_2.png) [@Wayne\_Bull1](https://community.roonlabs.com/u/Wayne_Bull1)\
**Post date:** [January 6, 2017, 7:13am UTC](https://community.roonlabs.com/t/spotify-connect-on-your-roonbridged-pi-the-quick-n-easy-way/17896/3 "2017-01-06T07:13:27Z")

</div>

Gonna try this tonight Rene, thanks very much 😀

---

<div class="post-metadata">

**Author:** ![RBM](https://community.roonlabs.com/user_avatar/community.roonlabs.com/rbm/32/48302_2.png) [@RBM](https://community.roonlabs.com/u/RBM)\
**Post date:** [January 6, 2017, 1:59pm UTC](https://community.roonlabs.com/t/spotify-connect-on-your-roonbridged-pi-the-quick-n-easy-way/17896/4 "2017-01-06T13:59:27Z")

</div>

What soundcard / DAC are you using? If it is not at hw:0, you have to change the card# in the service file. You can find out by issuing ‘aplay -l’.

This is the main command:

> /root/librespot --name SpotifyConnect --cache /tmp --bitrate 320 --backend alsa --device hw:0

You can stop the service temporarily and try device settings by running the above command direct from the prompt until it runs OK – then change the service file accordingly and restart.

---

<div class="post-metadata">

**Author:** ![Wayne\_Bull1](https://community.roonlabs.com/user_avatar/community.roonlabs.com/wayne_bull1/32/48844_2.png) [@Wayne\_Bull1](https://community.roonlabs.com/u/Wayne_Bull1)\
**Post date:** [January 6, 2017, 4:54pm UTC](https://community.roonlabs.com/t/spotify-connect-on-your-roonbridged-pi-the-quick-n-easy-way/17896/5 "2017-01-06T16:54:45Z")

</div>

Maybe @Dan_Knight could implement this into the dietpi build (not that you have’nt got enough to do Dan 😀)

I know lots of Roon users have Spotify subscriptions.

---

<div class="post-metadata">

**Author:** ![Wayne\_Bull1](https://community.roonlabs.com/user_avatar/community.roonlabs.com/wayne_bull1/32/48844_2.png) [@Wayne\_Bull1](https://community.roonlabs.com/u/Wayne_Bull1)\
**Post date:** [January 6, 2017, 5:19pm UTC](https://community.roonlabs.com/t/spotify-connect-on-your-roonbridged-pi-the-quick-n-easy-way/17896/6 "2017-01-06T17:19:51Z")

</div>

Thanks for this @RBM. Your instructions worked perfectly. Cheers

---

<div class="post-metadata">

**Author:** ![Tony\_Reimann](https://community.roonlabs.com/letter_avatar/tony_reimann/32/5_5575768a8748004e209b776fc1b2916d.png) [@Tony\_Reimann](https://community.roonlabs.com/u/Tony_Reimann)\
**Post date:** [January 6, 2017, 5:33pm UTC](https://community.roonlabs.com/t/spotify-connect-on-your-roonbridged-pi-the-quick-n-easy-way/17896/7 "2017-01-06T17:33:04Z")

</div>

I am using a Allo Piano Dac 2.1. The output of aplay -l is

\*\*\*\* List of PLAYBACK Hardware Devices \*\*\*\*  
card 0: PianoDAC [PianoDAC], device 0: Piano DAC HiFi pcm512x-hifi-0 []  
Subdevices: 1/1  
Subdevice #0: subdevice #0

so looks OK to me. I don’t see any Spotify Connect device at all. Running the command manually gives

root@DietPi:~# /root/librespot --name SpotifyConnect --cache /tmp --bitrate 320 --backend alsa --device hw:0  
INFO:librespot::main\_helper: librespot 3331338 (2016-12-30). Built on 2016-12-30.  
INFO:librespot::main\_helper: No username provided and no stored credentials, starting discovery …  
WARN:mdns: Error creating IPv4 UDP socket for mDNS: No such device (os error 19)  
WARN:mdns::fsm: couldn’t parse packet from V6([fe80::c25:1f57:8260:6d0c]:5353): class 32769 is invalid  
WARN:mdns::fsm: couldn’t parse packet from V6([fe80::1817:83af:9f46:c362]:5353): class 32769 is invalid  
WARN:mdns::fsm: couldn’t parse packet from V6([fe80::1817:83af:9f46:c362]:5353): class 32769 is invalid  
WARN:mdns::fsm: couldn’t parse packet from V6([fe80::1817:83af:9f46:c362]:5353): class 32769 is invalid  
WARN:mdns::fsm: couldn’t parse packet from V6([fe80::1817:83af:9f46:c362]:5353): class 32769 is invalid  
WARN:mdns::fsm: couldn’t parse packet from V6([fe80::4c7:5fc5:c871:fed0]:5353): class 32769 is invalid  
WARN:mdns::fsm: couldn’t parse packet from V6([fe80::4c7:5fc5:c871:fed0]:5353): class 32769 is invalid  
WARN:mdns::fsm: couldn’t parse packet from V6([fe80::4c7:5fc5:c871:fed0]:5353): class 32769 is invalid  
WARN:mdns::fsm: couldn’t parse packet from V6([fe80::4c7:5fc5:c871:fed0]:5353): class 32769 is invalid  
WARN:mdns::fsm: couldn’t parse packet from V6([fe80::4c7:5fc5:c871:fed0]:5353): class 32769 is invalid  
WARN:mdns::fsm: couldn’t parse packet from V6([fe80::4c7:5fc5:c871:fed0]:5353): class 32769 is invalid

---

<div class="post-metadata">

**Author:** ![maniac](https://community.roonlabs.com/user_avatar/community.roonlabs.com/maniac/32/57322_2.png) [@maniac](https://community.roonlabs.com/u/maniac)\
**Post date:** [January 6, 2017, 5:58pm UTC](https://community.roonlabs.com/t/spotify-connect-on-your-roonbridged-pi-the-quick-n-easy-way/17896/8 "2017-01-06T17:58:57Z")

</div>

@Tony_Reimann that seems to be rather network issue than DAC issue. Possibly some sort of ipv6 or mdns incompatibility - possibly upgrade of OS could help?

---

<div class="post-metadata">

**Author:** ![Sloop\_John\_B](https://community.roonlabs.com/user_avatar/community.roonlabs.com/sloop_john_b/32/48211_2.png) [@Sloop\_John\_B](https://community.roonlabs.com/u/Sloop_John_B)\
**Post date:** [January 6, 2017, 10:36pm UTC](https://community.roonlabs.com/t/spotify-connect-on-your-roonbridged-pi-the-quick-n-easy-way/17896/9 "2017-01-06T22:36:57Z")

</div>

@RBM @Dan_Knight

Once again Rene, and for the first time Dan, thanks very much for all you do to allow this fuddy 50 year old to set up something like this!

 ![](https://roon-community-uploads.s3.amazonaws.com/original/2X/2/221ca5e4a1c9a8d55e98406370ddbe0af3172e22.png)

Diet-Pi is amazing and I’m just heading over to add a few spondulicks to the budget.I know I only cut and pasted to get Spotify connect but it feels like magic to me!

Unfortunately this may mean quite a few silly questions may be asked here going forward!

SJB

SJB

---

<div class="post-metadata">

**Author:** ![RBM](https://community.roonlabs.com/user_avatar/community.roonlabs.com/rbm/32/48302_2.png) [@RBM](https://community.roonlabs.com/u/RBM)\
**Post date:** [January 6, 2017, 11:19pm UTC](https://community.roonlabs.com/t/spotify-connect-on-your-roonbridged-pi-the-quick-n-easy-way/17896/10 "2017-01-06T23:19:48Z")

</div>

> [@Tony\_Reimann](#):
>
> WARN:mdns: Error creating IPv4 UDP socket for mDNS: No such device (os error 19)

Does your Pi have any internet connectivity at all? Can you ping external websites? (Try ‘ping [google.com](http://google.com)’).

---

<div class="post-metadata">

**Author:** ![Tony\_Reimann](https://community.roonlabs.com/letter_avatar/tony_reimann/32/5_5575768a8748004e209b776fc1b2916d.png) [@Tony\_Reimann](https://community.roonlabs.com/u/Tony_Reimann)\
**Post date:** [January 7, 2017, 3:35am UTC](https://community.roonlabs.com/t/spotify-connect-on-your-roonbridged-pi-the-quick-n-easy-way/17896/11 "2017-01-07T03:35:08Z")

</div>

It sure does have internet connectivity (needed it to get the s/w in the first place 🙂 ) Running the latest dietpi 1.41. Here is the ping of google just to prove internet connectivity

root@DietPi:~# ping [www.google.com](http://www.google.com)  
PING [www.google.com](http://www.google.com) (216.58.199.36) 56(84) bytes of data.  
64 bytes from [www.google.com](http://www.google.com) (216.58.199.36): icmp\_seq=1 ttl=54 time=30.9 ms  
64 bytes from [www.google.com](http://www.google.com) (216.58.199.36): icmp\_seq=2 ttl=54 time=30.6 ms  
64 bytes from [www.google.com](http://www.google.com) (216.58.199.36): icmp\_seq=3 ttl=54 time=30.6 ms  
64 bytes from [www.google.com](http://www.google.com) (216.58.199.36): icmp\_seq=4 ttl=54 time=30.7 ms  
64 bytes from [www.google.com](http://www.google.com) (216.58.199.36): icmp\_seq=5 ttl=54 time=32.2 ms  
64 bytes from [www.google.com](http://www.google.com) (216.58.199.36): icmp\_seq=6 ttl=54 time=30.5 ms  
64 bytes from [www.google.com](http://www.google.com) (216.58.199.36): icmp\_seq=7 ttl=54 time=30.5 ms  
64 bytes from [www.google.com](http://www.google.com) (216.58.199.36): icmp\_seq=8 ttl=54 time=30.6 ms  
64 bytes from [www.google.com](http://www.google.com) (216.58.199.36): icmp\_seq=9 ttl=54 time=30.5 ms  
64 bytes from [www.google.com](http://www.google.com) (216.58.199.36): icmp\_seq=10 ttl=54 time=30.6 ms  
^C  
— [www.google.com](http://www.google.com) ping statistics —  
10 packets transmitted, 10 received, 0% packet loss, time 9015ms  
rtt min/avg/max/mdev = 30.572/30.838/32.218/0.509 ms

I am stumped and want spotify connect so I really appreciate any help.

Could it be an issue with me using a Kali reclocker with the piano 2.1 dac?

---

<div class="post-metadata">

**Author:** ![Tony\_Reimann](https://community.roonlabs.com/letter_avatar/tony_reimann/32/5_5575768a8748004e209b776fc1b2916d.png) [@Tony\_Reimann](https://community.roonlabs.com/u/Tony_Reimann)\
**Post date:** [January 7, 2017, 10:42am UTC](https://community.roonlabs.com/t/spotify-connect-on-your-roonbridged-pi-the-quick-n-easy-way/17896/12 "2017-01-07T10:42:58Z")

</div>

> [@RBM](#):
>
> systemctl start spotify-connect.service

OK I disabled IP V6 and bingo, all is good!

---

<div class="post-metadata">

**Author:** ![RBM](https://community.roonlabs.com/user_avatar/community.roonlabs.com/rbm/32/48302_2.png) [@RBM](https://community.roonlabs.com/u/RBM)\
**Post date:** [January 7, 2017, 10:51am UTC](https://community.roonlabs.com/t/spotify-connect-on-your-roonbridged-pi-the-quick-n-easy-way/17896/13 "2017-01-07T10:51:20Z")

</div>

👍 Good to hear.

I ended up in a similar situation this morning after updating RoonBridge – so I guess the coexistence between the two is not yet as peaceful as we’d like.

Things stabilised after stopping the spotify-connect.service, restarting roonbridge.service and starting spotify-connect again. Lets see how this works out over time.

In the mean time I’ll add a spare Pi + Digi+ board running Librespot exclusively to the mix, as I found it to be more reliable and better sounding compared to the Chromecast Audio that was assigned to Spotify duty until now.

---

<div class="post-metadata">

**Author:** ![Sloop\_John\_B](https://community.roonlabs.com/user_avatar/community.roonlabs.com/sloop_john_b/32/48211_2.png) [@Sloop\_John\_B](https://community.roonlabs.com/u/Sloop_John_B)\
**Post date:** [January 7, 2017, 2:13pm UTC](https://community.roonlabs.com/t/spotify-connect-on-your-roonbridged-pi-the-quick-n-easy-way/17896/14 "2017-01-07T14:13:06Z")

</div>

Is there a way to name the Spotify connect option, as I want to have it on 2 different Pis and need to be able to differentiate?

Thanks

SJB

---

<div class="post-metadata">

**Author:** ![RBM](https://community.roonlabs.com/user_avatar/community.roonlabs.com/rbm/32/48302_2.png) [@RBM](https://community.roonlabs.com/u/RBM)\
**Post date:** [January 7, 2017, 2:20pm UTC](https://community.roonlabs.com/t/spotify-connect-on-your-roonbridged-pi-the-quick-n-easy-way/17896/15 "2017-01-07T14:20:06Z")

</div>

Yes: repeat steps 5-10 (without the pasting part) and edit ‘–name SpotifyConnect’ to a name of your liking in step 5.

---

<div class="post-metadata">

**Author:** ![aart\_m](https://community.roonlabs.com/letter_avatar/aart_m/32/5_5575768a8748004e209b776fc1b2916d.png) [@aart\_m](https://community.roonlabs.com/u/aart_m)\
**Post date:** [January 8, 2017, 7:12pm UTC](https://community.roonlabs.com/t/spotify-connect-on-your-roonbridged-pi-the-quick-n-easy-way/17896/17 "2017-01-08T19:12:05Z")

</div>

cool, thanks Rene!  
Now just to figure out a way to control the volume on the Dion Audio Loco DAC/Amp on the Pi… alsa doesn’t show anything that I can do and this thing can be loud…

---

<div class="post-metadata">

**Author:** ![rovinggecko](https://community.roonlabs.com/user_avatar/community.roonlabs.com/rovinggecko/32/49185_2.png) [@rovinggecko](https://community.roonlabs.com/u/rovinggecko)\
**Post date:** [January 8, 2017, 8:31pm UTC](https://community.roonlabs.com/t/spotify-connect-on-your-roonbridged-pi-the-quick-n-easy-way/17896/18 "2017-01-08T20:31:43Z")

</div>

Thanks @RBM!

My rpi now nicely becomes a sound hub, switching seamlessly between:

- NAA for HQPlayer endpoint
- Roon Bridge (in preparation for 1.3)
- Shairport for that youtube sound
- SpotifyConnect for that guilty pleasure

---

<div class="post-metadata">

**Author:** ![Sloop\_John\_B](https://community.roonlabs.com/user_avatar/community.roonlabs.com/sloop_john_b/32/48211_2.png) [@Sloop\_John\_B](https://community.roonlabs.com/u/Sloop_John_B)\
**Post date:** [January 8, 2017, 11:09pm UTC](https://community.roonlabs.com/t/spotify-connect-on-your-roonbridged-pi-the-quick-n-easy-way/17896/19 "2017-01-08T23:09:59Z")

</div>

> [@RBM](#):
>
> I have added enabling systemd-networkd.service and systemd-networkd-wait-online.service to the instructions (step 9), to prevent LibreSpot from trying to load (and failing) when the network is not ready.

If I have spotify connect up and working do I have to do the extra step at 9 and if so where do I start.

(sorry if this is a silly question)

SJB

---

<div class="post-metadata">

**Author:** ![RBM](https://community.roonlabs.com/user_avatar/community.roonlabs.com/rbm/32/48302_2.png) [@RBM](https://community.roonlabs.com/u/RBM)\
**Post date:** [January 9, 2017, 2:11pm UTC](https://community.roonlabs.com/t/spotify-connect-on-your-roonbridged-pi-the-quick-n-easy-way/17896/20 "2017-01-09T14:11:14Z")

</div>

No silly questions here…

You won’t really need those services (I have since removed them from the first post) – this was me trying to make starting the service more reliable, but it looks like the embedded mDNS code is the culprit.

For now – if it works, it works. 😉

---

<div class="post-metadata">

**Author:** ![Mike\_Brailsford](https://community.roonlabs.com/letter_avatar/mike_brailsford/32/5_5575768a8748004e209b776fc1b2916d.png) [@Mike\_Brailsford](https://community.roonlabs.com/u/Mike_Brailsford)\
**Post date:** [January 12, 2017, 10:36am UTC](https://community.roonlabs.com/t/spotify-connect-on-your-roonbridged-pi-the-quick-n-easy-way/17896/21 "2017-01-12T10:36:45Z")

</div>

Hi,

thanks for the great writeup/help, however I have one issue within my setup, although the Spotify App on my Android phone sees the Spotify Connect option, however when I choose it and press play I get no sound via the Sparky/Piano/Kali setup.

Roon bridge is working fine and sounds great however Spotify connect is running but with no output ( Spotify connect volume is max )

Internet connection is all good as I can listen to the radio stations via net connection

Any ideas?

Thanks,

Mike.

[Next page](https://community.roonlabs.com/t/spotify-connect-on-your-roonbridged-pi-the-quick-n-easy-way/17896.md?page=2)
