I'm currently experimenting with pulseaudio in LibreELEC. What I did so far:
After that I rebooted and configured Kodi to use pulseaudio.
The good thing is this works. The bad thing is it adds a noticeable (1-3 seconds!) delay to the sound processing. The delay is clearly added by pulseaudio as it goes away when you configure Kodi to use ALSA instead. Also from time to time audio stops completely without anything (pulseaudio showing "D: [alsa-sink-bcm2835 ALSA] source.c: Processing rewind..." - which seems to be a harmless message as it does that while the sound works, too. dmesg doesn#t show anything for that issue).
The next thing I did was to create the file /storage/.config/pulse-daemon.conf.d/9999-pulsetest.conf - then I started to play around with it. My findings so far:
- resample-method = trivial uses more CPU than the default (speex-float-1) - In fact with the default pulseaudio will always show ~0% CPU usage.
- default-sample-rate beeing 44100 or 48000 doesn't seem to make a difference.
- Lowering default-fragments produces sound distortion. But even when we tune default-fragments and default-fragment-size-msec the delay won't go away.
- Highering realtime-priority also doesn't change the delay.
- Highering the suspend timeout from 5 to 120 seconds doesn't stop the sound from stopping randomly.
Now to my questions:
- Does anyone know a way to show FPU usage?
- Any ideas what else to test?
And a moment before I wanted to post this I found something new: When the sound stops and you do a killall kodi.bin the screen will stay black untill you kill pulseaudio, too. When you kill pulseaudio in that scenario it shows this: