How to force YUV 4:4:4 on Intel x64 generic ?

  • Hi,

    I've installed the latest LE 12 https://releases.libreelec.tv/LibreELEC-Gene…-11.95.1.img.gz on my intel core i5 12500T (Intel 12th Gen) with HDMI 2.0/HDR :?::?:output.

    Everything is going fine except the color space witch outputs RGB. My projector needs YUV, otherwise it thinks it's a PC displaying Powerpoint slides and switches to low contrast/high luminosity which is very bad for video content.

    I've tried searching on this forum how to do it but it's very confusing, not clear if I need to modify the code and recompile, which I don't know how to do or if a simple command at start will do it.

    Can anyone help ?

    Thanks in advance.

  • Maybe you can tweak RGB output with this (I guess xrandr needs Generic-Legacy):

    larslunte
    March 18, 2024 at 6:59 PM
  • ain't that for RGB limited ?

    I need YUV so I guess the only option is to hack the kernel as smp pointed out. Question is : how do I do that ?

    In the topic where this was mentioned, it points to a bit of code that I wasn't able to find in the GIT source repository :

    Posts by smp - Page 2 - LibreELEC Forum

    I looked and I can't find a/drivers/gpu/drm/i915/display/intel_hdmi.c anywhere ? I must be missing something. My Unix dev days are from 20 years ago ;(

  • ain't that for RGB limited ?

    I think so. I suggest to play with xrandr options, before you invest serious time by compiling your kernel. I don't know how exactly HDMI negotiation works, but there is a chance that you can enforce an HDMI mode, which has better contrast on RGB. So update to Generic-Legacy, and go back to Generic, if it doesn't work.

  • Can you provide a log on Generic? Then we know which HDMI modes the projector is offering. Maybe a hi-contrast RGB mode is available, but not in use.

    Please provide a full debug log.

    How to post a log (wiki)

    1. Enable debugging in Settings>System Settings>Logging
    2. Restart Kodi
    3. Replicate the problem
    4. Generate a log URL (do not post/upload logs to the forum)

    use "Settings > LibreELEC > System > Paste system logs" or run "pastekodi" over SSH, then post the URL link
  • On TV's people can usually select different color schemes for HDMI input (I did so for my RPi). Maybe you'll find such an option for the projector, too.

  • I tried already RGB full/RGB limited using different options and different source devices. While I can get close the YUV input in terms of quality, it is still a bit less vivid.

    So how do I build a hacked linux kernel and use that in the LE build ? Does LE build just takes the kernel of the machine it's compiled on, or how does it work ?

  • I had looked at that wiki but didn't found how the kernel is integrated there. So I will take your advice and start to try to build an generic image that works. Will probably start by installing a brand new ubuntu on a different computer and play with that, will take me some time though :-/

    As for the things to be changed, it's right here, post #4, just a few lines in intel_hdmi.c

  • Interesting but I don't think it would work. I used edid-decode native command to get the edid in human readable form and the only thing I could see is about YUV :

    Supports YCbCr 4:4:4
    Supports YCbCr 4:2:2

    no support Y/N for RGB seems available.

    Also, let's say we manage to disable RGB in the edid somehow, looking at the intel driver code above, it would still return RGB which will probably lead to a garbled colors screen.

  • I wonder if YUV mode can be forced by editing EDID?

    RGB support is mandatory, it's not possible to to disable it in EDID. Intel driver defaults to RGB and they don't provide a way to switch to YCbCr from the userspace.

  • portapro I made a quick rebuild of my last community version with the force YCbCr 4:4:4 patch.

    download image here https://sky42.libreelec.tv/testing/intel-yuv444/

    here is the full source https://github.com/sky42src/Libre…-240324y-yuv444

    this commit you can pick for your own build if it works for you https://github.com/sky42src/Libre…7d8a8158956b078

    Edit:
    Short test on my N100 -> X6700H -> OLED55E6D show it does what it is suposed to do. All is in YCbCr 4:4:4 says the info screen of my Denon with or without HDR10.
    You may run into audio trouble when playing 2160p @ 23.976 Hz and using pass through.
    quick workaround is to only use 10 bit not 12
    systemctl stop kodi && intel-gpu-max-10-bit.sh && systemctl start kodi

  • I tested a bit. For some reason I had to reflash the whole image as the uptate with tar file would give me a black screen.

    Once full image in, it worked very well ! :)

    YUV 4:4:4, 12 bpc for now since I didn't encounter any issue with pass through so far, very happy, Thanks again ;)

  • Hi Sky, I just installed this version but there was no essential addon like DVBView PVR, skin addons,

    pls advise !