(Rpi4) Crackling sound when video has HD resolution

I’m using the Kodi 19 from OSMC 2021.08 in Raspberry Pi 4
When I play a video equal or higher than 720 pixels, sound crackles.
I’ve tried both with Live TV (PVR) and with a saved .mp4 file.

At same Raspberry Pi 4, using Raspbian 10 (buster) + Kodi 18.9 , sound plays perfectly with video files up to 1080p and Live TV up to 720p

No different behaviour on AAC or MPEG audio formats and audio channels number.

Can this be caused for some latency adjustment? What can I do to fix sound?

Forum thread at Kodi forum:
https://forum.kodi.tv/showthread.php?tid=364561

how about with system/audio/output configuration: fixed ( from optimized )? still getting the crackling ?

No difference with audio/output setting; all values tested.

I’ve read this:

Does this occur on all files or just some?
What is the source of the files?

This occurs with Internet streaming, PVR for terrestrial TV signal, and local files.
When media is 1080p this occurs with ALL contents and even many video frames are lost. When media is 720p sound issue occurs most of cases and noise is not so intense. It never occurs with DVD resolutions or lower (any source).

I’m now trying this as a workaround:

How to boot to USB RAID - Raspberry Pi Forums

But I have this difficult:

How to boot with initramfs on Raspberry Pi 4

I’m not sure how booting from USB drives will change this.

USB interface is faster than SD card/interface. With USB RAID many operations run from 2x to 4x faster than using SD media.
I don’t know how to check if Kodi player do use of i/o for temporary data on decoding media, or unrelated i/o operations delay media decoding processes, but Raspbian in USB RAID works really faster and mitigates crackling sound issue.

I’ve downloaded this video to test about resolution vs sound: Static HD picture makes it to crackle too:
Static HD picture crackles sound too

I’ve found a workaround: System → Player → Video → Allow hardware acceleration: Disabled