Any way to strip HDR metadata?

Thank you. I can’t believe how borked the 2017 LGs are. Sigh.

I was able to whip up a rough addon that can/could do this stuff automatically and even better than just forcing 4000nits and relying on Active HDR.

However, there doesn’t seem to be any way for an addon/script to pause execution of Kodi itself. Basically Kodi already starts playing the movie before my script can finish everything, obviously at that point it’s already too late for that.

There’s a very hacky workaround for this but it’d be very unreliable and make launching a movie quite slow.

The alternative: trigger some sort of “signal reset” a few seconds into the movie to make it re-configure the signal in the hope it will call amvecm_cp_hdr_info() again to read the updated custom HDR values.
I tried echo "now" | sudo tee /sys/class/amhdmitx/amhdmitx0/attr
and echo "444,10bitnow" | sudo tee /sys/class/amhdmitx/amhdmitx0/attr
after the movie has already launched. Unfortunately, this makes the entire screen have a green tint.

Is there another command or something I could try to achieve this, @grahamh @sam_nazarko ? Or maybe an idea for some other way to make the running player re-read the values and update the signal? Re-initialize the video somehow or something.

The only other solution I can think of is to make the script change the values after a movie was launched, stop the player, and launch the player again with the same file. That’s not a good solution though and with all the auto-switching going on in-between this would take quite a bit every time.

You would have to do something that kicks the signal_change_flag I guess.

1 Like

Try toggle the PHY: /sys/class/amhdmitx/amhdmitx0/phy

Thanks, this was what made me find a way to trigger a new amvecm_cp_hdr_info() call. Toggling the HDMI PHY unfortunately did not cause signal_change_flag to change.

The addon is working now fully automatically and it (suspiciously) actually seems to work quite well from what I’ve tested so far. I’ll need to do some more testing and add some settings.

In my testing today I rediscovered something dumb I had already found some time ago and forgot about it. Having “Edge Enhancer” enabled and “Sharpness” at a value higher than 19 will actually influence the TV’s tonemapping, lol. Like, how is that even a thing?

I’m not surprised. Not in the slightest. LG has been really iffy with support for the TV.