Skip to content

librespot fails to accept ALSA device names as an output device #1546

@jduncanator

Description

@jduncanator

Description

Since commit ce1ab8f, the Rodio backend no longer exposes or recognizes ALSA device names, and instead only lists and recognizes "friendly names" for ALSA outputs.

After this commit the output of librespot --device ? is the following:

[2025-08-21T06:39:33Z INFO  librespot] librespot 0.6.0-dev c4766ce (Built on 2025-08-21, Build ID: QpLfXiGR, Profile: release)
[2025-08-21T06:39:33Z INFO  librespot_playback::audio_backend::rodio] Using Rodio sink with format S16 and cpal host: ALSA
Default Audio Device:
  default
Other Available Audio Devices:
  HDA Intel PCH
  Merging RAVENNA

Prior to this commit the output is the following:

[2025-08-21T06:32:04Z INFO  librespot] librespot 0.6.0-dev be37402 (Built on 2025-08-21, Build ID: HgoztJtj, Profile: release)
[2025-08-21T06:32:04Z INFO  librespot_playback::audio_backend::rodio] Using Rodio sink with format S16 and cpal host: ALSA
Default Audio Device:
  default
Other Available Audio Devices:
  hw:CARD=PCH,DEV=0
  hw:CARD=PCH,DEV=3
  hw:CARD=PCH,DEV=7
  hw:CARD=PCH,DEV=8
  hw:CARD=PCH,DEV=9
  plughw:CARD=PCH,DEV=0
  plughw:CARD=PCH,DEV=3
  plughw:CARD=PCH,DEV=7
  plughw:CARD=PCH,DEV=8
  plughw:CARD=PCH,DEV=9
  default:CARD=PCH
  sysdefault:CARD=PCH
  front:CARD=PCH,DEV=0
ALSA lib pcm_route.c:878:(find_matching_chmap) Found no matching channel map
ALSA lib pcm_route.c:878:(find_matching_chmap) Found no matching channel map
  surround40:CARD=PCH,DEV=0
ALSA lib pcm_route.c:878:(find_matching_chmap) Found no matching channel map
ALSA lib pcm_route.c:878:(find_matching_chmap) Found no matching channel map
ALSA lib pcm_route.c:878:(find_matching_chmap) Found no matching channel map
ALSA lib pcm_route.c:878:(find_matching_chmap) Found no matching channel map
  surround51:CARD=PCH,DEV=0
  surround71:CARD=PCH,DEV=0
  hdmi:CARD=PCH,DEV=0
  hdmi:CARD=PCH,DEV=1
  hdmi:CARD=PCH,DEV=2
  hdmi:CARD=PCH,DEV=3
ALSA lib pcm_dmix.c:973:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
  dmix:CARD=PCH,DEV=0
ALSA lib pcm_dmix.c:973:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
  dmix:CARD=PCH,DEV=3
ALSA lib pcm_dmix.c:973:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
  dmix:CARD=PCH,DEV=7
ALSA lib pcm_dmix.c:973:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
  dmix:CARD=PCH,DEV=8
ALSA lib pcm_dmix.c:973:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
  dmix:CARD=PCH,DEV=9
ALSA lib pcm_dsnoop.c:541:(snd_pcm_dsnoop_open) The dsnoop plugin supports only capture stream
ALSA lib pcm_dsnoop.c:541:(snd_pcm_dsnoop_open) The dsnoop plugin supports only capture stream
ALSA lib pcm_dsnoop.c:541:(snd_pcm_dsnoop_open) The dsnoop plugin supports only capture stream
ALSA lib pcm_dsnoop.c:541:(snd_pcm_dsnoop_open) The dsnoop plugin supports only capture stream
  hw:CARD=RAVENNA,DEV=0
  plughw:CARD=RAVENNA,DEV=0
  default:CARD=RAVENNA
  sysdefault:CARD=RAVENNA
ALSA lib pcm_dmix.c:973:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
  dmix:CARD=RAVENNA,DEV=0
ALSA lib pcm_dsnoop.c:541:(snd_pcm_dsnoop_open) The dsnoop plugin supports only capture stream
ALSA lib pcm_dsnoop.c:541:(snd_pcm_dsnoop_open) The dsnoop plugin supports only capture stream

When attempting to run librespot with an ALSA device (ie. librespot --device dmix:CARD=RAVENNA,DEV=0), the output is as a following:

[2025-08-21T05:59:52Z INFO  librespot_playback::audio_backend::rodio] Using Rodio sink with format S24_3 and cpal host: ALSA
ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM pipewire
ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM pipewire
ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM pulse
ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM pulse
ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM jack
ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM jack
ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM oss
ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM oss

thread '<unnamed>' panicked at playback/src/audio_backend/rodio.rs:219:61:
called `Result::unwrap()` on an `Err` value: DeviceNotAvailable("hw:CARD=RAVENNA,DEV=0")
stack backtrace:
   0:     0x55e507195d79 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::hc27021c40099767c
   1:     0x55e5071aa0a3 - core::fmt::write::h4f0770298adcd782
   2:     0x55e507184cff - std::io::Write::write_fmt::h0b2c201fcd300be4
   3:     0x55e507195bc3 - std::sys::backtrace::BacktraceLock::print::hbd491c8a45546b91
   4:     0x55e507160f45 - std::panicking::default_hook::{{closure}}::h65f4a8f2e434ce09
   5:     0x55e507160d38 - std::panicking::default_hook::h73ef68af6ebbb2d3
   6:     0x55e50716151f - std::panicking::rust_panic_with_hook::h1c95e5ef3e82efd3
   7:     0x55e50719684a - std::panicking::begin_panic_handler::{{closure}}::h4ba25af490254d55
   8:     0x55e507195fa9 - std::sys::backtrace::__rust_end_short_backtrace::hcd9c5798c8bf2e2a
   9:     0x55e50716108d - rust_begin_unwind
  10:     0x55e50693f5f0 - core::panicking::panic_fmt::h96856782d9d1734f
  11:     0x55e50693fb76 - core::result::unwrap_failed::hbbe143ff7eea6e77
  12:     0x55e506bcbcc0 - librespot_playback::audio_backend::rodio::mk_rodio::h0733a9a4505391cb
  13:     0x55e506a3c7b1 - std::sys::backtrace::__rust_begin_short_backtrace::hc5c44d38822e029f
  14:     0x55e506a3da4f - core::ops::function::FnOnce::call_once{{vtable.shim}}::hc3eead36c5fb2b9d
  15:     0x55e507161b6b - std::sys::pal::unix::thread::Thread::new::thread_start::hcbb8fcac760f1b8f
  16:     0x7fb15e1acb7b - start_thread
                               at ./nptl/pthread_create.c:448:8
  17:     0x7fb15e22a7b8 - __GI___clone3
                               at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
  18:                0x0 - <unknown>

Version

Versions since commit ce1ab8f

How to reproduce

Steps to reproduce the behavior in librespot e.g.

  1. Launch librespot with '--devices ?'
  2. Observe the lack of ALSA backend devices in the list

Host (what you are running librespot on):

  • OS: Debian Trixie, Linux 6.12.41

Additional context

This significantly impacts our ability to use librespot. We run multiple instances, that output to multiple sub-devices of a parent device, and we can no longer target these ALSA devices.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions