[GH-ISSUE #285] Client either freezes or just does nothing when selecting item to play #148

Closed
opened 2026-03-02 23:45:00 +03:00 by kerem · 12 comments
Owner

Originally created by @joebonneau on GitHub (Nov 11, 2023).
Original GitHub issue: https://github.com/aome510/spotify-player/issues/285

Describe the bug
When I open the client and it connects to a device, I'm able to press "space" to resume playback. I can also use other keys like "n" and "p" and everything works as expected. However, when I try to play an item from one of my playlists, playback stops and I can't get it to play again.

To Reproduce
Open the client and try to play a song from one of the current user's playlists.

Expected behavior
I'd expect it to play the highlighted item.

Log and backtrace
spotify-player-23-11-10-21-55.log
backtrace is empty

Screenshots
If applicable, add screenshots to help explain your problem.

Environment

  • OS: MacOS (M2)
  • Application version: 0.15.2
  • Application features: if applicable, provide cargo features used to build spotify_player

Additional context
Running within a tmux session.

Originally created by @joebonneau on GitHub (Nov 11, 2023). Original GitHub issue: https://github.com/aome510/spotify-player/issues/285 **Describe the bug** When I open the client and it connects to a device, I'm able to press "space" to resume playback. I can also use other keys like "n" and "p" and everything works as expected. However, when I try to play an item from one of my playlists, playback stops and I can't get it to play again. **To Reproduce** Open the client and try to play a song from one of the current user's playlists. **Expected behavior** I'd expect it to play the highlighted item. **Log and backtrace** [spotify-player-23-11-10-21-55.log](https://github.com/aome510/spotify-player/files/13324613/spotify-player-23-11-10-21-55.log) backtrace is empty **Screenshots** If applicable, add screenshots to help explain your problem. **Environment** - OS: MacOS (M2) - Application version: 0.15.2 - Application features: if applicable, provide [cargo features](https://doc.rust-lang.org/cargo/reference/features.html) used to build `spotify_player` **Additional context** Running within a tmux session.
kerem 2026-03-02 23:45:00 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@joebonneau commented on GitHub (Nov 11, 2023):

Actually, it seems to only happen on some of my playlists? My display name is Soul Dialect and it's happening specifically with my playlist "JRPG music" on the tracks by Devin Morrison.

OK, so it actually only happens with this one specific artist, Devin Morrison. It happens regardless of whether I try to play his music through a playlist or one of his albums. Very strange.

While I'm at it, one more question: Is the expected behavior that this remapping:

[[keymaps]]
command = "SelectNextOrScrollDown"
key_sequence = "C-j"

would actually map the command to command-j? That is what is occurring and it's not what I would expect (I'm trying to map it to control-j)

<!-- gh-comment-id:1806709440 --> @joebonneau commented on GitHub (Nov 11, 2023): Actually, it seems to only happen on some of my playlists? My display name is Soul Dialect and it's happening specifically with my playlist "JRPG music" on the tracks by Devin Morrison. OK, so it actually only happens with this one specific artist, Devin Morrison. It happens regardless of whether I try to play his music through a playlist or one of his albums. Very strange. While I'm at it, one more question: Is the expected behavior that this remapping: ```toml [[keymaps]] command = "SelectNextOrScrollDown" key_sequence = "C-j" ``` would actually map the command to command-j? That is what is occurring and it's not what I would expect (I'm trying to map it to control-j)
Author
Owner

@sewnie commented on GitHub (Nov 11, 2023):

Maybe this could be related to #282 ?!?!?!!?!?

<!-- gh-comment-id:1806761260 --> @sewnie commented on GitHub (Nov 11, 2023): Maybe this could be related to #282 ?!?!?!!?!?
Author
Owner

@aome510 commented on GitHub (Nov 11, 2023):

Actually, it seems to only happen on some of my playlists? My display name is Soul Dialect and it's happening specifically with my playlist "JRPG music" on the tracks by Devin Morrison.

OK, so it actually only happens with this one specific artist, Devin Morrison. It happens regardless of whether I try to play his music through a playlist or one of his albums. Very strange.

While I'm at it, one more question: Is the expected behavior that this remapping:

[[keymaps]]
command = "SelectNextOrScrollDown"
key_sequence = "C-j"

would actually map the command to command-j? That is what is occurring and it's not what I would expect (I'm trying to map it to control-j)

Thanks for reporting. It's difficult to fix this kind of weird behaviour when it's not reproducible. Can you try RUST_LOG=debug spotify_player and attach a new log? cc @apprehensions as well.

"C-j" will map to control-j, you can double check the mapping by pressing ? to show a list of commands and their mappings. Just a note that SelectNextOrScrollDown is also mapped to j by default, so it kinda explains the above behaviour.

