lolek thanks, got your mails, I'm answering here so other users can follow, too:
The buffer underruns ("snd_pcm_writei(-32) Broken pipe" lines in kodi log) are most certainly caused by kod not being able to sustain the data rate of the file.
Kodi requests 200ms audio buffers, but can only get a ~86ms one due to the current defaults in the vc4 driver. As you play the files from local media this means kodi won't use a read buffer/cache, so if the read rate from the drive drops (eg due to seeking etc) you have a higher chance of getting underruns.
Please do the following tests on the current nightly builds:
First try if increasing the audio buffer size helps:
systemctl stop kodi
echo 2048 > /proc/asound/vc4hdmi0/pcm0p/sub0/prealloc
systemctl start kodi
When playing a HD audio file kodi log should now indicate that it could use a 200ms buffer (the "setting timeout..." line)
2021-02-25 15:28:49.606 T:941 DEBUG <general>: CAESinkALSA::InitializeHW - Request: periodSize 9600, bufferSize 38400
2021-02-25 15:28:49.610 T:941 DEBUG <general>: CAESinkALSA::InitializeHW - Got: periodSize 9600, bufferSize 38400
2021-02-25 15:28:49.610 T:941 DEBUG <general>: CAESinkALSA::InitializeHW - Setting timeout to 200 ms
Then try with an advancedsettings.xml file, setting buffermode to 1 (so local files use kodi's cache, too) .
/storage/.kodi/userdata/advancedsettings.xml:
<advancedsettings version="1.0">
<cache>
<buffermode>1</buffermode>
</cache>
</advancedsettings>
Reboot, so the audio buffer size change is restored back to the default and advancedsettings change take effect and test again.
It could also be that both audio buffer size increase and local buffering are required.
Please let us know which variants work and send me pastekodi logs of the cases where you got audio dropouts / underruns. I'm also still interested in a pastekodi log of a dropout with plain nightly build, wiithout any of the above mentioned changes.
so long,
Hias