librespot: Spotify API does not list Librespot as device after some time of no playback

Describe the bug Some time (haven’t measured) after playback has stopped, the spotify get-available-devices api endpoint stops listing the librespot player as a device. Only after starting playback via the desktop app on the librespot player (it still shows up there) it shows up again in the api response. I can’t tell if the fault is on spotify’s end or with librespot or my configuration.

To reproduce Steps to reproduce the behavior:

  1. Start Librespot with librespot --name "Librespot" -b 320 -c /tmp --enable-volume-normalisation --initial-volume 30 --device-type speaker -v -u username -p "password"

Log Never had the terminal open when it happened, might add later if needed.

Host (what you are running librespot on):

  • OS: Ubuntu 22.04.1 Server

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 28 (15 by maintainers)

Most upvoted comments

Let’s not confuse this with automatically reconnecting after loss of network or peer disconnection. That’s not this.

This sends pings when the player is idle, so the server knows we’re alive and doesn’t disconnect us.

Other than that: what @kingosticks said.

Well, it also makes sure that librespot regularly receives those pings and otherwise invalidates the session. Usually, it should then try to reconnect with the last credentials. (not preserving the playback state, however)

dev hasn’t hooked up the dealer yet. That’s actually the next huge piece of work that should be for 0.6 I think.