Rumbles
Posts: 4
Joined: Sat Jan 21, 2017 1:31 am

pi4 won't display 4k on both outputs

Wed Nov 20, 2019 9:43 am

Yesterday I set up a pi4, I have attached it to 2 (identical) 4k screens (3840x2160), when I powered it on it was able to set the resolution for one screen to 4k, but when I started it connected to both 4k screens, the second screen only offers me a maximum resolution of 1024x768.

If I swapped the cables round, the other screen will work in 4k and I have the same resolutions offered on the screen that was originally running at 4k. I also tried swapping the micro-HDMI to HDMI adaptors and I had the same issue, one would run at 4k another would only offer 1024x768. I then set one to 1080x1920 and the other also offered me up to that resolution. Currently I have both set to this HD resolution, but ideally, I want both to run at 4k.

I tried adding a resolution to the display using xrandr:

Code: Select all

gtf 3840 2160 30
Gave me this response:

Code: Select all

# 3840x2160 @ 30.00 Hz (GTF) hsync: 65.91 kHz; pclk: 339.57 MHz
Modeline "3840x2160_30.00"  339.57  3840 4080 4496 5152  2160 2161 2164 2197  -HSync +Vsync
I was able to go through the steps to set that as a new mode:

Code: Select all

xrandr --newmode "3840x2160_30.00"  339.57  3840 4080 4496 5152  2160 2161 2164 2197  -HSync +Vsync
xrandr --addmode HDMI-2 3840x2160_30.00
xrandr --output HDMI-2 --mode 3840x2160_30.00
This gave me an error I believe it was the same error I got later when I managed to get the resolutions set low enough on both screens that the screen configuration utility offered my the 4k resolution on both screens, but when I tried this, I got this error:

Code: Select all

XRandR failed:
XRandR returned error code 1: X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  140 (RANDR)
  Minor opcode of failed request:  7 (RRSetScreenSize)
  Serial number of failed request:  27
  Current serial number in output stream:  28
I'm unable to reproduce this using "xrandr --newmode" currently as explained below. The screens are in use right now, but I can probably tinker with them a bit more when others have gone home, we are currently using them as Jenkins wallboards to display failed builds, so I don't want to mes around with them during working hours too much.

xrandr -q currently gives me:

Code: Select all

Screen 0: minimum 320 x 200, current 3840 x 1080, maximum 7680 x 7680
HDMI-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 708mm x 398mm
   3840x2160     30.00 +  30.00    25.00    25.00    24.00    24.00    29.97    23.98  
   1920x1080     60.00*   60.00    50.00    59.94    24.00    23.98  
   1680x1050     59.88  
   1280x1024     60.02  
   1280x960      60.00  
   1360x768      60.02  
   1280x800      59.91  
   1280x720      60.00    60.00    50.00    50.00    59.94  
   1024x768      60.00  
   800x600       60.32    56.25  
   720x576       50.00    50.00  
   720x480       60.00    60.00    59.94    59.94  
   640x480       60.00    59.94    59.94  
   720x400       70.08  
   3840x2160_30.00  30.00  
HDMI-2 connected 1920x1080+1920+0 (normal left inverted right x axis y axis) 708mm x 398mm
   1920x1080     60.00*   60.00    50.00    59.94    24.00    23.98  
   1680x1050     59.88  
   1280x1024     60.02  
   1280x960      60.00  
   1360x768      60.02  
   1280x800      59.91  
   1280x720      60.00    60.00    50.00    50.00    59.94  
   1024x768      60.00  
   800x600       60.32    56.25  
   720x576       50.00    50.00  
   720x480       60.00    60.00    59.94    59.94  
   640x480       60.00    59.94    59.94  
   720x400       70.08  
   3840x2160_30.00  30.00  
I just tried adding the same new mode again and got this error:

Code: Select all

X Error of failed request:  BadName (named color or font does not exist)
  Major opcode of failed request:  140 (RANDR)
  Minor opcode of failed request:  16 (RRCreateMode)
  Serial number of failed request:  27
  Current serial number in output stream:  27
I assume this is because they're both in 4k mode currently, but I can try to reproduce the error later today when there are less people in the office.

I also attempted to play around with the /boot/config.txt, but the changes I made didn't help much. Currently my config.txt is using the following options (I did notice there were a few DOS/Windows carriage-return characters in the file, I'm not sure if they need to be removed?) :

Code: Select all

