Kodi Community Forum

Full Version: Occasional Refresh Rate Change Problems
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hello everyone,

in roughly 1 of 5 playbacks I have problems with the refresh rate adjustment: My screen goes completely black and the tv indicates "unsupported signal".
I can temporary fix this black screen with three methods: 
- Stopping playback and try my luck again
- Switching the input of my Denon AVR to something else and back to my media computer
- Executing kodi-xrand (via ssh) two times. First with a different mode, then with the right mode 
bash:
/usr/lib/x86_64-linux-gnu/kodi/kodi-xrandr --screen 0 --output HDMI-1 --mode 0x49
/usr/lib/x86_64-linux-gnu/kodi/kodi-xrandr --screen 0 --output HDMI-1 --mode 0x50
I have this problem since a while and currently I am using "kodi callbacks" with a script to automatically change inputs of my avr while staring playback. But this is quite inconvenient as it causes other (non-related) problems. I am not sure whether its a kodi's or my AVR's fault.

Additional information:
- Debug log of successful playback start on Pastebin
- Debug log of unsuccessful playback start start on Pastebin
- OS: Ubuntu 18.04 (same with 16.04)
- Kodi: 17.6 (same with v18 unstable)
- Intel NUC I3 haswell, AVR: Denon X2000
It's the AVR's fault. I have a Denon of the same generation. It is a problem with the HDMI repeater when clocking at high bitrate.

The Intel driver will negotiate 12-bit output and dither when it is available even if the display is set to 8-bit. 12-bit at 1080p 60 Hz is high enough to trigger he bug in the AVR. 8-bit at 4K 30 Hz will also do it. I've worked around it by removing the 12-bit mode from the EDID and setting a manual EDID on the Intel card.
Mhm I already thought it's the AVR's fault. Too bad we can't fix their firmware. 

bash:
xwininfo -root | grep Depth
is always saying it is running in 24 bit mode!?

How do I remove the 12 bit mode and set a custom EDID? Do I have to grab the current one with something like "read-edid" and edit the .bin?

Also, I am mostly running 1080p 24 Hz content.
I've complained to Denon about it. They try to blame EDID negotiation of the TV despite that this happens for different TVs and monitors. I don't think it'd be fixable in firmware even if we had the source code. It's a hardware bug n the repeater chip, unfortunately.

xwininfo is telling you the X display depth. 24-bit is 3 x 8-bit per channel. This is different from the mode the Intel card negotiated with the display. If you turn on the DRM debug setting, you should see the 12-bit per channel mode negotiation in dmesg. The card gets a 12 bpc mode and dithers the 8 bpc from X to the 12 bpc display mode.

Yes, you capture the EDID with read-edid. Then, edit it in a hex editor to flip the 12 bpc allowed bit off and fix the checksum. There is a kernel parameter to force the EDID for a display.
Okay saw the line in dmesg and furthermore I read the EDID data. But I struggling to find the right value to disable 12 bpc. 
How did you find the right entry? Currently I am using "AW EDID Editor" to interpret the read edid.
It seems like it is an v 1.3 EDID and I am not sure but I think I read that 1.3 has no color depth support?

Edit: I have simply updated the EDID data to 1.4 then "AW EDID Editor" enables a dropdown menu for the Bitrate. I chose 8 bpc and it seems to work. Do you know if 10 will work too?

