[GH-ISSUE #651] Some songs not available in OGG Vorbis format #379

Closed
opened 2026-02-27 19:30:18 +03:00 by kerem · 15 comments
Owner

Originally created by @trillllian on GitHub (Feb 24, 2021).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/651

Originally assigned to: @roderickvd on GitHub.

Most songs that I could find have the following set of formats available: AAC_160, AAC_320, MP4_128, MP4_128_DUAL, OGG_VORBIS_160, OGG_VORBIS_320, OGG_VORBIS_96, OTHER5

However, "I Write Sins Not Tragedies" by Panic! at the Disco (link), for some reason, doesn't have this set of formats: notably, it's missing all 3 Vorbis formats, leaving only AAC_160, AAC_320, MP4_128, MP4_128_DUAL, OTHER5.

Since librespot only tries playing the Vorbis formats, it will fail playing this song (in v0.1.6, it'd even panic here, but that seems to be fixed in the dev branch).

I haven't found another song that's missing Vorbis, not even on the same album. I'm not sure if the added effort to support a different format as fallback is worth it for what seems to be only one song (or, well, I would be very surprised if this was the only song with this quirk, but I haven't found any others yet).

Originally created by @trillllian on GitHub (Feb 24, 2021). Original GitHub issue: https://github.com/librespot-org/librespot/issues/651 Originally assigned to: @roderickvd on GitHub. Most songs that I could find have the following set of formats available: AAC_160, AAC_320, MP4_128, MP4_128_DUAL, OGG_VORBIS_160, OGG_VORBIS_320, OGG_VORBIS_96, OTHER5 However, "I Write Sins Not Tragedies" by Panic! at the Disco ([link](https://open.spotify.com/track/5cY8y2XgOfkAh4kSWLFKkz)), for some reason, doesn't have this set of formats: notably, it's missing all 3 Vorbis formats, leaving only AAC_160, AAC_320, MP4_128, MP4_128_DUAL, OTHER5. Since librespot only tries playing the Vorbis formats, it will fail playing this song (in v0.1.6, it'd even panic [here](https://github.com/librespot-org/librespot/blob/v0.1.6/playback/src/player.rs#L653), but that seems to be fixed in the dev branch). I haven't found another song that's missing Vorbis, not even on the same album. I'm not sure if the added effort to support a different format as fallback is worth it for what seems to be only one song (or, well, I would be very surprised if this was the only song with this quirk, but I haven't found any others yet).
kerem 2026-02-27 19:30:18 +03:00
Author
Owner

@Johannesd3 commented on GitHub (Feb 24, 2021):

I suppose I fixed this panic "en passant", but I never thought it would actually occur.

I don't think it would be too hard to add more supported formats (just maybe the recently added ogg passthrough makes it more difficult). The official clients must support them too if they can play this track.

<!-- gh-comment-id:785413688 --> @Johannesd3 commented on GitHub (Feb 24, 2021): I suppose I fixed this panic "en passant", but I never thought it would actually occur. I don't think it would be too hard to add more supported formats (just maybe the recently added ogg passthrough makes it more difficult). The official clients must support them too if they can play this track.
Author
Owner

@Malvineous commented on GitHub (Feb 27, 2021):

I just came across the album "Diamonds" by "Enforcer" which also won't play citing an OggError(NoCapturePatternFound) on all tracks so I guess this is the same problem.

The web player works fine just not librespot.

<!-- gh-comment-id:786992361 --> @Malvineous commented on GitHub (Feb 27, 2021): I just came across the album ["Diamonds" by "Enforcer"](https://open.spotify.com/album/100G9R8SSiarOw8dwFTSUl) which also won't play citing an `OggError(NoCapturePatternFound)` on all tracks so I guess this is the same problem. The web player works fine just not librespot.
Author
Owner

@Johannesd3 commented on GitHub (Mar 23, 2021):

I just came across the album "Diamonds" by "Enforcer" which also won't play citing an OggError(NoCapturePatternFound) on all tracks so I guess this is the same problem.

I don't think it's the same problem. In this case, ogg is still in the list of available formats but librespot is not able to play the downloaded files. Maybe they're really corrupted and the spotify clients are able to use another format as fallback, but could be another reason as well.

<!-- gh-comment-id:805148859 --> @Johannesd3 commented on GitHub (Mar 23, 2021): > I just came across the album ["Diamonds" by "Enforcer"](https://open.spotify.com/album/100G9R8SSiarOw8dwFTSUl) which also won't play citing an `OggError(NoCapturePatternFound)` on all tracks so I guess this is the same problem. I don't think it's the same problem. In this case, ogg is still in the list of available formats but librespot is not able to play the downloaded files. Maybe they're really corrupted and the spotify clients are able to use another format as fallback, but could be another reason as well.
Author
Owner

@roderickvd commented on GitHub (May 24, 2021):

Couple of random thoughts:

  • I know librespot-java supports MP3 too but none of the others.
  • Doesn't the Spotify Web Player play AAC? Given the same bitrate, AAC is likely more efficient and of higher psychoacoustic quality than Vorbis. AAC platform support is not so great as Ogg Vorbis.
  • Symphonia is an interesting project to watch, that aims to offer pure Rust demuxing and decoding support for a wide variety of formats including Ogg, MP4, Vorbis, MP3, AAC and FLAC.
  • When Spotify HiFi lands, we should revisit this and see what knobs we can supply to choose different audio formats. (perhaps including optionally AAC over Vorbis, maybe feature gated)
<!-- gh-comment-id:847329511 --> @roderickvd commented on GitHub (May 24, 2021): Couple of random thoughts: - I know `librespot-java` supports MP3 too but none of the others. - Doesn't the Spotify Web Player play AAC? Given the same bitrate, AAC is likely more efficient and of higher psychoacoustic quality than Vorbis. AAC platform support is not so great as Ogg Vorbis. - [Symphonia](https://github.com/pdeljanov/Symphonia) is an interesting project to watch, that aims to offer pure Rust demuxing and decoding support for a wide variety of formats including Ogg, MP4, Vorbis, MP3, AAC and FLAC. - When Spotify HiFi lands, we should revisit this and see what knobs we can supply to choose different audio formats. (perhaps including optionally AAC over Vorbis, maybe feature gated)
Author
Owner

@Malvineous commented on GitHub (May 25, 2021):

Spotify HiFi? I guess that's only for new songs? The number of songs they have at the moment with pops and clicks in them that sound like CD ripping errors is surprising. There wouldn't be any point in having those in higher quality unless they could get a better quality source than a poorly ripped CD.

(Case in point, skip to 1:32 on the first track in this album: https://open.spotify.com/track/5CNJnvtmdxvbE062pLbfAK?si=CuHZf00oRE2eWPhBvOW7nw - I reported it in July 2020 and it was referred to the "content team" who apparently still haven't done anything about it.)

<!-- gh-comment-id:847468666 --> @Malvineous commented on GitHub (May 25, 2021): Spotify HiFi? I guess that's only for new songs? The number of songs they have at the moment with pops and clicks in them that sound like CD ripping errors is surprising. There wouldn't be any point in having those in higher quality unless they could get a better quality source than a poorly ripped CD. (Case in point, skip to 1:32 on the first track in this album: https://open.spotify.com/track/5CNJnvtmdxvbE062pLbfAK?si=CuHZf00oRE2eWPhBvOW7nw - I reported it in July 2020 and it was referred to the "content team" who apparently still haven't done anything about it.)
Author
Owner

@roderickvd commented on GitHub (May 25, 2021):

We don't know yet, official news channel is here: https://newsroom.spotify.com/2021-02-22/five-things-to-know-about-spotify-hifi/

Spotify requires musicians / distributors to submit their music in WAV or FLAC format, so there should be a cache of lossless masters.

<!-- gh-comment-id:847578363 --> @roderickvd commented on GitHub (May 25, 2021): We don't know yet, official news channel is here: https://newsroom.spotify.com/2021-02-22/five-things-to-know-about-spotify-hifi/ Spotify requires musicians / distributors to submit their music in [WAV or FLAC format](https://artists.spotify.com/help/article/audio-file-formats), so there should be a cache of lossless masters.
Author
Owner

@kingosticks commented on GitHub (May 25, 2021):

(Case in point, skip to 1:32 on the first track in this album: https://open.spotify.com/track/5CNJnvtmdxvbE062pLbfAK?si=CuHZf00oRE2eWPhBvOW7nw - I reported it in July 2020 and it was referred to the "content team" who apparently still haven't done anything about it.)

Wow.... that is quite impressively horrendous. For me, anything after that timestamp is a garbled mess of musical pain. I don't think that's a good example of pops and clicks from "CD ripping", that sounds more like full-on data corruption. But it is interesting that it's the same in both the official client and the web streaming which points to Spotify having been given a crap source from the musician.

AAC platform support is not so great as Ogg Vorbis.

Yes. Spotify's official client is built on Chromium Embedded Framework which (by default) does not include non-free codecs like AAC.

<!-- gh-comment-id:847783234 --> @kingosticks commented on GitHub (May 25, 2021): > (Case in point, skip to 1:32 on the first track in this album: https://open.spotify.com/track/5CNJnvtmdxvbE062pLbfAK?si=CuHZf00oRE2eWPhBvOW7nw - I reported it in July 2020 and it was referred to the "content team" who apparently still haven't done anything about it.) Wow.... that is quite impressively horrendous. For me, anything after that timestamp is a garbled mess of musical pain. I don't think that's a good example of pops and clicks from "CD ripping", that sounds more like full-on data corruption. But it is interesting that it's the same in both the official client and the web streaming which points to Spotify having been given a crap source from the musician. > AAC platform support is not so great as Ogg Vorbis. Yes. Spotify's official client is built on Chromium Embedded Framework which (by default) does not include non-free codecs like AAC.
Author
Owner

@roderickvd commented on GitHub (May 25, 2021):

Yes. Spotify's official client is built on Chromium Embedded Framework which (by default) does not include non-free codecs like AAC.

  • Symphonia is an interesting project to watch, that aims to offer pure Rust demuxing and decoding support for a wide variety of formats including Ogg, MP4, Vorbis, MP3, AAC and FLAC.

It's actually quite tempting to see how far we can get with this. Vorbis isn't in (yet), but MP3 and AAC are under compatible MPL license. So that could solve two issues in one swoop (and keep lewton around for Vorbis for the time being).

I think FLAC is a good candidate for Spotify HiFi, only time will tell.

Regardless of it'll be FLAC, and if we want to depend on Symphonia or not, this would still be a fun exercise to get multi-format support in and we can always swap libraries later.

Only let-down is that Symphonia outputs samples in i16 instead of f32, but that seems to be the case for the native fdk and faad2 libraries too. FLAC doesn't support floating point anyway.* We can still promote i16 to f32 for purpose of high-quality volume normalisation and control.

Let me know your thoughts and I can take a look at it.

*edit: claxon outputs i32 but it won't matter, because Spotify has announced they'll stream 16 bit lossless and not any higher.

<!-- gh-comment-id:847818184 --> @roderickvd commented on GitHub (May 25, 2021): > Yes. Spotify's official client is built on Chromium Embedded Framework which (by default) does not include non-free codecs like AAC. > * [Symphonia](https://github.com/pdeljanov/Symphonia) is an interesting project to watch, that aims to offer pure Rust demuxing and decoding support for a wide variety of formats including Ogg, MP4, Vorbis, MP3, AAC and FLAC. It's actually quite tempting to see how far we can get with this. Vorbis isn't in (yet), but MP3 and AAC are under compatible MPL license. So that could solve two issues in one swoop (and keep `lewton` around for Vorbis for the time being). I think FLAC is a good candidate for Spotify HiFi, only time will tell. Regardless of it'll be FLAC, and if we want to depend on Symphonia or not, this would still be a fun exercise to get multi-format support in and we can always swap libraries later. Only let-down is that Symphonia outputs samples in `i16` instead of `f32`, but that seems to be the case for the native `fdk` and `faad2` libraries too. FLAC doesn't support floating point anyway.* We can still promote `i16` to `f32` for purpose of high-quality volume normalisation and control. Let me know your thoughts and I can take a look at it. *edit: `claxon` outputs `i32` but it won't matter, because Spotify has announced they'll stream 16 bit lossless and not any higher.
Author
Owner

@pingw33n commented on GitHub (Jun 8, 2021):

Those AAC streams are encrypted with an external DRM (web player uses Widevine, streams provided by internal API probably use PlayReady), the existing key retrieval API doesn't work for them. Playing such streams will likely require bundling in a proprietary DRM library and reverse engineering how to set it up correctly.

<!-- gh-comment-id:856662842 --> @pingw33n commented on GitHub (Jun 8, 2021): Those AAC streams are encrypted with an external DRM (web player uses Widevine, streams provided by internal API probably use PlayReady), the existing key retrieval API doesn't work for them. Playing such streams will likely require bundling in a proprietary DRM library and reverse engineering how to set it up correctly.
Author
Owner

@roderickvd commented on GitHub (Jun 8, 2021):

The 24 and 48 kbps AAC streams too? Those can be fetched with spirc the "Old Way" so I was betting that those were not subject to DRM. Not the higher-bitrate AAC ones that the web player streams though, they are not in the protobufs.

I'm making progress on my multi-format branch, should be close to fetching and decoding AAC's and MP3's soon. Also saw in the latest protobufs that FLAC is in. So that sets us up for Spotify HiFi once released, and when we figure out how to advertise HiFi support with the new API.

<!-- gh-comment-id:856676139 --> @roderickvd commented on GitHub (Jun 8, 2021): The 24 and 48 kbps AAC streams too? Those can be fetched with `spirc` the "Old Way" so I was betting that those were not subject to DRM. Not the higher-bitrate AAC ones that the web player streams though, they are not in the protobufs. I'm making progress on my multi-format branch, should be close to fetching and decoding AAC's and MP3's soon. Also saw in the latest protobufs that FLAC is in. So that sets us up for Spotify HiFi once released, and when we figure out how to advertise HiFi support with the new API.
Author
Owner

@pingw33n commented on GitHub (Jun 8, 2021):

The 24 and 48 kbps AAC streams too? Those can be fetched with spirc the "Old Way" so I was betting that those were not subject to DRM. Not the higher-bitrate AAC ones that the web player streams though, they are not in the protobufs.

Not sure about the spirc but the AACs that appear in Track::files for few tracks I checked were all DRM encrypted.

<!-- gh-comment-id:856829962 --> @pingw33n commented on GitHub (Jun 8, 2021): > The 24 and 48 kbps AAC streams too? Those can be fetched with spirc the "Old Way" so I was betting that those were not subject to DRM. Not the higher-bitrate AAC ones that the web player streams though, they are not in the protobufs. Not sure about the `spirc` but the AACs that appear in `Track::files` for few tracks I checked were all DRM encrypted.
Author
Owner

@roderickvd commented on GitHub (Nov 3, 2021):

For reference, Psst is switching from minivorbis to Symphonia: https://github.com/jpochyla/psst/pull/197. Support for normalisation data is already in. I'll look into it, and welcome any PRs.

<!-- gh-comment-id:958750897 --> @roderickvd commented on GitHub (Nov 3, 2021): For reference, Psst is switching from `minivorbis` to `Symphonia`: https://github.com/jpochyla/psst/pull/197. Support for normalisation data is already in. I'll look into it, and welcome any PRs.
Author
Owner

@roderickvd commented on GitHub (Jan 2, 2022):

In my local new-api branch I've got MP3 support in, but now I can't find any track that's available in MP3 😅 who can point me to one?

The song in the issue description, "I Write Sins Not Tragedies" by Panic! at the Disco, is only available in CMAF-encrypted AAC (iso8mp41dashcmfc). Not much we can do about that.

The album "Diamonds" by "Enforcer" seems to play fine?

<!-- gh-comment-id:1003773947 --> @roderickvd commented on GitHub (Jan 2, 2022): In my local `new-api` branch I've got MP3 support in, but now I can't find any track that's available in MP3 :sweat_smile: who can point me to one? The song in the issue description, "I Write Sins Not Tragedies" by Panic! at the Disco, is only available in CMAF-encrypted AAC (`iso8mp41dashcmfc`). Not much we can do about that. The album "Diamonds" by "Enforcer" seems to play fine?
Author
Owner

@Malvineous commented on GitHub (Jan 3, 2022):

Confirming "Diamonds" by "Enforcer" recently got Vorbis versions added. I haven't come across any other MP3-only songs.

<!-- gh-comment-id:1003823162 --> @Malvineous commented on GitHub (Jan 3, 2022): Confirming "Diamonds" by "Enforcer" recently got Vorbis versions added. I haven't come across any other MP3-only songs.
Author
Owner

@roderickvd commented on GitHub (Jan 12, 2022):

MP3 support implemented in new-api @ github.com/librespot-org/librespot@7921f23927. While I haven't been able to find any MP3 tracks on the CDN, I am pretty confident such files will play fine.

Playing MP3's from external URL's is covered by issue #818.

Please reopen this if and only if you are encounter non-playing MP3 or Ogg Vorbis tracks that are actually available from Spotify's own infrastructure.

<!-- gh-comment-id:1011342459 --> @roderickvd commented on GitHub (Jan 12, 2022): MP3 support implemented in `new-api` @ https://github.com/librespot-org/librespot/commit/7921f239276099ac1175233fc45252e14030ea52. While I haven't been able to find any MP3 tracks on the CDN, I am pretty confident such files will play fine. Playing MP3's from external URL's is covered by issue #818. Please reopen this if and only if you are encounter non-playing MP3 or Ogg Vorbis tracks that are actually available from Spotify's own infrastructure.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/librespot#379
No description provided.