Hello,
I would like to report a reproducible Bluetooth audio issue on LibreELEC/Kodi.
Hardware
Device: Raspberry Pi 4
GPU: Broadcom VideoCore VI / Raspberry Pi 4 integrated GPU
Bluetooth audio device used for testing: JBL GO 2
Original target device: car Bluetooth audio/head unit
Storage: USB SSD used only as media storage; system boots from microSD
Software
LibreELEC version: 12.2.1
Bluetooth Audio add-on: service.bluetooth-audio v12.2.0.1
PulseAudio version shown by pactl info: 17.0
Problem summary
When using Bluetooth audio through LibreELEC/Kodi, the Bluetooth connection is established correctly and PulseAudio creates the expected Bluetooth sink, for example:
However, Kodi sometimes shows ALSA as the active audio output device, and MP3 playback has audio interruptions or can stop when entering the audio settings screen.
The issue appears to be caused by the service.bluetooth-audio add-on setting Kodi’s audio output device to the incomplete value:
instead of the full PulseAudio device value recognized by Kodi:
Steps to reproduce
- Boot LibreELEC on Raspberry Pi 4.
- Connect a Bluetooth audio device using LibreELEC Bluetooth configuration.
- Start Kodi and play an audio file, especially MP3.
- Open Kodi audio settings.
- In some cases Kodi shows ALSA as the selected output device.
- Playback may stop or become unstable.
- Manually changing the audio output in Kodi from ALSA to PulseAudio immediately restores correct audio playback.
Observed behavior
Before the workaround, Kodi could end up with this setting in guisettings.xml:
<setting id="audiooutput.audiodevice">ALSA:@|Default (vc4-hdmi-0 MAI PCM i2s-hifi-0) ()</setting>
At the same time, PulseAudio still had the Bluetooth sink available, but it was suspended and there was no active Kodi stream:
Kodi log also showed that the Bluetooth Audio add-on was setting the device to the incomplete value:
When the audio output was manually changed from the Kodi GUI to PulseAudio, the correct value was written:
and PulseAudio showed an active Kodi stream:
Expected behavior
The Bluetooth Audio add-on should set Kodi’s audio output device to the full PulseAudio device string used by Kodi:
instead of:
Kodi should consistently show PulseAudio as the selected audio output device after Bluetooth auto-connect, and audio playback should not fall back to ALSA or stop when entering the audio settings screen.
Investigation
The relevant add-on file is:
The problematic line was found here:
The add-on data file also contained the incomplete value:
with:
Workaround / local patch
Changing the add-on code from:
to:
and updating:
in:
fixed the problem.
After reboot:
- Bluetooth connects automatically.
- Kodi shows PulseAudio correctly in the audio settings page.
- guisettings.xml keeps the correct value.
- PulseAudio sink is active.
- Audio playback works normally.
- The previous ALSA fallback no longer occurs.
Kodi log after the patch shows:
service.bluetooth-audio: setting default audio device "PULSE:Default|Bluetooth Audio (PULSEAUDIO)" on start
PulseAudio: Opened device Default in pcm mode
Additional logs and outputs
I can provide a full debug log if needed.
Relevant commands used during testing:
pactl info
pactl list sinks short
pactl list sink-inputs
grep -iE 'audiooutput.audiodevice|audiooutput.passthrough' /storage/.kodi/userdata/guisettings.xml
grep -iE 'service.bluetooth-audio|PulseAudio|OpenSink|ALSA|PULSE' /storage/.kodi/temp/kodi.log
dmesg
lsusb
Suggested fix
Please consider updating service.bluetooth-audio so that it stores and applies the full Kodi PulseAudio device identifier:
instead of the shorter/incomplete value:
or alternatively dynamically retrieve the exact PulseAudio device identifier from Kodi’s enumerated audio devices before applying the setting.