jhoger
Posts: 4
Joined: Thu Nov 06, 2014 1:34 am

Disable second HDMI port via video= kernel option

Wed Jan 25, 2023 9:27 pm

First, motivation: I'm trying to disable the second HDMI port to solve a problem. If both end up enabled, I've found that mplayer will sometimes play to the second port, even though it is not connected to anything, sending the video I want to play on my kiosk into the void.

The video= kernel boot option is structured like this

video=conn:res[M][R][-bpp][@refresh][i][m][eDd]

You're supposed to be able to repeat this option as many times as you need to, since there can be multiple video devices.

I'm interested in the "conn" field for the Raspberry pi 4.

What are the names for the ports on the Raspberry pi 4? Invoking the xrandr command it refers to them as HDMI-1 and HDMI-2

But when I enable hdmi_safe=1 in config.txt, and I look at the kernel command line used via dmesg it shows this:

video=HDMI-A-1:640x480M@60D,margin_left=24,margin_right=24,margin_top=16,margin_bottom=16

So I infer from this that conn field on the Raspberry pi 4 should be

HDMI-A-1 for the conn field / HDMI-0 pcb port / HDMI-1 in xrandr
HDMI-A-2 for the conn field / HDMI-1 pcb port / HDMI-2 in xrandr

Can anyone in the know confirm this is correct? Or tell me how to confirm it for myself.

video=HDMI-A-2:d

seems to work for me to disable the second port. But I have seen some inconsistent behavior in experiments depending on what is connected so I wanted to confirm my understanding.

TIA

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6434
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Disable second HDMI port via video= kernel option

Thu Jan 26, 2023 12:23 pm

Yes, HDMI-A-1 and HDMI-A-2 are the correct names for video conn.
Although I'd expect HDMI-A-2 to show as disconnected without a command line entry if no hdmi device is connected. e.g.

Code: Select all

pi@pi4:~ $ kmsprint 
Connector 0 (32) HDMI-A-1 (connected)
  Encoder 0 (31) TMDS
    Crtc 3 (96) 3840x2160@60.00 594.000 3840/176/88/296/+ 2160/8/10/72/- 60 (60.00) P|U|D 
      Plane 3 (86) fb-id: 340 (crtcs: 3) 0,0 3840x2160 -> 0,0 3840x2160 (XR24 AR24 AB24 XB24 RG16 BG16 AR15 XR15 RG24 BG24 YU16 YV16 YU12 YV12 NV12 NV21 NV16 NV61 P030 XR30 AR30 AB30 XB30 RGB8 BGR8 XR12 AR12 XB12 AB12 BX12 BA12 RX12 RA12)
        FB 340 3840x2160 RG16
Connector 1 (42) HDMI-A-2 (disconnected)
  Encoder 1 (41) TMDS


dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6434
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Disable second HDMI port via video= kernel option

Fri Jan 27, 2023 1:06 pm

aBUGSworstnightmare wrote:
Thu Jan 26, 2023 8:05 pm
Why can't you do that via config.txt?
viewtopic.php?p=2063779#p2063325
Yes, that would work:

Code: Select all

dtoverlay=vc4-kms-v3d,nohdmi1
should disable hdmi1 more comprehensively. It's not longer disconnected, but non-existent.

Code: Select all

pi@pi4:~ $ kmsprint 
Connector 0 (32) HDMI-A-1 (connected)
  Encoder 0 (31) TMDS
    Crtc 3 (90) 3840x2160@60.00 594.000 3840/176/88/296/+ 2160/8/10/72/- 60 (60.00) P|U|D 
      Plane 3 (80) fb-id: 313 (crtcs: 3) 0,0 3840x2160 -> 0,0 3840x2160 (XR24 AR24 AB24 XB24 RG16 BG16 AR15 XR15 RG24 BG24 YU16 YV16 YU12 YV12 NV12 NV21 NV16 NV61 P030 XR30 AR30 AB30 XB30 RGB8 BGR8 XR12 AR12 XB12 AB12 BX12 BA12 RX12 RA12)
        FB 313 3840x2160 RG16
