[GH-ISSUE #1199] Librespot with pulseaudio setup #553

Closed
opened 2026-02-27 19:31:15 +03:00 by kerem · 2 comments
Owner

Originally created by @SummerSeaSun on GitHub (Aug 30, 2023).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/1199

To reproduce
Steps to reproduce the behavior:

  1. check available audio devices:
    librespot --backend pulseaudio --device ?
[2023-08-30T08:33:56Z INFO  librespot] librespot 0.4.2 a6e1258 (Built on 2023-06-21, Build ID: zuwVQKTQ, Profile: release)
[2023-08-30T08:33:56Z INFO  librespot_playback::audio_backend::pulseaudio] Using PulseAudioSink with format: S16, sample rate: 44100

  1. start librespot with selected device:
    librespot ---verbose -backend pulseaudio --device PulseAudioSink

  2. connect from open.spotify trow this error:
    2023-08-30T08:38:31Z ERROR librespot_playback::player] Audio Sink Error Connection Refused: <PulseAudioSink> Connection refused

Log
A full log so we may trace your problem (launch librespot with --verbose). Format the log as code.


 [2023-08-30T08:48:06Z DEBUG librespot_connect::spirc] kMessageTypeNotify "Web Player (Chrome)" a8315c5c2bc2f578b56dececbf8ee0693afa3573 116817>
 [2023-08-30T08:48:06Z DEBUG librespot_core::mercury] subscribed uri=hm://remote/user/aaaaaaaaaaaaaaaaaa/ count=0
 [2023-08-30T08:48:06Z INFO  librespot_core::session] Country: "IT"
 [2023-08-30T08:48:06Z DEBUG librespot_core::session] Session[0] strong=3 weak=2
 [2023-08-30T08:48:06Z DEBUG librespot_playback::player] command=VolumeSet(62139)
 [2023-08-30T08:48:06Z DEBUG librespot_playback::player] command=AddEventSender
 [2023-08-30T08:48:06Z DEBUG librespot_playback::normaliser] Normalisation Release: 100 ms
 [2023-08-30T08:48:06Z DEBUG librespot_playback::mixer::mappings] Input volume 62139 mapped to: 69.91%
 [2023-08-30T08:48:06Z DEBUG librespot_playback::normaliser] Normalisation Attack: 5 ms
 [2023-08-30T08:48:06Z DEBUG librespot_playback::normaliser] Normalisation Method: Dynamic
 [2023-08-30T08:48:06Z DEBUG librespot_playback::normaliser] Normalisation Threshold: -2.0 dBFS
 [2023-08-30T08:48:06Z DEBUG librespot_playback::normaliser] Normalisation Pregain: 0.0 dB
 [2023-08-30T08:48:06Z DEBUG librespot_playback::normaliser] Normalisation Type: Auto
 [2023-08-30T08:48:06Z DEBUG librespot_playback::resampler] No <ResampleWorker> threads required
 [2023-08-30T08:48:06Z DEBUG librespot_playback::resampler] Interpolation Type: Bypass
 [2023-08-30T08:48:06Z DEBUG librespot_playback::resampler] Sample Rate: 44.1kHz
 [2023-08-30T08:48:06Z INFO  librespot_playback::audio_backend::pulseaudio] Using PulseAudioSink with format: S32, sample rate: 44100
 [2023-08-30T08:48:06Z DEBUG librespot::component] new MercuryManager
 [2023-08-30T08:48:06Z DEBUG librespot_connect::spirc] canonical_username: aaaaaaaaaaaaaaaaaaaaaa
 [2023-08-30T08:48:06Z DEBUG librespot_connect::spirc] new Spirc[0]
 [2023-08-30T08:48:06Z DEBUG librespot_playback::player] Created <PlayerInternal> [player:0] thread
 [2023-08-30T08:48:06Z INFO  librespot_playback::mixer::softmixer] Mixing with softvol and volume control: Log(60.0)
 [2023-08-30T08:48:06Z DEBUG librespot_core::session] new Session[0]
 [2023-08-30T08:48:06Z INFO  librespot_core::session] Authenticated as "asaaaaaaaaaaaaa" !
 [2023-08-30T08:48:05Z INFO  librespot_core::session] Connecting to AP "ap-guc3.spotify.com:4070"
 [2023-08-30T08:48:05Z WARN  librespot_core::apresolve] Ignoring blacklisted access point ap-gue1.spotify.com:80
 [2023-08-30T08:48:05Z WARN  librespot_core::apresolve] Ignoring blacklisted access point ap-gew4.spotify.com:80
 [2023-08-30T08:48:05Z WARN  librespot_core::apresolve] Ignoring blacklisted access point ap-gew4.spotify.com:443
 [2023-08-30T08:48:05Z WARN  librespot_core::apresolve] Ignoring blacklisted access point ap-gew4.spotify.com:4070
 [2023-08-30T08:48:05Z DEBUG librespot_discovery::server] Shutting down discovery server
 [2023-08-30T08:48:05Z DEBUG librespot_discovery::server] Zeroconf server listening on 0.0.0.0:45065
 [2023-08-30T08:48:05Z TRACE librespot]                 LIBRESPOT_DEVICE="127.0.0.1"
 [2023-08-30T08:48:05Z TRACE librespot]                 LIBRESPOT_PASSWORD="XXXXXXXX"
 [2023-08-30T08:48:05Z TRACE librespot]                 LIBRESPOT_USERNAME="XXXXXXXX"
 [2023-08-30T08:48:05Z TRACE librespot]                 LIBRESPOT_DEVICE_TYPE="avr"
 [2023-08-30T08:48:05Z TRACE librespot]                 LIBRESPOT_FORMAT="S32"
 [2023-08-30T08:48:05Z TRACE librespot]                 LIBRESPOT_BITRATE="320"
 [2023-08-30T08:48:05Z TRACE librespot]                 LIBRESPOT_VERBOSE="on"
 [2023-08-30T08:48:05Z TRACE librespot]                 LIBRESPOT_ENABLE_VOLUME_NORMALISATION="on"
 [2023-08-30T08:48:05Z TRACE librespot]                 LIBRESPOT_DISABLE_CREDENTIAL_CACHE="off"
 [2023-08-30T08:48:05Z TRACE librespot]                 LIBRESPOT_DISABLE_AUDIO_CACHE="on"

