[SOLVED] HLG HDR output flagged as HDR10 PQ

Hi there

Just bought an ODroid N2 and am running the current CoreElec nightly from eMMC (after trying the stable release and realising it didn’t do PCM multichannel output - which is required for 5.1 AAC audio as used by UK Freeview HD)

However I’ve just tried playing a couple of HLG Rec 2020 HDR files and they are output as Rec 2020 gamut, but flagged with an ST.2084 EOTF (i.e. PQ as used by HDR10) rather than the HLG ARIB B67/Rec.2100 HLG EOTF that they have flagged within their HEVC video.

Media Info for the files below :

Color range                              : Limited
Color primaries                          : BT.2020
Transfer characteristics                 : HLG / BT.2020 (10-bit)
Matrix coefficients                      : BT.2020 non-constant

Is anyone working on HLG output for the N2 does anyone know? Will be very useful in the UK for UHD HDR iPlayer streams as the BBC use HLG for them.

So far only the RK3399 seems to correctly output HLG correctly flagged as HLG (but it doesn’t output HDR10 MaxCLL/MaxFALL metadata for HDR10 - so is flawed in other ways)

What do you mean flagged as HDR10? Where is it flagged? Do you mean in the info dialog or are you using something else to test this?

I have checked two ways :

  1. HD Fury Vertex HDMI analyser - which tells you gamut, EOTF, (plus MaxCLL/MaxFALL and mastering metadata for PQ), frame rate, chroma format, HDMI clock rate etc. When I play HLG HDR content on the N2 the Vertex reports it’s being fed video flagged as ST.2084 (i.e. PQ) EOTF - not the HLG (i.e. non-PQ) EOTF.

  2. My Sony UHD HDR TV lets you select HDR format automatically or manually. When I switch from Auto to forced HDR10 on the Sony TV when the N2 is playing HLG content I don’t see any change, confirming the TV is being put into HDR10 mode when the N2 is playing HLG content.

So far I’ve tried the LG Cymatic Jazz demo - which is available in both HDR10 and HLG variants.

Thanks, we’ll look into it.

Thanks - I’ll see if I can dig out some of the BBC iPlayer Planet Earth stuff to test too.

If you don’t have it already, here is a short sample from BBC Seven Worlds One Planet in HLG.

Unique ID                                : 255300624580580099788532410877499080352 (0xC0111C9CF646CD1278ECF5660792FEA0)
Complete name                            : Seven Worlds One Planet S01E01 HLG Sample.mkv
Format                                   : Matroska
Format version                           : Version 4
File size                                : 106 MiB
Duration                                 : 46s 80ms
Overall bit rate                         : 19.2 Mbps
Encoded date                             : UTC 2019-11-08 16:55:39
Writing application                      : mkvmerge v39.0.0 ('In The Waiting Line') 64-bit
Writing library                          : libebml v1.3.9 + libmatroska v1.5.2

ID                                       : 1
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format profile                           : Main 10@L5.1@Main
Codec ID                                 : V_MPEGH/ISO/HEVC
Duration                                 : 46s 80ms
Bit rate                                 : 18.6 Mbps
Width                                    : 3 840 pixels
Height                                   : 2 160 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 25.000 fps
Standard                                 : Component
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 10 bits
Bits/(Pixel*Frame)                       : 0.090
Stream size                              : 102 MiB (97%)
Default                                  : Yes
Forced                                   : No
Color range                              : Limited
Color primaries                          : BT.2020
Transfer characteristics                 : BT.2020 (10-bit)
transfer_characteristics_Original        : HLG / BT.2020 (10-bit)
Matrix coefficients                      : BT.2020 non-constant

ID                                       : 2
Format                                   : E-AC-3
Format/Info                              : Enhanced AC-3
Commercial name                          : Dolby Digital Plus
Codec ID                                 : A_EAC3
Duration                                 : 46s 80ms
Bit rate mode                            : Constant
Bit rate                                 : 640 Kbps
Channel(s)                               : 6 channels
Channel layout                           : L R C LFE Ls Rs
Sampling rate                            : 48.0 KHz
Frame rate                               : 31.250 fps (1536 SPF)
Compression mode                         : Lossy
Stream size                              : 3.52 MiB (3%)
Language                                 : English
Service kind                             : Complete Main
Default                                  : No
Forced                                   : No

