2020年7月5日星期日

Raspbian HDMI configuration


The Raspberry Pi 4 can drive up to two displays, with a resolution up to 1080p at a 60Hz refresh rate. At 4K resolution, if you connect two displays then you are limited to a 30Hz refresh rate. You can also drive a single display at 4K with a 60Hz refresh rate: this requires that the display is attached to the HDMI port adjacent to the USB-C power input (labelled HDMI0). You must also enable 4Kp60 output by setting the hdmi_enable_4kp60=1 flag in config.txt. This flag can also be set using the 'Raspberry Pi Configuration' tool within the desktop environment.

What modes does my device support?

You can use the tvservice application on the command line to determine which modes are supported by your device, along with other useful data:
  • tvservice -s displays the current HDMI status, including mode and resolution
  • tvservice -m CEA lists all supported CEA modes
  • tvservice -m DMT lists all supported DMT modes
If you are using a Pi 4 with more than one display attached, then tvservice needs to be told which device to ask for information. You can get display IDs for all attached devices by using:
tvservice -l
You can specify which display tvservice uses by adding -v  to the tvservice command, e.g:
  • tvservice -v 7 -m CEA, lists all supported CEA modes for display ID 7

Setting a specific HDMI mode

Setting a specific mode is done using the hdmi_group and hdmi_mode config.txt entries. The group entry selects between CEA or DMT, and the mode selects the resolution and frame rate. You can find tables of modes on the config.txt Video Configuration page, but you should use the tvservice command described above to find out exactly which modes your device supports.
On the Pi 4, to specify the HDMI port, add an index identifier to the hdmi_group or hdmi_mode entry in config.txt, e.g. hdmi_mode:0 or hdmi_group:1.

Setting a custom HDMI mode

There are two options for setting a custom mode: hdmi_cvt and hdmi_timings.
hdmi_cvt sets a custom Coordinated Video Timing entry, which is described fully here: Video Configuration
In certain rare cases it may be necessary to define the exact clock requirements of the HDMI signal. This is a fully custom mode, and it is activated by setting hdmi_group=2 and hdmi_mode=87. You can then use the hdmi_timings config.txt command to set the specific parameters for your display. hdmi_timings specifies all the timings that an HDMI signal needs to use. These timings are usually found in the datasheet of the display being used.
hdmi_timings= v_front_porch>
TimingPurpose
h_active_pixelsThe horizontal resolution
h_sync_polarity0 or 1 to define the horizontal sync polarity
h_front_porchNumber of horizontal front porch pixels
h_sync_pulseWidth of horizontal sync pulse
h_back_porchNumber of horizontal back porch pixels
v_active_linesThe vertical resolution
v_sync_polarity0 or 1 to define the vertical sync polarity
v_front_porchNumber of vertical front porch pixels
v_sync_pulseWidth of vertical sync pulse
v_back_porchNumber of vertical back porch pixels
v_sync_offset_aLeave at 0
v_sync_offset_bLeave at 0
pixel_repLeave at 0
frame_rateFrame rate of mode
interlaced0 for non-interlaced, 1 for interlaced
pixel_freqThe mode pixel frequency
aspect_ratioThe aspect ratio required
aspect_ratio should be one of the following:
Ratioaspect_ratio ID
4:31
14:92
16:93
5:44
16:105
15:96
21:97
64:278
For the Pi4, to specify the HDMI port, you can add an index identifier to the config.txt. e.g. hdmi_cvt:0=... or hdmi_timings:1=.... If no port identifier is specified, the settings are applied to port 0.

Display Rotation

Please see the Display Rotation Page for details.

HDMI not working properly?

In some rare cases you may need to increase the HDMI drive strength, for example when there is speckling on the display or when you are using very long cables. There is a config.txt item to do this, config_hdmi_boost, which is documented on the config.txt video page.
The Raspberry Pi 4B does not yet support config_hdmi_boost, support for this option will be added in a future software update.

没有评论:

发表评论

在PVE使用虚拟 USB 存储设备 + ARPL 引导 DSM

  部分内容来自: https://blog.myds.cloud/archives/synoboot-usb-image-in-pve-virtual-machine.html 虚拟机建好之后,打开配置文件 nano /etc/pve/qemu-server/100.conf ...