hdmi_safe=1
config_hdmi_boost=4
dtparam=audio=on
dtoverlay=vc4-fkms-v3d
max_framebuffers=2
gpu_mem=512
hdmi_enable_4kp60=1
Originally hdmi_safe, gpu_mem, hdmi_enable_4kp60 were not set, but enabling them and rebooting the pi doesn't improve the situation. Can anyone suggest any way to get both screens to run at 4k at the same time?

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7534
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: pi4 won't display 4k on both outputs

Wed Nov 20, 2019 11:18 am

The default configuration should allow dual 4k30.
Adding hdmi_enable_4kp60=1 allows 4k60 on HDMI0, but only 1080p60 on HDMI1. Dual 4kp60 is not supported.

Remove hdmi_enable_4kp60=1 and then check what modes xrandr reports based on the EDIDs of your displays.
You can also check that the pixel frequency limit via "vcgencmd get_config int". hdmi_pixel_freq_limit:0 and :1 are the limits for the two HDMI ports, and by default should be 0x11e1a300 (300,000,000 in decimal, or 300MHz).
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

Rumbles
Posts: 4
Joined: Sat Jan 21, 2017 1:31 am

Re: pi4 won't display 4k on both outputs

Wed Nov 20, 2019 1:26 pm

Thanks for the reply, but I only tried adding hdmi_enable_4kp60 after having the initial issues, and I don't get offered 4k @ 60Hz (but I don't want 60Hz anyway so that's not a problem)...

After removing that option from the config.txt I get the following from xrandr:

Code: Select all

Screen 0: minimum 320 x 200, current 3840 x 1080, maximum 7680 x 7680
HDMI-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 708mm x 398mm
   3840x2160     30.00 +  30.00    25.00    25.00    24.00    24.00    29.97    23.98  
   1920x1080     60.00*   60.00    50.00    59.94    24.00    23.98  
   1680x1050     59.88  
   1280x1024     60.02  
   1280x960      60.00  
   1360x768      60.02  
   1280x800      59.91  
   1280x720      60.00    60.00    50.00    50.00    59.94  
   1024x768      60.00  
   800x600       60.32    56.25  
   720x576       50.00    50.00  
   720x480       60.00    60.00    59.94    59.94  
   640x480       60.00    59.94    59.94  
   720x400       70.08  
HDMI-2 connected 1920x1080+1920+0 (normal left inverted right x axis y axis) 708mm x 398mm
   3840x2160     30.00 +  30.00    25.00    25.00    24.00    24.00    29.97    23.98  
   1920x1080     60.00*   60.00    50.00    59.94    24.00    23.98  
   1680x1050     59.88  
   1280x1024     60.02  
   1280x960      60.00  
   1360x768      60.02  
   1280x800      59.91  
   1280x720      60.00    60.00    50.00    50.00    59.94  
   1024x768      60.00  
   800x600       60.32    56.25  
   720x576       50.00    50.00  
   720x480       60.00    60.00    59.94    59.94  
   640x480       60.00    59.94    59.94  
   720x400       70.08  
And the pixel limits appear to be correct:

Code: Select all

arm_freq=1500
audio_pwm_mode=514
config_hdmi_boost=5
core_freq=500
core_freq_min=200
disable_commandline_tags=2
disable_l2cache=1
disable_splash=1
display_hdmi_rotate=-1
display_lcd_rotate=-1
enable_gic=1
force_eeprom_read=1
force_pwm_open=1
framebuffer_ignore_alpha=1
framebuffer_swap=1
gpu_freq=500
gpu_freq_min=500
hdmi_safe=1
init_uart_clock=0x2dc6c00
lcd_framerate=60
mask_gpu_interrupt0=1024
mask_gpu_interrupt1=0x10000
max_framebuffers=2
overscan_bottom=16
overscan_left=24
overscan_right=24
overscan_top=16
pause_burst_frames=1
program_serial_random=1
second_boot=1
hdmi_force_cec_address:0=65535
hdmi_force_cec_address:1=65535
hdmi_force_hotplug:0=1
hdmi_force_hotplug:1=1
hdmi_group:0=2
hdmi_group:1=2
hdmi_mode:0=4
hdmi_mode:1=4
hdmi_pixel_freq_limit:0=0x11e1a300
hdmi_pixel_freq_limit:1=0x11e1a300
And now it works fine... weird...

Thanks for the speedy reply, no idea what I was doing wrong yesterday

Return to “Troubleshooting”