spotifyd icon indicating copy to clipboard operation
spotifyd copied to clipboard

spotifyd keeps skipping to next song without playing anything

Open PierreRust opened this issue 1 year ago • 16 comments

Description

For a few days spotifyd does not play any song (it's been working flawlessly for years) and instead keeps jumping to the next song in the queue. When looking at the logs, it complains about failing to load the track.

A quick search show that raspotify (https://github.com/dtcooper/raspotify/issues/670 ) and librespot (https://github.com/librespot-org/librespot/issues/1322) have the same issue, which is linked to a change on spotify side. A fix has already been implemented in the dev branch, so it just switching to that branch might do the trick.

To Reproduce

Simply trying to play any song.

Expected behavior

Logs

Click to show logs
Skipping to next track, unable to load track <SpotifyId { id: 69833159059242552919549488751628926202, audio_type: Track }>: ()
At track 9 of 50 <"spotify:playlist:37i9dQZF1EVJHK7Q1TBABQ"> update [false]
Sending status to server: [kPlayStatusPlay]
command=Load(SpotifyId { id: 188428358408371624228923353197735646366, audio_type: Track }, true, 0)
Sending status to server: [kPlayStatusPlay]
Loading <Banquet> with Spotify URI <spotify:track:4juzduULFJiZVIcrC1tkxE>
Downloading file 34aab3a88d9e4675772318618ae0f4f2580e1ea8
channel error: 2 0
Unable to load encrypted file: ChannelError

Versions (please complete the following information):

  • OS: Ubuntu 24.04 LTS
  • Spotifyd: v 0.3.5

PierreRust avatar Sep 03 '24 20:09 PierreRust

I've just tried to edit the dependency to librespot to point to the dev branch. Due to conflicts on the dependencies of this branch and the version in the lock file, this requires to run cargo update .

Unfortunately it seems that librespot api has quite changed in the dev branch and the build fails (missing fields on enums and structs, invalid type un function args, ...) , it will require more work than what I hoped. Given that I know nothing about spotifyd nor librespot code base, I'm afraid I'll not be able ti fix this by myself :disappointed:

PierreRust avatar Sep 03 '24 20:09 PierreRust

The dev branch on librespot works just fine, you can migrate to that project for now.

I don't think the repo maintainer would be happy to merge the code that depends on librespot dev-5.0.0 code that hasn't been released yet.

@eladyn any thoughts on that?

dabalroman avatar Sep 03 '24 22:09 dabalroman

Yes, you're right, I'm switched to librespot as a workaround and it works fine.

The main reason for creating this issue was to trace the issue for other spotifyd users who encounter it.

PierreRust avatar Sep 04 '24 05:09 PierreRust

There is supposed to be a workaround (add "0.0.0.0 apresolve.spotify.com" to /etc/hosts): https://github.com/librespot-org/librespot/issues/972#issuecomment-2320943137

For me, the workaround does not work, unfortunately. I am thankful for any other solution.

Moltey avatar Sep 04 '24 06:09 Moltey

For me, the workaround does not work, unfortunately. I am thankful for any other solution.

That workaround used to work, but has stopped working recently. See the latest replies in the linked thread.

Seems you can use librespot's dev branch, or alternatively I got https://github.com/devgianlu/go-librespot to work (after configuring audio_device = "pulse" (but it's not as stable as spotifyd used to be).

ius avatar Sep 04 '24 17:09 ius

For anyone else encountering the same issues, see my comment here:

https://github.com/Spotifyd/spotifyd/issues/1300#issuecomment-2330316230

whisperzer0 avatar Sep 04 '24 23:09 whisperzer0

I made a quick workaround for this problem in my fork by updating librespot to v0.4.2 https://github.com/Exceen/spotifyd-fix

just check it out and compile it yourself

afaik signing into your account is broken in general, that's a problem of librespot and not of spotifyd, so you have to use it without an account

and I just noticed that there's a pull request already https://github.com/Spotifyd/spotifyd/pull/1301

Exceen avatar Sep 05 '24 12:09 Exceen

I made a quick workaround for this problem in my fork by updating librespot to v0.4.2 https://github.com/Exceen/spotifyd-fix

just check it out and compile it yourself

Seems to work great so far.

ultraboost avatar Sep 14 '24 08:09 ultraboost

I made a quick workaround for this problem in my fork by updating librespot to v0.4.2 https://github.com/Exceen/spotifyd-fix just check it out and compile it yourself

Seems to work great so far.

I spoke too soon. It's happening again.

ultraboost avatar Sep 18 '24 22:09 ultraboost

I made a quick workaround for this problem in my fork by updating librespot to v0.4.2 https://github.com/Exceen/spotifyd-fix just check it out and compile it yourself

Seems to work great so far.

I spoke too soon. It's happening again.

still works for me. what's the issue you have?

Exceen avatar Sep 23 '24 07:09 Exceen

I made a quick workaround for this problem in my fork by updating librespot to v0.4.2 https://github.com/Exceen/spotifyd-fix just check it out and compile it yourself

Seems to work great so far.

I spoke too soon. It's happening again.

still works for me. what's the issue you have?

After maybe 15 minutes of listening and searching for new music I like (so sampling several tracks from different artists) it started playing up the same as before. ie. random track selection, play for a few seconds then select another random track like it's possessed. A reboot sorted it but I'm now trying https://github.com/lordievader/spotifyd to see if that's any different.

ultraboost avatar Sep 23 '24 21:09 ultraboost

I made a quick workaround for this problem in my fork by updating librespot to v0.4.2 https://github.com/Exceen/spotifyd-fix just check it out and compile it yourself

Seems to work great so far.

I spoke too soon. It's happening again.

still works for me. what's the issue you have?

After maybe 15 minutes of listening and searching for new music I like (so sampling several tracks from different artists) it started playing up the same as before. ie. random track selection, play for a few seconds then select another random track like it's possessed. A reboot sorted it but I'm now trying https://github.com/lordievader/spotifyd to see if that's any different.

then maybe something else is wrong with your system. it's the exact same fix lordievader did

Exceen avatar Sep 24 '24 13:09 Exceen

I made a quick workaround for this problem in my fork by updating librespot to v0.4.2 https://github.com/Exceen/spotifyd-fix just check it out and compile it yourself

Seems to work great so far.

I spoke too soon. It's happening again.

still works for me. what's the issue you have?

After maybe 15 minutes of listening and searching for new music I like (so sampling several tracks from different artists) it started playing up the same as before. ie. random track selection, play for a few seconds then select another random track like it's possessed. A reboot sorted it but I'm now trying https://github.com/lordievader/spotifyd to see if that's any different.

then maybe something else is wrong with your system. it's the exact same fix lordievader did

Comparing side by side it looks like you've made more changes and some formatting alterations? Although I'm no expert in these matters! I'm running it on a PiZero 2W with DietPi if that offers any clues.

ultraboost avatar Sep 24 '24 19:09 ultraboost

After maybe 15 minutes of listening and searching for new music I like (so sampling several tracks from different artists) it started playing up the same as before. ie. random track selection, play for a few seconds then select another random track like it's possessed

Note librespot is currently affected by other playback issues, e.g. https://github.com/librespot-org/librespot/issues/1340 which I'm also running into with @Exceen's patched version.

For me the crash means spotifyd will restart (and need to be reselected as an output in the desktop Linux client) - but I can imagine the behavior might be different depending on your setup.

tl;dr check spotifyd logs

ius avatar Sep 24 '24 19:09 ius

I made a quick workaround for this problem in my fork by updating librespot to v0.4.2 https://github.com/Exceen/spotifyd-fix just check it out and compile it yourself

Seems to work great so far.

I spoke too soon. It's happening again.

still works for me. what's the issue you have?

After maybe 15 minutes of listening and searching for new music I like (so sampling several tracks from different artists) it started playing up the same as before. ie. random track selection, play for a few seconds then select another random track like it's possessed. A reboot sorted it but I'm now trying https://github.com/lordievader/spotifyd to see if that's any different.

Nope, no different. After 10 minutes it's skipping through tracks itself again. Unable to select anything or play anything.

ultraboost avatar Sep 24 '24 23:09 ultraboost

There is supposed to be a workaround (add "0.0.0.0 apresolve.spotify.com" to /etc/hosts): librespot-org/librespot#972 (comment)

For me, the workaround does not work, unfortunately. I am thankful for any other solution.

it's working for me thankfully :D one thing to note is that for my circumstance the logs were, weirder it said "Track should be available. but no alternatives were found" or something like that

tungstengmd avatar Aug 06 '25 15:08 tungstengmd