Linux Use ALSA and Pulse side by side on Ubuntu (like in LibreELEC)?
#1
I've been playing around with this for hours while reading several man pages and Wiki's but I just can't get it to work.

I'm running Ubuntu 16.04 and I would like Kodi to use my ALSA HDMI soundcard directly and do passthrough audio over it. However I would also like to run PulseAudio to support music streaming from my phone over Bluetooth. This music must be send to a different sink/ALSA card (to the analog and/or SPDIF out) so it shouldn't interfere with HDMI passthrough audio from Kodi.

So is it possible to let Kodi use my ALSA HDMI soundcard and also run PulseAudio to handle Bluetooth streaming to SPDIF and/or analog out (which are different ALSA interfaces)?

On LibreELEC this seems to be working perfectly. Kodi can passthrough audio over HDMI while watching a movie for example and I can simultaneously stream Bluetooth audio which is routed to an analog output sink.

I tried killing PulseAudio manually, then starting Kodi. Kodi can then access the HDMI ALSA sound card. However if I try to start PulseAudio again (while still running Kodi) it hangs and won't start before Kodi has been closed (thus when the ALSA card has been released by Kodi). When using pasuspender basically the same thing happens, as long as Kodi is running it's not possible to use PulseAudio.

It would be great if I could exclud the ALSA HDMI card from PulseAudio somehow so the card is not in use and can be used by Kodi exclusively, can that be done through config files for example? Or can the ALSA HDMI card be released by PulseAudio without killing the PulseAudio process altogether?

I hope anyone with more experience than me can give me some pointers or tips.

Thank you!
Reply
#2
You can do this but not at the same time?

When running kodi i have pulseaudio server stopped so alsa can work.

When running my WM i have pulseaudio server running.

This is very easy if you need more info if this is what you want let me know.
Reply
#3
What I do sometimes is to start Kodi via terminal like this:

Code:
AE_SINK=alsa kodi

Not the best solution, but it works Wink
Reply
#4
configure pulse to not use the SPDIF output, then start kodi as above and configure kodi to use HDMI
Reply
#5
We use a special patch to allow using alsa and pulse at the same time. https://github.com/LibreELEC/LibreELEC.t...ther.patch
"PPC is too slow, your CPU has no balls to handle HD content." ~ Davilla
"Maybe it's a toaster. Who knows, but it has nothing to do with us." ~ Ned Scott
Reply
#6
Ok obviously theres ways round it, i just use a couple of scripts; pulseon and pulseoff and run them as required - does the job and causes zero conflicts Smile But these boys seem to have an automated solution but im quite happy typing commands i miss it actually when i use my MAC's hehe Smile
Reply
#7
Thanks guys. I was running "AE_SINK=alsa kodi" with pasuspender as per the Wiki (so: "pasuspender AE_SINK=alsa kodi"). But indeed it's also possible to run it without the pasuspender prefix and thus keep PulseAudio active. I didn't think that would work so I didn't try it before.

Anyways, Bluetooth audio continues when launching with AE_SINK=alsa and Kodi binds to the HDMI ALSA soundcard. So it looks like mission accomplished here. However, I'm not able to test HDMI sound at the moment but it looks like this should work just fine. Is it possible that the LibreELEC patch does the same thing as the AE_SINK environment variable?

Anyways, thanks for the help guys!
Reply
#8
No it does not. LE's patch uses kodi's PA sink _AND_ kodi's ALSA sink in parallel. This works as in LE all PA devices are completely disabled besides the Bluetooth device. So there won't be any highjacking of hdmi / spdif / analog / whatever which will happen on normal distributions.
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#9
(2017-04-22, 08:53)fritsch Wrote: No it does not. LE's patch uses kodi's PA sink _AND_ kodi's ALSA sink in parallel. This works as in LE all PA devices are completely disabled besides the Bluetooth device. So there won't be any highjacking of hdmi / spdif / analog / whatever which will happen on normal distributions.

Alright, thanks for clarifying that.

Just a question about said highjacking: when could that happen? If I configure PulseAudio to default to SPDIF or analog using pavucontrol then theoretically PulseAudio should leave the HDMI sink alone right?

I guess I will find out eventually when I start using my HTPC in my new setup but it always sucks when sound won't work or [insert any technical problem here] when you just want to watch a movie (especially when you have visitors) so I'm trying to be prepared as best as I can.
Reply
#10
Yeah - find out.
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#11
has this now been merged into libreelec ?

see https://github.com/LibreELEC/LibreELEC.t...ther.patch

therefore should it work out of the box ?
Reply

Logout Mark Read Team Forum Stats Members Help
Use ALSA and Pulse side by side on Ubuntu (like in LibreELEC)?0