<!-- gh-comment-id:1806889086 --> @aome510 commented on GitHub (Nov 11, 2023): > Actually, it seems to only happen on some of my playlists? My display name is Soul Dialect and it's happening specifically with my playlist "JRPG music" on the tracks by Devin Morrison. > > OK, so it actually only happens with this one specific artist, Devin Morrison. It happens regardless of whether I try to play his music through a playlist or one of his albums. Very strange. > > While I'm at it, one more question: Is the expected behavior that this remapping: > > ```toml > [[keymaps]] > command = "SelectNextOrScrollDown" > key_sequence = "C-j" > ``` > > would actually map the command to command-j? That is what is occurring and it's not what I would expect (I'm trying to map it to control-j) Thanks for reporting. It's difficult to fix this kind of weird behaviour when it's not reproducible. Can you try `RUST_LOG=debug spotify_player` and attach a new log? cc @apprehensions as well. "C-j" will map to control-j, you can double check the mapping by pressing `?` to show a list of commands and their mappings. Just a note that `SelectNextOrScrollDown` is also mapped to `j` by default, so it kinda explains the above behaviour.
Author
Owner

@joebonneau commented on GitHub (Nov 11, 2023):

for the RUST_LOG debug, do you mean to set the RUST_LOG environment variable to that value prior to initializing a new spotify_player instance?

Also, one more wrinkle to this is that if I play a song in the "JRPG music" playlist that isn't by Devin Morrison, I can play a Devin Morrison song by using "p" or "n" until I get to one of his songs. When I do that, they all work... but I can't play them directly.

On the mapping - the use case for setting it to C-j is so that when I'm in a search, for example, I can navigate down using C-j. To be clear, in the situation I just described, C-j does nothing, but Cmd-j works. J by itself just is interpreted as input to the search field.

<!-- gh-comment-id:1806900139 --> @joebonneau commented on GitHub (Nov 11, 2023): for the RUST_LOG debug, do you mean to set the RUST_LOG environment variable to that value prior to initializing a new spotify_player instance? Also, one more wrinkle to this is that if I play a song in the "JRPG music" playlist that isn't by Devin Morrison, I can play a Devin Morrison song by using "p" or "n" until I get to one of his songs. When I do that, they all work... but I can't play them directly. On the mapping - the use case for setting it to C-j is so that when I'm in a search, for example, I can navigate down using C-j. To be clear, in the situation I just described, C-j does nothing, but Cmd-j works. J by itself just is interpreted as input to the search field.
Author
Owner

@aome510 commented on GitHub (Nov 11, 2023):

for the RUST_LOG debug, do you mean to set the RUST_LOG environment variable to that value prior to initializing a new spotify_player instance?

yes, just run RUST_LOG=debug spotify_player will set the env variable before launching the app.

Also, one more wrinkle to this is that if I play a song in the "JRPG music" playlist that isn't by Devin Morrison, I can play a Devin Morrison song by using "p" or "n" until I get to one of his songs. When I do that, they all work... but I can't play them directly.

hmm, very weird indeed.

On the mapping - the use case for setting it to C-j is so that when I'm in a search, for example, I can navigate down using C-j. To be clear, in the situation I just described, C-j does nothing, but Cmd-j works. J by itself just is interpreted as input to the search field.

Your use case makes sense and that's why the SelectNextOrScrollDown is mapped to multiple keys. I use C-n for example. hmm maybe the key sequence is interpreted differently by your terminal. control may mean command in your terminal. You can double-check the terminal settings to see if that's the case.

<!-- gh-comment-id:1806901860 --> @aome510 commented on GitHub (Nov 11, 2023): > for the RUST_LOG debug, do you mean to set the RUST_LOG environment variable to that value prior to initializing a new spotify_player instance? yes, just run `RUST_LOG=debug spotify_player` will set the env variable before launching the app. > Also, one more wrinkle to this is that if I play a song in the "JRPG music" playlist that isn't by Devin Morrison, I can play a Devin Morrison song by using "p" or "n" until I get to one of his songs. When I do that, they all work... but I can't play them directly. hmm, very weird indeed. > On the mapping - the use case for setting it to C-j is so that when I'm in a search, for example, I can navigate down using C-j. To be clear, in the situation I just described, C-j does nothing, but Cmd-j works. J by itself just is interpreted as input to the search field. Your use case makes sense and that's why the `SelectNextOrScrollDown` is mapped to multiple keys. I use `C-n` for example. hmm maybe the key sequence is interpreted differently by your terminal. `control` may mean `command` in your terminal. You can double-check the terminal settings to see if that's the case.
Author
Owner

@joebonneau commented on GitHub (Nov 11, 2023):

Here's a new log with RUST_LOG=debug (didn't know you could specify env var values right before calling a command, good to know!). The backtrace is still empty.

spotify-player-23-11-11-14-20.log

