Hi,
I'm currently experimenting with pulseaudio in LibreELEC. What I did so far:
mount -o remount,rw /flash
echo "dtparam=audio=on" >> /flash/config.txt
mount -o remount,ro /flash
echo "snd-bcm2835" > /etc/modules-load.d/snd-bcm2835.conf
echo "pactl load-module module-udev-detect" >> /storage/.config/autostart.sh
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:
E: [alsa-sink-bcm2835 ALSA] alsa-util.c: snd_pcm_delay() returned a value that is exceptionally large: -54599632 bytes (-309521 ms).
E: [alsa-sink-bcm2835 ALSA] alsa-util.c: Most likely this is a bug in the ALSA driver '(null)'. Please report this issue to the ALSA developers.
E: [alsa-sink-bcm2835 ALSA] alsa-util.c: snd_pcm_dump():
E: [alsa-sink-bcm2835 ALSA] alsa-util.c: Hardware PCM card 0 'bcm2835 ALSA' device 0 subdevice 0
E: [alsa-sink-bcm2835 ALSA] alsa-util.c: Its setup is:
E: [alsa-sink-bcm2835 ALSA] alsa-util.c: stream : PLAYBACK
E: [alsa-sink-bcm2835 ALSA] alsa-util.c: access : MMAP_INTERLEAVED
E: [alsa-sink-bcm2835 ALSA] alsa-util.c: format : S16_LE
E: [alsa-sink-bcm2835 ALSA] alsa-util.c: subformat : STD
E: [alsa-sink-bcm2835 ALSA] alsa-util.c: channels : 2
E: [alsa-sink-bcm2835 ALSA] alsa-util.c: rate : 44100
E: [alsa-sink-bcm2835 ALSA] alsa-util.c: exact rate : 44100 (44100/1)
E: [alsa-sink-bcm2835 ALSA] alsa-util.c: msbits : 16
E: [alsa-sink-bcm2835 ALSA] alsa-util.c: buffer_size : 4408
E: [alsa-sink-bcm2835 ALSA] alsa-util.c: period_size : 1104
E: [alsa-sink-bcm2835 ALSA] alsa-util.c: period_time : 25034
E: [alsa-sink-bcm2835 ALSA] alsa-util.c: tstamp_mode : ENABLE
E: [alsa-sink-bcm2835 ALSA] alsa-util.c: tstamp_type : MONOTONIC
E: [alsa-sink-bcm2835 ALSA] alsa-util.c: period_step : 1
E: [alsa-sink-bcm2835 ALSA] alsa-util.c: avail_min : 1104
E: [alsa-sink-bcm2835 ALSA] alsa-util.c: period_event : 1
E: [alsa-sink-bcm2835 ALSA] alsa-util.c: start_threshold : -1
E: [alsa-sink-bcm2835 ALSA] alsa-util.c: stop_threshold : 1155530752
E: [alsa-sink-bcm2835 ALSA] alsa-util.c: silence_threshold: 0
E: [alsa-sink-bcm2835 ALSA] alsa-util.c: silence_size : 0
E: [alsa-sink-bcm2835 ALSA] alsa-util.c: boundary : 1155530752
E: [alsa-sink-bcm2835 ALSA] alsa-util.c: appl_ptr : 677948
E: [alsa-sink-bcm2835 ALSA] alsa-util.c: hw_ptr : 673540
Display More