hifiberry / hifiberry-os

Linux distribution optimized for audio playback
MIT License
984 stars 125 forks source link

Spotify Connect fails #576

Open jakubstrama opened 5 days ago

jakubstrama commented 5 days ago

Describe the bug Spotify Connect does not work anymore

HiFiBerryOS version 20230404

HiFiBerry sound card DAC2 HD

To Reproduce Steps to reproduce the behaviour:

  1. Open any Spotify client
  2. try to connect to Hifiberry via Spotify Connect
  3. Status displays connecting
  4. Log in via ssh to linux.
  5. run "systemctl status spotify.service"
  6. It displays : hifiberry vollibrespot[1248]: [Vollibrespot] : Connecting to AP "ap-gew4.spotify.com:443"

Expected behaviour It should be possible to connect via Spotify Connect

Browser (if applicable)

Additional context This issue on librespot indicates, that Spotify does not support authentication via username/password anymore. Maybe it is somehow related. librespot/issues/1308

rum0s commented 5 days ago

I have the same issue. Switched to spotifyd for now.

jakubstrama commented 5 days ago

spotifyd

Do you run it alongside hifiberry-os on RaspberryPi? If so, would you share any details?

rum0s commented 5 days ago

spotifyd

Do you run it alongside hifiberry-os on RaspberryPi? If so, would you share any details?

Yes. I disabled spotify connect as described in the blog and activated spotifyd via extensions. Afterwards I entered my credentials.

gjvg56 commented 4 days ago

I also have this problem with SpotifyConnect. For me it is under an older version of HifiberryOS . I'm afraid to change to HifiBerry64 where I could use SpotifyD. Or should I try this ?

rum0s commented 4 days ago

I also have this problem with SpotifyConnect. For me it is under an older version of HifiberryOS . I'm afraid to change to HifiBerry64 where I could use SpotifyD. Or should I try this ?

This is what I did. I upgraded to HifiberryOS64 from a older version from 2023. Just use a second SD card and give it a try.

gjvg56 commented 4 days ago

This is what I did. I upgraded to HifiberryOS64 from a older version from 2023. Just use a second SD card and give it a try.

Works like a charm. At first it didnt work, cos in HifyberryOS64 I logged in with spotify-credentials..not needed for the Deamon !!

diederikdq commented 4 days ago

Hi This is discussed here https://support.hifiberry.com/hc/en-us/community/posts/21348779832605-Spotify-Connect-doesn-t-work-anymore-HifiberryOS-20230404?page=1. Chances are your issue will most likely have to do with the /etc/hosts file where ap-gew4.spotify.com is set to resolve to 104.199.65.124 . But that IP won't work.

So either comment out the line: nano /etc/hosts and change 104.199.65.124 ap-gew4.spotify.com into #104.199.65.124 ap-gew4.spotify.com OR fix it via the code where it got set. nano /usr/lib/systemd/system/spotify.service and remove the line ExecStartPre=/opt/hifiberry/bin/set-host-ip ap-gew4.spotify.com 104.199.65.124 then remove the current wrong resolved host by nano /etc/hosts and remove line 104.199.65.124 ap-gew4.spotify.com then reboot.

Repo wise, th is solved here: https://github.com/hifiberry/hifiberry-os/pull/577 but it will be for the 64 version I guess.

maxbundscherer commented 2 days ago

Hi This is discussed here https://support.hifiberry.com/hc/en-us/community/posts/21348779832605-Spotify-Connect-doesn-t-work-anymore-HifiberryOS-20230404?page=1. Chances are your issue will most likely have to do with the /etc/hosts file where ap-gew4.spotify.com is set to resolve to 104.199.65.124 . But that IP won't work.

So either comment out the line: nano /etc/hosts and change 104.199.65.124 ap-gew4.spotify.com into #104.199.65.124 ap-gew4.spotify.com OR fix it via the code where it got set. nano /usr/lib/systemd/system/spotify.service and remove the line ExecStartPre=/opt/hifiberry/bin/set-host-ip ap-gew4.spotify.com 104.199.65.124 then remove the current wrong resolved host by nano /etc/hosts and remove line 104.199.65.124 ap-gew4.spotify.com then reboot.

Repo wise, th is solved here: #577 but it will be for the 64 version I guess.

This manual fix worked for me. Now I can use Spotify Daemon again. I have a Raspberry Pi 3 and have updated to the new HifiBerryOS-64 Alpha. Spotify apparently no longer works with older versions of HifiBerryOS. This should be taken into account for further updates.

Unfortunately, the Spotify Connect doesn't work, so I can't establish a local connection.

Update: Sometimes Spotify Connect also works now.

hyperbart commented 2 days ago

Thank you @diederikdq . I came here after 2 hours of Googling and fumbling with Spotify connect not working, thinking it was an issue on my part because I had a switch of ISP last week.

Removed the set IP from the service unit file and from the hosts file, everything works again.

And now I am also aware a new version of HifiberryOS is coming up and this explains why the version I was running didn't get any updates anymore. What a night :) .