-
Notifications
You must be signed in to change notification settings - Fork 397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 | PlayerMPD.prev/next crash at the end of the playlist #2294
Comments
Good catch. Thanks! Your solutions looks already good. It would basically not do anything once the end of the playlist has been reached. Most Phonieboxes don't have a visual interface. So if a user tries to press to get to the next song and nothing happens, it's not intuitive nor accessible.
This behviour could be configurable, meaning an option in the Thoughts? |
I agree at the end going to start again with NEXT and vice versa would be the most intuitive. 👍 Making it configurable (other option "do nothing") would cover most cases and could be extended later, if we come up with more use cases in the future. |
Default behavior of v2 is "do nothing" until play is pressed or a card is swiped again. |
Instead of crashing the player thread, jukebox-daemon will now stop playing by default (similar to v2). It can also be configured to restart the playlist instead by setting the new config option `playermpd.end_of_playlist_next_action: rewind`. Fixes MiczFlor#2294
Instead of crashing the player thread, jukebox-daemon will now stop playing by default (similar to v2). It can also be configured to restart the playlist instead by setting the new config option `playermpd.end_of_playlist_next_action: rewind`. Fixes MiczFlor#2294
rewind() is documented to jump to the first song of the playlist. Instead, it jumped to the second song as SONGPOS in MPDClient.play(SONGPOS) is zero-indexed [1], so mpd.play(1) started the second song. [1] https://mpd.readthedocs.io/en/latest/protocol.html#the-queue "The position is a 0-based index" Related: MiczFlor#2294
Some corrections/additions:
In essence, we need to be clear about the behavior in the following cases. I'm no longer sure if it makes sense to make all of these configurable?
Independent of those specified cases, That's what I've implemented here and what I'll submit as a PR soon: hoffie@903e8d1 #2324 might also be relevant in the considerations. |
* Avoid MPD-related crashes during all prev/next() calls. * Explicitly handle prev() in stopped state * Explicitly handle next() in stopped state * Explicitly handle next() when stopped as the result of reaching the end of the playlist: jukebox-daemon will now stop playing by default (similar to v2). It can also be configured to restart the playlist instead by setting the new config option `playermpd.end_of_playlist_next_action: rewind`. Fixes MiczFlor#2294
* Avoid MPD-related crashes during all prev/next() calls. * Explicitly handle prev() in stopped state * Explicitly handle next() in stopped state * Explicitly handle next() when stopped as the result of reaching the end of the playlist: jukebox-daemon will now stop playing by default (similar to v2). It can also be configured to restart the playlist instead by setting the new config option `playermpd.end_of_playlist_next_action: rewind`. Fixes MiczFlor#2294
@hoffie I encountered this bug as well, after using you fork and the |
So please create a PR, I can confirm your changes are working. |
* Avoid MPD-related crashes during all prev/next() calls. * Explicitly handle prev() in stopped state * Explicitly handle next() in stopped state * Explicitly handle next() when stopped as the result of reaching the end of the playlist: jukebox-daemon will now stop playing by default (similar to v2). It can also be configured to restart the playlist instead by setting the new config option `playermpd.end_of_playlist_next_action: rewind`. Fixes MiczFlor#2294
* Avoid MPD-related crashes during all prev/next() calls. * Explicitly handle prev() in stopped state * Explicitly handle next() in stopped state * Explicitly handle next() when reaching the end of the playlist: jukebox-daemon will now stop playing by default (similar to v2). It can also be configured to restart the playlist instead by setting the new config option `playermpd.end_of_playlist_next_action: rewind`. Fixes MiczFlor#2294
rewind() is documented to jump to the first song of the playlist. Instead, it jumped to the second song as SONGPOS in MPDClient.play(SONGPOS) is zero-indexed [1], so mpd.play(1) started the second song. [1] https://mpd.readthedocs.io/en/latest/protocol.html#the-queue "The position is a 0-based index" Related: #2294
* Avoid MPD-related crashes during all prev/next() calls. * Explicitly handle prev() in stopped state * Explicitly handle next() in stopped state * Explicitly handle next() when reaching the end of the playlist: jukebox-daemon will now stop playing by default (similar to v2). It can also be configured to restart the playlist instead by setting the new config option `playermpd.end_of_playlist_next_action: rewind`. Fixes MiczFlor#2294 Co-authored-by: pabera <[email protected]>
* Avoid MPD-related crashes during all prev/next() calls. * Explicitly handle prev() in stopped state, configurable via `playermpd.stopped_prev_action`. * Explicitly handle next() in stopped state, configurable via `playermpd.stopped_next_action`. * Explicitly handle next() when reaching the end of the playlist: jukebox-daemon will now stop playing by default (similar to v2). It can also be configured to restart the playlist instead by setting the new config option `playermpd.end_of_playlist_next_action: rewind` or to ignore the action completely. Fixes MiczFlor#2294 Fixes MiczFlor#2327 Co-authored-by: pabera <[email protected]>
* Avoid MPD-related crashes during all prev/next() calls. * Explicitly handle prev() in stopped state, configurable via `playermpd.stopped_prev_action`. * Explicitly handle next() in stopped state, configurable via `playermpd.stopped_next_action`. * Explicitly handle next() when reaching the end of the playlist: jukebox-daemon will now ignore the action by default (similar to v2). It can also be configured to rewind the playlist instead by setting the new config option `playermpd.end_of_playlist_next_action: rewind` or to stop playing. Fixes MiczFlor#2294 Fixes MiczFlor#2327 Co-authored-by: pabera <[email protected]>
* Avoid MPD-related crashes during all prev/next() calls. * Explicitly handle prev() in stopped state, configurable via `playermpd.stopped_prev_action`. * Explicitly handle next() in stopped state, configurable via `playermpd.stopped_next_action`. * Explicitly handle next() when reaching the end of the playlist: jukebox-daemon will now ignore the action by default (similar to v2). It can also be configured to rewind the playlist instead by setting the new config option `playermpd.end_of_playlist_next_action: rewind` or to stop playing. Fixes MiczFlor#2294 Fixes MiczFlor#2327 Co-authored-by: pabera <[email protected]>
* Avoid MPD-related crashes during all prev/next() calls. * Explicitly handle prev() in stopped state, configurable via `playermpd.stopped_prev_action`. * Explicitly handle next() in stopped state, configurable via `playermpd.stopped_next_action`. * Explicitly handle next() when reaching the end of the playlist: jukebox-daemon will now ignore the action by default (similar to v2). It can also be configured to rewind the playlist instead by setting the new config option `playermpd.end_of_playlist_next_action: rewind` or to stop playing. Fixes MiczFlor#2294 Fixes MiczFlor#2327 Co-authored-by: pabera <[email protected]>
* utils: Add get_config_action This abstracts away the functionality to resolve a given config option to an action in a pre-defined dict. Co-authored-by: Christian Hoffmann <[email protected]> * Fix PlayerMPD.prev/next() when stopped * Avoid MPD-related crashes during all prev/next() calls. * Explicitly handle prev() in stopped state, configurable via `playermpd.stopped_prev_action`. * Explicitly handle next() in stopped state, configurable via `playermpd.stopped_next_action`. * Explicitly handle next() when reaching the end of the playlist: jukebox-daemon will now ignore the action by default (similar to v2). It can also be configured to rewind the playlist instead by setting the new config option `playermpd.end_of_playlist_next_action: rewind` or to stop playing. Fixes #2294 Fixes #2327 Co-authored-by: pabera <[email protected]> --------- Co-authored-by: pabera <[email protected]>
#2326 has been merged to future3/develop |
Version
v3.5.2
Branch
future3/main
OS
Raspberry Pi OS Bookworm Lite - 32bit
Pi model
3B
Hardware
No response
What happened?
jukebox-daemon logs the below exception and stops reacting to music play requests until restarted.
Logs
Configuration
GPIO config
More info
A stop gap solution which works for me would be something like this:
Obviously, it doesn't cover all cases and might be suboptimal. Maybe prev/next should rather wrap around?
I'm happy to submit a PR once it is clear how it should behave and where the fix should be located.
The text was updated successfully, but these errors were encountered: