HDR Problems on S912 and S905

I have some confusion about this topic.
So, current github, use a different kernel than the released versions of CE, isn’t?
Is there a transient method that allows you to change to 10bit, HDR videos? Reading in OSMC forum there is a workaround. Do you think is faesible use it to change autoamtically 10bits, 4K HDR videos?

#!/bin/bash
sleep 4
string=$(</sys/class/display/mode)
if [ $string = "2160p24hz" ]; then
echo "2160p24hz420">/sys/class/display/mode
elif  [ $string = "2160p60hz" ]; then
echo "2160p60hz444">/sys/class/display/mode
fi
  1. .3 and .4 used the OSMC kernel, all of the other CE versions use Kszaq’s kernel.
  2. I wouldn’t recommend using 420, as in many case it won’t put out a picture at all.
  3. Your script would only affect the resolution. I used a small script that I executed manually to set 10bit or 8bit mode, the only thing you need to remember is that the change will only take effect after a resolution and/or refresh rate change.

Thanks.

So, if you leave the kodi gui in 1080 every time you play a video at 4k HDR, 10 bits, the script would jump, is that right? and then when your return to Kodi GUI, will returno to 8 bits. isn’t it? Can you share your script?

Something like it?

#!/bin/bash
sleep 4
string=$(</sys/class/display/mode)
if [ $string = "2160p24hz" ] ||  [ $string = "2160p60hz" ]; then
echo "444,10bit">/sys/class/amhdmitx/amhdmitx0/attr
elif  [ $string = "1080p60hz" ]; then
echo "420,8bit">/sys/class/amhdmitx/amhdmitx0/attr
fi

Don’t use 420, use 444. 420 is broken, at least right now.
You’ll need to set it the other way around. If you’re at 1080P, then enable 10bit, if you’re at 4K then enable 8bit.
This is because you need to call the script before the resolution changes.

Thanks for your suggestion but i’m only copying some script that i saw in osmc i don’t what i’m doing :sweat_smile:

Following your suggestions:

#!/bin/bash
sleep 4
string=$(</sys/class/display/mode)
if [ $string = "2160p24hz" ] ||  [ $string = "2160p60hz" ]; then
echo "444,8bit">/sys/class/amhdmitx/amhdmitx0/attr
elif  [ $string = "1080p60hz" ]; then
echo "444,10bit">/sys/class/amhdmitx/amhdmitx0/attr
fi

Doing this…kodi will run 1080p, 8 bits and will change to 444,10bit so when i play 4K HDR, video will play correctly and after that, will change to 8bits, so when i return to kodi gui it will set at 8 bit…

But, what happens if instead i play a 4K i play a 1080p? Whit this script, 1080p video will play as 10bits, right?

It is no possible another method? change only 444,10bits with 4k HDR, and 1080p 444,8bit?

If you set this script to execute manually then you can only run it when you want to watch 4k hdr content.
What I did was add 2 buttons to the skin UI, one that sets 8 bits and one that sets 10 bits. It’s not that user friendly, but it works.
For me, proper 10 bit behavior is important and is a priority. Once we port the OSMC banding/flashing fix over to the current kernel, you’ll be able to leave the UI at 1080P and have 10 bit always selected without adverse effects (except 4K non-HDR material)

Thanks.

but what was the method used by @wrxtasy in previous Kodi Krypton to set these automatically?

What do you think about this script? Will it work automatically?

#!/bin/bash
sleep 4
string=$(</sys/class/display/mode)
if [ $string = "2160p24hz" ]; then
echo "444,10bit">/sys/class/amhdmitx/amhdmitx0/attr
echo "2160p24hz444">/sys/class/display/mode
elif  [ $string = "1080p60hz" ]; then
echo "444,8bit">/sys/class/amhdmitx/amhdmitx0/attr
echo "1080p60hz444">/sys/class/display/mode
fi

I don’t really know what wrxtasy does to make it work, but I think whatever it is, it’s probably either broken or unavailable in Leia.
I don’t know, you can try it, in the worst case scenario it won’t work or you’d have to reboot the box.

I see! So, I need to run the command echo "444,10bit">/sys/class/amhdmitx/amhdmitx0/attr before playback of HDR content and echo round1 > /sys/class/amhdmitx/amhdmitx0/debug during playback to get proper HDR10 playback of 444,10-bit without banding issues. Do I’ve to run echo "444,8bit">/sys/class/amhdmitx/amhdmitx0/attr later before playback of SDR content? Is the first command fixed, or will it revert back to default at ex. reboot?

When you have some spare time, do you care to make a simple guide on how you accomplished this? I’m thinking about mapping the three commands above to key 1-3 on my remote as I’m never using those, yet your solution might be a great addition :grinning:

Correct. Now, before you stop said HDR content, you’ll need to run echo "444,8bit">/sys/class/amhdmitx/amhdmitx0/attr so that when playback stops and the GUI switches resolution, it will return to 8bit mode. You can also just reboot.

I modified the Confluence skin, as I prefer using it over the default skin in Krypton/Leia.
I also hacked this change together for myself, and don’t consider it to be user friendly, or anything that is worth sharing. If you can tie execution of a script to a button press on the remote, that’d be a much better solution anyway.

Thanks for the information, @TheCoolest! It’s much appreciated! :slight_smile:

I’ll look into this when I return from vacation in about a week. I’ve already configured my IR remote as I had some issues earlier this summer, so, the only part I’ve to figure out is where the key functions (keytable) are saved (like http://ix.io/19sO) to make my own. I’ll probably make a how-to on it (unless someone else manage to do it before me…) as the banding and 8/10-bit autoswitching issues seems unlikely to be solved in the close future.

We will focus more on HDR issues in 8.95.1, including fixing the flicker and auto-switching.

1 Like

It’s great to hear that! I’ll be willingly to contribute with testing in the future to make it less painful to resolve issues regarding the implementations.

I think it could be using the method OSMC uses:

Good point! Maybe it’s an important starting point!

Hi.
I think that original Vero patch is more complete.
I’m not an expert, but the patch add a method for detect BT2020 color space and as consequence execute
SysfsUtils::SetString("/sys/class/amhdmitx/amhdmitx0/attr", "444,10bit"

Maybe, until complete implementation, it is possible make a script to do the job. I’m trying to look for it, but I don’t know if Kodi (without modification) can detect colorspace.

The current build of CoreElec seems to be switching fine for me, but I haven’t tested it fully.

Thanks @anon88919003 for adding support to HDR autoswith into github. I’ve tested last nighlty build with this patch included and the autoswitch works, but there is some banding effect on 10bits video uploeaded by @arien https://www.dropbox.com/s/sg10xvpb89nxdv2/HDR_Flicker_10bit24fps_5m.mp4?dl=0
It also happen in CoreElec 8.95.0

In @wrxtasy build video is played correctly. Stange, isn’t?
Maybe it is necessary add also this patch


If i can help…please tell me.

Thanks for your effort!!!

The fix for banding/flashing in HDR is included in our kernel now.
If you’re experiencing banding, then it means that the 10bit switch does not occur in time.
I tested it to confirm myself yesterday, and it works.
At 10 bit enabling rounding should cause banding.
At 10 bit dither should have no effect.
At 8 bit enabling dithering should reduce banding.
At 8 bit round should have no effect.

s912 here, no banding with latest nightly, auto switching works, box stays at 8 bit and switches to 10 bit when playing HDR content, no autostart.sh needed. i must say this is pretty solid, thanks for the good work.