mirror of
https://github.com/librespot-org/librespot.git
synced 2026-04-27 08:15:50 +03:00
[GH-ISSUE #488] Neither rodio nor alsa output working when using dmix plugin / alsa-jack bridge. #308
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#308
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 @mr-berndt on GitHub (Jun 8, 2020).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/488
Hello, I am the developer of Aroio OS, an embedded audio player distribution based on GPL software. There are commercial products available but the OS is free and can be run on any Raspberry Pi. -> https://www.abacus-electronics.de/produkte/streaming/aroiosu-11/aroiosu.html
At the moment I am trying to integrate librespot into the system but sadly I am facing issues with each of the audio outputs I am trying to use.
We are using mostly jackd in order to be able to run multiple player services simultaneously and feed them into BruteFIR, if wanted. Since jackd and BruteFIR run on a fixed sampling rate, this leads to a chain which automatically needs to insert a resampler for players which output with a sampling-rate that differs from jack's/BruteFIR's. So using jack straight away is no option, due to the lack of a resampler. Overcoming this is done via the alsa dmix plugin followed by an alsa-jack plugin. This chain is running stable with aplay, squeezelite, gmediarender, shairport-sync and bluealsa-aplay, even when running all of them simultaniously, so I consider it to be functioning properly.
Now when trying to output into our alsa-jack bridge using librespot's alsa-ouput module, I get the dreaded EINVAL-error:
ERROR librespot_playback::audio_backend::alsa] Alsa error PCM open ALSA function 'snd_pcm_hw_params_set_buffer_size_near' failed with error 'EINVAL: Invalid argument'When tring to output using rodio I end up with:
ALSA lib pcm_dmix.c:1089:(snd_pcm_dmix_open) unable to open slave ALSA lib pcm_dmix.c:1024:(snd_pcm_dmix_open) The dmix plugin supports only playback streamTo me it looks like rodio is trying to open a capture channel, which can not work, since we do not have audio inputs. Also it is not needed in this case.
How to go about fixing this? I understand that librespot on the long run might drop all other audio ouputs in favour of rodio, so maybe it makes most sense to concentrate on getting this to work. Sadly there are no options for influencing parameters of any of the given output possibilities, so I have no way of trying to debug this myself.
Can you help here or point me in the right direction for fixing this error with rodio?
Any help would be very welcome, especially since it concerns hundreds of users who would surely love being able to use your very appreciated software on their streamers!
@ashthespy commented on GitHub (Jun 8, 2020):
This happens because the alsa back-end implementation here makes some assumptions of the buffer size, and sets them. It is quite possible that your
alsa-jackplugin doesn't support the default buffer size. You could play around with the buffer size and/or check the documentations for the alsa-jack plugin to see what are the parameters it supports.EDIT: So a quick google suggests the alsa-jack is picky with the buffersize
So you could try playing with the buffer size.. I vaguely recall a discussion about if this should be a configurable setting, so we could revisit that if you get it working :-)
I hope not - rodio has quite some overhead on little SBCs compared to alsa!
@mr-berndt commented on GitHub (Jun 8, 2020):
Thx for your answer and the link, which looks very interesting. I am just going out right now and will look into it tomorrow and report back.
@mr-berndt commented on GitHub (Jun 9, 2020):
The patch linked in that thread simply solved the problem - many thanks for pointing this out!
@ashthespy commented on GitHub (Jun 9, 2020):
Just to confirm - you mean the patch from this post?