Max2Play Home › Forums › Max2Play Development (Ideas, Wishes) › [NEW UPDATE] Spotify Connect Server – beta available!
Tagged: librespot, spotify connect server
- This topic has 126 replies, 36 voices, and was last updated 7 years, 1 month ago by Heiner premium.
-
28. Februar 2017 at 14:22 #27335
Mit spotify-connect wird die Musik nicht durch Squeezebox Server gestreamt, die Musik ist dann nur auf dem einen Pi hörbar.
1. März 2017 at 11:11 #27362Can you please explane a bit how to set it up?
I tried with a Hifiberry AMP but after the steps in the Video and adding the „-C“ in the Squeezeplug Options i have not sound at all.Thnaks.
1. März 2017 at 21:49 #27384Not sure what might be the problem 😉 I am not an expert and it took me at least several hours of googling etc. to get it working. Strictly following the steps in the video is not enough, unfortunately. I had to manually copy the newest ‚commits‘ to prevent SCS from blocking the hifiberry soundcard (that might be the issue). I use „-C 1“ in squeezeplayer, which means that it unblocks the soundcard if it is not playing after 1 second.
This is exactly why we need Max2play to integrate SCS into their solution 😉
2. März 2017 at 12:02 #27391Hello
How can you follow the tutorial in the video you gave when the 1st step is to ask for a Spotify Connect API key and it is deprecated on Spotify server ? Is there another way to get a key ?
Cheers
2. März 2017 at 12:08 #27392Hm, I requested the key a couple of months ago. I understand the request form still works, but I didn’t try…
2. März 2017 at 12:28 #27393You can also download a key… It´s not linked to your account – but it works.
https://github.com/jodal/spoticy/blob/master/tests/spotify_appkey.key
5. März 2017 at 22:02 #27454You can get a key via the provided google form link: https://developer.spotify.com/technologies/libspotify/application-keys/
7. März 2017 at 12:00 #27485I did ask for a key through this form months ago, and never got any answer 🙁
I’ll try with the downloaded key given by Phil86 (thanks!)
- This reply was modified 7 years, 8 months ago by malletfils.
23. April 2017 at 20:45 #28420This is how I did this – I think it should be quite an easy to implement this as plugin in max2play.
Step by step (you need to be root):
1. Look up the most recent release of librespot and copy the link to the latest ZIP-file
2. SSH into your Pi and get the ZIP (example; copy your own link after ‚wget‘):
wget https://github.com/herrernst/librespot/releases/download/v20170413-d95c0b3/librespot-linux-armhf-raspberry_pi.zip
3. Unzip:
unzip librespot-linux-armhf-raspberry_pi.zip
4. Create the service definition:
nano /etc/systemd/system/spotify-connect.service
5. Paste the following into the empty file:[Unit] Description=Librespot Requires=network-online.target After=network-online.target [Service] User=root Restart=always RestartSec=10 ExecStart=/root/librespot --name SpotiPi --username renebouwmeester --password ******** --disable-discovery --cache /tmp --bitrate 320 --device hw:0 > /dev/null 2>&1 [Install] WantedBy=multi-user.target
6. Save with CTRL-X, Y
7. Reload daemons:
systemctl daemon-reload
8. Enable your new service:
systemctl enable spotify-connect.service
9. Enable and activate your new service:
systemctl start spotify-connect.service
This works for me on two max2play installations:
1. Hifiberry Digi+ Pro (multisuqeeze – hw:0 is my Hifiberry – hw:1 is USB DAC)
You need to add -C <sec> option to squeezelite command line
-C 10
2. IQAudio DigiAmp+
You need to add -C <sec> option to squeezelite command line
-o hw:CARD=IQaudIODAC -V Digital -C 10
(I’ve removed -Q option as after closing output device alsa volume was set to 0 – librespot does only software volume)
3. For USB DAC you need to use plughw:CARD=<name> – use aplay -L to get this name, in my case it’s:
plughw:CARD=Pro
That’s for Matrix Mini-i Pro 2014Other options worth mentioning:
Enable I2S-MMAP (Mixerdevice for Soundcards) – ON
Disable IPv6 – OFF (this gave me error as it’s turned ON as default)
Disable Build-In-Audio on RPI3 – ONCredits:
https://github.com/herrernst/librespot
https://community.roonlabs.com/t/spotify-connect-on-your-roonbridged-pi-the-quick-n-easy-way/17896
https://github.com/herrernst/librespot/releases/23. April 2017 at 23:04 #28423@cpu Thanks for sharing, geat news, but i have 4 questions:
1. How to check if install worked and if it’s running
2. Doesn’t it need an api-key anymore like i used it before?
3. Where do i edit squeezelite (command-line)settings?
4. I think related to those 3 questions above: when i start spotify on my android it doesn’t show ‚SpotiPi‘Hope you can shed some light on this!
😉24. April 2017 at 0:31 #284261. Either use android Spotify app or desktop on your windows machine (windows build showed everything faster)
2. No, just put your username and password, you can check status with
systemctl status Spotify-connect.service
You need premium account
3. Do this via browser – use max2play IP to get to config page, then move to audioplayer tab -> edit advanced options under squeezelite and add -C 10 to make sure once you’ll turn off squeezelite your card will be free to be taken over by Spotify connect. BTW make sure you’ll turn off squeezelite in LMS web page with power button!
4. Try to reconnect to WiFi or it worked for me faster without any tricks on desktop Spotify client.- This reply was modified 7 years, 6 months ago by cpu.
24. April 2017 at 10:37 #28432Thanks! Did all those steps already yesterday, i forgot to disable the spotify-plugin in LMS, i think (but not 100% sure) that’s why it didn’t work.
I works, but of course we still need max2play to implement this cause i can’t use it with the RPi Touchdisplay and Connect at the same time so i won’t need LMS anymore… #justwaitandsee27. April 2017 at 17:52 #28599Small update:
5. Paste the following into the empty file:
[Unit]
Description=Librespot
Requires=network-online.target
After=network-online.target[Service]
User=root
Restart=always
RestartSec=10
ExecStart=/root/librespot –name SpotiPi –username <username> –password <password> –cache /tmp –bitrate 320 –device plughw:CARD=Pro > /dev/null 2>&1[Install]
WantedBy=multi-user.targetRemoved –disable-discovery as it’s easier to find device on Android device.
Also output as plughw – in this case it’s doing output to USB DAC Matrix Mini-i Pro – to find yours just use aplay -L.
In my case I’m using USB for MPD and coaxial through I2S Hifiberry Digi Pro for squeezelite and spotify.27. April 2017 at 23:13 #28604It would be nice if the maintainers of max2play can tell us if they are gonna embed spotify connect into their build cause that would be the best way to get it integrated. For testing purposes i installed volumio2 on 2 devices and it works great with the spotify plugin for browsing and playing (play)lists etc. For Spotify Connect to work there is another plugin by ballbuze that you have to install separately but it obvious doesn’t work together with the first plugin. The only downside is that you manually have to switch between those 2 plugins.
Hopefully Max2play can and will counter-attack this nice piece of work?Honoustly most of the time i want a spotify to play ‚radio‘ based on a couple of songs which will improve using it.
4. Mai 2017 at 13:07 #28700Hi guys,
First of all, great work! We have not had the chance to look into this solution in more detail, but will do so this week.
In the meantime, we would appreciate it if you guys could look into our Plugin Builder in conjunction with this solution. We would love it if this could be added to our Community Plugins and would, of course, readily help with any issues or questions. Our head developer recently made an extensive tutorial on how easy it is to create and share your own plugins: https://www.youtube.com/watch?v=gWwQ0A1HoWY
5. Mai 2017 at 9:14 #28713So nice… THX I love it. After some trouble it now works. With IQaudIO and SD-Card Protection. It’s a good Friday
use
find / -name librespot
to find the librespot placement, correct it if necessary in the spotify-connect.service file
Also remember that systemctl is case sensitive, so use
systemctl status spotify-connect.service
it took me awhile to figure that out.. stupid me5. Mai 2017 at 13:51 #28715Hi !
It doesn’t work for me.
I’m not Linux expert.Help me please!!I check status with systemctl status Spotify-connect.service:
● spotify-connect.service – Librespot
Loaded: loaded (/etc/systemd/system/spotify-connect.service; enabled)
Active: activating (auto-restart) (Result: exit-code) since Fri 2017-05-05 12:34:32 CEST; 2s ago
Process: 3885 ExecStart=/root/librespot –name SpotiPi –username ******** –password ******** –disable-dis covery –cache /tmp –bitrate 320 –device hw:0 > /dev/null 2>&1 (code=exited, status=203/EXEC)
Main PID: 3885 (code=exited, status=203/EXEC)May 05 12:34:32 max2play systemd[1]: spotify-connect.service: main process exited, code=exited, status=203/EXEC
May 05 12:34:32 max2play systemd[1]: Unit spotify-connect.service entered failed state.I have a hifiberry digi+ pro
This is device:
pi@max2play:~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: sndrpihifiberry [snd_rpi_hifiberry_digi], device 0: HiFiBerry Digi+ Pro HiFi wm8804-spdif-0 []
Subdevices: 0/1
Subdevice #0: subdevice #0This is the server definition:
[Unit]
Description=Librespot
Requires=network-online.target
After=network-online.target[Service]
User=root
Restart=always
RestartSec=10
ExecStart=/root/librespot –name SpotiPi –username ******** –password ******** –disable-discovery –cache /tmp –bitrate 320 –device hw:0 > /dev/null 2>&1[Install]
WantedBy=multi-user.targetThank you!!
5. Mai 2017 at 13:58 #28717Is librespot under the root sub-folder? Find it with:
find / -name librespot
then if necessary correct the spotify-connect.service file after ExecStart=5. Mai 2017 at 14:17 #28719Thank you!!
yes , now my android device find rasperry but no sound..(my external Dac recognize digi+ pro Toslink output)
5. Mai 2017 at 14:39 #28722Try
aplay -L
The card i want is the plughw:CARD=IQaudIODAC, so i edit the spotify-connect.service file at –device hw:0 to –device plughw:CARD=IQaudIODAC
Bingo, that was itOutput from aplay -L is:
null
Discard all samples (playback) or generate zero samples (capture)
equal
plugequal
Equalizer for plughw:0,0
default:CARD=ALSA
bcm2835 ALSA, bcm2835 ALSA
Default Audio Device
sysdefault:CARD=ALSA
bcm2835 ALSA, bcm2835 ALSA
Default Audio Device
dmix:CARD=ALSA,DEV=0
bcm2835 ALSA, bcm2835 ALSA
Direct sample mixing device
dmix:CARD=ALSA,DEV=1
bcm2835 ALSA, bcm2835 IEC958/HDMI
Direct sample mixing device
dsnoop:CARD=ALSA,DEV=0
bcm2835 ALSA, bcm2835 ALSA
Direct sample snooping device
dsnoop:CARD=ALSA,DEV=1
bcm2835 ALSA, bcm2835 IEC958/HDMI
Direct sample snooping device
hw:CARD=ALSA,DEV=0
bcm2835 ALSA, bcm2835 ALSA
Direct hardware device without any conversions
hw:CARD=ALSA,DEV=1
bcm2835 ALSA, bcm2835 IEC958/HDMI
Direct hardware device without any conversions
plughw:CARD=ALSA,DEV=0
bcm2835 ALSA, bcm2835 ALSA
Hardware device with all software conversions
plughw:CARD=ALSA,DEV=1
bcm2835 ALSA, bcm2835 IEC958/HDMI
Hardware device with all software conversions
default:CARD=IQaudIODAC
IQaudIODAC,
Default Audio Device
sysdefault:CARD=IQaudIODAC
IQaudIODAC,
Default Audio Device
dmix:CARD=IQaudIODAC,DEV=0
IQaudIODAC,
Direct sample mixing device
dsnoop:CARD=IQaudIODAC,DEV=0
IQaudIODAC,
Direct sample snooping device
hw:CARD=IQaudIODAC,DEV=0
IQaudIODAC,
Direct hardware device without any conversions
plughw:CARD=IQaudIODAC,DEV=0
IQaudIODAC,
Hardware device with all software conversions- This reply was modified 7 years, 6 months ago by manuelk.
5. Mai 2017 at 15:31 #28724ok,
but no sound yetThis is aplay -L
root@max2play:~# aplay -L
null
Discard all samples (playback) or generate zero samples (capture)
equal
plugequal
Equalizer for plughw:0,0
default:CARD=sndrpihifiberry
snd_rpi_hifiberry_digi,
Default Audio Device
sysdefault:CARD=sndrpihifiberry
snd_rpi_hifiberry_digi,
Default Audio Device
dmix:CARD=sndrpihifiberry,DEV=0
snd_rpi_hifiberry_digi,
Direct sample mixing device
dsnoop:CARD=sndrpihifiberry,DEV=0
snd_rpi_hifiberry_digi,
Direct sample snooping device
hw:CARD=sndrpihifiberry,DEV=0
snd_rpi_hifiberry_digi,
Direct hardware device without any conversions
plughw:CARD=sndrpihifiberry,DEV=0
snd_rpi_hifiberry_digi,
Hardware device with all software conversionsNew edit spotify-connect.service:
[Unit]
Description=Librespot
Requires=network-online.target
After=network-online.target[Service]
User=root
Restart=always
RestartSec=10
ExecStart=/root/librespot –name SpotiPi –username ****** –password ******* –disable-discovery –cache /tmp –bitrate 320 –device plughw:CARD=sndrpihifiberry > /dev/null 2>&1[Install]
WantedBy=multi-user.targetand new start service
● spotify-connect.service – Librespot
Loaded: loaded (/etc/systemd/system/spotify-connect.service; enabled)
Active: active (running) since Fri 2017-05-05 15:17:36 CEST; 12s ago
Main PID: 4023 (librespot)
CGroup: /system.slice/spotify-connect.service
└─4023 /root/librespot –name SpotiPi –username ***** –password ****** –disable-discovery –cache /tmp –bitrate 320 –device plughw:CARD=sndrpih…May 05 15:17:36 max2play systemd[1]: Started Librespot.
May 05 15:17:36 max2play librespot[4023]: INFO:librespot: librespot 871e9e8 (2017-03-26). Built on 2017-04-13.
May 05 15:17:36 max2play librespot[4023]: INFO:librespot::session: Connecting to AP „gew1-accesspoint-a-xs57.ap.spotify.com:4070“
May 05 15:17:37 max2play librespot[4023]: INFO:librespot::session: Authenticated as „******“ !
May 05 15:17:37 max2play librespot[4023]: INFO:librespot::audio_backend::alsa: Using alsa sink
May 05 15:17:37 max2play systemd[1]: Started Librespot.Thank you
5. Mai 2017 at 16:02 #28725Now it works!!!!
I have to edit advanced options under squeezelite : add -C 10 and set the right audio card !!!
thank you very much manuelk!
13. Mai 2017 at 14:22 #28830Hi,
Wondering if anybody could help, I am able to connect from the spotify app but getting no sound.
Does Squeezelite need to be running or not please?
I have -o hw:CARD=IQaudIODAC -V Digital -Q -C 10 in my advanced options. I have tried both with and without the -Q flag.
The service status reports:
● spotify-connect.service – Librespot
Loaded: loaded (/etc/systemd/system/spotify-connect.service; enabled)
Active: active (running) since Sat 2017-05-13 13:02:49 BST; 5min ago
Main PID: 7161 (librespot)
CGroup: /system.slice/spotify-connect.service
├─7161 /home/pi/librespot –name SpotiPi –username [email protected] –password sp1ll3r –cache /tmp –bitrate 320 –de…
└─7171 /usr/bin/pulseaudio –start –log-target=syslogMy hw is the IQaudioIO Digiamp+
And aplay -l reports:
**** List of PLAYBACK Hardware Devices ****
card 0: IQaudIODAC [IQaudIODAC], device 0: IQaudIO DAC HiFi pcm512x-hifi-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0I’d love to get this working, any help much appreciated.
18. Mai 2017 at 11:13 #28901This is a different angle from a max2play plugin as such but Heiner have you seen that the ever-wonderful Michael Herger is testing a new plugin using the Librespot library here
http://forums.slimdevices.com/showthread.php?107418-For-the-brave-only-the-Spotty-Spotify-implementation&p=884041&posted=1#post884041
I have not had the chance to try it out with max2lay yet, but it would be great if we could give Michael any assistance necessary to make sure this works with Max2play (he says it is ok with raspbian but it seems perhaps not with picorelayer.) Perhaps I should start a new thread?18. Mai 2017 at 11:35 #28906Hi guys,
We are currently creating a clean solution for your great groundwork on Spotify Connect! I’ll keep you posted, but it should be ready soon.
@adamd: I noticed the new thread in the slimdevices forums and the idea sounds great for better LMS Spotify solution. However, I agree, that a new thread for testing and discussion of this LMS plugin would make more sense, so we can focus on our progress with Spotify Connect, here 😉19. Mai 2017 at 10:38 #28943Hi guys,
We are still testing it, but the Spotify Connect plugin is now functional and working hard to pump music here in the offices.
You can check it out already as a beta under the install-URL „http://shop.max2play.com/media/downloadable/beta/spotifyconnect.tar“
Again, thanks for the groundwork you did and the patience and trust you afforded us to realize this. I hope you enjoy it!
19. Mai 2017 at 12:24 #28953Should be great! But when I try to install this is the log:
„Install Spotify Connect Started
Install-Script for Spotify Connect Server
–2017-05-19 12:19:16– https://github.com/herrernst/librespot/releases/download/v20170413-d95c0b3/librespot-linux-armhf-raspberry_pi.zip
Resolving github.com (github.com)… 192.30.253.112, 192.30.253.113
Connecting to github.com (github.com)|192.30.253.112|:443… failed: No route to host.
Connecting to github.com (github.com)|192.30.253.113|:443… failed: No route to host.
mkdir: cannot create directory `/opt/spotifyconnect‘: File exists
Archive: /opt/max2play/cache/librespot.zip
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of /opt/max2play/cache/librespot.zip or
/opt/max2play/cache/librespot.zip.zip, and cannot find /opt/max2play/cache/librespot.zip.ZIP, period.
chmod: cannot access `/opt/spotifyconnect/librespot‘: No such file or directory
finished – Now Click here to Reload PageInstallation finished“
Any idea what is going wrong?
19. Mai 2017 at 13:33 #28955Thanks for the effort Heiner, I will be testing the M2P spotify connect implementation as soon as I can, and spread the word!
Greetings,
Megantonneke
-
You must be logged in to reply to this topic.