[GH-ISSUE #128] Don't try play while ALSA device is using by other player #77

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

Originally created by @szygmunt on GitHub (Oct 21, 2024).
Original GitHub issue: https://github.com/devgianlu/go-librespot/issues/128

  1. Pause currently playing track in android spotify app (and start playing internet radio with mpd...)

DEBU[3699] handling pause player command from [UID - edited]
DEBU[3699] pause track at 139981ms
DEBU[3699] put connect state because PLAYER_STATE_CHANGED
DEBU[3699] sending successful reply for dealer request
DEBU[3699] put connect state because PLAYER_STATE_CHANGED

  1. Trying resume palyback in spotify app while mpd is still using ALSA Device

DEBU[3954] handling resume player command from [UID - edited]
ERRO[3954] failed resuming playback error="ALSA error at snd_pcm_open: Device or resource busy"
DEBU[3954] resume track at 139739ms
DEBU[3954] put connect state because PLAYER_STATE_CHANGED
DEBU[3954] sending successful reply for dealer request
DEBU[3954] put connect state because PLAYER_STATE_CHANGED

After that mpd is still playing (as expected) and progress bar in spotify android app goes forward without sound.

Can we handle this scenario in go-librespot (dont resume track while ALSA Device is using by other player)?

Originally created by @szygmunt on GitHub (Oct 21, 2024). Original GitHub issue: https://github.com/devgianlu/go-librespot/issues/128 1. Pause currently playing track in android spotify app (and start playing internet radio with mpd...) DEBU[3699] handling pause player command from [UID - edited] DEBU[3699] pause track at 139981ms DEBU[3699] put connect state because PLAYER_STATE_CHANGED DEBU[3699] sending successful reply for dealer request DEBU[3699] put connect state because PLAYER_STATE_CHANGED 2. Trying resume palyback in spotify app while mpd is still using ALSA Device DEBU[3954] handling resume player command from [UID - edited] ERRO[3954] failed resuming playback error="ALSA error at snd_pcm_open: Device or resource busy" DEBU[3954] resume track at 139739ms DEBU[3954] put connect state because PLAYER_STATE_CHANGED DEBU[3954] sending successful reply for dealer request DEBU[3954] put connect state because PLAYER_STATE_CHANGED After that mpd is still playing (as expected) and progress bar in spotify android app goes forward without sound. Can we handle this scenario in go-librespot (dont resume track while ALSA Device is using by other player)?
kerem 2026-02-28 14:25:10 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@devgianlu commented on GitHub (Oct 22, 2024):

We definitely should not fake being able to play, but instead return an error. I don't think there's any easy way to communicate this specific problem (audio device busy) to the client in a nice way.

<!-- gh-comment-id:2429807531 --> @devgianlu commented on GitHub (Oct 22, 2024): We definitely should not fake being able to play, but instead return an error. I don't think there's any easy way to communicate this specific problem (audio device busy) to the client in a nice way.
Author
Owner

@devgianlu commented on GitHub (Oct 22, 2024):

I have implemented a fix, feel free to re-open if this is not fixed.

<!-- gh-comment-id:2429837330 --> @devgianlu commented on GitHub (Oct 22, 2024): I have implemented a fix, feel free to re-open if this is not fixed.
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#77
No description provided.