Edit2: Using the custom EDID I get stuttering every few minutes during playback. Have you encountered something similiar?
(2018-05-10, 11:29)Protestallianz Wrote: [ -> ]Okay saw the line in dmesg and furthermore I read the EDID data. But I struggling to find the right value to disable 12 bpc. 
How did you find the right entry? Currently I am using "AW EDID Editor" to interpret the read edid.
It seems like it is an v 1.3 EDID and I am not sure but I think I read that 1.3 has no color depth support?
I hand edited mine with a hex editor by looking at the EDID specification: https://en.wikipedia.org/wiki/Extended_D...ation_Data . The color depth support is in the Vendor Specific Data Block which is an extension, and it works with EDID 1.3. My EDID is also v1.3. I used xxd to convert EDID to hex, edited it, and xxd -r to convert it back. I just did a diff to compare them. I flipped 1 bit in the extension to turn off 12-bit color, and 1-bit in the checksum to account for that. It can be a little confusing translating that spec because of endianness.
I looked for bytes 03 0c 00 to find the HDMI Licensing VSB. The next two bytes after that are the CEC address (in my case 25 00 for port 2 on the TV, port 5 on the AVR). The next byte after that is the color support, and bit 5 is 12-bit support. I flipped mine from 0xb8 to 0x98 to turn off 12-bit color. I had to add 0x20 to the checksum to adjust for that. parse-edid < newedid.bin will tell you if the checksum is valid.
(2018-05-10, 11:29)Protestallianz Wrote: [ -> ]Edit: I have simply updated the EDID data to 1.4 then "AW EDID Editor" enables a dropdown menu for the Bitrate. I chose 8 bpc and it seems to work. Do you know if 10 will work too?
The Intel driver doesn't support 10-bit modes on Kaby Lake, so allowing 10-bit won't matter. I assume they don't support it on Haswell either.
(2018-05-10, 11:29)Protestallianz Wrote: [ -> ]Edit2: Using the custom EDID I get stuttering every few minutes during playback. Have you encountered something similiar?
I have not encountered this. It could be that the AW EDID Editor messed with the timings a little when you converted it to EDID 1.4.
Thank you very much for your help!
I modified the two Bytes. In my case the color byte was B8 and is now 98 and the checksum was 37 now 57.
Unfortunately I get errors while loading the customized EDID:
dmesg:
[    1.964133] platform HDMI-A-1: Direct firmware load for edid/eight.bin failed with error -2
[    1.964189] [drm:drm_load_edid_firmware [drm]] *ERROR* Requesting EDID firmware "edid/eight.bin" failed (err=-2)
.....
[    2.231779] [drm:intel_hdmi_compute_config [i915]] picking bpc to 12 for HDMI output
.....
[    4.060181] [drm] Got external EDID base block and 1 extension from "edid/eight.bin" for connector "HDMI-A-1"
Starting playback results in 12 bpc as well.

Placing the original read EDID under /lib/firmware/edid/eight.bin works fine without any errors. 
Have I made a mistake altering the file?
Original EDID as HEX on Pastebin
Altered EDID as HEX on Pastebin
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash drm.debug=14 log_buf_len=16M drm.edid_firmware=edid/eight.bin"
(Double Post)
(2018-05-13, 10:33)Protestallianz Wrote: [ -> ]Thank you very much for your help!
I modified the two Bytes. In my case the color byte was B8 and is now 98 and the checksum was 37 now 57.
Unfortunately I get errors while loading the customized EDID:
dmesg:
[    1.964133] platform HDMI-A-1: Direct firmware load for edid/eight.bin failed with error -2
[    1.964189][drm:drm_load_edid_firmware [drm]] *ERROR* Requesting EDID firmware "edid/eight.bin" failed (err=-2)
.....
[    2.231779][drm:intel_hdmi_compute_config [i915]] picking bpc to 12 for HDMI output
.....
[    4.060181][drm] Got external EDID base block and 1 extension from "edid/eight.bin" for connector "HDMI-A-1"
Starting playback results in 12 bpc as well.

Placing the original read EDID under /lib/firmware/edid/eight.bin works fine without any errors. 
Have I made a mistake altering the file?
Original EDID as HEX on PastebinAltered EDID as HEX on Pastebin
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash drm.debug=14 log_buf_len=16M drm.edid_firmware=edid/eight.bin"
 Err -2 is ENOENT: No such file or directory.

Ubuntu doesn't stick the EDID in the initramfs by default, and that might be what that error is. I think that's what I got when I forgot to update the initramfs. The message at 4.060181 looks like it loaded fine and found the extension. I had to add a hook to /etc/initramfs-tools/hooks which copies the edid bin to the initramfs and the update-initramfs -u -k all.

The change you made looks right. I tried to convert the hex dump back to a binary, and check it with parse-edid, but parse-edid segfaulted when reading it for both of the hex dumps. Does it do that on your original binaries?
(2018-05-14, 17:29)yasij Wrote: [ -> ]The change you made looks right. I tried to convert the hex dump back to a binary, and check it with parse-edid, but parse-edid segfaulted when reading it for both of the hex dumps. Does it do that on your original binaries?
Yes, when I use parse-edid right after read-edid I get a segmentation fault as well. 

