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

Thanks Rene
It also works for Hugo which is not a big surprise when it works for the very similar Mojo.
I just had to change to: plughw:CARD=Hugo

Ahā€¦So you have to have a Spotify Premium account in order to use Spotify Connect I see. Drat. decisions, decisionsā€¦

The latest Librespot compile seems more stable. I now use my Spotify Premium username/password and disable discovery. Early days still, but itā€™s working 100% reliable (including reboots) over the last few days. Hereā€™s my current .service definition:

[Unit]
Description=Librespot
Requires=network-online.target
After=network-online.target

[Service]
User=root
Restart=always
RestartSec=10
ExecStart=/root/librespot --name SpotiPi --username renebouwmeester --password ******** --disable-discovery --cache /tmp --bitrate 320 --device hw:0 > /dev/null 2>&1

[Install]
WantedBy=multi-user.target

Cheers Rene, Iā€™ve been using the latest librespot with no problems. Havenā€™t had password details entered though so I think I will edit it to do so using your script

Hi Rene, what do you see as the benefit of using username/password and disabling discovery?

The mDNS/discovery service was always a bit shaky in Librespot.

In this latest release, it has been 100% stable for me. Whether this is because of improvements to Rust/mDNS or me switching to username/password ā€“ I donā€™t know, but Iā€™m happy.

Letā€™s just see how it behaves over time. :slight_smile:

Is Spotify streaming hi-res or MQA yet?

Three times no: no lossless, no highres, no MQA.

Hi

I have manged to setup a Pi 3 (Diet-Pi) with a HIFIBERRY DIGI+ PRO for Roon and Spotify. I also have an unmodified Odroid C2. I have Roon working but canā€™t get Spotify to work. When I issue : systemctl status spotify-connect.service
ā— spotify-connect.service - Spotify Connect
Loaded: loaded (/etc/systemd/system/spotify-connect.service; enabled)
Active: activating (auto-restart) (Result: exit-code) since Sun 2017-04-16 13:41:01 BST; 4s ago
Process: 20281 ExecStart=/root/librespot --name SpotifyConnect --cache /tmp --bitrate 320 --backend alsa --device hw:0 > /dev/null 2>&1 (code=exited, status=203/EXEC)
Main PID: 20281 (code=exited, status=203/EXEC)

I have also tried the same after stopping the Roon service i.e.
systemctl stop spotify-connect.service
systemctl stop roonbridge.service
systemctl start roonbridge.service
systemctl start spotify-connect.service
systemctl status spotify-connect.service -l

Which gives me the same message as before but with:
Apr 16 13:42:54 DietPi systemd[1]: spotify-connect.service: main process exited, code=exited, status=203/EXEC
Apr 16 13:42:54 DietPi systemd[1]: Unit spotify-connect.service entered failed state.

Is there any reason why the Spotify connect solution wouldnā€™t work on Odroid C2?

Thanks
Tom

Spotify Connect has suddenly stopped showing as a device in spotify on my android phone. Anybody else having problems?

I had this problem yesterday. Updated dietpi and all was well again.

I have been on 149 since it came out so nothing for me to update.

Rebooted router (including wireless AP) and it all came back.

Rene

Got this working within minutes of reading the threadā€¦ Thanks very much.

Not exactly related to this, but do you think itā€™s possible to group devices so that you can playback in multiple rooms. I know Connect can only output to one device at a time ( as a result of their licensing rules) but would it be possible to create a network of devices as Sonos and few other are able to.

Off topic I know, sorry

Hi @gmt . Could you solve the problem? I am trying to get it working but found the same wall and problem as you I think (dietpi on Odroid C2+Hifi shield 2).

@RBM Have you encounter this problem/error so as to give some guidance? This is the result of systemctl status spotify-connect.service. I have tried the first code for the service definition aswell as the second one you provided.

ā— spotify-connect.service - Librespot
Loaded: loaded (/etc/systemd/system/spotify-connect.service; enabled)
Active: activating (auto-restart) (Result: exit-code) since Sat 2017-07-01 21:01:29 -03; 9s ago
Process: 2297 ExecStart=/root/librespot --name SpotifyConnect --username ekinig@gmail.com --password ********* --disable-discovery --cache /tmp --bitrate 320 --device hw:0 > /dev/null 2>&1 (code=exited, status=203/EXEC)
Main PID: 2297 (code=exited, status=203/EXEC)
Jul 01 21:01:29 DietPi systemd[1]: Unit spotify-connect.service entered failed state.

I guess I suck at terminal commands, because I also know that I have to change the soundcard to hw:1, but the command

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

returns -bash: /root/librespot: No such file or directory . :sweat:.

Any help will be appreciated.
Regards

ItĀ“s not a standalone command, which you have to terminate. ItĀ“s a part of whole text for new file/service definition created in ā€œStep 5ā€
nano /etc/systemd/system/spotify-connect.service

ā€œStep 6ā€
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:1 > /dev/null 2>&1
    Restart=always
    RestartSec=10
    StartLimitInterval=30
    StartLimitBurst=20
    [Install]
    WantedBy=multi-user.target

Save and close the new file with:
CTRL-x y ENTER

Got it. But still not working. I donā€™t know anything about ARM arch., but could it be because it is an ODROID C2 and not a rpi and the binary has been compiled on rpi?

Hi @Elece

No joy at this end. Iā€™ve now got more Roon sources than systems now so itā€™s a low priority for me now. Would be good if there is a fix though.

Cheers
Tom

The binary I linked to in the first post is a pre-compiled file for the Pi/Raspbian. It could work on other ARM7 platforms, but Iā€™ve found it does not run on Ropieee (running Arch for ARM).

If you are up to it, you can compile it yourself on/for the Odroid: https://github.com/plietar/librespot

Is the librespot binary actually present in your root dir?

Yes, I noted that. I compiled it on my odroid and got a binary without any errors, but no luch, it doesnā€™t work.

Yes! it is.

Thanks anyway

people may find this easier https://github.com/dtcooper/raspotify

2 Likes