I use alacritty which does not have native support for command, so I think it should be interpreting it as control.

<!-- gh-comment-id:1806932345 --> @joebonneau commented on GitHub (Nov 11, 2023): Here's a new log with RUST_LOG=debug (didn't know you could specify env var values right before calling a command, good to know!). The backtrace is still empty. [spotify-player-23-11-11-14-20.log](https://github.com/aome510/spotify-player/files/13326667/spotify-player-23-11-11-14-20.log) I use `alacritty` which does not have native support for `command`, so I think it should be interpreting it as `control`.
Author
Owner

@aome510 commented on GitHub (Nov 11, 2023):

Here's a new log with RUST_LOG=debug (didn't know you could specify env var values right before calling a command, good to know!). The backtrace is still empty.

spotify-player-23-11-11-14-20.log

I use alacritty which does not have native support for command, so I think it should be interpreting it as control.

hmm, the attached log doesn't look like it is run with RUST_LOG=debug. Should see a lot of DEBUG ... messages. Can you try again but with export RUST_LOG=debug before running the application?

<!-- gh-comment-id:1806933345 --> @aome510 commented on GitHub (Nov 11, 2023): > Here's a new log with RUST_LOG=debug (didn't know you could specify env var values right before calling a command, good to know!). The backtrace is still empty. > > [spotify-player-23-11-11-14-20.log](https://github.com/aome510/spotify-player/files/13326667/spotify-player-23-11-11-14-20.log) > > I use `alacritty` which does not have native support for `command`, so I think it should be interpreting it as `control`. hmm, the attached log doesn't look like it is run with `RUST_LOG=debug`. Should see a lot of `DEBUG ...` messages. Can you try again but with `export RUST_LOG=debug` before running the application?
Author
Owner

@joebonneau commented on GitHub (Nov 11, 2023):

My fault, I didn't export the variable 🤦

Here you go:
spotify-player-23-11-11-15-06.log

<!-- gh-comment-id:1806939954 --> @joebonneau commented on GitHub (Nov 11, 2023): My fault, I didn't export the variable 🤦 Here you go: [spotify-player-23-11-11-15-06.log](https://github.com/aome510/spotify-player/files/13326745/spotify-player-23-11-11-15-06.log)
Author
Owner

@aome510 commented on GitHub (Nov 12, 2023):

Thanks. I think I know the problem. Will put up a fix soon.

<!-- gh-comment-id:1806959224 --> @aome510 commented on GitHub (Nov 12, 2023): Thanks. I think I know the problem. Will put up a fix soon.
Author
Owner

@aome510 commented on GitHub (Nov 12, 2023):

This issue happens because

Spotify uses Track Relinking to re-link a track to a different version of the same track if it's unavailable in user's market while the other version is available.

Because of this relinking process, the linked track's ID is returned by the Spotify APIs. This makes starting a playback in a context (e.g album, playlist, etc) with the linked track's ID failed because Spotify cannot find a track with that ID in the context.

Should be fixed by #286. @apprehensions @joebonneau can you guys check out the branch and run the application (cargo run) to see if it fixes the problem?

<!-- gh-comment-id:1806970161 --> @aome510 commented on GitHub (Nov 12, 2023): This issue happens because > Spotify uses [Track Relinking](https://developer.spotify.com/documentation/web-api/concepts/track-relinking) to re-link a track to a different version of the same track if it's unavailable in user's market while the other version is available. > > Because of this relinking process, the linked track's ID is returned by the Spotify APIs. This makes starting a playback in a context (e.g album, playlist, etc) with the linked track's ID failed because Spotify cannot find a track with that ID in the context. Should be fixed by #286. @apprehensions @joebonneau can you guys check out the branch and run the application (`cargo run`) to see if it fixes the problem?
Author
Owner

@sewnie commented on GitHub (Nov 12, 2023):

yep, i can finally listen to Turquoise Hexagon Sun by Boards of Canada now.

<!-- gh-comment-id:1807090342 --> @sewnie commented on GitHub (Nov 12, 2023): yep, i can finally listen to Turquoise Hexagon Sun by Boards of Canada now.
Author
Owner

@joebonneau commented on GitHub (Nov 12, 2023):

Works as expected now! Thanks for the quick fix @aome510.

I know this is the classic "I'm asking for help, so let me praise you" but I did want to say thanks for creating and maintaining this project. I can already tell that it's going to be a big boost to my workflow so I'm stoked to have found it.

<!-- gh-comment-id:1807187132 --> @joebonneau commented on GitHub (Nov 12, 2023): Works as expected now! Thanks for the quick fix @aome510. I know this is the classic "I'm asking for help, so let me praise you" but I did want to say thanks for creating and maintaining this project. I can already tell that it's going to be a big boost to my workflow so I'm stoked to have found it.
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/spotify-player#148
No description provided.