Kodi Community Forum

Full Version: Squeezelite and Kodi sharing audio Device on Ubuntu
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I'm running suqeezlite on an Ubuntu 14.04 with an external USB Dac. This is working really smooth. Now I'm also using this system to play some videos with Kodi. The installation was pretty easy and it's also working.

The problem I have is that either KODI or Squeezlite is playing. After starting squeezelite Kodi is not playing any sound and even after stooping squeezlite, Kodi is dead --> I have to reboot. I guess using the same ALSA device is the problem and I'm not sure if there is a way to solve this. Anyone who have a similar setup?

Thanks and Regards,

Alex
You'll have to use PulseAudio (wiki) for this to work. Beware of caveats like no HD audio passthrough
Hi,

thanks a lot. I'm not sure but as far as I understood squeezelite can only use alsa - is that possible?

I there a way to use Pulseaudio for Kodi and Alsa for the other (sorry if this is nonsense I'm not familiar with the audio structure of Linux). I want to have a bitperfect Audio with squeezelite (for Kodi thi is not important here)

Regards,

Alex
no idea about squeezelite. The only way to allow concurrent access to the _same_ alsa device is using dmix. This will break passthrough and bit perfect audio.
If you have multiple alsa devices e.g. HDMI and SPDIF or Analog, you could use one for Kodi and one for squeezelite.

But: do you really need both kodi and squeezelite playing audio _at the same time_? If not, just disable "keep audio device alive" in kodi. If you don't want to stop squeezelite after playing it probably needs a similar setting to stop hogging the alsa device when not playing anything.
Have you tried this addon: Xsqueeze
Squeezelite always hogs the audio device. This is why it won't work. You can "turn off" squeezelite with a squeezebox controller or inside LMS. But the latest version of squeezelite (1.8) has implemented a function to close the output device when idle. (-C option), so that should work.
The OP said that even after closing squeezelite kodi won't work.
He wrote stopping squeezelite. (which of course could mean closing, but probably not in this circumstance)
True, perhaps he just means stopping playback but keeping squeezelite running.

The new -C option sounds good, thanks for the heads up.
Hello!

Sorry for digging this up but it's sort of related I believe: I want to have Squeezelite running in the background of Kodi (Openelec on a Raspberry Pi 2), but this obviously leads to difficulties with the standard audio output thorugh HDMI. I'm wondering whether it's more foolproof to get an additional sound output like the HifiBerry or to play around with this -C option, which appears to have helped.

The ideal case for me would be the shared HDMI output but I'm not good enough with Linux to try it ony my own. So in case you got it working, would you mind giving me a short How-to for the autostart script and squeezelite settings to make it work?
Dear,
I just have try the -C option in Squeezelite and the option "keep audio device alive” to NO " in KODI.
It works perfectly with my card HififiBerry (even card HifiBerry can't be accessed by two different application in the same time).

When I play a film and I stop it, then Squeezelite can play a song.
When I play a song with Squeezelite, and I stop it, then I can start a movie in KODI.
It’s working as on purpose.

Remark : starting Squuezelite manually will show you the error opening the soundcard when a movie is playing in kodi :

/usr/bin/squeezelite184 -n "Squeeze184" -o "default:CARD=sndrpihifiberry" -C 3
[17:48:38.967699] alsa_open:387 playback open error: Device or resource busy
[17:48:43.970471] alsa_open:387 playback open error: Device or resource busy
[17:48:48.972896] alsa_open:387 playback open error: Device or resource busy
[17:48:53.974913] alsa_open:387 playback open error: Device or resource busy

Then I stop the movie. I don’t need to stop squeezelite. The Sqeezeplayer will restart the song and play the sound.

BR