mirror of
https://github.com/librespot-org/librespot.git
synced 2026-04-27 00:05:55 +03:00
[GH-ISSUE #350] Lock-up when connection is reset on Spotify's end #233
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#233
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 @matthijskooijman on GitHub (Jul 13, 2019).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/350
I've seen librespot lock up after some time, disappearing from the discovered devices list (no longer responding to mdns requests). I'm not sure if it actually interrupted playing or just hung up while nothing was playing.
This was observed with a self-compiled git master version (
github.com/librespot-org/librespot@4e3576ba7c)This seems to be similar to #247 and #215, though I'm not so sure this is really the same bug. I don't have any meaningful backtrace in the logfile, for example. Also I have quite some details, so it is probably better to have a separate issue unless we can confirm that they are indeed the same.
In the log file, I see:
It seems librespot has stopped reading from the mdns socket:
strace shows that no syscalls are happening:
gdb also suggests that all threads are locked up:
I made a core dump file. If it helps, I can share it (but I'm a bit hesitant, since I'm not sure if there's sensitive credentials in there).
@matthijskooijman commented on GitHub (Jul 23, 2019):
I tried to dig into this a bit further, and it turns out the coredump might not be so useful after all. It seems that gdb does not know (or fails to read) the list of shared libraries loaded at runtime, which means it fails to load the debugging symbols of the libraries in use, and fails to render the backtrace. I also noticed that the "program entry point" (as printed by "info shared" IIRC) was different between a running process and a core dump, which might also be related. It also seems that rust has a fairly complicated multithreading model, so I haven't figured out any extra info from debugging a locked up process directly...
@PMaynard commented on GitHub (Nov 28, 2019):
I am also experiencing this issue. After 1-3 songs (via Spotifyd 0.2.20) I get the error
Connection reset by peer, so I enabled verbose logging (Full debug log can be found here )Going to try with a fresh compile. Will update with results.
EDIT: Error still happens with a fresh build
@espindola commented on GitHub (Apr 29, 2020):
I was having the ConnectionReset problem. What seems to have solved it making sure pulseaudio never quits. Instead of running it with systemd, what I did was
Disable pulseaudio.socket:
$ sudo systemctl --global disable pulseaudio.service pulseaudio.socket
On daemon.conf, disable exit on idle:
exit-idle-time = -1
In default.pa, comment
load-module module-systemd-login
With that I have librespot running on a raspberrypi for a day and no problems so far.
@idofr commented on GitHub (May 21, 2020):
@espindola a bit of a dull question, but are you using alsa or pulseaudio as your backend?
I'm having the same problem with
spotifydbut it's using alsa as a backend@espindola commented on GitHub (May 21, 2020):
I am using pulseaudio
@dangerfish96 commented on GitHub (Jun 17, 2020):
I am not quite sure whether this is the same issue but librespot stops to work after about 3 songs aswell, with the log:
@utkiupe commented on GitHub (Aug 21, 2020):
Hi, I am using Librespot through raspotify, experiencing recently many playback stops after a while (seems very random to me sometime after a couple of minutes, sometime after a longer time).
My logs look similar to those reported earlier :
I have also noticed that before this I have a dozen of
any ideas on how to fix that? Is it something related to our configuration ?
thanks
@all3kcis commented on GitHub (Oct 1, 2020):
Same here, it looks like #331.
@paulbastian commented on GitHub (Nov 22, 2020):
same problem for me
@mutipg commented on GitHub (Nov 25, 2020):
Same issue on new Raspberry Pi 4. After 2 songs raspotify disconnects with errors:
@paulbastian commented on GitHub (Nov 26, 2020):
Although I don't like running java on a headless raspberry pi, I want to state, that the librespot-java project works flawless and I'm not getting any disconnects there
@mutipg commented on GitHub (Nov 26, 2020):
@paulbastian, thank you for your suggestion!
For about one hour Spotify plays without disconnects. So Spocon based on librespot-java is quite good alternative for Raspotify.
@Malvineous commented on GitHub (Feb 23, 2021):
The "Connection reset by peer" error is because the Spotify network connection broke, for reasons like a Spotify server was shut down, your Internet connection went offline briefly, or many other issues. librespot should try to automatically reconnect in this case but it doesn't always seem to for some reason.
@utkiupe commented on GitHub (Feb 23, 2021):
this is probably the reason we need to investigate :)
I guess all the Spotify clients face the same kind of issue and have found some workaround.
I am not able to help you for coding but I'll be more than happy to help you as much as I could
@roderickvd commented on GitHub (May 24, 2021):
Is this still happening for you?
It's known that reconnection isn't handled well. This is likely to be fixed when we get the new API in, which supports reconnection from the ground up.
With the current
librespotversion however (assuming a stable network) I have no issues runninglibrespotheedlessly for days and weeks at end, connecting and disconnecting in the evenings.@espindola commented on GitHub (May 24, 2021):
I haven't noticed this issue in a long time. Not sure what changed.
@Malvineous commented on GitHub (May 25, 2021):
I still see it maybe once a week? Often it will reconnect without any issues but occasionally it just crashes completely. It is rare enough that it isn't causing me any problems but it is still happening.
@roderickvd commented on GitHub (May 25, 2021):
Which version are you on?
@Malvineous commented on GitHub (May 25, 2021):
I haven't upgraded in a while as it has been running without issue. But I leave it connected 24/7 so that's probably why. I guess if you disconnect and reconnect you probably won't see it if it's due to Spotify rebooting servers from time to time.
@roderickvd commented on GitHub (May 25, 2021):
Please try the latest and report back. There's been a rather large upgrade and rewrite of the asynchronous functions. I also see in
mainthat there will be up to five reconnection attempts whenspircshuts down unexpectedly.It's probably a lot better than it was, and it's about as good as it's going to get until the new API gets in.
@roderickvd commented on GitHub (Jun 14, 2021):
Duplicate of #276.
@Malvineous commented on GitHub (Sep 2, 2021):
Sorry for the late reply. Been running the updated code for the last two months and it does seem to be a lot more reliable. It will automatically reconnect but it won't resume the previously playing track which somewhat defeats the point as I still have to go mess with it to get it playing again, but it's definitely a step in the right direction!