Host (what you are running librespot on):

  • OS: raspbian
  • Platform: RPi 4

Additional context
I've followed this for mpd https://askubuntu.com/questions/555103/mpd-with-pulseaudio and that works fine. If I use alsa instead librespot works fine.

Originally created by @SummerSeaSun on GitHub (Aug 30, 2023). Original GitHub issue: https://github.com/librespot-org/librespot/issues/1199 **To reproduce** Steps to reproduce the behavior: 1. check available audio devices: `librespot --backend pulseaudio --device ?` ``` [2023-08-30T08:33:56Z INFO librespot] librespot 0.4.2 a6e1258 (Built on 2023-06-21, Build ID: zuwVQKTQ, Profile: release) [2023-08-30T08:33:56Z INFO librespot_playback::audio_backend::pulseaudio] Using PulseAudioSink with format: S16, sample rate: 44100 ``` 2. start librespot with selected device: `librespot ---verbose -backend pulseaudio --device PulseAudioSink` 3. connect from open.spotify trow this error: `2023-08-30T08:38:31Z ERROR librespot_playback::player] Audio Sink Error Connection Refused: <PulseAudioSink> Connection refused` **Log** A full log so we may trace your problem (launch `librespot` with `--verbose`). Format the log as code. ``` [2023-08-30T08:48:06Z DEBUG librespot_connect::spirc] kMessageTypeNotify "Web Player (Chrome)" a8315c5c2bc2f578b56dececbf8ee0693afa3573 116817> [2023-08-30T08:48:06Z DEBUG librespot_core::mercury] subscribed uri=hm://remote/user/aaaaaaaaaaaaaaaaaa/ count=0 [2023-08-30T08:48:06Z INFO librespot_core::session] Country: "IT" [2023-08-30T08:48:06Z DEBUG librespot_core::session] Session[0] strong=3 weak=2 [2023-08-30T08:48:06Z DEBUG librespot_playback::player] command=VolumeSet(62139) [2023-08-30T08:48:06Z DEBUG librespot_playback::player] command=AddEventSender [2023-08-30T08:48:06Z DEBUG librespot_playback::normaliser] Normalisation Release: 100 ms [2023-08-30T08:48:06Z DEBUG librespot_playback::mixer::mappings] Input volume 62139 mapped to: 69.91% [2023-08-30T08:48:06Z DEBUG librespot_playback::normaliser] Normalisation Attack: 5 ms [2023-08-30T08:48:06Z DEBUG librespot_playback::normaliser] Normalisation Method: Dynamic [2023-08-30T08:48:06Z DEBUG librespot_playback::normaliser] Normalisation Threshold: -2.0 dBFS [2023-08-30T08:48:06Z DEBUG librespot_playback::normaliser] Normalisation Pregain: 0.0 dB [2023-08-30T08:48:06Z DEBUG librespot_playback::normaliser] Normalisation Type: Auto [2023-08-30T08:48:06Z DEBUG librespot_playback::resampler] No <ResampleWorker> threads required [2023-08-30T08:48:06Z DEBUG librespot_playback::resampler] Interpolation Type: Bypass [2023-08-30T08:48:06Z DEBUG librespot_playback::resampler] Sample Rate: 44.1kHz [2023-08-30T08:48:06Z INFO librespot_playback::audio_backend::pulseaudio] Using PulseAudioSink with format: S32, sample rate: 44100 [2023-08-30T08:48:06Z DEBUG librespot::component] new MercuryManager [2023-08-30T08:48:06Z DEBUG librespot_connect::spirc] canonical_username: aaaaaaaaaaaaaaaaaaaaaa [2023-08-30T08:48:06Z DEBUG librespot_connect::spirc] new Spirc[0] [2023-08-30T08:48:06Z DEBUG librespot_playback::player] Created <PlayerInternal> [player:0] thread [2023-08-30T08:48:06Z INFO librespot_playback::mixer::softmixer] Mixing with softvol and volume control: Log(60.0) [2023-08-30T08:48:06Z DEBUG librespot_core::session] new Session[0] [2023-08-30T08:48:06Z INFO librespot_core::session] Authenticated as "asaaaaaaaaaaaaa" ! [2023-08-30T08:48:05Z INFO librespot_core::session] Connecting to AP "ap-guc3.spotify.com:4070" [2023-08-30T08:48:05Z WARN librespot_core::apresolve] Ignoring blacklisted access point ap-gue1.spotify.com:80 [2023-08-30T08:48:05Z WARN librespot_core::apresolve] Ignoring blacklisted access point ap-gew4.spotify.com:80 [2023-08-30T08:48:05Z WARN librespot_core::apresolve] Ignoring blacklisted access point ap-gew4.spotify.com:443 [2023-08-30T08:48:05Z WARN librespot_core::apresolve] Ignoring blacklisted access point ap-gew4.spotify.com:4070 [2023-08-30T08:48:05Z DEBUG librespot_discovery::server] Shutting down discovery server [2023-08-30T08:48:05Z DEBUG librespot_discovery::server] Zeroconf server listening on 0.0.0.0:45065 [2023-08-30T08:48:05Z TRACE librespot] LIBRESPOT_DEVICE="127.0.0.1" [2023-08-30T08:48:05Z TRACE librespot] LIBRESPOT_PASSWORD="XXXXXXXX" [2023-08-30T08:48:05Z TRACE librespot] LIBRESPOT_USERNAME="XXXXXXXX" [2023-08-30T08:48:05Z TRACE librespot] LIBRESPOT_DEVICE_TYPE="avr" [2023-08-30T08:48:05Z TRACE librespot] LIBRESPOT_FORMAT="S32" [2023-08-30T08:48:05Z TRACE librespot] LIBRESPOT_BITRATE="320" [2023-08-30T08:48:05Z TRACE librespot] LIBRESPOT_VERBOSE="on" [2023-08-30T08:48:05Z TRACE librespot] LIBRESPOT_ENABLE_VOLUME_NORMALISATION="on" [2023-08-30T08:48:05Z TRACE librespot] LIBRESPOT_DISABLE_CREDENTIAL_CACHE="off" [2023-08-30T08:48:05Z TRACE librespot] LIBRESPOT_DISABLE_AUDIO_CACHE="on" ``` **Host (what you are running `librespot` on):** - OS: raspbian - Platform: RPi 4 **Additional context** I've followed this for mpd https://askubuntu.com/questions/555103/mpd-with-pulseaudio and that works fine. If I use alsa instead librespot works fine.
kerem 2026-02-27 19:31:15 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@kingosticks commented on GitHub (Aug 30, 2023):

That doesn't look like a full log, it doesn't even contain your error message.

Considering the link you posted, why not try running
PULSE_SERVER=127.0.0.1 librespot ---verbose --backend pulseaudio

<!-- gh-comment-id:1698812904 --> @kingosticks commented on GitHub (Aug 30, 2023): That doesn't look like a full log, it doesn't even contain your error message. Considering the link you posted, why not try running ```PULSE_SERVER=127.0.0.1 librespot ---verbose --backend pulseaudio```
Author
Owner

@roderickvd commented on GitHub (Nov 14, 2023):

No response, closing.

<!-- gh-comment-id:1811181758 --> @roderickvd commented on GitHub (Nov 14, 2023): No response, closing.
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/librespot#553
No description provided.