[GH-ISSUE #404] Librespot crashes when it cannot find a soundcard #259

Closed
opened 2026-02-27 19:29:42 +03:00 by kerem · 7 comments
Owner

Originally created by @je-marshall on GitHub (Nov 23, 2019).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/404

I would think that this bug is related to #50, with the possible added complication that I am running Librespot in a container. As @ashwinvandijk is in the referenced issue, I'm running Librespot in conjunction with snapserver; as a result this container has never had a sound card. Its been running fine for the last year or so but I recently updated to the latest version of everything (wasn't keeping track of version numbers when I did the update) and only now am I experiencing the issue. I thought at first that I could potentially passthrough the hosts sound card, but am banging my head against a poorly documented wall trying to get this working and to be honest I don't really want to as this will mean making it an unprivileged container (I think).

Here's a backtrace with the details:

librespot -n House -b 320 -c /cache
[2019-11-23T13:39:57Z INFO librespot] librespot 9e2cfe3 (2019-11-06). Built on 2019-11-07. Build ID: QUjVRS3b
[2019-11-23T13:39:57Z INFO librespot_core::session] Connecting to AP "gew1-accesspoint-a-xr5v.ap.spotify.com:4070"
[2019-11-23T13:39:57Z INFO librespot_core::session] Authenticated as "deathcakes" !
ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM default
thread '' panicked at 'The device doesn't support any format!?: DeviceNotAvailable', src/libcore/result.rs:999:5
stack backtrace:
[2019-11-23T13:39:57Z INFO librespot_core::session] Country: "GB"
0: 0x55e18f597d7b - backtrace::backtrace::libunwind::trace::hfe5db90796807973
at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.29/src/backtrace/libunwind.rs:88
1: 0x55e18f597d7b - backtrace::backtrace::trace_unsynchronized::h34b865a835594335
at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.29/src/backtrace/mod.rs:66
2: 0x55e18f597d7b - std::sys_common::backtrace::_print::h527254ae44989167
at src/libstd/sys_common/backtrace.rs:47
3: 0x55e18f597d7b - std::sys_common::backtrace::print::he85dd5ddddf46503
at src/libstd/sys_common/backtrace.rs:36
4: 0x55e18f597d7b - std::panicking::default_hook::{{closure}}::h847a2eb38b396f14
at src/libstd/panicking.rs:200
5: 0x55e18f597a57 - std::panicking::default_hook::h2ca0f9a30a0e206b
at src/libstd/panicking.rs:214
6: 0x55e18f5984f0 - std::panicking::rust_panic_with_hook::hffcefc09751839d1
at src/libstd/panicking.rs:477
7: 0x55e18f598072 - std::panicking::continue_panic_fmt::hc0f142c930c846fc
at src/libstd/panicking.rs:384
8: 0x55e18f597f56 - rust_begin_unwind
at src/libstd/panicking.rs:311
9: 0x55e18f5b876d - core::panicking::panic_fmt::h2daf88b2616ca2b2
at src/libcore/panicking.rs:85
10: 0x55e18f174471 - core::result::unwrap_failed::had362399ced8ad70
11: 0x55e18f16f72a - rodio::engine::new_output_stream::h3852f1b741d35214
12: 0x55e18f15c29e - rodio::engine::play_raw::h5a53a0b0fb2f6e1b
13: 0x55e18f14cc15 - <librespot_playback::audio_backend::rodio::RodioSink as librespot_playback::audio_backend::Open>::open::h58977b1df0664a61
14: 0x55e18f140ee2 - librespot_playback::audio_backend::mk_sink::hcae3fb23489ef37f
15: 0x55e18f0ae841 - std::sys_common::backtrace::__rust_begin_short_backtrace::h195aa92dfb11796d
16: 0x55e18f0ad569 - std::panicking::try::do_call::h450011732fca44be
17: 0x55e18f5a04fa - __rust_maybe_catch_panic
at src/libpanic_unwind/lib.rs:82
18: 0x55e18f0a9184 - core::ops::function::FnOnce::call_once{{vtable.shim}}::h0439762fa91fa386
19: 0x55e18f588a3f - <alloc::boxed::Box as core::ops::function::FnOnce>::call_once::h42806b83647d4c79
at /rustc/eae3437dfe991621e8afdc82734f4a172d7ddf9b/src/liballoc/boxed.rs:746
20: 0x55e18f59f8d0 - <alloc::boxed::Box as core::ops::function::FnOnce>::call_once::h83c921c8e826dd1d
at /rustc/eae3437dfe991621e8afdc82734f4a172d7ddf9b/src/liballoc/boxed.rs:746
21: 0x55e18f59f8d0 - std::sys_common:🧵:start_thread::h2613204ce513782e
at src/libstd/sys_common/thread.rs:13
22: 0x55e18f59f8d0 - std::sys::unix:🧵:Thread:🆕:thread_start::h4570080769500bcd
at src/libstd/sys/unix/thread.rs:79
23: 0x7fad6f8324a4 - start_thread
24: 0x7fad6f35dd0f - __clone
25: 0x0 -
^C[2019-11-23T13:39:58Z ERROR librespot_playback::player] Player thread panicked!

Like I say I'm trying to get it to work by passing through a sound card to the container and I will let you know if I have any success with this.

Thanks for all the hard work on Librespot btw, its a great program - I appreciate my use case might be slightly obscure so no worries if its not something you want to support.

Originally created by @je-marshall on GitHub (Nov 23, 2019). Original GitHub issue: https://github.com/librespot-org/librespot/issues/404 I would think that this bug is related to #50, with the possible added complication that I am running Librespot in a container. As @ashwinvandijk is in the referenced issue, I'm running Librespot in conjunction with snapserver; as a result this container has never had a sound card. Its been running fine for the last year or so but I recently updated to the latest version of everything (wasn't keeping track of version numbers when I did the update) and only now am I experiencing the issue. I thought at first that I could potentially passthrough the hosts sound card, but am banging my head against a poorly documented wall trying to get this working and to be honest I don't really want to as this will mean making it an unprivileged container (I think). Here's a backtrace with the details: > > librespot -n House -b 320 -c /cache > [2019-11-23T13:39:57Z INFO librespot] librespot 9e2cfe3 (2019-11-06). Built on 2019-11-07. Build ID: QUjVRS3b > [2019-11-23T13:39:57Z INFO librespot_core::session] Connecting to AP "gew1-accesspoint-a-xr5v.ap.spotify.com:4070" > [2019-11-23T13:39:57Z INFO librespot_core::session] Authenticated as "deathcakes" ! > ALSA lib confmisc.c:767:(parse_card) cannot find card '0' > ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory > ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings > ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory > ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name > ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory > ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory > ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM default > thread '<unnamed>' panicked at 'The device doesn't support any format!?: DeviceNotAvailable', src/libcore/result.rs:999:5 > stack backtrace: > [2019-11-23T13:39:57Z INFO librespot_core::session] Country: "GB" > 0: 0x55e18f597d7b - backtrace::backtrace::libunwind::trace::hfe5db90796807973 > at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.29/src/backtrace/libunwind.rs:88 > 1: 0x55e18f597d7b - backtrace::backtrace::trace_unsynchronized::h34b865a835594335 > at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.29/src/backtrace/mod.rs:66 > 2: 0x55e18f597d7b - std::sys_common::backtrace::_print::h527254ae44989167 > at src/libstd/sys_common/backtrace.rs:47 > 3: 0x55e18f597d7b - std::sys_common::backtrace::print::he85dd5ddddf46503 > at src/libstd/sys_common/backtrace.rs:36 > 4: 0x55e18f597d7b - std::panicking::default_hook::{{closure}}::h847a2eb38b396f14 > at src/libstd/panicking.rs:200 > 5: 0x55e18f597a57 - std::panicking::default_hook::h2ca0f9a30a0e206b > at src/libstd/panicking.rs:214 > 6: 0x55e18f5984f0 - std::panicking::rust_panic_with_hook::hffcefc09751839d1 > at src/libstd/panicking.rs:477 > 7: 0x55e18f598072 - std::panicking::continue_panic_fmt::hc0f142c930c846fc > at src/libstd/panicking.rs:384 > 8: 0x55e18f597f56 - rust_begin_unwind > at src/libstd/panicking.rs:311 > 9: 0x55e18f5b876d - core::panicking::panic_fmt::h2daf88b2616ca2b2 > at src/libcore/panicking.rs:85 > 10: 0x55e18f174471 - core::result::unwrap_failed::had362399ced8ad70 > 11: 0x55e18f16f72a - rodio::engine::new_output_stream::h3852f1b741d35214 > 12: 0x55e18f15c29e - rodio::engine::play_raw::h5a53a0b0fb2f6e1b > 13: 0x55e18f14cc15 - <librespot_playback::audio_backend::rodio::RodioSink as librespot_playback::audio_backend::Open>::open::h58977b1df0664a61 > 14: 0x55e18f140ee2 - librespot_playback::audio_backend::mk_sink::hcae3fb23489ef37f > 15: 0x55e18f0ae841 - std::sys_common::backtrace::__rust_begin_short_backtrace::h195aa92dfb11796d > 16: 0x55e18f0ad569 - std::panicking::try::do_call::h450011732fca44be > 17: 0x55e18f5a04fa - __rust_maybe_catch_panic > at src/libpanic_unwind/lib.rs:82 > 18: 0x55e18f0a9184 - core::ops::function::FnOnce::call_once{{vtable.shim}}::h0439762fa91fa386 > 19: 0x55e18f588a3f - <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once::h42806b83647d4c79 > at /rustc/eae3437dfe991621e8afdc82734f4a172d7ddf9b/src/liballoc/boxed.rs:746 > 20: 0x55e18f59f8d0 - <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once::h83c921c8e826dd1d > at /rustc/eae3437dfe991621e8afdc82734f4a172d7ddf9b/src/liballoc/boxed.rs:746 > 21: 0x55e18f59f8d0 - std::sys_common::thread::start_thread::h2613204ce513782e > at src/libstd/sys_common/thread.rs:13 > 22: 0x55e18f59f8d0 - std::sys::unix::thread::Thread::new::thread_start::h4570080769500bcd > at src/libstd/sys/unix/thread.rs:79 > 23: 0x7fad6f8324a4 - start_thread > 24: 0x7fad6f35dd0f - __clone > 25: 0x0 - <unknown> > ^C[2019-11-23T13:39:58Z ERROR librespot_playback::player] Player thread panicked! Like I say I'm trying to get it to work by passing through a sound card to the container and I will let you know if I have any success with this. Thanks for all the hard work on Librespot btw, its a great program - I appreciate my use case might be slightly obscure so no worries if its not something you want to support.
kerem closed this issue 2026-02-27 19:29:42 +03:00
Author
Owner

@ashthespy commented on GitHub (Nov 23, 2019):

Not sure what your trying to do, but can't you just use a pipe to snapserver?

<!-- gh-comment-id:557799622 --> @ashthespy commented on GitHub (Nov 23, 2019): Not sure what your trying to do, but can't you just use a pipe to snapserver?
Author
Owner

@je-marshall commented on GitHub (Nov 23, 2019):

Yeah so I didn't include a bit of background - snapserver has been crashing and I suspected it was due to updating Librespot. I can't see any point where snapserver was having problems except when it invokes Librespot so I figured I'd try running it by itself and got this error. Then I found a similar one that wasn't resolved so I thought it might be the same thing!

<!-- gh-comment-id:557800146 --> @je-marshall commented on GitHub (Nov 23, 2019): Yeah so I didn't include a bit of background - snapserver has been crashing and I suspected it was due to updating Librespot. I can't see any point where snapserver was having problems except when it invokes Librespot so I figured I'd try running it by itself and got this error. Then I found a similar one that wasn't resolved so I thought it might be the same thing!
Author
Owner

@ashthespy commented on GitHub (Nov 23, 2019):

I am not sure what librespot is supposed to do if there is no audio device present to playback on?
To test the other non playback parts, you can always pipe to /dev/null

<!-- gh-comment-id:557800462 --> @ashthespy commented on GitHub (Nov 23, 2019): I am not sure what librespot is supposed to do if there is no audio device present to playback on? To test the other non playback parts, you can always pipe to `/dev/null`
Author
Owner

@je-marshall commented on GitHub (Nov 23, 2019):

That seems fair but like I say it has been working for a little while without throwing this error. If I pipe it to /dev/null I get the exact same trace.

I can't rule out that this is an issue with snapserver, I will carry on digging and let you know what I find out.

Thanks!

<!-- gh-comment-id:557800568 --> @je-marshall commented on GitHub (Nov 23, 2019): That seems fair but like I say it has been working for a little while without throwing this error. If I pipe it to /dev/null I get the exact same trace. I can't rule out that this is an issue with snapserver, I will carry on digging and let you know what I find out. Thanks!
Author
Owner

@kingosticks commented on GitHub (Nov 23, 2019):

To be fair it shouldn't crash so this is a bug to fix. It's just not an interesting bug.

<!-- gh-comment-id:557800572 --> @kingosticks commented on GitHub (Nov 23, 2019): To be fair it shouldn't crash so this is a bug to fix. It's just not an interesting bug.
Author
Owner

@kingosticks commented on GitHub (Nov 23, 2019):

Hang on, the exact same crash when you use the pipe backend? That doesn't make sense. Can you provide the command line you used to pipe it to /dev/null?

<!-- gh-comment-id:557800762 --> @kingosticks commented on GitHub (Nov 23, 2019): Hang on, the *exact* same crash when you use the pipe backend? That doesn't make sense. Can you provide the command line you used to pipe it to /dev/null?
Author
Owner

@je-marshall commented on GitHub (Nov 23, 2019):

Nope my mistake - didn't realise that --backend was specified. Looks like this bug can be closed, apologies for wasting your time. The issue likely lies with snapserver, I will take it up with them.

<!-- gh-comment-id:557801076 --> @je-marshall commented on GitHub (Nov 23, 2019): Nope my mistake - didn't realise that --backend was specified. Looks like this bug can be closed, apologies for wasting your time. The issue likely lies with snapserver, I will take it up with them.
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#259
No description provided.