织梦CMS - 轻松建站从此开始!

欧博ABG官网-欧博官方网址-会员登入

Linux Framebuffer set resolu皇冠tion correctly

时间:2025-08-20 14:14来源: 作者:admin 点击: 3 次
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 whol

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.

(责任编辑:)
------分隔线----------------------------
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
用户名: 验证码:
发布者资料
查看详细资料 发送留言 加为好友 用户等级: 注册时间:2025-08-23 15:08 最后登录:2025-08-23 15:08
栏目列表
推荐内容