andrum99
Posts: 1671
Joined: Fri Jul 20, 2012 2:41 pm

Forcing HDMI config on KMS/DRM graphics stack

Sun Aug 14, 2022 11:14 am

This query is related to Kodi, so apologies if this should be added to the existing 'Kodi on Bullseye RPiOS' thread - feel free to move it if this is the case.

My main TV has a problem with one of its two HDMI ports - the DDC pins seems to not work. (I believe they did work originally, but somehow they got broken). The symptoms are that my Raspberry Pis and my YouView TV box cannot configure their HDMI output correctly if they are connected to that port. Checking from a Pi reveals that they cannot read the EDID from the TV. With the old firmware graphics stack, I successfully forced the correct video mode, and enabled HDMI audio, using directives in config.txt. With the KMS/DRM stack I tried passing the EDID, captured using the one fully-working HDMI port on the TV, to the kernel by adding the following to the end of the single line of text in /boot/cmdline.txt:

Code: Select all

drm.edid_firmware=edid/edid.dat
With the EDID file at /lib/firmware/edid/edid.dat. This successfully enables the VC4 audio device, so Kodi is able to use it. I also see this in the kernle ring buffer (dmesg):

Code: Select all

[506292.220669] [drm] Got external EDID base block and 1 extension from "edid/edid.dat" for connector "HDMI-A-1"
However, it does not set the video mode correctly - the console comes up in a default low-resolution mode, and so does Kodi. How can I force the KMS/DRM driver to actually use the native video mode in the EDID? I have managed to work around it by setting the console video mode using the old config.txt settings, but I would prefer a clean solution that does not touch the firmware graphics driver's config.

aBUGSworstnightmare
Posts: 5675
Joined: Tue Jun 30, 2015 1:35 pm

Re: Forcing HDMI config on KMS/DRM graphics stack

Tue Aug 16, 2022 4:42 am

Have you tried forcing the requested resolution from kernel command line?
Add below - with 1280x800 used as example only - to your cmdline.txt. That uses HDMI0; in case of HDMI1 use 'HDMI-A-2'

Code: Select all

video=HDMI-A-1:1280x800M@60
would be beneficial if you'll let us know which resolution you want to use.

andrum99
Posts: 1671
Joined: Fri Jul 20, 2012 2:41 pm

Re: Forcing HDMI config on KMS/DRM graphics stack

Tue Aug 16, 2022 4:10 pm

aBUGSworstnightmare wrote:
Tue Aug 16, 2022 4:42 am
Have you tried forcing the requested resolution from kernel command line?
Add below - with 1280x800 used as example only - to your cmdline.txt. That uses HDMI0; in case of HDMI1 use 'HDMI-A-2'

Code: Select all

video=HDMI-A-1:1280x800M@60
would be beneficial if you'll let us know which resolution you want to use.
Thanks - using a setting of video=HDMI-A-1:1920x1080M@60 worked. After removing all HDMI settings from config.txt, the console comes up in the low res default mode, then once the KMS/DRM driver loads it switches to 1080p. Kodi then starts in 1080p as intended. It also works if I don't have the TV powered on, which was also needed as I usually reboot the Pi when the TV is not on.

Many thanks :)

aBUGSworstnightmare
Posts: 5675
Joined: Tue Jun 30, 2015 1:35 pm

Re: Forcing HDMI config on KMS/DRM graphics stack

Tue Aug 16, 2022 7:01 pm

andrum99 wrote:
Tue Aug 16, 2022 4:10 pm
aBUGSworstnightmare wrote:
Tue Aug 16, 2022 4:42 am
Have you tried forcing the requested resolution from kernel command line?
Add below - with 1280x800 used as example only - to your cmdline.txt. That uses HDMI0; in case of HDMI1 use 'HDMI-A-2'

Code: Select all

video=HDMI-A-1:1280x800M@60
would be beneficial if you'll let us know which resolution you want to use.
Thanks - using a setting of video=HDMI-A-1:1920x1080M@60 worked. After removing all HDMI settings from config.txt, the console comes up in the low res default mode, then once the KMS/DRM driver loads it switches to 1080p. Kodi then starts in 1080p as intended. It also works if I don't have the TV powered on, which was also needed as I usually reboot the Pi when the TV is not on.

Many thanks :)
that's how it should be as boot is on firmware and command line is used when KMS takes control.

Glad you got ir working! You're welcome.

andrum99
Posts: 1671
Joined: Fri Jul 20, 2012 2:41 pm

Re: Forcing HDMI config on KMS/DRM graphics stack

Tue Aug 16, 2022 8:07 pm

aBUGSworstnightmare wrote:
Tue Aug 16, 2022 7:01 pm
...
that's how it should be as boot is on firmware and command line is used when KMS takes control.
...
I know. I was really just reporting what it did for anyone else who might happen to read this thread. 😉

Return to “Media centres”