Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


[HOW-TO] Spotify Connect Web for Moode
#11
The 'dtcooper' version has worked well for me with a couple of I2S DACS, apart from the gapless playback issue.
Reply
#12
(04-09-2018, 04:58 PM)pinkdot Wrote:
(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!

Will do! I'm following your guide so... let's see!

EDIT: Well, it's more stable than the pre-compiled version available via apt but... I still got a little delay at the beginning of the song, can it be reduced?
Reply
#13
(04-13-2018, 11:33 PM)gabmartini Wrote: ... I still got a little delay at the beginning of the song, can it be reduced?
See if disabling cache in spotify-connect.service will do the trick.
Replace --cache /temp  with --disable-audio-cache
Reply
#14
If I implement in moOde, what launch parameters do you recommend?

-Tim
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#15
(04-09-2018, 04:58 PM)pinkdot Wrote: 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
Hello pinkdot,

I've tried installing this and it all seemed to go well but MoodeSpot does not show up as a device option from other computers.  I tried running the systemctl enable spotify-connect.service manually as root and get an "Invalid Argument" response.  I suspect I've missed something here.

I ran systemctl status spotify-connect.service and got a response of [/etc/systemd/system/spotify-connect.service:18] Missing '='.

I thought this might refer to line 18 of the spotify-connect.service file but that line is "systemctl enable spotify-connect.service" without quotes.

Any suggestion to troubleshoot ?
Reply
#16
@pinkdot Could you post the results of:

Code:
$ cat /etc/systemd/system/spotify-connect.service


In the above post, I don't think it's really clear what the content of the file should be.  It should be just:

Code:
[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


Obviously, you would need to configure your device, which is the tricky part.

After re-saving the file, try running the start option:
Code:
$ sudo systemctl start spotify-connect.service

Wait a few seconds and then run:
Code:
$ sudo systemctl status spotify-connect.service

report back with the issues.  If all went well, you can enable the service.

Still, since that is not the approach I use, I may not be of all that help after all.  I am still vouching for the method I use Smile

Best regards,
Rafa.
Reply
#17
Thanks for the reply Rafa.  I did comment out the systemctl commands and removed the moode device name I'd specified. Did the daemon-reload and now have the service working - I can see the MoodeSpot device listed in Spotify on my phone.

I selected MoodeSpot and play an album but there's no sound.  Per the screenshot there's an Alsa error.  Could be another config error causing this.  Not sure if it relates to the Pi having a HifiBerry Digi+ Pro attached for output.  Will have to keep looking.



[Image: 41487259752_2bf64e0e97_z.jpg]

Edit:  MPD settings in System Information indicated that the Alsa device = hw:0 and the device in the original config was hw:1.  Whoops.  Changed to the correct value and rebooted.  Now have sound output.

Thanks again Rafa, your response helped.  Have to say my troubleshooting skills are extremely rusty.   Sad
Reply
#18
Change the "--device hw:1" parameter to "--device hw:0"
Reply
#19
(04-17-2018, 11:50 PM)gabmartini Wrote: Change the "--device hw:1" parameter to "--device hw:0"

Yes !!  Thanks for the reply.
Reply
#20
Just as a datapoint, the in-place upgrade from 4.0 to 4.1 went flawlessly with all the added Spotify related software.  Spotify Connect still working as it should.
Reply


Forum Jump: