4

I just picked up a Pi 4 and imaged a new card with Raspbian Buster. I'm running this headless (using VNC) but noticed the resolution doesn't match what I've set via raspi-config (which updates /boot/config.txt).

I selected DMT mode 82 (1920 x 1080) and I can see /boot/config.txt has:

# uncomment if hdmi display is not detected and composite is being output
hdmi_force_hotplug=1

# uncomment to force a specific HDMI mode (this will force VGA)
hdmi_group=2
hdmi_mode=82

That looks right. Then I check fbset --show and it reads:

pi@tims-raspi4:~ $ fbset --show

mode "1920x1080"
    geometry 1920 1080 1920 1080 32
    timings 0 0 0 0 0 0 0
    accel true
    rgba 8/16,8/8,8/0,0/0
endmode

So that also looks right. But I can clearly see the window is not as larger as my Pi 3 B+.

I checked xdpyinfo to see what X thinks it has for a display and the relevant section reads:

default screen number:    0
number of screens:    1

screen #0:
  dimensions:    1024x768 pixels (270x203 millimeters)

So that's a problem... X is using a lower display resolution than the frame buffer provides.

So finally, I used xrandr -s 1920x1080 to force X to use that resolution -- and this works! (yay!)

BUT puzzlingly... if I reboot, it's right back to the lower 1024x768 resolution despite the frame buffer being in 1920x1080 mode.

This is basically a generic Buster install (downloaded the image from Raspberrypi.org) and the only thing I've done to it is set a hostname, configured wi-fi, enabled ssh, and enabled VNC (same as I've done with my previous Pi's).

Any ideas why X is coming up with the wrong resolution?

  • I use the same hdmi_group and hdmi_mode settings as you, but my hdmi_force_hotplug line is commented out, and my local X server has the correct resolution (1920x1080) at the getgo, with no intervention on my part. What happens if you comment out hdmi_force_hotplug? – bls Jul 22 '19 at 23:51
  • @bls, Thank you for your suggestion. I did test commenting the hdmi_force_hotplug line. This did not work (it resulted in having no graphical frame buffer). I had to revert back. Was your OS upgraded from a previous release (e.g. Stretch?) or a fresh install? I'm wondering if there might have been some lingering settings from a previous OS that made the difference. – Tim Campbell Jul 23 '19 at 1:37
  • I did a fresh Buster install. Good that you found a workaround. – bls Jul 23 '19 at 16:33
2

Because Raspbian Buster defaults to vc4-kms-v3d (not the fake one, vc4-fkms-v3d), setting the display resolution is a bit more complicated.

I found an imperfect solution and documented it over here:

Custom screen resolution for Android on Raspberry Pi 3

The main drawback is the initial login is at the 1024x768 resolution, and then shortly after the script kicks in and sets it to the desired resolution.

HTH. YMMV. Would love to see someone post a more perfect solution. =D

  • Per your advice in the linked solution, I created /etc/xdg/autostart/set-vnc-resolution.desktop. I simplified the Exec line to read `Exec=/bin/bash -c "xrandr -s 1920x1080" but kept other details the same. This does resolve the issue. Thanks! I'll still be interested to see if someone can work out why the resolution doesn't come up correctly on boot. – Tim Campbell Jul 23 '19 at 1:33
3

The syntax for HDMI related settings in config.txt on a Raspberry Pi 4B appears to have changed, likely because the Pi4B has two HDMI outputs (numbered 0 and 1 in technical documentation, and somewhat confusingly 1 & 2 otherwise).

Every time I would run the Pi4B headlessly(?), the RealVNC session would use a low resolution filling just a small part of my laptop's screen. With a TV screen connected to HDMI0 the VNC session would use the same high resolution as the TV.

Settings in /boot/config.txt that worked for me, in the new syntax, turned out to be as follows:

# Force HDMI-output on,
# and set VNC screen resolution when headless.
# ar - 21-09-2019, 04-10-2019
hdmi_force_hotplug:0=1
hdmi_drive:0=2
hdmi_group:0=2
hdmi_mode:0=82
#core_freq_min=500
# Not yet implemented for RPi4B
hdmi_blanking:0=1

Settings related to HDMI elsewhere in /boot/config.txt are commented out, as far as I understand them to be related to HDMI.

  • Thanks for posting this. I did try these changes and also found this page raspberrypi.org/documentation/configuration/config-txt/video.md which discusses the changes. Unfortunately I wasn't able to get this solution to work. My Pi4 is still ignoring the video settings. – Tim Campbell Oct 5 '19 at 18:27
  • Unfortunately, adding those lines to the end of my /boot/config.txt had no effect on the VNC screen size. Is the order of lines important in config.txt? – Rob Robinett Oct 30 '19 at 17:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.