Force Kodi on LibreELEC to use PulseAudio


2020-03-22

This is to enable streaming from remote machines.

Assumes RPi4.

Make sure audio is enabled in the device tree. This is done by putting dtparam=audio=on in /flash/config.txt/

# Stop Kodi to release the audio device
$ systemctl stop kodi

# Mode module-udev-detect
$ pactl load-module module-udev-detect

# Make sure the audio device is shown
$ pactl list short sinks
1	alsa_output.0.iec958-stereo	module-alsa-card.c	s16le 2ch 44100Hz	RUNNING

# Restart Kodi
systemctl start kodi

Now configure Kodi to use PulseAudio in settings.

Remarks

To persist, put pactl load-module module-udev-detect tsched=0 in /storage/.config/autostart.sh. Create it if it doesn’t exist.

The tsched=0 prevents stuttering.

https://forum.libreelec.tv/thread/9299-pulseaudio-network-receiving-in-5-1-on-rpi2/