[GH-ISSUE #171] Keep alive Spotify Connect during "Active" and playback "Paused", Time-Out duration #107

Closed
opened 2026-02-28 14:25:25 +03:00 by kerem · 11 comments
Owner

Originally created by @olaf-at-oradio on GitHub (Feb 14, 2025).
Original GitHub issue: https://github.com/devgianlu/go-librespot/issues/171

I like to use this fantastic go-librespot to support a music player for elderly people. When Spotify Connect is active, I like to pause the playback for some time.
During my testing, after some hours, it seems that there is a kind of "Time-out" mechanism.

Is there a time-out indeed configured? and is it possible to keep an Active connection alive for longer period (say couple of pays)? Thanks

Originally created by @olaf-at-oradio on GitHub (Feb 14, 2025). Original GitHub issue: https://github.com/devgianlu/go-librespot/issues/171 I like to use this fantastic go-librespot to support a music player for elderly people. When Spotify Connect is active, I like to pause the playback for some time. During my testing, after some hours, it seems that there is a kind of "Time-out" mechanism. Is there a time-out indeed configured? and is it possible to keep an Active connection alive for longer period (say couple of pays)? Thanks
kerem closed this issue 2026-02-28 14:25:25 +03:00
Author
Owner

@devgianlu commented on GitHub (Feb 15, 2025):

I think the timeout you are observing is enforced by Spotify. I am also used to coming back to the Desktop/Android app and not having my previous Spotify Connect session active.

<!-- gh-comment-id:2660882601 --> @devgianlu commented on GitHub (Feb 15, 2025): I think the timeout you are observing is enforced by Spotify. I am also used to coming back to the Desktop/Android app and not having my previous Spotify Connect session active.
Author
Owner

@olaf-at-oradio commented on GitHub (Feb 17, 2025):

When I run librespot, I see that there is a kind "keeping alive pin pong" see picture. Is that also active in go-librespot?

Image
<!-- gh-comment-id:2662290678 --> @olaf-at-oradio commented on GitHub (Feb 17, 2025): When I run librespot, I see that there is a kind "keeping alive pin pong" see picture. Is that also active in go-librespot? <img width="756" alt="Image" src="https://github.com/user-attachments/assets/20b2bc87-1ea6-4d2d-957c-5e29a6492e38" />
Author
Owner

@devgianlu commented on GitHub (Feb 17, 2025):

Yes, that is required to keep the AP and Dealer connections with the server alive.

<!-- gh-comment-id:2662754620 --> @devgianlu commented on GitHub (Feb 17, 2025): Yes, that is required to keep the AP and Dealer connections with the server alive.
Author
Owner

@olaf-at-oradio commented on GitHub (Feb 18, 2025):

Tested with requesting status update every 20 seconds . It kept the connection for 3943 seconds and than it stopped. Is there a better way to keep the connection?

Image Image
<!-- gh-comment-id:2664710832 --> @olaf-at-oradio commented on GitHub (Feb 18, 2025): Tested with requesting status update every 20 seconds . It kept the connection for 3943 seconds and than it stopped. Is there a better way to keep the connection? <img width="914" alt="Image" src="https://github.com/user-attachments/assets/47c49dfc-c3b4-439f-b852-6461f0b945b7" /> <img width="472" alt="Image" src="https://github.com/user-attachments/assets/10b92b5c-162f-4a05-a9d3-895a3445f3f3" />
Author
Owner

@devgianlu commented on GitHub (Feb 18, 2025):

I think this will happen as long as you don't issue any command to the player. You might try sending small volume updates every 5 minutes or so to see if the session remains alive.

<!-- gh-comment-id:2664936712 --> @devgianlu commented on GitHub (Feb 18, 2025): I think this will happen as long as you don't issue any command to the player. You might try sending small volume updates every 5 minutes or so to see if the session remains alive.
Author
Owner

@olaf-at-oradio commented on GitHub (Feb 27, 2025):

Have tried volume updated, and seek (1 s) every 20 s, in the pause mode.
Did not work. At this moment, it seems that during pause, resume play for 1 s every x seconds works. Tested x = 20 s, hopefully x can go up to 5-10 min. Than it would be a possible "hack". It is far from elegant, but if it works, for now it would be ok. Will update on the test results.

<!-- gh-comment-id:2688720908 --> @olaf-at-oradio commented on GitHub (Feb 27, 2025): Have tried volume updated, and seek (1 s) every 20 s, in the pause mode. Did not work. At this moment, it seems that during pause, resume play for 1 s every x seconds works. Tested x = 20 s, hopefully x can go up to 5-10 min. Than it would be a possible "hack". It is far from elegant, but if it works, for now it would be ok. Will update on the test results.
Author
Owner

@olaf-at-oradio commented on GitHub (Feb 27, 2025):

Another question, I test now with "persist_credentials" = False. Would it make a difference if it is persist_credentials" = True?

<!-- gh-comment-id:2688737954 --> @olaf-at-oradio commented on GitHub (Feb 27, 2025): Another question, I test now with "persist_credentials" = False. Would it make a difference if it is persist_credentials" = True?
Author
Owner

@devgianlu commented on GitHub (Feb 28, 2025):

persist_credentials only toggles whether Zeroconf credentials are saved so that you are automatically logged in next time. It doesn't affect the Spotify playback session.

<!-- gh-comment-id:2691391686 --> @devgianlu commented on GitHub (Feb 28, 2025): `persist_credentials` only toggles whether Zeroconf credentials are saved so that you are automatically logged in next time. It doesn't affect the Spotify playback session.
Author
Owner

@olaf-at-oradio commented on GitHub (Mar 1, 2025):

Have tried volume updated, and seek (1 s) every 20 s, in the pause mode.
Did not work. At this moment, it seems that during pause, resume play for 1 s every x seconds works. Tested x = 20 s, hopefully x can go up to 5-10 min. Than it would be a possible "hack". It is far from elegant, but if it works, for now it would be ok. Will update on the test results.

Have tested up to 600 s and 900 s. 600 s works, 900 s not. Every 600 s , 1 s play is a workable workaround for us. As far as I can see, the connection stays for many hours active.

<!-- gh-comment-id:2692345068 --> @olaf-at-oradio commented on GitHub (Mar 1, 2025): > Have tried volume updated, and seek (1 s) every 20 s, in the pause mode. > Did not work. At this moment, it seems that during pause, resume play for 1 s every x seconds works. Tested x = 20 s, hopefully x can go up to 5-10 min. Than it would be a possible "hack". It is far from elegant, but if it works, for now it would be ok. Will update on the test results. > Have tested up to 600 s and 900 s. 600 s works, 900 s not. Every 600 s , 1 s play is a workable workaround for us. As far as I can see, the connection stays for many hours active.
Author
Owner

@olaf-at-oradio commented on GitHub (Mar 2, 2025):

persist_credentials only toggles whether Zeroconf credentials are saved so that you are automatically logged in next time. It doesn't affect the Spotify playback session.

Great, tested the persist_credentials. This works excellent. With this feature I can play playlist , without the need for the Spotify app. So, standalone operation is now possible. We will build further on this and give an update

<!-- gh-comment-id:2692658281 --> @olaf-at-oradio commented on GitHub (Mar 2, 2025): > `persist_credentials` only toggles whether Zeroconf credentials are saved so that you are automatically logged in next time. It doesn't affect the Spotify playback session. Great, tested the persist_credentials. This works excellent. With this feature I can play playlist , without the need for the Spotify app. So, standalone operation is now possible. We will build further on this and give an update
Author
Owner

@devgianlu commented on GitHub (Mar 30, 2025):

That's great, thank you for sharing. I'll close this for now.

<!-- gh-comment-id:2764651381 --> @devgianlu commented on GitHub (Mar 30, 2025): That's great, thank you for sharing. I'll close this for now.
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/go-librespot#107
No description provided.