Text #1
ID                                       : 3
Format                                   : UTF-8
Codec ID                                 : S_TEXT/UTF8
Codec ID/Info                            : UTF-8 Plain Text
Duration                                 : 23s 440ms
Bit rate                                 : 82 bps
Count of elements                        : 8
Stream size                              : 243 Bytes (0%)
Language                                 : English
Default                                  : No
Forced                                   : No

Text #2
ID                                       : 4
Format                                   : UTF-8
Codec ID                                 : S_TEXT/UTF8
Codec ID/Info                            : UTF-8 Plain Text
Duration                                 : 23s 440ms
Bit rate                                 : 82 bps
Count of elements                        : 8
Stream size                              : 243 Bytes (0%)
Title                                    : SDH
Language                                 : English
Default                                  : No
Forced                                   : No

Yep - that plays flagged as HDR10 rather than HLG too.

My HD Fury Vertex reports : SMPTE ST 2084 LUM 5000/0.005 maxCLL/FALL 0/0

It is output with BT2020 gamut in 10-bit 4:2:0 4K50.

Oddly - if I force it into HLG mode it doesn’t look right though, and looks more ‘right’ in HDR10 mode. Could the N2 be doing an HLG->PQ conversion (or an SDR->HDR conversion and ignoring the HLG gamma - as HLG is pretty similar to SDR for 75% of it’s EOTF and rolls off the highlights so they look OK in SDR - hence the backwards compatibility argument HLG has)

When you have some time, it would be very helpful if you could test the samples on Android Pie OS for N2 and compare the results. If the results are the same, we can create a bug report at Hardkernels forum so they can consult with AMLogic directly to look into this :+1:

One more thing, if you play the HLG samples with your TV’s internal player, do you see a difference in picture quality as the samples should be played in HLG?

Which Android Pie build should I download ? There are lots here - 64 bit, and I guess 32 bit?

Have found out about SPI vs MMC switch - and it seems eMMC has priority over uSD so I’ll just pull my eMMC module.

I’ll try them in the internal player and on the RockPro64 which outputs HLG correctly flagged as HLG in LibreElec.

It’ll take me a little while to get Android installed - can I boot that from uSD ? And do I need to do anything to boot from uSD rather than eMMC ? (I see an SPI / MMC switch on the front)

Choose the latest Android Pie using 32-bit system as 64-bit is fairly new and has probably a lot of issues… So version selfinstall-odroidn2-eng-s922_9.0.0_master-91-20191028.img by following HK’s OS installation guide or HK’s flashing guide :slight_smile:

You can either switch to SPI and choose OS with Petiboot, latest version is 201911-rc1 from the latest page of the thread, or unplug eMMC as you say and use mSD. The easiest way is to install petiboot by copying the renamed spiboot.img to an empty mSD card to update/install, wipe the same mSD card and flash Android to it with Etcher and finally plug it into with SPI selected and then choose OS with Petiboot.

Update: At first boot with Android, you have to remove eMMC with CE and not select SPI (turn the switch to the right). After that, the partions should be set-up so you can use SPI and don’t need to remove eMMC every time you want to use Android :+1:

Try the following in SSH:
echo 0 > /sys/module/am_vecm/parameters/hlg_process_mode
echo 1 > /sys/module/am_vecm/parameters/force_pure_hlg
Then start your HLG video and see if it works right or not.

Also, please post the link returned by dispinfo command during video playback before making the above change and after.

Great - thanks for this @TheCoolest and @CI6N0Z - am away from my HDR TV this evening. Should be able to do that tomorrow (though I can do the Android and SPI stuff tonight in preparation)

What your tv says when you play HLG content from the N2 (HLG or HDR)? My LG shows HLG.

Update 2:
In my case, my AVR is the issue as the manual says it supports HDR, yet nothing more regarding which HDR standard. So, unfortunately it might not support HLG. I’ve sent Onkyo a mail for clarification regarding this.

Dispinfo from playback when N2 is connected directly to TV

------------ /sys/devices/virtual/amhdmitx/amhdmitx0/config ------------
cur_VIC: 94
VIC: 94 3840x2160p25hz
Colour depth: 10-bit
Colourspace: YUV444
Colour range: default
YCC colour range: limited
Colourimetry: BT.2020nc

