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:
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:
Install DietPi and RoonBridge in the usual way
Look up the most recent release of Librespot and copy the link to the latest ZIP-file
SSH into your Pi and get the ZIP (example; copy your own link after ‘wget’):
unzip librespot-linux-armhf-raspberry_pi.zip -d .
- Create the service definition:
- Paste the following into the empty file:
ExecStart=/root/librespot --name SpotifyConnect --cache /tmp --bitrate 320 --backend alsa --device hw:0 > /dev/null 2>&1
Save with CTRL-X, Y
- Enable your new service:
systemctl enable spotify-connect.service
- 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).
(This little guide was created from an excellent post by Ari at the Hifiberry forums).