hevc kernel panic in le11 ? / x265 howto or workaround ?

  • Hello, when trying to read x265 files in local storage in le 11.0.1 on a s912 (vorkez z6 plus), I think the box hangs : gui is unresponsive and terminal no longer accepts input (had to unplug to stop)

    I understand there is a problem with hevc / x265 drivers that is hard to fix with the recent kernels and with limits in amlogic builds (as per le11 announcement https://libreelec.tv/2023/03/06/libreelec-nexus-11-0-0/)

    My questions would be :

    - whether I could prevent in kodi from reading certain types of data based on the metadata (eg : video stream codec is hevc) or stop playback before attempting to decode streams that will hang the box.

    - if the box should not hang but there is a problem with my config (approximate dtb that would cause general instability : using meson-gxm-tx9-pro.dtb with gb ethernet and wifi simultaneously)

    - if there is a log that could help with the problem, or something that I can do to reproduce the problem with more info if it is interesting

    Thanks in advance.

    These x265 files were not a problem in CE 9.2 (retested) :

    main info for video is below, audio is AAC LC

    Format : HEVC

    Format profile : Main@L4@Main

    Width : 1 898 pixels

    Height : 1 078 pixels

    more info :

    Code
    Writing library                          : x265 1.9:[Mac OS X][clang 7.0.0][64 bit] 8bit
    Encoding settings                        : wpp / ctu=64 / min-cu-size=8 / max-tu-size=32 / tu-intra-depth=2 / tu-inter-depth=2 / me=3 / subme=3 / merange=57 / rect / amp / max-merge=3 / temporal-mvp / no-early-skip / rdpenalty=0 / no-tskip / no-tskip-fast / strong-intra-smoothing / no-lossless / no-cu-lossless / no-constrained-intra / no-fast-intra / open-gop / no-temporal-layers / interlace=0 / keyint=250 / min-keyint=25 / scenecut=40 / rc-lookahead=30 / lookahead-slices=4 / bframes=8 / bframe-bias=0 / b-adapt=2 / ref=4 / limit-refs=2 / limit-modes / weightp / weightb / aq-mode=1 / qg-size=32 / aq-strength=1.00 / cbqpoffs=0 / crqpoffs=0 / rd=6 / psy-rd=2.00 / rdoq-level=2 / psy-rdoq=1.00 / signhide / deblock / sao / no-sao-non-deblock / b-pyramid / cutree / no-intra-refresh / rc=crf / crf=25.0 / qcomp=0.60 / qpmin=0 / qpmax=51 / qpstep=4 / ipratio=1.40 / pbratio=1.30
  • It may help to have 1080p 60/59.94/50/24/23.976 modes whitelisted and adjust refresh start/stop enabled as it will eliminate or greatly reduce the amount of correction Kodi needs to attempt; as the decoder doesn't handle correction too well (same issue as seeking). There is no known list of problem media configs/types so nothing to avoid .. it either works or doesn't.

    I'd be interested in a sample of the file for long-term testing with problem media, but currently there isn't anything I can do about fixing the decoder so my advice would be to transcode the file to H264.

  • ok, I had to do several tries to get proper logs (and removed the mouse so that no spam after evry move of the mouse in the log), the problem is a bit more complex and may be a problem of re configuration of the decoder after x264 playback + ac3

    The steps to reproduce are :

    - ok trying to play the x265 file the first time

    - ok trying to play a x264 file, stopping the reading

    this gives this log : http://ix.io/4rRo


    then ko crash :

    - retrying same x265 file : the machine seems to crash :

    * the network is down (ssh unresponsive)

    * lcd screen (vfd) still displays the time of the crash

    * kodi? emits a loop sound through the screen speakers

    only way to reboot is plug-pulling


    the log is not very helpful as when I re read the x265 file, there is a bit of seemingly binary log at the end that is not valid utf8, and no trace of trying to read the file :

    with pastebinit kodi.old.log i only got no more text information

    http://ix.io/4rRw


    chewitt :

    - ok for the hevc analysis and media configs, my main problem is that it brings down the entire system

    - thanks, i can provide you the samples hum around 500M each to reproduce, I just have not seen yet how to provide them to you (dm with cloud url ?)

    - for the whitelisting, these are both 25fps videos, I'll try to play with the settings (whitelisting 1080p 60 + 50 at least)

    another info for the sample 1 x264 that may put le + kodi in conditions to trigger the crash is that is is ac-3 vs aac, and maybe I am blaming the wrong cluprit (video stream)

  • Hi there,

    sorry, my english is not very good and i don't know much about codecs and so on, but i think i have the same problem...

    Just want to let you know this...

    i have a Tictid K12 (S912) box and with Libreelec 11.0.1 i can't play 4k videos from my NAS drive.

    Rebooting the Device and starting 4k Video the first time it runs.

    Then Starting a 1080 Video and Stopping.

    Starting the same 4k Video that runs - box is crashing - no ssh

    Played with some Settings (Refresh rate) the box is not crashing but after a few seconds 4k Video plays with massive errors or stops or don't start the video. I just gave up with testing...

    With Coreelec 9.2.8 Video playback 4k from my NAS drive works very well...

  • As per release notes; the AMLGX image is not perfect and will not be for all users. I'm not too interested in bug reports because I know the hardware decoders have bugs, there is nothing I can do about that, and comparisons with CE are meaningless since the codebase has 0% kernel and driver code in common.