Spotify Connect

no. The quality is dependent from Spotify stream. But don’t worry, with a dac and by setting to 320kps, it works very well, even if spopd lag sometime…

I have tried it again but I still get the same error.

I have taken the URL from the website: spotify-connect-web.s3-website.e … ect-web.sh … is this the always actual release? (I´am not familiar with GitHub Repos).

Tried it all, working when giving the command ./spotify-connect-web.sh --username 12345678 --password xyz123 --bitrate 320 in the command line (putty) but when adding to /etc/rc.local no luck… also, not when adding ‘sudo’ in front of it (sudo /spotify-connect-web.sh --username 12345678 --password xyz123 --bitrate 320 &)

any advice ? I’m no software guy …

Hi,
You can’t launch it as su user. Use a other user “pi” in rc.local

su pi -c your command

I my case I wrote a small script call startconnect.sh containing the launch command and added it in the rc.local

Thanks, way past my programming ability sadly so I’ll go and see a friend who does know a thing or two about it…

Still, connect is working after all the commands, just no auto startup after restarting the pi.

yes I undesrtood, but as I said, you can’t run it automatically from rc.local unless you use a other user than root (due to the chroot). On Volumio, there is a other user “pi”. You need to add su pi -c 'your command' so that it is started at boot. :wink:

So, what I did :

Have a working volumio 1.55 system on a pi1 B+

Made a key on the spotify site, put that on a USB stick which I copied to the PI later

Then did all the following

curl -O spotify-connect-web.s3-website.e … ect-web.sh
chmod u+x spotify-connect-web.sh

Download the current chroot (~ 180 MB)

./spotify-connect-web.sh install

Copy your spotify_appkey.key into the app directory. (See below for information on how to get that file.)

sudo cp spotify_appkey.key spotify-connect-web-chroot/usr/src/app/ (checked it, key is actuall in the dir)

Run using normal cmdline options

./spotify-connect-web.sh --username 12345678 --password xyz123 --bitrate 320

and it actually ran !

Then edited the /etc/rc.local and added before the exit 0 command

su pi -c ./spotify-connect-web.sh --name Huiskamer --username ******* --password ***** --bitrate 320 &

then saved and exit the editor

then make all executable :

sudo chown root /etc/rc.local
sudo chmod 755 /etc/rc.local

and restarted the pi…

no luck

just giving the command ‘./spotify-connect-web.sh --name Huiskamer --username ******* --password ***** --bitrate 320 &’ makes it work but not in any way in the rc.local…

Try to add ‘’ su pi -c 'command'
You don’t have to modify the flag for rc.local…

changed the comment to su pi -c ‘command and all the stuff &’

and did the executable thing again

now, when I sudo /etc/rc.local it works

so just the startup doesn’t

could it be that it goes wrong on the ALSA ? When the pi is playing a radiostation and I give the command sudo /etc/rc.local it returns an error alsaaudio.ALSAAudioError: Device or resource busy

YEP,
It’s because Soptify connect still capture alsa output. This is solve with that branch https://github.com/JozoVilcek/spotify-connect-web
And I’m going to test https://github.com/tommph/spotify-connect-web.

Just got the pi up and running with Volumio and USB DAC and sounds excellent. However, wife is threatening to switch back to laptop if I can’t get the Spotify connect working.

Any idea if this should work okay with USB DAC? Can’t seem to get it to run. Segmentation errors…

Any assistance would be greatly appreciated, thanks

Worked fine with my Hifiberry DAC, will try the other build now to get it to run from start automatically

github.com/JozoVilcek/spotify-connect-web works perfect for me.

Laptop now relegated to kids room!

Just as an aside though Volumio doesn’t show as a UPNP device any longer.

Small price to pay but just wondered if this was related to this fork?

Well… I almost give up… the whole thing stopped giving any sound with spotify (although playing in the play screen but no sound) and did give perfect sound with all other sources… now, one step further… can not get spotify connect to volumio anymore (not even the normal std way)… done re-installs, changed config files, re-installed a few more times but no luck… bugger :angry:

Edit… strange… setup of an identical system at my sister place, 15 minutes and all plays well, including the playlists from spotify.

Today, took the PI to work and hooked it up there with a fresh install, all well… hm… Back home… all well too. Just once that spotify did not show up but after a library update it was back…

Now, back to the spotify connect stuff…

hi , i use great script spotify conect web and his work perfectly. But i have 2 question ?

  1. Balbuze you talk you make a script for launching spotify connect at startup can you share this ?
  2. how i can fix my usb dac on default output ? when i switch On/off my dac spotify connect stop working .

Just create a file, let’s say startconnect.sh in your /home/pi folder
containing ( change all what you need to match your config )

/home/pi/spotify-connect-web.sh --name Volumio-lounge --username XXXXX --password XXXXX --bitrate 320
Then chmod +x startconnect.sh
In /etc/rc.local add

su pi -c /home/pi/startconnect.sh &

Balbuze , thanks very much for sharing.

Just wondered :-

  1. Does running the script then prevent Volumio showing up as Upnp device?

  2. Does the script run endlessly? It runs well for a period then the device does not show up as available from my Android devices and I have to re-run the command via SSH. Simple fix for me but less so for the family.

Just curious as to this is something I have messed up on or standard behaviour.

Thanks

Yesterday, I tested the Fornoth implementation on my raspberry pi with hifiberry + dac. Took some time to figure out how to start it at boot, but thanks to your information i got it working using rc.local.

I experienced the reported problem when switching from volumio to spotify connect. Seems the project solved this issue at november 9 (github.com/Fornoth/spotify-conn … its/master). Gave it a try and replaced the code of console_callbacks.py (https://github.com/Fornoth/spotify-connect-web/blob/855b92b49555cdcc11d0ab4c71866475cd7c9499/console_callbacks.py) with the new one. And it works great!
You manualy have to stop and start playback when switching. Only thing left to do is stopping volumio and spotify connect automatic when switching…

You can find this file in spotify-connect-web-chroot/usr/src/app (make sure you back up the original file, maybe this causes other problems i didn’t encounter yet).

Anyone interested in helping port this to Volumio2?

Hello , i try your solution balbuze but is not working! if i launch ./etc/rc.local manualy it’s ok , but when i reboot my pi the script doesn’t start