[RPi4] PRIME breaks system on 12.2

  • After upgrading to 12.2 from one of the nightly 12.1 releases (july-something) my RPi started to hang after ~5 minutes of movie playtime; I thought about temperature and CPU load but no, it was stable in completely freezing up after 5-10 minutes to the point where only a reset would help. After some digging I turned off direct PRIME sync and now it's fine.

    Just sharing this in case someone else sees this problem.

  • It's unclear what the actual issue is (debug logs demonstrating the problem would help) but disabling DRMPRIME is a workaround and not a fix. You will probably/eventually find that other media will play badly because you've disabled the optimised decoding path and are forcing media to be less efficiently handled.

    /shrug

  • Hi, I have the exact same problem. I upgraded my rpi4 from version 12.0.2 to version 12.2.
    And since then, I've been having issues with complete freezing after a few minutes on h264 videos. However, h265 codec videos play.
    Here are some screenshots of h264 videos that are crashing.



    The problem is that the kodi.log file isn't complete, since you have to power cycle the rpi4.
    And as DeerHunter says, by disabling "DRM PRIME," h264 videos play without crashing.


    Thierry

  • If you can't provide a log from the problematic video then please upload a (short) sample file that exhibits the problem and a debug log from playing that file without DRMPRIME.

    Please provide a full debug log.

    How to post a log (wiki)

    1. Enable debugging in Settings>System Settings>Logging
    2. Restart Kodi
    3. Replicate the problem
    4. Generate a log URL (do not post/upload logs to the forum)

    use "Settings > LibreELEC > System > Paste system logs" or run "pastekodi" over SSH, then post the URL link

    so long,

    Hias

  • Hello,
    I think the problem occurs with all H264 videos.
    But I downloaded a free video from the internet. Here's the link: https://lafibre.info/videos/test/20…p_h264-main.mp4

    I can confirm that the video is causing my rpi4 to crash with the DRM_PRIME option enabled.

    I'm uploading the full video log with the DRM_PRIME option disabled.

    here is the link : https://paste.libreelec.tv/sharing-midge.log

    Thanks, I tried that sample on my RPi4 and it played fine.

    But I noticed in your log that you have hyperion and drm-capture services installed and they are in a crash loop:

    Code
    Jun 26 10:44:38.189005 TEST-KODI systemd[1]: [email protected]: Scheduled restart job, restart counter is at 1.
    Jun 26 10:44:38.224208 TEST-KODI systemd[1]: Started [email protected].
    Jun 26 10:44:38.225830 TEST-KODI systemd[1]: [email protected]: Main process exited, code=exited, status=203/EXEC
    Jun 26 10:44:38.226180 TEST-KODI systemd[1]: [email protected]: Failed with result 'exit-code'.
    Jun 26 10:44:40.103767 TEST-KODI systemd[1]: Started drm-capture.service.
    Jun 26 10:44:40.109901 TEST-KODI systemd[1]: drm-capture.service: Main process exited, code=exited, status=203/EXEC
    Jun 26 10:44:40.110624 TEST-KODI systemd[1]: drm-capture.service: Failed with result 'exit-code'.

    Please remove both of them and test again with DRMPRIME enabled.

    If that hangs as well, ssh in before playing a video and then try to run "pastekodi" just after kodi became unresponsive.

    so long,

    Hias

  • Hello,

    So, Hyperion and DRM-Capture weren't installed on the PI. Since I had restored Libreelec, it was just the services that tried to launch.
    I disabled both services, but it still crashes.
    So I just did a fresh install directly in 12.2 on another USB drive, then copied the videos to the folder in /storage. The only setting I re-enabled was EGL in the rendering method for DRM_PRIME, and it crashed. However, in "DIRECT" mode, it works, but the FPS performance is lower.


    I tested with official kodi video :

    -FPS_test_1080p23.976_L4.1.mkv

    -FPS_test_1080p50_L4.2.mkv


    system crash at ~1'20"

  • Thanks for the info, I could now reproduce the issue and we'll look into getting that fixed.

    EGL rendering is the culprit, that causes a huge memory leak and when all memory is used up the system comes to a crawl - until eventually the OOM killer kicks in and restarts kodi (that could take a couple of minutes).

    In general I strongly recommend to stick to the default Direct-to-plane rendering method as that has a lot higher performance than EGL (and also supports 10bit / HDR output).

    so long,

    Hias

  • Thanks for the info, I could now reproduce the issue and we'll look into getting that fixed.

    EGL rendering is the culprit, that causes a huge memory leak and when all memory is used up the system comes to a crawl - until eventually the OOM killer kicks in and restarts kodi (that could take a couple of minutes).

    In general I strongly recommend to stick to the default Direct-to-plane rendering method as that has a lot higher performance than EGL (and also supports 10bit / HDR output).

    so long,

    Hias

    Hi,
    It's great that you were able to reproduce the problem. This will help me try to find a solution.
    I'll follow your advice and use the "Direct" rendering method. I don't know why I enabled EGL mode. I've been using Libreelec for a long time, and I don't remember ever playing with this option.