Pulseaudio
Pulseaudio is used for routing audio to a Bluetooth device. With additional configuration it can also be used to receive audio and stream to multi-device (multi-room) configurations.
The tutorials on this page are basically using four commands:
pactl load-module <name>
to load a pulseaudio module (not all are loaded by default)pactl set-default-sink
to set the pulseaudio output devicepactl set-default-source
to set the pulseaudio input devicepactl info
to check the current sink/source configuration
Sample pactl info
output:
Bluetooth Sending
This is the default configuration. Simply pair a Bluetooth audio device in the LibreELEC settings add-on and change the Kodi output device (in Kodi settings) to Bluetooth Audio.
Bluetooth Receiving
This allows you to stream Bluetooth audio from a smartphone or other Bluetooth device. Before you start, pair the device in the LibreELEC settings add-on.
Stop Kodi (else it holds onto the audio device):
Load the pulseaudio udev module:
List the names of pulseaudio output devices using the pactl
utility:
For example:
Configure the pulseaudio output device:
Use pactl
to find your Bluetooth audio device:
For example:
Configure the pulseaudio source device:
Restart Kodi:
Select the audio output device in Kodi if you want audio from your device, and from playing files in Kodi.
Network Sending
This requires another computer or device running pulseaudio, e.g. an MPD music player or another LibreELEC device.
On the pulseaudio target device, ensure the the native-protocol-tcp
and zeroconf-publish
modules are loaded:
On the pulseaudio source (LibreELEC) device, stop Kodi and find the output device:
For example:
On the pulseaudio source, configure the pulseaudio output device:
Restart Kodi:
You can now select the default pulseaudio output device in Kodi settings. Audio will be broadcast on the network and other pulseaudio devices can select it as their audio source.
Network Receiving
This requires another pulseaudio device in the network, e.g. an MPD player or another LibreELEC device.
Stop Kodi else it will hold onto the audio output device:
Load the pulseaudio udev module:
Use pactl
to list pulseaudio output devices:
For example:
Configure the pulseaudio output device:
On the source pulseaudio device, load the native-protocol-tcp
and zeroconf-discover
modules:
On the target device, use pactl
to list available input devices:
For example:
Configure the pulseaudio input device:
Restart Kodi:
Configuration
Custom pulseaudio configuration is stored in /storage/.config/pulse-daemon.conf.d
as /etc/pulse
is inside the read-only filesystem. Files must have a .conf
extension. The file daemon.conf
is processed first, followed by other files in alphabetical order so if the same option is set in multiple files, the last one to be read will be used. If files have the same name as a default (embedded) file they override (replace) the embedded file.
To make custom configurations persistent, we must override /etc/pulse/default.pa
which is read on startup. Create /storage/.config/pulse-daemon.conf.d/custom.conf
and set the following to override the startup script file location:
Now create /storage/.config/pulse-daemon.conf.d/custom.pa
to extend the default startup script:
Sample Rates and Resampling
Create /storage/.config/pulse-daemon.conf.d/custom.conf
with your custom options, e.g.
To see the available resample methods:
For example:
Last updated