-
Notifications
You must be signed in to change notification settings - Fork 194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bluealsa as parallel input #50
Comments
Hi, Right now it is not possible to connect more than one app to the bluealsa ALSA plugin. See #48. I haven't experimented with JACK, though. If JACK supports audio mixing, it might be possible to use it instead of ALSA interface. However, I've got no experience with JACK, and I do not know how it works (on a connection level). |
No sorry that's not what i meant: phone (BT) stream -->bluealsa pcm --> alsa loopback--> real soundcard --> speaker musicplayer e.g. Kodi audio CD-->alsa loopback -->real soundcard-->speaker This is what i'm trying. Creating 2 virtual soundcards to stream the music to and both can use the hardware device same time. |
Hmm... I do not quite understand why you need two separate ALSA devices for real soundcard. If real soundcard (hw in the ALSA nomenclature) does not support mixing, you can use dmix plugin. So, you can connect (to the hw) as many apps as you want. Or I'm missing something from the picture... |
So maybe i did something wrong with my setup for bluealsa and asound.conf.
|
OK, so it is definitely something wrong with your ALSA configuration. Make sure, that this overwritten default PCM uses dmix (or that dmix is somewhere in the plugin chain). Not all soundcards support mixing internally, so software mixer (dmix) is required. By default, such a sane configuration is delivered by the ALSA itself. However, if you make something like this (as an example):
all ALSA magic is gone. Now you are using bare metal (not quite bare metal, because format conversion is supported via the plug plugin, however it's just an example) hardware, which might lack audio mixing. |
Call me noob but I don't understand that :/ I create via modprobe snd_aloop 2 virtual soundcards. The hardware card is a Hifiberry-DAC.
How can i link the Kodi stream to virtual device and also the bluealsa stream to the other virtual device and mix both and then link this on to default (real sound card). In dmix i can only set one slave or can i also set two slaves ? Like so ?
I guess not. How should i link the pcm.mixed to the pcm.!default ? Can't find a tutorial for that. Sorry for that foolish question, but i don't get it... |
And how and where can I tell bluealsa to use virtual device 1 or 2. In Kodi I can set it up under audio setting. |
If my understanding of the problem is correct:
Then, what I'd have done would be setting up default PCM to use this soundcard (if it's not done already by the ALSA), e.g.:
However, firstly check if it's not done already by the ALSA. Just remove your ALSA configuration (comment it out) and see the output from the If you are using bluealsa-aplay, you can use |
The right hw soundcard is found by ALSA. Also without extra config. The problem is, like I said, when playing music in Kodi, bluealsa-aplay complains about device in use. So starting |
OK, so try something like this:
Then, use |
Content of .asoundrc is only your code |
with config like this: ` pcm.default {
|
If you're using |
guess something must be wrong... sorry for that
also without sudo many errors. aplay -L also not working
|
Yeah, something is wrong :D Remove pcm.default entry from the confing. It's not allowed. |
But that brings me back to the error
now I'm confused.... but when i do something like that:
i get a new error type. at least not complaining about pcm:
|
It would be much easer to communicate without delay. IRC: #bluealsa @freenode.org |
After nice conversation via IRC here is the solution to make it work as suggested. Configure the .asoundrc like this:
or another actual config for sound tests:
My
In case someone else will stumble over this by searching the net :) THX @arkq |
I forgot to mention how to use it: ofcause bluealsa must be startet in backround via rc.local for example.
|
Somehow it's not working with compiled master version. It's working with downloaded not self-compiled version. Did you change something? When using config with plugdmix, kodi can't find default pcm but bluealsa-aplay works. When using pcm dmix, kodi is finding default and plays sound, but bluealsa-aplay says pcm open error, already in use. Also aplay -L doesn't show PCM from .asoundrc. That might be the problem, why kodi can't find plugdmix. Update: As long as i dont update the alsa-lib (1.0.28 to match alsa-utils) i can find new pcm from .asoundrc. Update: Error was caused by compiling alsa-lib. After that aplay -L wasn't able to show PCM from .asoundrc . So you should not compile alsa-lib by yourself. I installed it now via Now compiling bluealsa works and aplay -L still shows PCM from .asoundrc |
Hi, Looping back to this, I cannot get this dmix in my configuration at all, meaning I do put it as stated above but Does it work still? |
Hi, I was looking at a similar problem to play both bluetooth sound from my phone and sound from other applications on my RPI4. I solved it using the following .asoundrc:
using the following link to configure bluealsa-play as a A2DP Sink:
|
Hallo,
finally i managed to get your bluealsa working on my Pi3 with raspbian jessie.
Great program.
The reason why I installed it, on raspbian wheezy with bluez4 i was able to stream music from phone via BT to Pi and also to hear music same time in kodi mediacenter. Doesn't make sense, but so i had not not restart mediacnter or bluez all the time. I guess it was because of ALSA. Now the bluez5 is set to pulse i had the problem i described.
With your program i can use ALSA again. Also the mediacenter is working with ALSA (kodi 15.2).
But at the moment i got the same problem like with pulseaudio. Only one stream is possible. I know that it works somehow because with bluez4 and ALSA it was working too.
Is there a possibility to route the stream of bluealsa to an ALSA plugin like jack ? I'd like to send both streams to this plugin and this will send the combined stream to the output.
The text was updated successfully, but these errors were encountered: