[GH-ISSUE #269] ALSA problem #162

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

Originally created by @benoitdr on GitHub (Dec 7, 2025).
Original GitHub issue: https://github.com/devgianlu/go-librespot/issues/269

I need some help to troubleshoot this issue.
I'm trying to setup go-librespot via docker.
I'm using the proposed docker-compose file :

services:
  daemon:
    image: ghcr.io/devgianlu/go-librespot
    build: .
    network_mode: host
    userns_mode: keep-id
    volumes:
      - ~/.config/go-librespot:/config
      - ~/.config/pulse/cookie:/pulse_cookie:ro
      - /run/user/1000/pulse/native:/pulse_native # Replace 1000 with your UID
    environment:
      PULSE_SERVER: "unix:/pulse_native"
      PULSE_COOKIE: "/pulse_cookie"

When I try to play a track, I get the error below :

docker compose logs
go-librespot-daemon-1  | time="2025-12-07T09:49:20Z" level=info msg="running go-librespot dev"
go-librespot-daemon-1  | time="2025-12-07T09:49:20Z" level=info msg="generated new device id: 465a9c0a207d8c3624481c3cb0142cfe4df29fd4"
go-librespot-daemon-1  | time="2025-12-07T09:49:21Z" level=info msg="zeroconf server listening on port 43059"
go-librespot-daemon-1  | time="2025-12-07T09:49:33Z" level=info msg="authenticated AP" username="be************ag"
go-librespot-daemon-1  | time="2025-12-07T09:49:33Z" level=info msg="authenticated Login5" username="be************ag"
go-librespot-daemon-1  | time="2025-12-07T09:49:33Z" level=info msg="accepted zeroconf from Nokia X30 5G" username="be************ag"
go-librespot-daemon-1  | ALSA lib confmisc.c:855:(parse_card) cannot find card '0'
go-librespot-daemon-1  | ALSA lib conf.c:5204:(_snd_config_evaluate) function snd_func_card_inum returned error: No such file or directory
go-librespot-daemon-1  | ALSA lib confmisc.c:422:(snd_func_concat) error evaluating strings
go-librespot-daemon-1  | ALSA lib conf.c:5204:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
go-librespot-daemon-1  | ALSA lib confmisc.c:1342:(snd_func_refer) error evaluating name
go-librespot-daemon-1  | ALSA lib conf.c:5204:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
go-librespot-daemon-1  | ALSA lib conf.c:5727:(snd_config_expand) Evaluate error: No such file or directory
go-librespot-daemon-1  | ALSA lib pcm.c:2721:(snd_pcm_open_noupdate) Unknown PCM default
go-librespot-daemon-1  | time="2025-12-07T09:49:34Z" level=warning msg="failed handling dealer request" error="failed loading current track (transfer): failed setting stream for spotify:track:01MKZzdSQL0byZSNVSZw9L: ALSA error at snd_pcm_open: No such file or directory"

Originally created by @benoitdr on GitHub (Dec 7, 2025). Original GitHub issue: https://github.com/devgianlu/go-librespot/issues/269 I need some help to troubleshoot this issue. I'm trying to setup go-librespot via docker. I'm using the proposed docker-compose file : ``` services: daemon: image: ghcr.io/devgianlu/go-librespot build: . network_mode: host userns_mode: keep-id volumes: - ~/.config/go-librespot:/config - ~/.config/pulse/cookie:/pulse_cookie:ro - /run/user/1000/pulse/native:/pulse_native # Replace 1000 with your UID environment: PULSE_SERVER: "unix:/pulse_native" PULSE_COOKIE: "/pulse_cookie" ``` When I try to play a track, I get the error below : ``` docker compose logs go-librespot-daemon-1 | time="2025-12-07T09:49:20Z" level=info msg="running go-librespot dev" go-librespot-daemon-1 | time="2025-12-07T09:49:20Z" level=info msg="generated new device id: 465a9c0a207d8c3624481c3cb0142cfe4df29fd4" go-librespot-daemon-1 | time="2025-12-07T09:49:21Z" level=info msg="zeroconf server listening on port 43059" go-librespot-daemon-1 | time="2025-12-07T09:49:33Z" level=info msg="authenticated AP" username="be************ag" go-librespot-daemon-1 | time="2025-12-07T09:49:33Z" level=info msg="authenticated Login5" username="be************ag" go-librespot-daemon-1 | time="2025-12-07T09:49:33Z" level=info msg="accepted zeroconf from Nokia X30 5G" username="be************ag" go-librespot-daemon-1 | ALSA lib confmisc.c:855:(parse_card) cannot find card '0' go-librespot-daemon-1 | ALSA lib conf.c:5204:(_snd_config_evaluate) function snd_func_card_inum returned error: No such file or directory go-librespot-daemon-1 | ALSA lib confmisc.c:422:(snd_func_concat) error evaluating strings go-librespot-daemon-1 | ALSA lib conf.c:5204:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory go-librespot-daemon-1 | ALSA lib confmisc.c:1342:(snd_func_refer) error evaluating name go-librespot-daemon-1 | ALSA lib conf.c:5204:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory go-librespot-daemon-1 | ALSA lib conf.c:5727:(snd_config_expand) Evaluate error: No such file or directory go-librespot-daemon-1 | ALSA lib pcm.c:2721:(snd_pcm_open_noupdate) Unknown PCM default go-librespot-daemon-1 | time="2025-12-07T09:49:34Z" level=warning msg="failed handling dealer request" error="failed loading current track (transfer): failed setting stream for spotify:track:01MKZzdSQL0byZSNVSZw9L: ALSA error at snd_pcm_open: No such file or directory" ```
kerem closed this issue 2026-02-28 14:25:54 +03:00
Author
Owner

@devgianlu commented on GitHub (Dec 7, 2025):

The docker compose you are using is for PulseAudio, not ALSA.

For ALSA you should be adding /dev/snd:/dev/snd as a volume.

<!-- gh-comment-id:3621907418 --> @devgianlu commented on GitHub (Dec 7, 2025): The docker compose you are using is for PulseAudio, not ALSA. For ALSA you should be adding `/dev/snd:/dev/snd` as a volume.
Author
Owner

@benoitdr commented on GitHub (Dec 7, 2025):

But I'm using pulseaudio.
If I get it correctly, the problem is that the docker container does not see it and fallbacks on alsa (the issue title may be misleading, sorry about that).

Additional info :

pactl info
Server String: /run/user/1000/pulse/native
Library Protocol Version: 32
Server Protocol Version: 32
Is Local: yes
Client Index: 28
Tile Size: 65472
User Name: atomicpi
Host Name: atomicpi
Server Name: pulseaudio
Server Version: 11.1
Default Sample Specification: s16le 2ch 48000Hz
Default Channel Map: front-left,front-right
Default Sink: alsa_output.hw_Device_0
Default Source: bluez_source.A8_CC_6F_0E_6B_2A.a2dp_source
Cookie: d484:4dc4

<!-- gh-comment-id:3621994306 --> @benoitdr commented on GitHub (Dec 7, 2025): But I'm using pulseaudio. If I get it correctly, the problem is that the docker container does not see it and fallbacks on alsa (the issue title may be misleading, sorry about that). Additional info : ``` pactl info Server String: /run/user/1000/pulse/native Library Protocol Version: 32 Server Protocol Version: 32 Is Local: yes Client Index: 28 Tile Size: 65472 User Name: atomicpi Host Name: atomicpi Server Name: pulseaudio Server Version: 11.1 Default Sample Specification: s16le 2ch 48000Hz Default Channel Map: front-left,front-right Default Sink: alsa_output.hw_Device_0 Default Source: bluez_source.A8_CC_6F_0E_6B_2A.a2dp_source Cookie: d484:4dc4 ```
Author
Owner

@devgianlu commented on GitHub (Dec 7, 2025):

What's your config file like? You have to specify the correct audio_backend.

<!-- gh-comment-id:3621995352 --> @devgianlu commented on GitHub (Dec 7, 2025): What's your config file like? You have to specify the correct `audio_backend`.
Author
Owner

@benoitdr commented on GitHub (Dec 7, 2025):

ok, I've set the audio backend in the config to pulseaudio.

cat ~/.config/go-librespot/config.yml 
audio_backend: pulseaudio

Now I get a different error :

go-librespot-daemon-1  | time="2025-12-07T13:46:54Z" level=warning msg="failed handling dealer request" error="failed loading current track (transfer): failed creating stream for spotify:track:5daevfaISYmRr2rp1rvB4a: failed retrieving audio key: failed retrieving aes key with code 1"
<!-- gh-comment-id:3622100222 --> @benoitdr commented on GitHub (Dec 7, 2025): ok, I've set the audio backend in the config to pulseaudio. ``` cat ~/.config/go-librespot/config.yml audio_backend: pulseaudio ``` Now I get a different error : ``` go-librespot-daemon-1 | time="2025-12-07T13:46:54Z" level=warning msg="failed handling dealer request" error="failed loading current track (transfer): failed creating stream for spotify:track:5daevfaISYmRr2rp1rvB4a: failed retrieving audio key: failed retrieving aes key with code 1" ```
Author
Owner

@guidcruncher commented on GitHub (Dec 7, 2025):

ive got a fully working Alpine based container running Pipewire (emulates pulseaudio) Snapcast and golibrespot that I wrote for another project, I am working on, i can tidy it up and share here if you want?

JC

<!-- gh-comment-id:3622139014 --> @guidcruncher commented on GitHub (Dec 7, 2025): ive got a fully working Alpine based container running Pipewire (emulates pulseaudio) Snapcast and golibrespot that I wrote for another project, I am working on, i can tidy it up and share here if you want? JC
Author
Owner

@devgianlu commented on GitHub (Dec 7, 2025):

Now I get a different error :

go-librespot-daemon-1  | time="2025-12-07T13:46:54Z" level=warning msg="failed handling dealer request" error="failed loading current track (transfer): failed creating stream for spotify:track:5daevfaISYmRr2rp1rvB4a: failed retrieving audio key: failed retrieving aes key with code 1"

That issue has been fixed, I've published version 0.6.0, that should work.

<!-- gh-comment-id:3622705540 --> @devgianlu commented on GitHub (Dec 7, 2025): > Now I get a different error : > > ``` > go-librespot-daemon-1 | time="2025-12-07T13:46:54Z" level=warning msg="failed handling dealer request" error="failed loading current track (transfer): failed creating stream for spotify:track:5daevfaISYmRr2rp1rvB4a: failed retrieving audio key: failed retrieving aes key with code 1" > ``` That issue has been fixed, I've published version 0.6.0, that should work.
Author
Owner

@benoitdr commented on GitHub (Dec 7, 2025):

Confirmed, working with 0.6.0
Thanks

<!-- gh-comment-id:3623217270 --> @benoitdr commented on GitHub (Dec 7, 2025): Confirmed, working with 0.6.0 Thanks
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#162
No description provided.