Hi all,
I've got Spotify connect with librespot working on piCore, and I wanted to share how I did it.
With librespot running, your raspbery pi will show up in the Spotify app under "devices available".
When selected, the song will be played on your raspberry instead of your phone.
(NOTE: I believe this does not work with a free spotify account)
Librespot uses "libportaudio2" which wasn't available on piCore, so I compiled it, and made a .tcz package for it.
To get it all running, execute these commands:
mkdir librespot
cd librespot
# libportaudio2 compiled and packaged by me, and source downloaded from:
# http://www.portaudio.com/download.html
wget http://www.gerrelt.nl/RaspberryPi/libportaudio2.tcz -P /mnt/mmcblk0p2/tce/optional
sudo echo "libportaudio2.tcz" >> /mnt/mmcblk0p2/tce/onboot.lst
# librespot compiled by me, and source downloaded from:
# https://github.com/librespot-org/librespot
wget http://www.gerrelt.nl/RaspberryPi/SpotifyRadio/librespot.tar.gz
tar -xvzf librespot.tar.gz
sudo mv librespot /mnt/mmcblk0p2/tce
chmod u+x /mnt/mmcblk0p2/tce/librespot
To start it at boot, you will have to choose a soundcard first.
Execute:
aplay -l
or
cat /proc/asound/cards
And see wich soundcard number and device number you want to use.
Open bootlocal.sh:
sudo nano -\$\icwS /opt/bootlocal.sh
And add this line to the end:
/mnt/mmcblk0p2/tce/librespot --name YourSpotifyConnectDevicename --cache /tmp --bitrate 320 --initial-volume 100 --backend alsa --device hw:0,0 > /dev/null 2>&1 &
Now, change "--device hw:0,0" to the choosen soundcard and device number, this example uses soundcard 0 and device 0.
Also check if you want to set the initial volume to 100%. If you adjust volume by a physical volume knob, you probably want it set to 100. If you use a software "volume knob", you probaly want to set it to something a lot lower.
See option "--initial-volume 100" to change it.
You will also want to change "--name YourSpotifyConnectDevicename" to give your device a recognizable name.
Exit nano with CTRL-X, save the file, and make all your changes persistent by executing:
filetool.sh -b
Reboot your raspberry pi, and when booted, it should appear under "devices available".
Enjoy!