[GH-ISSUE #579] Playback crashes when switching users #368

Closed
opened 2026-02-27 19:30:15 +03:00 by kerem · 5 comments
Owner

Originally created by @mikeszila on GitHub (Jan 24, 2021).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/579

I do not use username or password options when starting librespot. I can connect to librespot with multiple different clients as long as they are the same user. If I then try to connect with a client logged in with a different user, librespot crashes. I don't even have to press play for this to happen. Below is the only output when this happens. Previous versions of librespot did not exhibit this behaviour, though I'm not sure when it started.


DEBUG librespot_connect::discovery] Post "/" {}
DEBUG librespot_connect::spirc] drop Spirc[0]
DEBUG librespot_playback::player] Shutting down player thread ...

The only way to connect with a different user us to remove the credentials.json file in the cache folder then restart librespot, but then it's locked into whichever client connects next forever. This makes it difficult for friends and family to make use of librespot.

I'm not sure if this is the same issue or not. Other than the title and basic symptoms it looks different to me. https://github.com/librespot-org/librespot/issues/523 If it matters I use the pipe backend.

Originally created by @mikeszila on GitHub (Jan 24, 2021). Original GitHub issue: https://github.com/librespot-org/librespot/issues/579 I do not use username or password options when starting librespot. I can connect to librespot with multiple different clients as long as they are the same user. If I then try to connect with a client logged in with a different user, librespot crashes. I don't even have to press play for this to happen. Below is the only output when this happens. Previous versions of librespot did not exhibit this behaviour, though I'm not sure when it started. ``` DEBUG librespot_connect::discovery] Post "/" {} DEBUG librespot_connect::spirc] drop Spirc[0] DEBUG librespot_playback::player] Shutting down player thread ... ``` The only way to connect with a different user us to remove the credentials.json file in the cache folder then restart librespot, but then it's locked into whichever client connects next forever. This makes it difficult for friends and family to make use of librespot. I'm not sure if this is the same issue or not. Other than the title and basic symptoms it looks different to me. https://github.com/librespot-org/librespot/issues/523 If it matters I use the pipe backend.
Author
Owner

@mikeszila commented on GitHub (Jan 27, 2021):

Is this considered normal behaviour? Is there anything else I could provide to help convey the issue?

<!-- gh-comment-id:768562511 --> @mikeszila commented on GitHub (Jan 27, 2021): Is this considered normal behaviour? Is there anything else I could provide to help convey the issue?
Author
Owner

@sashahilton00 commented on GitHub (Jan 30, 2021):

Is that built with the latest commit? There were some cache issues that I let slip through in a PR. Doesn't look like the problem that was reported, but deleting credentials.json to resolve suggests it may be related

<!-- gh-comment-id:770139372 --> @sashahilton00 commented on GitHub (Jan 30, 2021): Is that built with the latest commit? There were some cache issues that I let slip through in a PR. Doesn't look like the problem that was reported, but deleting credentials.json to resolve suggests it may be related
Author
Owner

@sashahilton00 commented on GitHub (Feb 6, 2021):

I wonder if github.com/librespot-org/librespot@f67ceb5f6d/connect/src/discovery.rs (L81) is somewhat responsible, in that if a client tries to connect when a user is active, it might send an action such as logoutUser, which removes the active user before logging the new one in. Having said that though, I believe account switching should just work, it shouldn't be sticking with one account forever so to speak.

We may need to investigate further, will tag with reverse engineering for now.

<!-- gh-comment-id:774390402 --> @sashahilton00 commented on GitHub (Feb 6, 2021): I wonder if https://github.com/librespot-org/librespot/blob/f67ceb5f6d955c800564a98f8a4098c7702e8083/connect/src/discovery.rs#L81 is somewhat responsible, in that if a client tries to connect when a user is active, it might send an action such as `logoutUser`, which removes the active user before logging the new one in. Having said that though, I believe account switching should just work, it shouldn't be sticking with one account forever so to speak. We may need to investigate further, will tag with reverse engineering for now.
Author
Owner

@roderickvd commented on GitHub (Jun 14, 2021):

Is this still an issue on vanilla librespot (i.e. not repackaged with ncspot or Spotifyd or the like)? Recently I have tested switching back and forth users and cannot reproduce this.

<!-- gh-comment-id:860578776 --> @roderickvd commented on GitHub (Jun 14, 2021): Is this still an issue on vanilla `librespot` (i.e. not repackaged with `ncspot` or `Spotifyd` or the like)? Recently I have tested switching back and forth users and cannot reproduce this.
Author
Owner

@roderickvd commented on GitHub (Aug 7, 2021):

Closing, no further feedback.

<!-- gh-comment-id:894702780 --> @roderickvd commented on GitHub (Aug 7, 2021): Closing, no further feedback.
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/librespot#368
No description provided.