librespot: Timeout? Librespot-enabled device disappears from Spotify device list after a while
My RaspberryPi with Librespot has been running for a couple hours now and, earlier today, everything was working fine and I could listen to songs on Spotify through the speakers connected to the RPi. At some point this afternoon I paused the music, though, and now, hours later, I wanted to unpause it. However, Spotify didn’t list my RPi among the available devices anymore.
So I ssh’d into the RPi and took a look at the logs. They seemed fine:
[…]
INFO:librespot_playback::player: Loading track "XY" with Spotify URI "spotify:track:4H6qtMPzKYRCsf7bT2DcBP"
INFO:librespot_playback::player: Track "XY" loaded
INFO:librespot::player_event_handler: Running ["/opt/musicbox/mpc_stop.sh"] with environment variables {"OLD_TRACK_ID": "foo", "TRACK_ID": "bar", "PLAYER_EVENT": "change"}
INFO:librespot::player_event_handler: Running ["/opt/musicbox/mpc_stop.sh"] with environment variables {"PLAYER_EVENT": "stop", "TRACK_ID": "bla"}
I then restarted librespot through service librestart stop/start and this fixed the issue—the RPi reappeared in Spotify’s device list. Meanwhile, the logs are:
INFO:librespot: librespot 1e69138 (2018-05-18). Built on 2018-05-29. Build ID: Ptc4Ggyb
INFO:librespot_core::session: Connecting to AP "gew1-accesspoint-b-psjr.ap.spotify.com:4070"
INFO:librespot_core::session: Authenticated as "ABCDEFG" !
INFO:librespot_playback::audio_backend::alsa: Using alsa sink
INFO:librespot_core::session: Country: "CO"
So it seems that there is some kind of timeout causing Spotify to forget about a device with Librespot after a while?
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 5
- Comments: 30 (12 by maintainers)
This happens for me with every project I’ve used based on this library (volumio, raspotify, etc.) Even if librespot can’t handle reconnections yet, if we could at least have it crash it would be easier to programmatically restart it.
Still have this issue (running on latest build)- It happens randomly - sometimes librespot runs for ages - sometimes a few times a week. Tonight it happened on both my Pi’s - connected on 2 different locations and networks. (same city thou) It must be something with the handshake with the server that fails. If the connection between librespot and the Spotify server is unavailable at that exact time it fails and panic.