mirror of
https://github.com/librespot-org/librespot.git
synced 2026-04-27 08:15:50 +03:00
[GH-ISSUE #902] Librespot crashes when seeking to a position that is not yet downloaded. #448
Labels
No labels
A-Alsa
SpotifyAPI
Tokio 1.0
audio
bug
can't reproduce
compilation
dependencies
duplicate
enhancement
good first issue
help wanted
high priority
imported
imported
invalid
new api
pull-request
question
reverse engineering
wiki
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/librespot#448
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ghost on GitHub (Dec 9, 2021).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/902
Originally assigned to: @roderickvd on GitHub.
When librespot starts downloading and playing a track, when one seeks manually forward to a part that is not yet downloaded, librespot crashes. Here is the last lines of the
--verboselog:Then the application crashed.
EDIT: This is running
librespot 0.3.1 e66cc55 (Built on 2021-12-02, Build ID: b5V8XqQE, Profile: release).@JasonLG1979 commented on GitHub (Dec 11, 2021):
I tried to reproduce this error by:
I can not reproduce.
The worst I can get is a
Player::seek called from invalid statewarning. Andlibrespotrecovers just fine from those.Can the tracks in question be played otherwise? If not it could be that they're just not Vorbis? Either that or your connection is unstable and/or slow. I looked up those errors in Lewton and Ogg (the decoder libs) and they're not very helpful. It could be anything from it's not a vorbis to any number of I/O errors.
@JasonLG1979 commented on GitHub (Dec 11, 2021):
After:
You should have gotten something that looked like this if you haven't downloaded the file up to that point:
@ghost commented on GitHub (Dec 11, 2021):
You are right, it is not easy to reproduce. It happens rarely it seems. If I figure out how to reproduce it every time, I will update this thread.
This is what happens when librespot does not crash and continues playing:
After this error, librespot does not crash and continues playing the track after it is downloaded properly.
@JasonLG1979 commented on GitHub (Dec 11, 2021):
Can the tracks that crash
librespototherwise be played normally?The underruns are just the byproduct of trying to induce the error. Continually and rapidly changing tracks is opening and closing the ALSA device over and over again. That's just the device's way of saying "hold on a sec and let me catch my breath." They are otherwise unrelated to the decoder bug.
I'm inclined to say that this is either because the stream is not a vorbis stream or it's some bug in the decoder.
librespotonly supports vorbis but Spotify also streams mp3 and aac depending on what type of content. Music is vorbis 99.9% of the time but occasionally it will try to serve up mp3 or aac in place of vorbis.@JasonLG1979 commented on GitHub (Dec 11, 2021):
@roderickvd is in the process of figuring out the new API and the plan is to move to a decoder framework that can do mp3 aac and vorbis so I don't really want to do a deep dive into handling decoder errors only to have it all just be rewritten in a few weeks anyway. But in the future I would think that in the event of a fatal decoding error we should just skip to the next track instead of crashing or exiting completely.
@ghost commented on GitHub (Dec 11, 2021):
Yes, it can! I tried and am sure.
@ghost commented on GitHub (Dec 11, 2021):
I don't know why this isn't the case already. Even spotify client does that (some tracks are unplayable in certain countries, etc.)
@roderickvd commented on GitHub (Dec 11, 2021):
Yeah, we'll be pushing reporting decoding errors down to Symphonia.
Please try #905.
@kingosticks commented on GitHub (Dec 11, 2021):
Pretty sure librespot handles regular track availability just fine. That's got nothing to do with decoding errors.
@JasonLG1979 commented on GitHub (Dec 11, 2021):
What they said.
Calm down. I was just cover the bases.
Like I said the error messages come from a upstream crate and aren't particularity descriptive or useful. It could be any number of a million and 1 different I/O errors.