Skip to content

Audio Sink Error Connection Refused: <PulseAudioSink> Connection refused #160

@tosiara

Description

@tosiara

I made standalone librespot working by running this command:

LIBRESPOT_DEVICE="HDA Intel PCH" librespot -n "Librespot Speaker" -b 160 --zeroconf-interface 192.168.50.103

It works and plays fine.

Now I'm trying to make librespot-docker working, but it is unable to reach Pulseaudio:

Current user id is [0]
BACKEND=[pulseaudio]
Backend is [pulseaudio], user mode is enforced
User mode with PUID=[1000] PGID=[1000] AUDIO_GID=[]
Ensuring user with uid:[1000] gid:[1000] exists ...
Group with gid [1000] does not exist, creating...
Group [librespot-group] with gid [1000] created.
User with uid [1000] does not exist, creating...
User [librespot-user] with uid [1000] created.
Home directory [/home/librespot-user] not found, creating.
. done.
Setting ownership of [/home/librespot-user] to [librespot-user:librespot-group] ...
Done.
WARNING: AUDIO_GID is mandatory for user mode and alsa backend
WARNING: Ignore the previous warning if you set PGID to the audio group
Setting ownership of volumes to [librespot-user:librespot-group] ...
Done.
cat /app/assets/pulse-client-template.conf
# Connect to the host's server using the mounted UNIX socket
default-server = unix:/run/user/PUID/pulse/native

# Prevent a server running in the container
autospawn = no
daemon-binary = /bin/true

# Prevent the use of shared memory
enable-shm = false
Creating pulseaudio configuration file /etc/pulse/client.conf...
# Connect to the host's server using the mounted UNIX socket
default-server = unix:/run/user/1000/pulse/native

# Prevent a server running in the container
autospawn = no
daemon-binary = /bin/true

# Prevent the use of shared memory
enable-shm = false
Discovery is enabled.
Using zeroconf interfaces [192.168.50.103}]
Using zeroconf backend [libmdns]
Additional arguments have not been specified.
Command Line: [/usr/bin/librespot --backend pulseaudio --bitrate 320 --name 'librespot-pulse' --zeroconf-interface 192.168.50.103 --zeroconf-backend libmdns]
Running in user mode ...
[2026-03-18T17:36:00Z INFO  librespot] librespot 0.8.0 d36f9f1 (Built on 2025-12-12, Build ID: l9W4ATWG, Profile: release)
[2026-03-18T17:36:00Z INFO  librespot_playback::mixer::softmixer] Mixing with softvol and volume control: Log(60.0)
[2026-03-18T17:36:00Z INFO  librespot_playback::convert] Converting with ditherer: tpdf
[2026-03-18T17:36:00Z INFO  librespot_playback::audio_backend::pulseaudio] Using PulseAudioSink with format: S16
[2026-03-18T17:36:05Z INFO  librespot_core::session] Connecting to AP "ap-gew1.spotify.com:4070"
[2026-03-18T17:36:05Z INFO  librespot_core::session] Authenticated as 'xxxxxxx' !
[2026-03-18T17:36:05Z INFO  librespot_core::session] Country: "LT"
[2026-03-18T17:36:05Z INFO  librespot_core::spclient] Resolved "gew1-spclient.spotify.com:443" as spclient access point
[2026-03-18T17:36:05Z INFO  librespot_connect::spirc] active device is <> with session <xxxxxx>
[2026-03-18T17:36:05Z WARN  librespot_connect::state::context] couldn't load context info because: context is not available. type: Default
[2026-03-18T17:36:05Z INFO  librespot_playback::player] Loading <Baby Can I Hold You - Live in Modena, 2000> with Spotify URI <spotify:track:4wlUeKXi9sNX2HDshFHllS>
[2026-03-18T17:36:06Z INFO  librespot_playback::player] <Baby Can I Hold You - Live in Modena, 2000> (202706 ms) loaded
[2026-03-18T17:36:09Z ERROR librespot_playback::player] Audio Sink Error Connection Refused: <PulseAudioSink> Connection refused

The command I'm using is:

docker run \
    -ti \
    --rm \
    -e PUID=1000 \
    -e PGID=1000 \
    --network host \
    -e BACKEND=pulseaudio \
    -e BITRATE=320 \
    -e DEVICE_NAME=librespot-pulse \
    -e ZEROCONF_INTERFACE=192.168.50.103 \
    -v /run/user/1101/pulse:/run/user/1000/pulse \
    --name librespot-pulse \
    giof71/librespot:latest

User id:

$ id -u
1101

Any hints what else to try? 🙏

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions