RPi4 testbuild with HDR support

  • Just tried the .tar linked in the first post here. I get 2160p23.976 HDR10 HEVC stuff playing back with an HDR PQ EOTF flagged and HD Audio bitstreamed.


    However the video output is only 8-bit not 10-bit according to my HD Fury Vertex, so although the TV is in HDR mode and displaying HDR video content with the correct EOTF - there will potentially be banding as the 10-bit source video is being truncated to 8-bits? (If dithering is used this might be partially masked though)


    Is there supposed to be 10-bit 4:4:4/RGB or 12-bit 4:2:2 output implemented, to allow 10-bit content to be output in 10 or 12-bit - or is this test build just to get correctly flagged EOTFs?


    I notice I'm not offered 2160p50 or 2160p59.94 output options in Kodi and when I play 2160p50/59.94 content rather than output it 1080p50/59.94 - I get no video replay at all. (I understand the Pi can't output 2160p50/59.94/60 with 4:2:0 - so for HDR 10-bit content at p50 and higher 4:2:2 12-bit will be the only option for preserving 10-bit?)

    Edited 2 times, last by noggin ().

  • noggin thanks a lot for testing!


    The video driver should support 4:4:4 RGB output at 8/10/12 bit, just read through the info in the PR KMS 10 & 12 bpc updates (5.10) by 6by9 · Pull Request #3982 · raspberrypi/linux · GitHub again and noticed that 4kp30 is limited to 8bpp ATM... 1080p should support 10/12 bit output though.


    When checking the AVI infoframe this morning I noticed it's missing colorimetry info (C0/1 bits are zero), so there may be a few more bits missing in the driver - I've asked popcornmix about that.


    If the driver doesn't handle and signal BT2020 correctly that might explain why there are colour differences to other players.


    The dynamic range infoframe however seems to be sent fine, EOTF, maxCLL/maxFALL etc seem to be set accordingly.


    so long,


    Hias


  • I'll see what Gamut (Rec 709 vs Rec 2020) the HD Fury reports.


    I'll also see what bit depth I get if I remove 2160p modes from the whitelist.


    I've got test signals with various CLL values so can also check those when I get a chance.


    Is HLG HDR flagging supported too - or is it just PQ HDR currently?

  • HLG seems to be properly signaled, my TV displayed "HLG HDR" with one or two of my demo files. Haven't verified the infoframe data in that case but pretty sure EOTF 3 / HLG was set correctly.


    1080p and CLL testing is lso highly appreciated. The metadata in the video files seems to be passed on correctly into the infoframe so I think that part should be fine.


    I'm quite sure you'll see BT.709 in all cases, the kernel code to fill in the colorspace data into AVI infoframe isn't called from the driver :-)


    Could also be that a bit of plumbing in kodi is needed, haven't checked yet if the info is passed on correctly. And as CTA 861 lists three different BT.2020 versions (RGB, YCbCr and YcCbcCrc) there might be some additional work ahead.


    so long,


    Hias

  • Hi, I have a question how the dolby atmos pass-through works on this libreelec version? Like I have a tv that's is certified dolby atmoa device, if I play some videos that have dolby atmos audio how the audio will be flagged? And will I get audio when I have audio pass-through enabled and play dolby atmos files? Thank you in advance , continue the amazing work

  • Thank you for the hard work!

    With my Receiver (Denon AVR-X1600H) and TV (Philips 55OLED804/12), I also have the washed-out colour problem:

    (RPi4 with LibreELEC) vs

    (Builtin video player) and

    (Windows 10 with some Kodi Nightly)


    Curiously, my receiver says the following about the video signal:

    • Resolution: 4K:24Hz
    • HDR: HDR10
    • Color Space: RGB
    • Pixel Depth: 8bits

    When with the Windows 10 input it says:

    • Resolution: 4K:24Hz
    • HDR: HDR10
    • Color Space: YCbCr 4:2:2 BT.2020
    • Pixel Depth: 12bits

    The attached hdr.zip contains edid.dat and debug log. I hope it helps unvover the problem.


    Addendum: Just saw your response to noggin and forced 1080p playback; still only 8 bit RGB and washed-out colours.

    Files

    • hdr.zip

      (43.74 kB, downloaded 39 times, last: )

    Edited once, last by TpmKranz ().

  • TpmKranz thanks a lot for testing and your detailed report, this is highly appreciated!


    I just found out that a bit more plumbing is needed in kodi so we can signal BT2020. Looks like we have a bit of work to do to get proper 10bit BT2020 output - but we'll get there eventually :)


    so long,


    Hias

  • Hi, I have a question how the dolby atmos pass-through works on this libreelec version? Like I have a tv that's is certified dolby atmoa device, if I play some videos that have dolby atmos audio how the audio will be flagged? And will I get audio when I have audio pass-through enabled and play dolby atmos files? Thank you in advance , continue the amazing work

    You have to change settings level to "Expert", then tick Atmos (and whatever other formats your receiver supports) in the "passthrough" section of settings->system->audio.


    Kodi doesn't query the devices capabilites so you have to select formats manually. Note that DD+/E-AC3 passthrough in kodi is buggy, so better keep that disabled. DD/AC3, DTS HD and Atmos should all work fine.


    so long,


    Hias


  • Disabling 2160p output modes in the whitelist and playing back a 2160p HDR10 file I get 1080p RGB 8bit output for HDR 10, with an ST 2084 EOTF flagged. I haven't seen >8 bit depth or YCbCr output so far.


    Without doing a bit more digging I can't easily see on my HD Fury OSD whether Rec 2020 or Rec 709 gamut is being signalled - but looking at the output it looks like it's in the wrong gamut as expected. (i.e. Rec 709 primaries rather than Rec 2020 are being flagged or assumed by my display). It's also not instantly easy to tell whether Rec 2020 or Rec 709 YCbCr->RGB matrix co-efficients have been used for the YCbCr to RGB conversion (Rec 2020 has different YCbCr<->RGB conversion matrix values to Rec 709, just as Rec 709 HD and Rec 601 SD (*) differ from each other)


    (WRT to Rec 2020 - I don't think much content uses YcCbCCrc which is the constant luminance-based option - I think all mainstream content, other than DV single-stream, which isn't going to be relevant here, is 4:2:0 YCbCr - output on most consumer players as 4:2:2 12-bit YCbCr)


    Also - only the first 2160p HDR file I play correctly plays. Subsequent files fail to play (I get audio but only see the file list GUI and have to reboot)


    (*) Rec 601 even, technically, has different RGB primaries, and thus gamuts, for the 525/480i and 625/576i variants due to the NTSC and PAL legacies before them... (And Japanese NTSC and North American NTSC have different white points...)

    Edited 4 times, last by noggin ().

  • noggin thanks a lot for testing, this is in line with my suspicion (video driver using the wrong transformation matrix). Not 100% sure why 10/12bit output isn't automatically enabled, could be that we need to explicitly request it.


    Regarding subsequent playback issues: Which testbuild did you use? The one from the first post (from Feb 5) or the one from here RE: RPi4 testbuild with HDR support (Feb 10)? The later build contains some important fixes that may be related.


    If you got that issue with the newer build please post a log (ssh in, run "pastekodi" and post the URL) and ideally a link to a sample file so I can try to reproduce that locally.


    so long,


    Hias

  • Hi, I tried the image today and I am very surprised with the all new cool stuff, congrats hiass but I have the following question , as some users reported that this image supoorts dts hd and dolby atmoa and other dolby formats , my tv is certified for dts hd-ma and for dolby atmos and kodi when I download it from the android tb playstore supoorts these audio formats but for some reason on the pi can't get these formats could you help me get truehd , dts hd ma and dolby atmos , I have uploaded 2 pictures to see what I mean, thank you in advance and continue the amazing work you do!


    ** when I play dts-hd format the format displayed is dts and when I play dolby HD I get dolby digital and like these 2 formats the other audio formats appear the same

  • linuxuser can you please grab the edid of your TV and upload it? Run

    Code
    cat /sys/class/drm/card0-HDMI-A-1/edid > edid.dat

    then upload edid.dat (you may need to ZIP it so attaching works in the forum software).


    so long,


    Hias

  • Hi again , do I need to grab this file from the tv or from the Raspberry pi 4? Thank you and also I tried but it says -sh edid.dat : not found

  • Hi again , do I need to grab this file from the tv or from the Raspberry pi 4? Thank you and also I tried but it says -sh edid.dat : not found

    Use putty to connect to your RPi, enter that command, then use eg filezilla to copy the edid.dat file to your PC.


    As an alternative you can run the following command via putty:

    Code
    cat /sys/class/drm/card0-HDMI-A-1/edid > /storage/videos/edid.dat

    then you can get to the edid.dat file via the "Videos" samba/windows share.


    Edit: if you are using linux then use ssh [email protected] instead of putty and "scp [email protected]:~/edid.dat ." instead of filezilla.


    so long,


    Hias

  • Sorry but I am dumb and not an ecepert , is there any tutorial to find the edid.dat easier?because I tried and it says permission denied


    Thank you