fcollingwood
Posts: 9
Joined: Sat Aug 03, 2019 11:17 am

Pi4 - HDMI 1 Resolution commands overriding HDMI 0 resolution commands

Sun Aug 04, 2019 1:33 pm

Hi All

Running Raspbian Buster on a 2GB Pi4. I'm trying to set two different resolutions for each of the HDMI ports. The first port has a 7" 1024x600 screen which is just a test screen, as it's going to be replaced by an 8.9" 2K screen with no backlight for a resin 3D printer. The second HDMI port has a 7" 800x480 touchscreen.

I have commented out the dtoverlay=vc4-fkms-v3d command in /boot/config.txt, as FKMS consolidates both framebuffers into a single virtual one, and I require both fb0 and fb1 to be exposed in /dev

I have added the following to /boot/config.txt in the [all] conditional:

Code: Select all

# settings for exposure screen on HDMI 0
framebuffer_width:0=1024
framebuffer_height:0=600
hdmi_force_hotplug:0=1
hdmi_cvt:0=1024 600 60 3 0 0 0
hdmi_mode:0=87
hdmi_group:0=2
hdmi_force_hotplug:0=1

# Settings for 7" touchscreen on HDMI 1
framebuffer_width:1=800
framebuffer_height:1=480
hdmi_force_hotplug:1=1
hdmi_edid_file:1=1
hdmi_cvt:1=800 480 60 6 0 0 0
hdmi_mode:1=87
hdmi_group:1=2
hdmi_force_hotplug:1=1

This is what is happening:

Code: Select all

pi@raspberrypi:~ $ tvservice -l
2 attached device(s), display ID's are : 
Display Number 2, type HDMI 0
Display Number 7, type HDMI 1
pi@raspberrypi:~ $ tvservice -v 2 -s
state 0xa [HDMI DMT (87) RGB full 15:9], 800x480 @ 59.00Hz, progressive
pi@raspberrypi:~ $ tvservice -v 7 -s
state 0x6 [DVI DMT (87) RGB full 15:9], 800x480 @ 59.00Hz, progressive
pi@raspberrypi:~ $ fbset -fb /dev/fb0 -s

mode "800x480"
    geometry 800 480 800 480 32
    timings 0 0 0 0 0 0 0
    rgba 8/16,8/8,8/0,8/24
endmode

pi@raspberrypi:~ $ fbset -fb /dev/fb1 -s

mode "800x480"
    geometry 800 480 800 480 32
    timings 0 0 0 0 0 0 0
    rgba 8/16,8/8,8/0,8/24
endmode

pi@raspberrypi:~ $ 
Note that I have also tried placing the relevant commands under the [HDMI:0] and [HDMI:1] conditionals with the same results.

If I comment out the commands for the 800x480 screen and disconnect it, I get this:

Code: Select all

pi@raspberrypi:~ $ tvservice -l
1 attached device(s), display ID's are : 
Display Number 2, type HDMI 0
pi@raspberrypi:~ $ tvservice -v 2 -s
state 0xa [HDMI DMT (87) RGB full 16:9], 1024x600 @ 60.00Hz, progressive
pi@raspberrypi:~ $ fbset -fb /dev/fb0 -s

mode "1024x600"
    geometry 1024 600 1024 600 32
    timings 0 0 0 0 0 0 0
    rgba 8/16,8/8,8/0,8/24
endmode

pi@raspberrypi:~ $ 
So I know the commands for the 1024x600 screen are correct.

Can anyone tell me why the resolution commands for HDMI 1 seem to be overriding the resolution commands for HDMI 0?

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26660
Joined: Sat Jul 30, 2011 7:41 pm

Re: Pi4 - HDMI 1 Resolution commands overriding HDMI 0 resolution commands

Sun Aug 04, 2019 2:58 pm

That sounds a bit like a bug but would need to take a closer look. Can you add this to our bug tracker please?

https://github.com/raspberrypi/firmware
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26660
Joined: Sat Jul 30, 2011 7:41 pm

Re: Pi4 - HDMI 1 Resolution commands overriding HDMI 0 resolution commands

Mon Aug 05, 2019 10:49 am

jamesh wrote:
Sun Aug 04, 2019 2:58 pm
That sounds a bit like a bug but would need to take a closer look. Can you add this to our bug tracker please?

https://github.com/raspberrypi/firmware
I've actually added the issue myself, https://github.com/raspberrypi/firmware/issues/1218, although reading the issue through again, not sure what the best approach is here.

You appear to be using the framebuffer_x config items to set the HDMI resolution - is there any reason you are not just setting a specific HDMI mode for that resolution, or relying on the EDID of the displays?

Note that the framebuffer_x config items are not HDMI specific so they don't use the same index scheme, so :0,:1 is not supported. So the framebuffer_x are whatever the last framebuffer_x entry was, irrespective of the :x bit.

I probably should l think about making them display specific, will give that some thought.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

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

Re: Pi4 - HDMI 1 Resolution commands overriding HDMI 0 resolution commands

Mon Aug 05, 2019 11:54 am

jamesh wrote:
Mon Aug 05, 2019 10:49 am
jamesh wrote:
Sun Aug 04, 2019 2:58 pm
That sounds a bit like a bug but would need to take a closer look. Can you add this to our bug tracker please?

