mirror of
https://github.com/librespot-org/librespot.git
synced 2026-04-27 00:05:55 +03:00
[GH-ISSUE #1546] librespot fails to accept ALSA device names as an output device #699
Labels
No labels
A-Alsa
SpotifyAPI
Tokio 1.0
audio
bug
can't reproduce
compilation
dependencies
duplicate
enhancement
good first issue
help wanted
high priority
imported
imported
invalid
new api
pull-request
question
reverse engineering
wiki
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/librespot#699
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jduncanator on GitHub (Aug 22, 2025).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/1546
Originally assigned to: @roderickvd on GitHub.
Description
Since commit
ce1ab8ff3f, 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:Prior to this commit the output is the following:
When attempting to run librespot with an ALSA device (ie.
librespot --device dmix:CARD=RAVENNA,DEV=0), the output is as a following:Version
Versions since commit
ce1ab8ff3fHow to reproduce
Steps to reproduce the behavior in librespot e.g.
librespotwith '--devices ?'Host (what you are running
librespoton):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.
@jduncanator commented on GitHub (Aug 22, 2025):
Suspect this was broken in cpal here:
github.com/RustAudio/cpal@f43d36e554.@jduncanator commented on GitHub (Aug 22, 2025):
I can confirm, manually reverting
github.com/RustAudio/cpal@f43d36e554from cpal, and referencing a local version of the dependency resolves this issue. Not sure how best to proceed with getting 0.7.0 out, however I feel like this will be a fairly significant breaking change for a lot of people downstream.The quickest way would be to revert cpal and rodio back to 0.15.1/0.20.1, but I'm aware there are a number of changes in the change-log that depend on the dep bump of Rodio.
@jduncanator commented on GitHub (Aug 22, 2025):
Looks like @roderickvd is already on it, didn't look close enough at the cpal repo. Relevant issues and PRs here: https://github.com/RustAudio/cpal/issues/991 https://github.com/RustAudio/cpal/pull/992.
We should look to apply their fix as a patch until this is fixed upstream:
github.com/roderickvd/pleezer@f16802aaf9@roderickvd commented on GitHub (Aug 22, 2025):
Thanks for reporting. Yes, known. Let’s continue the technical discussion over at the cpal PR.
For librespot, rather than rolling back now I prefer that users use the dedicated Alsa backend instead.
For the normal use case, Rodio in librespot is still able to open the default Alsa device. If you must use Rodio instead of Alsa (why? 😄 ) then you can work around this by creating an
asoundrcand forward the default device to what you want.@roderickvd commented on GitHub (Aug 22, 2025):
Over at the cpal I thought I had seen a comment of yours with a very interesting data point, but I can’t find it anymore. Could you re-add there your experience with
dmix:CARD=RAVENNA,DEV=0and add what’s special about it? What kind of device is it, how was it set up?@jduncanator commented on GitHub (Aug 22, 2025):
I did make an initial note that it appeared with the fix in your PR the Ravenna device didn't appear in the device list, however it was due to the device being open (with
plughw) in another instance of librespot, and not due to an issue with the PR itself. I removed the comment after I realized the PR worked correctly.For context, the Ravenna device is an AES67 virtual sound card, source here: https://bitbucket.org/MergingTechnologies/ravenna-alsa-lkm
I'm happy to use the ALSA backend directly, to be honest I wasn't even aware it existed until I started troubleshooting this issue. I've always used the default Rodio backend by default.
@roderickvd commented on GitHub (Aug 22, 2025):
I see. In this exact condition of already being opened, did it enumerate with cpal 0.15?
Cool. Rodio is there for ease of use, but Alsa is more bare metal.
@jduncanator commented on GitHub (Aug 22, 2025):
I've tested this, and the behavior is the same between both versions.
@jduncanator commented on GitHub (Oct 24, 2025):
For what it's worth, I've switched back to cpal, with a patch applied to librespot to grab the latest upstream, because I ran into weird issues with using ALSA directly that I didn't using cpal. Over time, I get increasingly worse and worse distortion, playback rate warping, and eventually audibly dropped samples. I've noticed since switching to the ALSA backend I get a multitude of error messages that look like the following:
Regardless, just reporting that the change to cpal has fixed this issue for me, and looking forward to it landing in the latest version of librespot.
ready!macro to reduce boilerplate #1028