5

This has been asked multiple times in multiple forums. Invariably the answer is editing /boot/config.txt. This doesn't solve the issue.

My RasPi's connected to a TV via HDMI0. The TV is one of those old "HD-ready" thingys, native resolution is 1280x720 but it can do full 1080p. I usually run it on 720, but the problem is present with both. I'd need to get overscan about 20 - 24 on the horizontal plane but it's not happening.

Here are my current settings:

# Disable compensation for displays with overscan
#disable_overscan=1

uncomment the following to adjust overscan. Use positive numbers if console

goes off screen, and negative if there is too much border

overscan_left=100 overscan_right=100 #overscan_top=16 #overscan_bottom=16

Current 100 is purposefully overdone to see if L/R overscan has any effect. It doesn't.

The problem's present in the current Raspberry Pi OS, whether or not it's running from SD card or an external SSD or USB stick. I've re-flashed it now four times over on different SD cards, current iteration is a fresh install on a USB stick.

For testing I installed Gentoo with PINN, and had no issues, so that'd be an obvious workaround. However I'd like to stick to RasPi OS as I'm most at home with Debian-based OS.

The TV has no menu item to affect the overscan. What else can I try to fix this?

Milliways
  • 62,573
  • 32
  • 113
  • 225
Peregrino69
  • 151
  • 1
  • 1
  • 6

3 Answers3

4

I was able to fix it using some information posted on this github issue back in 2019. This also works with the Pi5; it's about the library not the hardware. This is now the default library in use with Raspberry Pi OS 12, aka Bookworm.

Commands have to be passed directly in to vc4-kms-v3d at boot to tweak the margins on the screen. There were a couple steps:

  1. Get the name of the display you want to modify by clicking on Raspberry Pi Menu > Preferences > Screen Configuration
    • This is the menu in the upper left of the main desktop - assuming you can see it
    • The identifier of the display should show up in the "Screen Layout Editor" window
    • Take a note of this name, in my instance it was called HDMI-A-1
  2. Open a new terminal in order to edit cmdline.txt
    • Run the command sudo nano /boot/cmdline.txt
  3. Add the following text to the end of the single line contained in cmdline.txt
    • video=HDMI-A-1:1920x1080@60,margin_left=40,margin_right=40,margin_top=32,margin_bottom=32
      • Note: The name of the display is followed by the desired resolution, refresh rate and margin values
      • All of this information should be pasted directly to the end of the single line of text that is already in cmdline.txt
      • It appears to me that cmdline.txt is space delimited
      • Adjust the margin values as needed, adding to them to make the padding around the edge of the display larger
      • i.e. bigger margin number = smaller display in the TV
    • You'll need to reboot the system to see the changes go in to effect.

Took a little bit of digging in to vc4-kms-v3d to get a straight and effective answer that wasn't dependent upon some setting in the television itself.

Shrout1
  • 172
  • 1
  • 11
3

The only way I could get this to work was to disable the "new" video driver, which apparently ignores all of these values.

Further down in config.txt, you have to comment out this line:

dtoverlay=vc4-kms-v3d

Doing this will reduce some functionality (acceleration? 4k?) but at least you can see the whole screen.

Also note the "disable_overscan=1" should be uncommented, or else it seems to add an extra 48 pixels around the border which is both unintuitive and poorly documented.

wulph
  • 54
  • 2
0

I am using this successfully on Raspberry Pi 5 / Wayland hosts:

echo "--- Before -" && sudo cat /boot/firmware/cmdline.txt && echo && echo "--- Remove video configuration -" && sudo sed -i 's/[[:space:]]*video=.*margin_.*[[:space:]]//g' /boot/firmware/cmdline.txt && sudo cat /boot/firmware/cmdline.txt && echo && echo "--- Final - Append video configuration -" && sudo sed -i "1 s/$/ video=HDMI-A-1:1920x1080@60,margin_left=60,margin_right=60,margin_top=40,margin_bottom=40 /" /boot/firmware/cmdline.txt && sudo cat /boot/firmware/cmdline.txt && echo && echo "--- missing just a 'sudo reboot'"
Ray
  • 1
  • 1