Posts by sigmaris

    I have some scripts to rebuild the Debian FFMPEG packages with v4l2-request support which may provide some helpful info. In particular when compiling FFMPEG, you need to add --enable-v4l2-request to the configure arguments, but you also have to have Linux kernel headers (in Debian the package name for this is linux-libc-dev) from a kernel with v4l2-request support installed on the system where you are compiling FFMPEG. You can see in the script I install linux-libc-dev from a kernel I built previously.

    Hmm, actually I have noticed something similar with my TV where I need to keep the volume in Kodi at about 33% to avoid severe audio distortion. This only affects my TV (Samsung UE40EH5000), but not another HDMI monitor I tested with. However I did experience the glitches/clicks problem on the HDMI monitor when I was using it.

    I thought the two problems weren’t related, but I guess they might be? Worth noting, the distortion at high volume happens on LibreELEC as well as my Debian install.

    I've been wondering if pulseaudio would be able to fix it. Would you happen to have a how to on doing this? I've implemented the settings from KOPRajs, but I feel that's not a long term fix really. I even have to do it with the newly released LE 10. Would be nice to have a more proper fix, and using pulseaudio would be great.

    I'm afraid I don't have a how-to for LibreELEC, I am using Debian but with a custom kernel & FFmpeg with patches from LibreELEC. For me, I installed and enabled pulseaudio and added

    Code
    User=kodi
    PAMName=login
    TTYPath=/dev/tty1

    to the systemd unit file I use to run Kodi as a service, then it starts a user session for Kodi which includes pulseaudio. I am not familiar with how to do the same on LibreELEC though, sorry.

    PS: my original post was 2 years ago, I did a quick test of disabling pulseaudio now, and couldn't reproduce the audio glitches using only ALSA. It may have been fixed at some point in the past 2 years.

    I've noticed that Software decoded video using DRM PRIME rendering causes a lot of kernel warnings on the latest nightly build on RK3399 (RockPRO64). I first found this with my own Debian distro and build of Kodi 19, chewitt on the Freenode #panfrost channel suggested reporting it to knaerzche here as it happens on LibreELEC 9.8 nightly 20210206-dc904cd as well.

    To reproduce it, I just played a RealVideo (i.e. definitely not hardware decoded) video clip in LibreELEC with default settings. The video is displayed in Kodi, but the frame rate is lower than it should be - maybe because it seems like every few frames or maybe every frame, a warning is logged by the kernel. The warnings all look like this: kernel WARNING from kodi software decoding · GitHub logged from drivers/gpu/drm/drm_gem.c:1096 drm_gem_mmap_obj+0x1a8/0x208

    It looks like this doesn't happen for hardware-decoded video which gets displayed directly on a DRM plane; seems like it's triggered by importing frames from a DMA-buf to a texture using EGL, which in the RK3399 case only happens for software-decoded video.

    I have also noticed small clicks/pops in HDMI audio in Kodi, not on LibreELEC but using a custom build of Debian Buster with 5.3 kernel.

    If the CPUfreq scaling governor is set to "performance" it doesn't happen for me.

    If the governor is the default "ondemand" I hear the clicks. So I suspect it's related to CPUfreq switching frequencies.

    KOPRajs and butterkitty on the mainline kernel, you could try running (as root)

    Code
    echo "performance" > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor
    echo "performance" > /sys/devices/system/cpu/cpufreq/policy4/scaling_governor

    and then test HDMI audio. It'd be interesting to see if that fixes the issue.