[GH-ISSUE #78] Crashes on Raspi 3 using pulseaudio #68

Closed
opened 2026-02-27 19:28:38 +03:00 by kerem · 6 comments
Owner

Originally created by @sashahilton00 on GitHub (Jan 29, 2018).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/78

Issue by Bebowi
Monday Aug 21, 2017 at 01:56 GMT
Originally opened as https://github.com/plietar/librespot/issues/235


I'm using Raspbian Jessie Release 8.0

When i'm trying to start librespot on my Raspberry Pi 3 using PulseAudio backend

RUST_BACKTRACE=1 ~/librespot/target/release/librespot --username my@email --cache /tmp/librespot --name Libre -p MySuperStrongPassword -b 320 --backend pulseaudio

it crashes with following message:

INFO:librespot_core::session: Connecting to AP "gew1-accesspoint-c-h1c1.ap.spotify.com:4070"
INFO:librespot_core::session: Authenticated as "1157689638" !
INFO:librespot_core::session: Country: "DE"
thread '<unnamed>' panicked at 'assertion failed: s != null_mut()', src/audio_backend/pulseaudio.rs:39
stack backtrace:
   0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
             at /checkout/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::_print
             at /checkout/src/libstd/sys_common/backtrace.rs:71
   2: std::panicking::default_hook::{{closure}}
             at /checkout/src/libstd/sys_common/backtrace.rs:60
             at /checkout/src/libstd/panicking.rs:355
   3: std::panicking::default_hook
             at /checkout/src/libstd/panicking.rs:371
   4: std::panicking::rust_panic_with_hook
             at /checkout/src/libstd/panicking.rs:549
   5: std::panicking::begin_panic
   6: <librespot::audio_backend::pulseaudio::PulseAudioSink as librespot::audio_backend::Open>::open
   7: librespot::audio_backend::mk_sink
   8: std::panicking::try::do_call
   9: __rust_maybe_catch_panic
             at /checkout/src/libpanic_unwind/lib.rs:98
  10: <F as alloc::boxed::FnBox<A>>::call_box
  11: std::sys::imp::thread::Thread::new::thread_start
             at /checkout/src/liballoc/boxed.rs:650
             at /checkout/src/libstd/sys_common/thread.rs:21
             at /checkout/src/libstd/sys/unix/thread.rs:84 

It works fine on my ubuntu VM, so I thought it is caused by the version of Pulseaudio. After an Update to Pulseaudio 10.0 the same issue occours.

I want to use Pulseaudio for several reasons:

  1. With Portaudio write underflow occours from time to time
  2. I want to do some further work in network

Any Ideas what is wrong on my Raspberry?

Originally created by @sashahilton00 on GitHub (Jan 29, 2018). Original GitHub issue: https://github.com/librespot-org/librespot/issues/78 <a href="https://github.com/Bebowi"><img src="https://avatars3.githubusercontent.com/u/21242387?v=4" align="left" width="96" height="96" hspace="10"></img></a> **Issue by [Bebowi](https://github.com/Bebowi)** _Monday Aug 21, 2017 at 01:56 GMT_ _Originally opened as https://github.com/plietar/librespot/issues/235_ ---- I'm using Raspbian Jessie Release 8.0 When i'm trying to start librespot on my Raspberry Pi 3 using PulseAudio backend ```RUST_BACKTRACE=1 ~/librespot/target/release/librespot --username my@email --cache /tmp/librespot --name Libre -p MySuperStrongPassword -b 320 --backend pulseaudio``` it crashes with following message: ```INFO:librespot: librespot ddfc28f (2017-08-04). Built on 2017-08-19. Build ID: a7jKFVaO INFO:librespot_core::session: Connecting to AP "gew1-accesspoint-c-h1c1.ap.spotify.com:4070" INFO:librespot_core::session: Authenticated as "1157689638" ! INFO:librespot_core::session: Country: "DE" thread '<unnamed>' panicked at 'assertion failed: s != null_mut()', src/audio_backend/pulseaudio.rs:39 stack backtrace: 0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace at /checkout/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49 1: std::sys_common::backtrace::_print at /checkout/src/libstd/sys_common/backtrace.rs:71 2: std::panicking::default_hook::{{closure}} at /checkout/src/libstd/sys_common/backtrace.rs:60 at /checkout/src/libstd/panicking.rs:355 3: std::panicking::default_hook at /checkout/src/libstd/panicking.rs:371 4: std::panicking::rust_panic_with_hook at /checkout/src/libstd/panicking.rs:549 5: std::panicking::begin_panic 6: <librespot::audio_backend::pulseaudio::PulseAudioSink as librespot::audio_backend::Open>::open 7: librespot::audio_backend::mk_sink 8: std::panicking::try::do_call 9: __rust_maybe_catch_panic at /checkout/src/libpanic_unwind/lib.rs:98 10: <F as alloc::boxed::FnBox<A>>::call_box 11: std::sys::imp::thread::Thread::new::thread_start at /checkout/src/liballoc/boxed.rs:650 at /checkout/src/libstd/sys_common/thread.rs:21 at /checkout/src/libstd/sys/unix/thread.rs:84 ``` It works fine on my ubuntu VM, so I thought it is caused by the version of Pulseaudio. After an Update to Pulseaudio 10.0 the same issue occours. I want to use Pulseaudio for several reasons: 1. With Portaudio write underflow occours from time to time 1. I want to do some further work in network Any Ideas what is wrong on my Raspberry?
kerem 2026-02-27 19:28:38 +03:00
Author
Owner

@sashahilton00 commented on GitHub (Jan 29, 2018):

Comment by TurokO8A
Wednesday Aug 23, 2017 at 04:53 GMT


Hi, I've had the same issue for a while on my RPi3, Jessie 8.0 as well. Got a crash on connection from the Spotify client and it seemed to be related to pulseaudio. I deleted my cloned repo folder and re-cloned it with git clone https://github.com/plietar/librespot.git and then rebuilt. That got it running for the first time in a while. However, I still see the same errors involving pulseaudio, so I'm not claiming victory just yet (as it also seems nothing like a permanent solution). So, This is what I got:

ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround40
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround41
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround50
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround51
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround71
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused
ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
INFO:librespot::player: Loading track "Landed On La Luna"
INFO:librespot::player: Track "Landed On La Luna" loaded

I'll update if it crashes again. Good Luck!

<!-- gh-comment-id:361275838 --> @sashahilton00 commented on GitHub (Jan 29, 2018): <a href="https://github.com/TurokO8A"><img src="https://avatars0.githubusercontent.com/u/26705831?v=4" align="left" width="48" height="48" hspace="10"></img></a> **Comment by [TurokO8A](https://github.com/TurokO8A)** _Wednesday Aug 23, 2017 at 04:53 GMT_ ---- Hi, I've had the same issue for a while on my RPi3, Jessie 8.0 as well. Got a crash on connection from the Spotify client and it seemed to be related to pulseaudio. I deleted my cloned repo folder and re-cloned it with `git clone https://github.com/plietar/librespot.git` and then rebuilt. That got it running for the first time in a while. However, I still see the same errors involving pulseaudio, so I'm not claiming victory just yet (as it also seems nothing like a permanent solution). So, This is what I got: ``` ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21 ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21 ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround40 ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround41 ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround50 ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround51 ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround71 ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958 ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958 ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958 ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused Cannot connect to server socket err = No such file or directory Cannot connect to server request channel jack server is not running or cannot be started JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock INFO:librespot::player: Loading track "Landed On La Luna" INFO:librespot::player: Track "Landed On La Luna" loaded ``` I'll update if it crashes again. Good Luck!
Author
Owner

@sashahilton00 commented on GitHub (Jan 29, 2018):

Comment by Bebowi
Friday Aug 25, 2017 at 10:23 GMT


@TurokO8A You don't use pulesaudio as backend. What you are discribing is a normal start using stadard backend (Portaudio).

Any ideas regarding my error?

<!-- gh-comment-id:361275861 --> @sashahilton00 commented on GitHub (Jan 29, 2018): <a href="https://github.com/Bebowi"><img src="https://avatars3.githubusercontent.com/u/21242387?v=4" align="left" width="48" height="48" hspace="10"></img></a> **Comment by [Bebowi](https://github.com/Bebowi)** _Friday Aug 25, 2017 at 10:23 GMT_ ---- @TurokO8A You don't use pulesaudio as backend. What you are discribing is a normal start using stadard backend (Portaudio). Any ideas regarding my error?
Author
Owner

@ComlOnline commented on GitHub (Jan 29, 2018):

@Bebowi do you still have this error?

<!-- gh-comment-id:361338050 --> @ComlOnline commented on GitHub (Jan 29, 2018): @Bebowi do you still have this error?
Author
Owner

@raphaelki commented on GitHub (Mar 5, 2018):

@ComlOnline This looks to me like the user has not been added to the pulse-access group. So
adduser <user> pulse-access should fix this. You only get this error message with the old plietar version.

<!-- gh-comment-id:370350916 --> @raphaelki commented on GitHub (Mar 5, 2018): @ComlOnline This looks to me like the user has not been added to the pulse-access group. So `adduser <user> pulse-access` should fix this. You only get this error message with the old plietar version.
Author
Owner

@raphaelki commented on GitHub (Mar 5, 2018):

But still I've not been successful running the libresport-org version on a similar setup using a Raspberry 3 with Raspbian Stretch Lite and Pulseaudio 10.

./librespot -n Librespot --backend pulseaudio

gives me an error on playback:

INFO:librespot: librespot 8f8eb8c (2018-02-28). Built on 2018-03-05. Build ID: uRvwVXfZ
INFO:librespot_core::session: Connecting to AP "gew1-accesspoint-b-crfz.ap.spotify.com:4070"
INFO:librespot_core::session: Authenticated as "**********" !
INFO:librespot_core::session: Country: "DE"
INFO:librespot_playback::player: Loading track "Held" with Spotify URI "spotify:track:1C5BrGgyUBB0QiZ35c4CsE"
INFO:librespot_playback::player: Track "Held" loaded
ERROR:librespot_playback::player: Could not write audio: Invalid argument

The same setup was working with the plietar code until the recent enum change (#167).

<!-- gh-comment-id:370362932 --> @raphaelki commented on GitHub (Mar 5, 2018): But still I've not been successful running the libresport-org version on a similar setup using a Raspberry 3 with Raspbian Stretch Lite and Pulseaudio 10. `./librespot -n Librespot --backend pulseaudio` gives me an error on playback: ``` INFO:librespot: librespot 8f8eb8c (2018-02-28). Built on 2018-03-05. Build ID: uRvwVXfZ INFO:librespot_core::session: Connecting to AP "gew1-accesspoint-b-crfz.ap.spotify.com:4070" INFO:librespot_core::session: Authenticated as "**********" ! INFO:librespot_core::session: Country: "DE" INFO:librespot_playback::player: Loading track "Held" with Spotify URI "spotify:track:1C5BrGgyUBB0QiZ35c4CsE" INFO:librespot_playback::player: Track "Held" loaded ERROR:librespot_playback::player: Could not write audio: Invalid argument ``` The same setup was working with the [plietar](https://github.com/plietar/librespot) code until the recent enum change (#167).
Author
Owner

@ComlOnline commented on GitHub (Mar 6, 2018):

@raphaki Either way it's been so long I'm going to close this issue anyway. If you built Librespot using cargo build --release it will only include the PortAudio backend. Try rebuilding using this cargo build --release --no-default-features --features pulseaudio-backend. If you still get a problem please open a new issue.

<!-- gh-comment-id:370758248 --> @ComlOnline commented on GitHub (Mar 6, 2018): @raphaki Either way it's been so long I'm going to close this issue anyway. If you built Librespot using `cargo build --release` it will only include the PortAudio backend. Try rebuilding using this `cargo build --release --no-default-features --features pulseaudio-backend`. If you still get a problem please open a new issue.
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#68
No description provided.