Linux Framebuffer set resolution correctly

Try this format for fbset:

fbset -fb /dev/fb0 -g 1920 1200 1920 1200 16 

And check you're really looking at fb0 and not fb1:

fbset -fb /dev/fb0

Double check what was actually set:

cat /sys/class/graphics/fb0/mode

Also try to run fbi with (again, to make sure you're using fb0):

fbi -d /dev/fb0 image.png

You could also force your settings into the fb0 by doing:

echo U:1920x1200p-0 > /sys/class/graphics/fb0/mode

Technically, that is what fbset is doing anyway. Just making sure fb1 isn't screwing things up.

Last, make sure your console is using fb0. I'm sure it is.

con2fbmap 1

You may also want to reboot, so check what your setting is:

cat /proc/cmdline

If its not 1920x1200, update to 1920x200. I think it located in /boot/cmdline.txt for raspberry pi. For me its /boot/uEnv.txt.


I have a two part answer which works wonders on Raspberry Pi.

First, the Pi has the concept of overscan, which is a black border added around the whole screen to make it fall within the "tube" of older TVs. And yes, it's also needed on some modern flat-screen TVs that emulate that function. If your black border is around all the screen resolutions, then change this. The easiest way is through sudo raspi-config . The options and layout vary in different versions of raspi-config but you might start by looking in the Advanced Options menu for Overscan. If overscan is your issue, but you want finer control over the size of the black border - then there is a way to fine tune it in /boot/config.txt. I won't go into that here, and it's easy to search for how to tweak that file.

If this is not your problem, and you are looking for a better resolution you can set for your TV/monitor, then you can also use raspi-config to select from among all the valid screen resolutions. They are in the same Advanced Options menu as was overscan.

If you need to check and set the resolution programmatically, then the go-to tool for that is tvservice. There is no man page for the program, but running it with no arguments provides some help. There are very interesting capabilities that go well beyond what fbset can do.

Some brief examples:

$ sudo tvservice --status
state 0x120009 [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive
$
$ sudo tvservice --modes=CEA
Group CEA has 11 modes:
           mode 1: 640x480 @ 60Hz 4:3, clock:25MHz progressive 
           mode 2: 720x480 @ 60Hz 4:3, clock:27MHz progressive 
           mode 3: 720x480 @ 60Hz 16:9, clock:27MHz progressive 
           mode 4: 1280x720 @ 60Hz 16:9, clock:74MHz progressive 
  (prefer) mode 16: 1920x1080 @ 60Hz 16:9, clock:148MHz progressive 
           mode 17: 720x576 @ 50Hz 4:3, clock:27MHz progressive 
           mode 18: 720x576 @ 50Hz 16:9, clock:27MHz progressive 
           mode 19: 1280x720 @ 50Hz 16:9, clock:74MHz progressive 
           mode 31: 1920x1080 @ 50Hz 16:9, clock:148MHz progressive 
           mode 32: 1920x1080 @ 24Hz 16:9, clock:74MHz progressive 
           mode 34: 1920x1080 @ 30Hz 16:9, clock:74MHz progressive 

You can see what modes the TV supports, and to be complete you should scan both for DMT and CEA groups to catch everything. DMT modes are more attuned to computer monitors rather than TVs.

Then your program can select from that list and use tvservice -e to set one of these modes.