Raspberry Pi 5: HDR not working

  • BallerShotCaller Does HDR work on RPi4 with DRM Prime?

    If it does, could you provide an RPi4 log after playing the same HDR source? Then we can compare.

    Maybe DRM Prime has an HDR bug on RPi5:

    Code
    2024-06-08 09:47:33.737 T:1007    debug <general>: SetHDR: setting connector colorspace to BT2020_YCC
    2024-06-08 09:47:33.737 T:1007    debug <general>: CVideoLayerBridgeDRMPRIME::Configure - setting max bpc to 12 (true)
    2024-06-08 09:47:33.737 T:1007    debug <general>: CDRMUtils::DrmFbDestroyCallback - removing framebuffer: 304
    2024-06-08 09:47:33.737 T:1007    debug <general>: CDRMAtomic::FlipPage - Execute modeset at next commit
    2024-06-08 09:47:33.775 T:1007    debug <general>: CDRMUtils::DrmFbDestroyCallback - removing framebuffer: 299
    2024-06-08 09:47:33.802 T:1194    debug <general>: CVideoPlayer::SetCaching - caching state 2
    2024-06-08 09:47:33.802 T:1194    debug <general>: CDVDClock::SetSpeedAdjust - adjusted:0.000000
    2024-06-08 09:47:33.811 T:1007    debug <general>: CDRMUtils::DrmFbDestroyCallback - removing framebuffer: 300
    2024-06-08 09:47:33.852 T:1007    debug <general>: CDRMUtils::DrmFbDestroyCallback - removing framebuffer: 303
  • Maybe DRM Prime has an HDR bug on RPi5

    Nope .. at least not one affecting the 40K+ RPi5 users we have (else there'd be more folks showing up with issues).

    All the error messages flagged above are normal/harmless, and show it setting an HDR colourspace and 12-bit output. The RPi side appears to be doing everything correctly. I think the solution lies in AVR and/or TV settings, or port combinations.

  • Thanks. I still would like to compere the logs. Maybe a different modifier is in use on DRM Prime:

    Code
    2024-06-08 09:47:33.736 T:1007    debug <general>: SetHDR: setting connector colorspace to Default
    2024-06-08 09:47:33.736 T:1007    debug <general>: CDRMPlane::SupportsFormatAndModifier - found plane format (P030) and modifier (BROADCOM_SAND128)
  • Nope .. at least not one affecting the 40K+ RPi5 users we have (else there'd be more folks showing up with issues).

    All the error messages flagged above are normal/harmless, and show it setting an HDR colourspace and 12-bit output. The RPi side appears to be doing everything correctly. I think the solution lies in AVR and/or TV settings, or port combinations.

    My guess is that it's something related to the Pi and AVR combo - other 4:2:2 2160p UHD HDR sources work OK - but the Pi 5 (and in some situations Pi 4) don't. There's a similar - though not neccessarily related thread here :

    tomstephens89
    December 29, 2023 at 1:36 PM

    If I get time I'll try to document my experiences with an LG C3 OLED and a Denon AVR-X2800H (4K/8K compatible AVR) with a Pi 4B and a Pi 5 on both the 4K and 8K AVR inputs (8K = HDMI 2.1 - so may have some other differences with 4K/UHD1 sources)

  • OK guys...I did bite the bullet, unplugged everything and moved the Pi5 near to the TV now. So now the Onkyo receiver is not part of the chain anymore and guess what...it works like that. But I mean wtf...why is the Pi4 working with exactly the same setup when the Onkyo receiver is within the HDMI chain and the Pi5 is not working...

    Here are the logs wihtout the Onkyo receiver:

    https://paste.libreelec.tv/holy-raven.log


    EDIT: Maybe it would be interesting to compare the logs from Pi4 with HDMI port 0 and Pi4 with HDMI port 1 when the Onkyo receiver is involved.

    Because on one of the two Pi4 HDMI ports, the issue is exactly the same as with the Pi5 on both HDMI ports. As I already mentioned, on the Pi4 it only works on one of the Pi4 HDMI ports, not on both.

    What do you guys think?

    Edited 3 times, last by BallerShotCaller: Ein Beitrag von BallerShotCaller mit diesem Beitrag zusammengefügt. (June 9, 2024 at 5:53 PM).

  • OK, this is weird. I just re-installed LibreELEC on the Pi5 from scratch again, restored the config from the Pi4 and now it works as it should. WTF? There's absolutely nothing I did differently than before!

    But something strange happened: After restoring the config and rebooting, the screen remained completely black but I was able to boot into LE via SSH. The default Kodi UI resolution was set to 1920x1080p@60Hz, exactly the same as before the re-installation when the Kodi UI was showing up fine. So I tried to set the default Kodi UI resolution to 3840x2160p@Hz which made the screen showing up immediately. Now when I change it back to 1080p via the system menu, the screen goes black again.

    I really don't know what is happening here but it's very weird. HDR works now flawlessly but 1080p@60Hz on the Kodi UI does not work anymore.

    Well, I can easily live with that as the Pi5 can handle 3840x2160p on the Kodi UI with ease. But REALLY WTF :D

  • BallerShotCaller: FYI, I had a similar problem playing some videos through my Onkyo TX-L50 4K AVR with a RPi5/le12.

    I was finding that HEVC videos at all resolutions with 24fps would only play audio (surprisingly 4K/60 HDR test videos played fine).

    Long, long story short, I first tried getedid create with the full train (RPi5 -> AVR -> Samsung 4K TV) without success.

    Next tried removing the TV so only RPi to AVR and did another getedid create. Put back TV but still no good.

    Finally tried a direct RPi5 to TV - this worked so did a getedid create, put back the AVR into the train and low and behold I now have all HEVC videos at all resolutions (including 4K with HDR) playing faultlessly.

    (off course when doing the getedid thing I rebooted, tried test, did getedid delete, reboot etc.)

    It would be interesting for someone in the know to compare the AVR+TV edid vs. AVR only edid vs. TV only edid (i.e. working edid) as I have the files available.

  • I first tried getedid create with the full train (RPi5 -> AVR -> Samsung 4K TV) without success.

    Finally tried a direct RPi5 to TV - this worked

    If you can share the EDID files from AVR+TV and TV-direct I'll ask the Pi devs to have a closer look. The intermediate one (RPi + AVR only) is expected to not work since there's no TV to pass EDID from so it'll be incomplete.


  • Can you play HD Audio (i.e. Dolby True HD, DTS HD MA/HRA) with this set-up (I'm wondering if the TV-only EDID you are using doesn't have flags for the AVR-supported audio that the TV doesn't support ? Or it could be that with modern TVs they do flag support for this because eARC lets them pass it through?)

  • If you can share the EDID files from AVR+TV and TV-direct I'll ask the Pi devs to have a closer look. The intermediate one (RPi + AVR only) is expected to not work since there's no TV to pass EDID from so it'll be incomplete.

    chewitt Sorry about the delay in replying.

    I thought I had saved the edid.bin files for each permutation but I can only find the equivalent .txt files that I stored after doing a edid-decode on each of the .bin files.

    Anyway, I have attached the 2 .txt files with the EDID TV-wo AVR.txt being the working one and EDID TV+AVR.txt non-working to see if this is of any help.

    EDID TV-wo AVR.txt  EDID TV+AVR.txt

    Can you play HD Audio (i.e. Dolby True HD, DTS HD MA/HRA) with this set-up (I'm wondering if the TV-only EDID you are using doesn't have flags for the AVR-supported audio that the TV doesn't support ? Or it could be that with modern TVs they do flag support for this because eARC lets them pass it through?)

    noggin I have checked all my audio test files and the AVR shows correct output according to the test files (DD, DD TrueHD, DTS, DTSMA) so I believe the TV must flag all the audio options for passthrough.

  • OK, this is weird. I just re-installed LibreELEC on the Pi5 from scratch again, restored the config from the Pi4 and now it works as it should. WTF? There's absolutely nothing I did differently than before!

    But something strange happened: After restring the config and rebooting, the screen remained completely black but I was able to boot into LE via SSH.

    Can you be precise with the sequence here.

    1. Fresh install of LE on Pi5 from scratch works fine

    2. "restored the config from the Pi4" - did you copy .kodi directory or use an backup/restore addon? And this works fine.

    3. "After restring the config and rebooting, the screen remained completely black" do you just mean a reboot compared to the previous step, or did you restore something else?


    Assuming step 2 was working without a reboot, then kodi is likely not using the restored config.

    It may be interesting to identify what file in the config is the one that causes the issue. guisettings.xml is the most likely.

    (But I don't know if you are restoring anything else, like contents of /flash partition).

  • popcornmix These are the steps I did in the exactly following order:

    1. I did a fresh install of LE on the Pi5 (Which was working fine, the UI came up without any issues.).

    2. Via the UI I did restore the config from the Pi4 with the LE native backup/restore menu (Which also worked fine.).

    3. After the config restore, the Pi5 rebooted (The boot logo came up, but the screen remained black after that, but logging in via SSH was possible. So I rebooted via SSH again, the boot logo came up again but after that, the screen still remained black.)

    4. Then I SSH'd into the system again, stopped Kodi service, set the default UI resolution to 4K@60Hz in guisettings.xml and then started Kodi service again (After that the UI came up and since then everything works as intended.).

    The really strange thing is that 1080p@60Hz does not work anymore now. When I set the default UI setting to 1080p@60Hz, the screen goes black until the resolution goes back to 4K automatically again after confirmation time is up.

  • The really strange thing is that 1080p@60Hz does not work anymore now. When I set the default UI setting to 1080p@60Hz, the screen goes black until the resolution goes back to 4K automatically again after confirmation time is up.

    When it is set to 1080p60 (and is not showing an image), can you report output of kmsprint?

    (execute that through ssh).

  • Hmm...when I started the system again today and switched from 4096x2160p@60Hz to 1920x1080p@60Hz the issue with the UI remaining black was gone somehow. But now the initial issue with the HDR problem came back again.

    Good news is, after tinkering around, I have foud a way where I can definitely reproduce the HDR issue.
    Let me explain the according steps I can reproduce:

    1. Booting LE with UI resolution 4096x2160@60Hz
    2. Starting the HDR video --> Works
    3. Stopping the HDR video
    4. Changing the UI resolution to 1920x1080p@60Hz
    5. Starting the HDR video --> Does not work (the invalid format TV message appears)
    6. Stopping the HDR video
    7. Changing the UI resolution to 4096x2160p@60Hz
    8. Starting the HDR video --> Does not work (the invalid format TV message appears)
    9. Reboot LE
    10. Starting the HDR video --> Works