[GH-ISSUE #284] Playback fails when using pipe backend #172

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

Originally created by @xterm91 on GitHub (Jan 22, 2026).
Original GitHub issue: https://github.com/devgianlu/go-librespot/issues/284

Description

The session terminates shortly (3 seconds-ish) after starting when attempting to use the pipe audio backend.

Context

I'm attempting to run go-librespot in a Home Assistant add-on on a Raspberry Pi 4. The output is destined for a snapcast-server. The error does not occur if I route the audio to a dummy output. I've tried building from source and copying the prebuilt binary from the latest docker image.

Logs

The logs don't show any specific errors but I included logs showing that the session starts, chunks are fetched.

time="2026-01-22T11:27:27-07:00" level=debug msg="skipping packet PacketTypeMercuryEvent, len: 323"
time="2026-01-22T11:27:27-07:00" level=debug msg="selected format OGG_VORBIS_160 (c14d00e18fa85136f8c49ea6f3170848e2f7b4ea)" uri="spotify:track:1dHW6MypbqYUzRXAItBQ07"
time="2026-01-22T11:27:27-07:00" level=debug msg="requested aes key for file c14d00e18fa85136f8c49ea6f3170848e2f7b4ea, gid: 1dHW6MypbqYUzRXAItBQ07"
time="2026-01-22T11:27:27-07:00" level=trace msg="found 2 cdn urls" uri="spotify:track:1dHW6MypbqYUzRXAItBQ07"
time="2026-01-22T11:27:27-07:00" level=debug msg="fetched first chunk of 8, total size is 4158564 bytes" uri="spotify:track:1dHW6MypbqYUzRXAItBQ07"
time="2026-01-22T11:27:27-07:00" level=debug msg="fetched chunk 2/7, size: 524288" uri="spotify:track:1dHW6MypbqYUzRXAItBQ07"
time="2026-01-22T11:27:27-07:00" level=debug msg="fetched chunk 1/7, size: 524288" uri="spotify:track:1dHW6MypbqYUzRXAItBQ07"
time="2026-01-22T11:27:27-07:00" level=debug msg="fetched chunk 3/7, size: 524288" uri="spotify:track:1dHW6MypbqYUzRXAItBQ07"
time="2026-01-22T11:27:27-07:00" level=debug msg="fetched chunk 7/7, size: 488548" uri="spotify:track:1dHW6MypbqYUzRXAItBQ07"
time="2026-01-22T11:27:27-07:00" level=trace msg="seek to 198620ms (diff: 198462ms, samples: 8759142, bytes: 4145735)" uri="spotify:track:1dHW6MypbqYUzRXAItBQ07"
time="2026-01-22T11:27:56-07:00" level=trace msg="sent dealer ping"
time="2026-01-22T11:28:26-07:00" level=trace msg="sent dealer ping"
time="2026-01-22T11:28:56-07:00" level=error msg="did not receive last pong from dealer, 60s passed"
time="2026-01-22T11:29:26-07:00" level=trace msg="received accesspoint ping"
time="2026-01-22T11:29:26-07:00" level=trace msg="received accesspoint pong ack"
time="2026-01-22T11:29:26-07:00" level=error msg="did not receive last pong from dealer, 90s passed"
time="2026-01-22T11:29:56-07:00" level=error msg="did not receive last pong from dealer, 120s passed"

Config

log_level: trace
audio_backend: pipe
audio_output_pipe: /var/run/snapfifo
Originally created by @xterm91 on GitHub (Jan 22, 2026). Original GitHub issue: https://github.com/devgianlu/go-librespot/issues/284 # Description The session terminates shortly (3 seconds-ish) after starting when attempting to use the pipe audio backend. # Context I'm attempting to run go-librespot in a Home Assistant add-on on a Raspberry Pi 4. The output is destined for a snapcast-server. The error does not occur if I route the audio to a dummy output. I've tried building from source and copying the prebuilt binary from the latest docker image. # Logs The logs don't show any specific errors but I included logs showing that the session starts, chunks are fetched. ``` time="2026-01-22T11:27:27-07:00" level=debug msg="skipping packet PacketTypeMercuryEvent, len: 323" time="2026-01-22T11:27:27-07:00" level=debug msg="selected format OGG_VORBIS_160 (c14d00e18fa85136f8c49ea6f3170848e2f7b4ea)" uri="spotify:track:1dHW6MypbqYUzRXAItBQ07" time="2026-01-22T11:27:27-07:00" level=debug msg="requested aes key for file c14d00e18fa85136f8c49ea6f3170848e2f7b4ea, gid: 1dHW6MypbqYUzRXAItBQ07" time="2026-01-22T11:27:27-07:00" level=trace msg="found 2 cdn urls" uri="spotify:track:1dHW6MypbqYUzRXAItBQ07" time="2026-01-22T11:27:27-07:00" level=debug msg="fetched first chunk of 8, total size is 4158564 bytes" uri="spotify:track:1dHW6MypbqYUzRXAItBQ07" time="2026-01-22T11:27:27-07:00" level=debug msg="fetched chunk 2/7, size: 524288" uri="spotify:track:1dHW6MypbqYUzRXAItBQ07" time="2026-01-22T11:27:27-07:00" level=debug msg="fetched chunk 1/7, size: 524288" uri="spotify:track:1dHW6MypbqYUzRXAItBQ07" time="2026-01-22T11:27:27-07:00" level=debug msg="fetched chunk 3/7, size: 524288" uri="spotify:track:1dHW6MypbqYUzRXAItBQ07" time="2026-01-22T11:27:27-07:00" level=debug msg="fetched chunk 7/7, size: 488548" uri="spotify:track:1dHW6MypbqYUzRXAItBQ07" time="2026-01-22T11:27:27-07:00" level=trace msg="seek to 198620ms (diff: 198462ms, samples: 8759142, bytes: 4145735)" uri="spotify:track:1dHW6MypbqYUzRXAItBQ07" time="2026-01-22T11:27:56-07:00" level=trace msg="sent dealer ping" time="2026-01-22T11:28:26-07:00" level=trace msg="sent dealer ping" time="2026-01-22T11:28:56-07:00" level=error msg="did not receive last pong from dealer, 60s passed" time="2026-01-22T11:29:26-07:00" level=trace msg="received accesspoint ping" time="2026-01-22T11:29:26-07:00" level=trace msg="received accesspoint pong ack" time="2026-01-22T11:29:26-07:00" level=error msg="did not receive last pong from dealer, 90s passed" time="2026-01-22T11:29:56-07:00" level=error msg="did not receive last pong from dealer, 120s passed" ``` # Config ``` log_level: trace audio_backend: pipe audio_output_pipe: /var/run/snapfifo ```
kerem 2026-02-28 14:25:59 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@devgianlu commented on GitHub (Jan 23, 2026):

The program is most likely hanging because it is trying to open a FIFO that has no readers. I have updated the FIFO code so that it fails if there are no readers: https://github.com/devgianlu/go-librespot/pull/285

Can you confirm this was the issue?

<!-- gh-comment-id:3791598788 --> @devgianlu commented on GitHub (Jan 23, 2026): The program is most likely hanging because it is trying to open a FIFO that has no readers. I have updated the FIFO code so that it fails if there are no readers: https://github.com/devgianlu/go-librespot/pull/285 Can you confirm this was the issue?
Author
Owner

@xterm91 commented on GitHub (Jan 23, 2026):

Resolved

Fetching chunks gets blocked if there is no pipe reader. Not an issue with go-librespot.

<!-- gh-comment-id:3792908733 --> @xterm91 commented on GitHub (Jan 23, 2026): # Resolved Fetching chunks gets blocked if there is no pipe reader. Not an issue with go-librespot.
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#172
No description provided.