[GH-ISSUE #256] audio_backend configuration setting is ignored - always defaults to ALSA #158

Closed
opened 2026-02-28 14:25:53 +03:00 by kerem · 1 comment
Owner

Originally created by @phil-wittwer on GitHub (Nov 14, 2025).
Original GitHub issue: https://github.com/devgianlu/go-librespot/issues/256

Summary

The audio_backend configuration option in config.yml is being completely ignored. Despite explicitly setting audio_backend: pipe, go-librespot always attempts to use ALSA, causing failures in Docker environments without sound cards.

Environment

  • Version: v0.5.3 (also tested with latest/dev)
  • Platform: Docker (ghcr.io/devgianlu/go-librespot:v0.5.3)
  • Host OS: Linux 5.15.0-151-generic

Configuration

config.yml:

device_name: 'MyDevice'
device_type: computer
audio_backend: pipe                    # Explicitly set to pipe
audio_output_pipe: /Music/spotify
audio_output_pipe_format: s16le
bitrate: 320

Expected Behavior

go-librespot should use the pipe audio backend and write audio data to /Music/spotify FIFO.

Actual Behavior

go-librespot ignores the audio_backend: pipe setting and attempts to use ALSA instead, resulting in errors:

ALSA lib confmisc.c:855:(parse_card) cannot find card '0'
ALSA lib pcm.c:2721:(snd_pcm_open_noupdate) Unknown PCM default
time="2025-11-14T12:51:01Z" level=warning msg="failed handling dealer request" error="failed loading current track (transfer): failed setting stream for spotify:track:...: ALSA error at snd_pcm_open: No such file or directory"

Reproduction Steps

1. Create a Docker container with go-librespot v0.5.3
2. Configure config.yml with audio_backend: pipe and a valid audio_output_pipe path
3. Create the FIFO: mkfifo /Music/spotify
4. Start go-librespot
5. Attempt to play music via Spotify Connect
6. Observe ALSA errors in logs despite pipe backend being configured

Verification

- ✅ Config file confirmed to contain audio_backend: pipe
- ✅ FIFO exists and is accessible (prw-rw-rw- /Music/spotify)
- ✅ Config is properly mounted in container
- ❌ go-librespot still attempts ALSA initialization

Additional Context

According to config_schema.json, the default value for audio_backend is "alsa". It appears go-librespot is using this default value instead of reading the configured value from config.yml.

Versions Tested

- v0.3.2: Different issue ("no supported formats")
- v0.5.3: Ignores audio_backend configuration
- latest/dev: Ignores audio_backend configuration

The issue persists across multiple versions, suggesting the configuration parsing or backend initialization logic may not be properly reading or respecting this field.
Originally created by @phil-wittwer on GitHub (Nov 14, 2025). Original GitHub issue: https://github.com/devgianlu/go-librespot/issues/256 ### Summary The `audio_backend` configuration option in `config.yml` is being completely ignored. Despite explicitly setting `audio_backend: pipe`, go-librespot always attempts to use ALSA, causing failures in Docker environments without sound cards. ### Environment - **Version:** v0.5.3 (also tested with latest/dev) - **Platform:** Docker (ghcr.io/devgianlu/go-librespot:v0.5.3) - **Host OS:** Linux 5.15.0-151-generic ### Configuration `config.yml`: ```yaml device_name: 'MyDevice' device_type: computer audio_backend: pipe # Explicitly set to pipe audio_output_pipe: /Music/spotify audio_output_pipe_format: s16le bitrate: 320 Expected Behavior go-librespot should use the pipe audio backend and write audio data to /Music/spotify FIFO. Actual Behavior go-librespot ignores the audio_backend: pipe setting and attempts to use ALSA instead, resulting in errors: ALSA lib confmisc.c:855:(parse_card) cannot find card '0' ALSA lib pcm.c:2721:(snd_pcm_open_noupdate) Unknown PCM default time="2025-11-14T12:51:01Z" level=warning msg="failed handling dealer request" error="failed loading current track (transfer): failed setting stream for spotify:track:...: ALSA error at snd_pcm_open: No such file or directory" Reproduction Steps 1. Create a Docker container with go-librespot v0.5.3 2. Configure config.yml with audio_backend: pipe and a valid audio_output_pipe path 3. Create the FIFO: mkfifo /Music/spotify 4. Start go-librespot 5. Attempt to play music via Spotify Connect 6. Observe ALSA errors in logs despite pipe backend being configured Verification - ✅ Config file confirmed to contain audio_backend: pipe - ✅ FIFO exists and is accessible (prw-rw-rw- /Music/spotify) - ✅ Config is properly mounted in container - ❌ go-librespot still attempts ALSA initialization Additional Context According to config_schema.json, the default value for audio_backend is "alsa". It appears go-librespot is using this default value instead of reading the configured value from config.yml. Versions Tested - v0.3.2: Different issue ("no supported formats") - v0.5.3: Ignores audio_backend configuration - latest/dev: Ignores audio_backend configuration The issue persists across multiple versions, suggesting the configuration parsing or backend initialization logic may not be properly reading or respecting this field.
kerem closed this issue 2026-02-28 14:25:53 +03:00
Author
Owner

@phil-wittwer commented on GitHub (Nov 14, 2025):

Issue was with configuration file path, resolved

<!-- gh-comment-id:3532879810 --> @phil-wittwer commented on GitHub (Nov 14, 2025): Issue was with configuration file path, resolved
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#158
No description provided.