https://github.com/raspberrypi/firmware
I've actually added the issue myself, https://github.com/raspberrypi/firmware/issues/1218, although reading the issue through again, not sure what the best approach is here.

You appear to be using the framebuffer_x config items to set the HDMI resolution - is there any reason you are not just setting a specific HDMI mode for that resolution, or relying on the EDID of the displays?

Note that the framebuffer_x config items are not HDMI specific so they don't use the same index scheme, so :0,:1 is not supported. So the framebuffer_x are whatever the last framebuffer_x entry was, irrespective of the :x bit.

I probably should l think about making them display specific, will give that some thought.
for custom hdmi_timings you will have to have seperate hdmi_mode and hdmi_group; is this allowed with the index scheme?
Using EDID data (even from file) is inconvinient sometimes (and may require deeper knowledge of the topic).

fcollingwood
Posts: 9
Joined: Sat Aug 03, 2019 11:17 am

Re: Pi4 - HDMI 1 Resolution commands overriding HDMI 0 resolution commands

Mon Aug 05, 2019 4:05 pm

jamesh wrote:
Mon Aug 05, 2019 10:49 am

I've actually added the issue myself, https://github.com/raspberrypi/firmware/issues/1218, although reading the issue through again, not sure what the best approach is here.

You appear to be using the framebuffer_x config items to set the HDMI resolution - is there any reason you are not just setting a specific HDMI mode for that resolution, or relying on the EDID of the displays?
I am setting the mode, to 87 and using CVT. EDID doesn't work, as the resolution is not standard, and it sets the resolution to one of the standard resolutions that it thinks I'd the closest.
jamesh wrote:
Mon Aug 05, 2019 10:49 am
Note that the framebuffer_x config items are not HDMI specific so they don't use the same index scheme, so :0,:1 is not supported. So the framebuffer_x are whatever the last framebuffer_x entry was, irrespective of the :x bit.

I probably should l think about making them display specific, will give that some thought.
I did try with the framebuffer config items commented, but it made no difference. If they were FB specific, it would probably work nicely

fcollingwood
Posts: 9
Joined: Sat Aug 03, 2019 11:17 am

Re: Pi4 - HDMI 1 Resolution commands overriding HDMI 0 resolution commands

Mon Aug 05, 2019 4:22 pm

jamesh wrote:
Mon Aug 05, 2019 10:49 am
jamesh wrote:
Sun Aug 04, 2019 2:58 pm
That sounds a bit like a bug but would need to take a closer look. Can you add this to our bug tracker please?

https://github.com/raspberrypi/firmware
I've actually added the issue myself, https://github.com/raspberrypi/firmware/issues/1218, although reading the issue through again, not sure what the best approach is here.
User 6by9 has commented on the issue with a quick hack to get around it. I'll give it a try in the morning and report back

fcollingwood
Posts: 9
Joined: Sat Aug 03, 2019 11:17 am

Re: Pi4 - HDMI 1 Resolution commands overriding HDMI 0 resolution commands

Mon Aug 05, 2019 10:56 pm

I tried the workaround posted by 6by9 in the GitHub issue, unfortunately it still doesn't work..

Relevant portion of /boot/config.txt is:

Code: Select all

[HDMI:0]
# settings for exposure screen on HDMI 0
hdmi_force_hotplug=1
hdmi_cvt 1024 600 60 3 0 0 0
hdmi_mode=107
hdmi_group=1


[HDMI:1]
# Settings for 7" touchscreen on HDMI 1
hdmi_force_hotplug=1
hdmi_cvt 800 480 60 6 0 0 0
hdmi_mode=87
hdmi_group=2

This is the result:

Code: Select all

pi@raspberrypi:~ $ tvservice -s -v 2
state 0xa [HDMI CEA (17) RGB lim 4:3], 720x576 @ 50.00Hz, progressive
pi@raspberrypi:~ $ tvservice -s -v 7
state 0xa [HDMI DMT (87) RGB full 15:9], 800x480 @ 59.00Hz, progressive
pi@raspberrypi:~ $ fbset -fb /dev/fb0 -s

mode "656x512"
    geometry 656 512 656 512 32
    timings 0 0 0 0 0 0 0
    rgba 8/16,8/8,8/0,8/24
endmode

pi@raspberrypi:~ $ fbset -fb /dev/fb1 -s

mode "800x480"
    geometry 800 480 800 480 32
    timings 0 0 0 0 0 0 0
    rgba 8/16,8/8,8/0,8/24
endmode

pi@raspberrypi:~ $ 

Echevresm
Posts: 4
Joined: Tue Apr 05, 2016 12:37 pm

Re: Pi4 - HDMI 1 Resolution commands overriding HDMI 0 resolution commands

Sun Aug 11, 2019 6:53 am

I succeeded in connecting a 1024 x 600 monitor on hdmi 0. First, I connected the Pi4 to another 1440 x 900 monitor, afterwards I connected the 1024 x 600 monitor using a config.txt including the "hdmi_cvt=1024 600 60 3 0 0 0" directive without updating hdmi-mode. Then I used the "screen configuration" utility from the main menu "préférence" to set the 1024x600 definition. This utility did not update the config.txt but did the job.
It seems that the Pi4 ignores the hdmi_group and hdmi_mode settings but gets the EDID file of the monitor in order to offer the right list of the monitor available modes.
Regards,
Michel

Return to “Troubleshooting”