librespot: Lots of failing songs - "Error from channel for data receiver"

Is anyone else experiencing a lot of problems playing files within the last couple of days? I am getting a lot of errors like this:

ERROR librespot_core::channel] channel error: 2 0
WARN  librespot_audio::fetch] Error from channel for data receiver for range 3677412 (+16384).
ERROR librespot_core::channel] channel error: 2 0
WARN  librespot_audio::fetch] Error from channel for data receiver for range 3794352 (+16384).
ERROR librespot_core::channel] channel error: 2 0
WARN  librespot_audio::fetch] Error from channel for data receiver for range 3827120 (+16384).
ERROR librespot_core::channel] channel error: 2 0
WARN  librespot_audio::fetch] Error from channel for data receiver for range 3876272 (+16384).
ERROR librespot_core::channel] channel error: 2 0
WARN  librespot_audio::fetch] Error from channel for data receiver for range 3843504 (+16384).

Sometimes it keeps going and the song plays fine, sometimes it just skips that track, other times it just stops playback completely and I have to find where it’s up to and press play on the following track.

Is it just me or is anyone else seeing this as well?

It only seems to affect certain songs, as many of them play fine, but you get one or two that won’t play no matter what you do, with the above errors coming up all the time.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 4
  • Comments: 19 (12 by maintainers)

Most upvoted comments

I gave librespot-java a test and while it works I found it to be way slower/buggier for picking songs/skipping/shuffle/etc.

Yeah, the new protocol is much more complex and requires a lot of dumping to get it right. The JVM doesn’t help either on lower end systems where resources are limited and everything is slowed down. I’ve just planned a rewrite of some of its parts (for that matters): https://github.com/librespot-org/librespot-java/issues/249

Please let me know if there are any other debugging steps I can help with!

I don’t think there’s anything more to debug. The channel system exists since librespot was born and it’s getting old as I’ve started implementing CDN on 16/03/2019 and it probably was there even before. My thought is that they are slowly shutting it down.

The CDN loading system is quite simple and it’ll take someone who knows Rust no more that 3 days. Sadly, I don’t know it, but I can help anybody who wants to implement it.

I don’t want to speak too soon but this afternoon I noticed Spotify have fixed the bug that prevented songs from being removed when you delete them from a playlist (via the website), and at the same time I have noticed that I am no longer getting these channel errors and all the songs that used to give me errors are now playing correctly again.

I hope this means they have just deployed an update that fixed the issue!

@devgianlu Thanks that’s super helpful! And thanks for building librespot in general, it’s a really great project

At least this time they were aware of it pretty quickly and wrote about it on their status page: https://twitter.com/spotifystatus

It’s been working fine again for me for many hours now.

Thanks for confirming. I’ve also not seen the error come back again so I’m going to close this issue as “fixed upstream by Spotify”.

@devgianlu I just had a quick look at the CDN code. Am I understanding the logic correctly?:

  1. You make a request to https://spclient.wg.spotify.com/storage-resolve/files/audio/interactive/TRACK_ID. The request requires some authorisation token. It seems to come from Mercury and is called “playlist-read”.
  2. The above request returns a protobuf which contains a URL
  3. You can download the encrypted file from this URL with normal http features as you like (i.e. whole file or range requests are possible)

Regarding the token in step 1: We have a currently unused function get_token(session, client_id, scopes) in keymaster.rs. I would guess that the scope argument is the “playlist-read” from the Java code. We’ve got a mercury session no problem. But I can’t see where the client_id would have to come from.