It's not required per se, but on some platforms I had to use Pulseaudio in order to get sound working in Emulationstation's video previews, also there used to be an issue back when youtube used flash plugin to output sound as the browser itself had locked the device and the plugin tried to acquire it. There will always be corner cases where you need to mix two streams together, and there's just no reason not to use Pulseaudio. ALSA has dmix as well available as /storage/.config/asound.conf.dmix , but according to my testing Pulseaudio's resampler is superior both quality and performance wise.
Here's my other reasons for using it:
- Automatic detection of the active output (mine is hw:0,3)
- A2DP audio streaming
- All apps including containers can simply point to it and have sound on the correct output
Technically, it supports passthrough of HD audio as of 13.0 but Kodi being 5 years behind on technology as usual (no HDR yet lol) it's not supported yet at least not in Leia AFAIK.
My launcher scripts lets you force ALSA if you wish, just prefix the commands with ALSA=1 in es_systems.cfg and you should be good to go (that'll use pasuspender to launch RA too though, so Pulseaudio will still be running after exit due to the current issue). The reason for you not having sound when you stop Pulseaudio is probably because the correct output is not set in asound.conf. ALSA needs to be configured for the right output, I try to detect this (by using Pulseaudio) with alsa-config.sh and output it to /storage/.config/asound.conf.hw which is symlinked to asound.conf. Have a look at it, it's not fail proof.
I used to have ALSA as a default, but then I was flooded with "no sound" reports due to improperly set up asound.conf (before I created alsa-config.sh). Either way you look at it, it's hard to have sound working automagically on all platforms and across all applications. I choose Pulseaudio because I feel it's the right way forward and when it does work it works beautifully.
Back to the issue at hand, it seems like pasuspender doesn't unsuspend the sink. This was working, I suspect an issue with glibc 2.31. I see that pactl list ends in a segmentation fault as well. A quick fix is to add a custom kodi.service with this line added:
ExecStopPost=/usr/bin/pactl suspend-sink @DEFAULT_SINK@ 0
I can reproduce, so I will get this fixed. I know my quality control is poor at times due to lack of time. I don't keep an archive of images either as my gdrive gets filled up. I'll try to get it solved after work + build time for all platforms