Although I do wonder about:
mplayer will sometimes play to the second port, even though it is not connected to anything
It seems unlikely mplayer would sometimes choose to play to a disconnected port. But we need more info from jhoger about exactly what is occurring.
Are you sure it is being output to second port? Do you see that in a log. Does physically connecting to second hdmi port while it is playing show video?

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

Re: Disable second HDMI port via video= kernel option

Fri Jan 27, 2023 1:48 pm

dom wrote:
Fri Jan 27, 2023 1:06 pm
..
Yes, that would work:

Code: Select all

dtoverlay=vc4-kms-v3d,nohdmi1
should disable hdmi1 more comprehensively. It's not longer disconnected, but non-existent.
...
@dom: think that's a typo as there is no 'nohdmi1' overlay for 'vc4-kms-v3d', at least no documented one (https://github.com/raspberrypi/linux/bl ... ADME#L4454)
ame: vc4-kms-v3d
Info: Enable Eric Anholt's DRM VC4 HDMI/HVS/V3D driver.
Load: dtoverlay=vc4-kms-v3d,<param>
Params: cma-512 CMA is 512MB (needs 1GB)
cma-448 CMA is 448MB (needs 1GB)
cma-384 CMA is 384MB (needs 1GB)
cma-320 CMA is 320MB (needs 1GB)
cma-256 CMA is 256MB (needs 1GB)
cma-192 CMA is 192MB (needs 1GB)
cma-128 CMA is 128MB
cma-96 CMA is 96MB
cma-64 CMA is 64MB
cma-size CMA size in bytes, 4MB aligned
cma-default Use upstream's default value
audio Enable or disable audio over HDMI (default "on")
noaudio Disable all HDMI audio (default "off")
composite Enable the composite output (default "off")
N.B. Disables all other outputs on a Pi 4.
nohdmi Disable HDMI output
OP needs to make use of 'vc4-kms-v3d-pi4' (https://github.com/raspberrypi/linux/bl ... ADME#L4475)
Name: vc4-kms-v3d-pi4
Info: Enable Eric Anholt's DRM VC4 HDMI/HVS/V3D driver for Pi4.
Load: dtoverlay=vc4-kms-v3d-pi4,<param>
Params: cma-512 CMA is 512MB
cma-448 CMA is 448MB
cma-384 CMA is 384MB
cma-320 CMA is 320MB
cma-256 CMA is 256MB
cma-192 CMA is 192MB
cma-128 CMA is 128MB
cma-96 CMA is 96MB
cma-64 CMA is 64MB
cma-size CMA size in bytes, 4MB aligned
cma-default Use upstream's default value
audio Enable or disable audio over HDMI0 (default
"on")
audio1 Enable or disable audio over HDMI1 (default
"on")
noaudio Disable all HDMI audio (default "off")
composite Enable the composite output (disables all other
outputs)
nohdmi Disable both HDMI 0 & 1 outputs
nohdmi0 Disable HDMI 0 output
nohdmi1 Disable HDMI 1 output

Code: Select all

dtoverlay=vc4-kms-v3d-pi4,nohdmi1
will disable HDMI1 (which is HDMI-2-A from OS POV) on a Pi4

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6434
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Disable second HDMI port via video= kernel option

Fri Jan 27, 2023 2:26 pm

No. vc4-kms-v3d is an alias for vc4-kms-v3d-pi4 on a pi4, not a unique overlay. See here.
The line I quoted works and is the preferred notation.

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

Re: Disable second HDMI port via video= kernel option

Fri Jan 27, 2023 3:09 pm

dom wrote:
Fri Jan 27, 2023 2:26 pm
No. vc4-kms-v3d is an alias for vc4-kms-v3d-pi4 on a pi4, not a unique overlay. See here.
The line I quoted works and is the preferred notation.
Forgot about that overlay map ... :oops:

But need to say that I personally find using 'vc4-kms-v3d-pi4 ' in case of OP's use case more intuitive as one doesn't have to care on the overlay_map.dts and can simply have a look at README to understand what the override is good/used for.

Return to “Raspberry Pi OS”