How can it be first an err -2 and then load it. Is a hook for initramfs necessary as it seems to finally load it (at 4 s or later)? Just in case it is needed, can you share yours? 
From this point I am somehow out of ideas what the problem might be.
(2018-05-14, 22:06)Protestallianz Wrote: [ -> ]How can it be first an err -2 and then load it. Is a hook for initramfs necessary as it seems to finally load it (at 4 s or later)? Just in case it is needed, can you share yours? 
From this point I am somehow out of ideas what the problem might be. 

The success at 4 s would be after your root partition mounted, and it found it there after it not finding it in the initrd. It could have set a 12-bit mode by that point in early start-up.

I've embedded the initramfs hook. Update edid.bin with the name of your edid file.
Code:
#!/bin/sh

PREREQ="udev"
prereqs()
{
echo "$PREREQ"
}

case $1 in
prereqs)
prereqs
exit 0
;;
esac

. /usr/share/initramfs-tools/hook-functions
# Begin real processing below this line

if [ ! -e "${DESTDIR}/lib/firmware/edid" ]; then
mkdir -p "${DESTDIR}/lib/firmware/edid"
fi

if [ -r "/lib/firmware/edid/edid.bin" ]; then
cp "/lib/firmware/edid/edid.bin" "${DESTDIR}/lib/firmware/edid/"
fi

exit 0
Thanks, I used your script (changed the name + chmod x), ran "sudo update-initramfs -u" without errors, updated grub to use the parameters indicated above (were deactivated for test) and rebooted. Still exactly the same. Err -2 in the beginning then 12 bpcs. Strange thing is that if I use (the stuttering) V1.4 EDID Made with the editor, I get the same 12 bpc after boot but when starting playback it switches to 8 bpc (using the hex altered one, sticks with 12 bpc)

EDIT (!): I forgot chmod +x in the first run and then looked at an old log. Now err -2 is gone and also it says:

dmesg:

[    2.022424] [drm:intel_hdmi_compute_config [i915]] picking bpc to 8 for HDMI output

It seems like it is working. Thanks a lot! I really appreciate your help on this!!
where did you copy the script? -> /etc/initramfs And where the firmware -> needs to go to 7lib/firmware/edid/edid.bin
Put the script here: /etc/initramfs-tools/hooks/include-edid-data The firmware is here lib/firmware/edid/eight.bin
Strange thin is that I still get the black screen/"No Signal" while dmesg still says
dmesg:
[   72.072151] [drm:intel_hdmi_compute_config [i915]] picking bpc to 8 for HDMI output

This dmesg excerpt shows that indeed 8 bpc are used but I still get a black screen.
(2018-05-14, 23:04)Protestallianz Wrote: [ -> ]Put the script here: /etc/initramfs-tools/hooks/include-edid-data The firmware is here lib/firmware/edid/eight.bin
Strange thin is that I still get the black screen/"No Signal" while dmesg still says
dmesg:
[   72.072151][drm:intel_hdmi_compute_config [i915]] picking bpc to 8 for HDMI output
This dmesg excerpt shows that indeed 8 bpc are used but I still get a black screen.

I guess the only differences I had are that I set edid on the connector I was using directly instead of everything, I set a video mode of 1080p at boot, and I used drm_kms_helper.edid_firmware instead of the newer drm.edid_firmware because I had this set up before kernel 4.15 was out with that newer parameter. It shouldn't matter.drm_kms_helper.edid_firmware=HDMI-A-1:edid/edid.bin video=HDMI-A-1:1920x1080@60

I also set GRUB_GFXMODE=1920x1080 so that it selects a 1080p mode.
I don't get black screens on refresh rate changes with this edid force edited to not support 12 bpc. I've tested it switching between 50 Hz, 59.97 Hz and 23.976 Hz content. It will happen sporadically if I go to a 4K mode due to the bitrate, but I don't have much 4K content on that machine.
Pages: 1 2