(04-09-2018, 02:08 AM)gabmartini Wrote: There still isn't a reliable solution to Spotify Connect. Librespot still have connection issues, it usually hangs randomly. Volumio recently released the volumio-spotify-connect2 plugin but it's only a wrapper for librespot. Raspotify has some delay (+20 secs sometimes) to start a song and also, issues with stability. Spotify-Connect-Web has this "request API KEY" thing (which is annoying) and also, mayor issues caching songs.
But hey! There is progress being done. Let's hope to have a more stable implementation in the future.
The current Librespot-org implementation is very solid. I installed it on Moode 3.8.4 and Moode 4.0. Both installations run without big issues. It's worth a try!
Code:
cd /home/pi
sudo apt-get install build-essential portaudio19-dev git
git clone https://github.com/librespot-org/librespot.git
cd librespot/
curl https://sh.rustup.rs -sSf | sh
#from the given options choose 1
source $HOME/.cargo/env
sudo reboot
#Login again
cd /home/pi/librespot/
cargo build --release --features alsa-backend
#this will take a while, 30 minutes plus
# after this process is done, create a spotify-connect.service
sudo su
nano /etc/systemd/system/spotify-connect.service
#add the following to the spotify-connect.service file
#change --device depending on the device you are using
#change --name to your liking
#add if needed --username <your spotify username>
#add if needed --password <your spotify password>
[Unit]
Description=Spotify Connect
Requires=network-online.target
After=network-online.target
[Service]
User=root
ExecStart=/home/pi/librespot/target/release/librespot --name MoodeSpot --initial-volume 75 --cache /tmp --bitrate 320 --backend alsa --device hw:1
Restart=always
RestartSec=10
StartLimitInterval=30
StartLimitBurst=20
[Install]
WantedBy=multi-user.target
#save and close the file by 'ctrl x' -> 'y' -> enter
#start and enable the service
systemctl enable spotify-connect.service
systemctl start spotify-connect.service
#Make sure Moode is stopped before using Librespot and vise versa.
#to update
cd /home/pi/librespot
git pull
cargo build --release --features alsa-backend
sudo reboot