CoreElec Nightly - hdr 2 sdr does not work

Hi there,

I got my N2 yesterday, put the recent CoreElec Nightly on microSD card and set hdr to sdr tonemapping to active.

To check this feature I played a 2160p mkv file with 10 Bit and HDR metadata, but the colors seemed to be washed out and the picture in general was way to dark. So I guess the tone mapping does not work or a took a non suitable source file. Does anyone know a suitable demo?

I also checked the kodi.log file, but i did not find anything obvious there - although I must admit that I do not understand that much from the log file anyway :slight_smile:

The N2 is connected to a Denon AVR, a Darbee box is following and a 1080p Beamer comes at the end. A PC with plex media player is connected to the very same Denon AVR, tonemapping works fine there, so my best guess is, that the problem should be the N2.

So for the moment, I do honestly not know where i could find the source of the problem.

Any help is warmly welcome!


SDR to HDR works ok, but I’m pretty sure that the tonemap is geared towards a relatively bright TV.
Also SDR to HDR will only work, if the device at the end of the HDMI cable doesn’t support HDR natively. If the device supports HDR, it will not activate HDR to SDR tonemapping.

My projector does not support HDR at all, so SDR to HDR is switched off in the coreelec settings, which seem to be standard setting.
Actually I am looking for the other way round: HDR to SDR tonemapping, playing a 4k HDR mkv on the odroid which is connected to the 1080p SDR projector (Benq W1070) at the end. Already connected the N2 directly to the projector, no change.

Maybe the link to the logs helps?

Kodi logs

You can do a simple test. Turn HDR to SDR off, reboot, check how it looks. Then turn it on, reboot and check how it looks.
If you see a difference, then it means that HDR to SDR is working. Otherwise, it means that the N2 sees the device it’s connected to as HDR capable, and therefore it does not enable HDR to SDR tone mapping.
All of this is done automatically by the kernel, and it’s confirmed to work.

I did as you suggested and surprise: there is a difference :slight_smile: I used a LG New York HDR Demo file, switched tonemapping off (yes: off!) and the video looks brighter, although with a bit pale colours. You can get really every detail even in dark scenes. Pressed the “o” key on my remote, EOTF & Gamut said SDR BT.2020.
I reactivated tonemapping again, pressed “o” again, EOTF & Gamut said SDR BT.709. Guess that means that tonemapping is working, but the video is quite dark again, it is really hard to get the details in dark scenes.
So, is there any possibility to change/improve the way of tonemapping? Also found this line in the Kodi log:
ERROR: GetString: error reading /storage/.kodi/userdata/disp_cap
I am not an expert, but maybe this means, that Kodi does not now what the projector is capable of and therefore the tonemapping results in the way described above?

btw: the htpc with windows/plex media player does tonemapping as expected… maybe because Windows can recgonizes and handles the projector in a different way?

I will try to look into it this upcoming week or next weekend, maybe the tone mapping curve can be changed. But I can’t really promise anything, as I’m not that sure it’s easy.

Thanks a lot in advance as well as for your precious help so far!

I am quite sure as well that it is not easy. Some month ago I played around with the tonemapping settings in Plex (which uses mpv) where you can tweak the settings in mpv.conf. You can change the tone mapping mode there, the saturation and the brightness.
Found some example there, no idea if that can help in any way:
Tonemapping / mpv.conf

And yes, I know Kodi uses a totally different platform, so I will just wait and maybe there will be some improvement. If not, I am still very glad that you have helped me :slight_smile:

Just out of curiosity: could the result of the hdr-> sdr tonemapping be caused by those entries in the kodi.log?

ERROR: GetString: error reading /storage/.kodi/userdata/disp_cap
ERROR: GetString: error reading /sys/class/amhdmitx/amhdmitx0/vesa_cap

I am certainly no expert, but maybe Kodi does not properly tonemap when it does not know the display capabilities and/or the vesa capabilities?

No, this is not related. It’s just Kodi trying to read those files without first checking whether those files exist first. It must be something in one of our patches, not actual Kodi code, but this has nothing to do with HDR tone mapping.

Thanks a lot for clarification!