@TheCoolest, I can also confirm HLG samples being played in HDR10 as seen from dispinfo during playback of HLG sample

Running the following two commands, I’m not able to change hlg_process_mode as seen below, yet the value is already 0.

CoreELEC: ~ # echo 0 > /sys/module/am_vecm/parameters/hlg_process_mode
sh: can’t create /sys/module/am_vecm/parameters/hlg_process_mode: Permission denied
CoreELEC: ~ #
CoreELEC: ~ # echo 1 > /sys/module/am_vecm/parameters/force_pure_hlg

So, with force_pure_hlg = 1 the sample is played in SDR as seen in dispinfo during playback of HLG sample with force_pure_hlg = 1

As seen from dispinfo, HLG support is not checked for my display and I’m actually not 100% sure that my TV supports HLG. According to Samsung they say that “All of Samsung’s 2016 HDR TVs support HLG Broadcast technology” (Source). By playing a HLG Youtube sample, stats says: Color: arib-std-b67 (HLG) / bt2020 with vp9.2 (337) codec. However, I can’t confirm it actually being played in HLG, so noggin has to verify and look deeper into this as he has a HD Fury Vertex :+1:

OK - am back with my UHD HDR TV and AVR. Both of which are HLG compatible.

Here’s dispinfo output in idle whilst displaying 1080p50 SDR without any video playing http://ix.io/21p2 (Interestingly this seems to suggest it thinks my AVR+TV combo isn’t HLG compatible?

------------ /sys/devices/virtual/amhdmitx/amhdmitx0/hdr_cap ------------
HDR Static Metadata:
    Supported EOTF:
        Traditional SDR: 1
        Traditional HDR: 1
        SMPTE ST 2084: 1
        Hybrif Log-Gamma: 0
    Supported SMD type1: 1
    Luminance Data
        Max: 0
        Avg: 0
        Min: 0

HDR Dynamic Metadata:

colorimetry_data: c3

When I play the short sample.mkv clip of Seven Worlds, One Planet without making any changes I get this : http://ix.io/21p3

It’s output in HDR10 mode - but looks like it may be being converted from HLG to HDR10 - at least partially.

If I then type echo 1 > /sys/module/am_vecm/parameters/force_pure_hlg the TV goes into SDR mode and the picture looks correct (for HLG displayed backwards compatibly with SDR). I can then manually force my TV into HLG mode. My guess is that the N2 doesn’t think my TV / AVR is HLG?

dispinfo gives me this http://ix.io/21p4

I’ll try and take my AVR out of the chain - but both my TV and my AVR support HLG.

I’ll give Android a go too.

I thought the same about my Onkyo AVR which state at the website “This Onkyo AVR enables transmission of High Dynamic Range (HDR) formats…” So it should be able to passthrough HDR formats such as at least HDR10 and HLG. I’ve sent Onkyo an email to clarify this.

At least your results look similar to mine and I bet that you’ll get “Hybrif Log-Gamma: 1” and EOTF: HLG as I did when you connect N2 directly to your TV.

1 Like

What are the full product names for your TV and AVR? And which firmware version are they on?

Our edid values for the AVRs are quite similar. Two things to look into are ColorDeepSupport b8 and DolbyVision2 HDR DeepColor vs HDR DeepColor which I’ve. So, from edid, CoreELEC can’t recognice if the AVRs support HLG…

Update: With a newer Denon AVR, edid is similar, but HLG is working fine. In my case I think it’s my AVR which have issues with passthough of HLG

I have a Denon AVR X2400H (which had an HLG firmware upgrade). I have Sony 49XF9005 UHD HDR TV which is also HLG compatible.

I need to remove things from the chain to see if the HD Fury (which used to block HLG in error, but had a firmware update to stop this) and the Denon are causing the issue.

I’m pretty certain that my Amazon Fire TV Stick 4K output HLG correctly in iPlayer in the past, but I’ll need to dig it out. Ditto the Rock Pro64. (I remember posting about the Rockchip Pro being the first Kodi platform I had that correctly flagged and triggered HLG to my TV, and that would be via my Denon AVR)

And I’ll power cycle. Everything…

Yes, it looks like CE doesn’t see your display as HLG capable, so it outputs it as HDR10.
I have an LG TV, and HLG works correctly.