Stuttering / slowness and frame drops on RPi4

  • Hi

    I'm new to the Pi way of life and just installed LibreElec on a brand new Pi 4 with 4 GB of RAM.

    I'm experiencing some mild stuttering and time slowdown effect when playing some more demanding files.

    From Kodi's OSD codec info I could see the following:

    - for a 1080p 60fps x264 encoded video I'm getting around 10 frame skips per minute. Example http://distribution.bbb3d.renderfarming.net/video/mp4/bbb_…0fps_normal.mp4

    - for a 2160p 60fps x265 encoded video I'm getting hundreds of frame drops per minute. Example http://jell.yfish.us/media/jellyfis…-hevc-10bit.mkv

    (I removed the http:// from the links to avoid embedding)

    The CPU load always stays under 20%

    I'm running LibreElec 9.2.5 with Pi Firmware 2020.09.03

    Is this normal or do I need to tweak anything?

    The other issue is that I'm not 100% sure Kodi is playing the videos at 60Hz.

    I've updated my `config.txt` to include the line `hdmi_enable_4kp60=1` and I can choose a 4k resolution with a 60hz refresh rate from the settings in Raspbian.

    When I boot to LibreElec I'm only able to select 4k at 30hz. But I believe that only applies to the UI.

    If I ssh to LE while playing a video I can see that the preferred mode is still 4k60p by running `tvservice -d /tmp/eid.dat && edidparser /tmp/eid.dat`

    > HDMI0:EDID preferred mode remained as CEA (97) 3840x2160p @ 60 Hz

    But `tvservice -s` will say

    > state 0xa [HDMI CUSTOM RGB lim 16:9], 3840x2160 @ 30.00Hz, progressive

    So I'm not 100% sure video playback is happening at 60Hz.

    Thanks