A06 pulseaudio high CPU usage, random breakage of video decoding

Title pretty much says it all, pulseaudio will randomly use very high CPU (>70% in top), and when this happens video playback will go at at most 1fps. Killing pulseaudio makes video play normally but without audio. I checked dmesg and found this:

[ 5159.135477] hdmi-audio-codec hdmi-audio-codec.5.auto: Only one simultaneous stream supported!
[ 5159.135500] hdmi-audio-codec hdmi-audio-codec.5.auto: ASoC: error at snd_soc_dai_startup on i2s-hifi: -22
[ 5159.135515]  ff8a0000.i2s-i2s-hifi: __soc_pcm_open() failed (-22)

That message might be from killing and restarting pulseaudio. If it is occurring during normal playback then it’s a bug.

Pulse burns a lot of CPU because of the way it works. It has multiple conversion steps in order to mix audio that is done in software and not hardware. Pulse is nice because it gives higher level software a very consistent interface for audio even when hardware is lacking in functionality or has strange limitations for mixing.

If you’re looking for performance than going to ALSA directly and disabling pulse will let you run sound in one application at a time. This is probably the best choice if you’re looking for high performance, low latency video playback.

Another option is to move to using Pipewire (or Jack2). It can behave a little better with regard to real-time performance and lower latency. You will still see some CPU load while audio is playing, but it shouldn’t affect your other programs too badly. Video sync is theoretically better with Pipewire, and it should work fine with GStreamer based players, but you will have to look carefully at setting up non-gstreamer players to take advantage of Pipewire else it will simply emulate Pulseaudio interfaces and not buy you much.

It does occur during normal playback, before killing pulse iirc.

I’ll look into pipewire. Also, during normal playback pulse doesn’t go over 10’%, hence why I too assume that it’s a bug.

That sounds like a bug to me. It is probably a driver bug because other platforms aren’t having this issue with pulse. I’d recommend staying tuned into kernel updates and seeing if there is any activity on the Rockchip RK3399.

would be nice if there are any kernel updates at all lmfao

may end up having to compile my own (a06 kernel was built june 30th '23)

1 Like