遗留选项

该config.txt options described here don’t work with Raspberry Pi OS 书虫以及后续版本,且不再受官方正式支持。

然而,它们仍在此处保留文档记录,因为如果您正在 bare-metal 开发中,它们可能仍然对您有益。

遗留启动选项

(另见config.txt 启动选项。)

start_x, start_debug

这些为某些替代方案提供了快捷方式start_file and fixup_file settings, and are the recommended methods for selecting firmware configurations.

start_x=1 implies

  start_file=start_x.elf
  fixup_file=fixup_x.dat

在 Raspberry Pi 4 上,如果文件start4x.elf and fixup4x.dat are present, these files will be used instead.

start_debug=1 implies

  start_file=start_db.elf
  fixup_file=fixup_db.dat

disable_commandline_tags

设置disable_commandline_tags command to 1 to stop start.elf from filling in ATAGS (memory from 0x100) before launching the kernel.

arm_control

该设置已废弃。请使用arm_64bit instead to enable 64-bit kernels.

设置板级特定控制位。

arm_peri_high

将arm_peri_high to 1 to enable high peripheral mode on Raspberry Pi 4. It is set automatically if a suitable DTB is loaded.

在未使用兼容 Device Tree 的情况下启用高外设模式将导致系统无法启动。目前缺少 ARM stub 支持,因此您还需要使用 加载一个合适的文件armstub.

kernel_address

kernel_address is the memory address to which the kernel image should be loaded. By default, 32-bit kernels are loaded to address 0x8000, and 64-bit kernels to address 0x200000. If kernel_old is set, kernels are loaded to the address 0x0.

kernel_old

将kernel_old to 1 to load the kernel to the memory address 0x0.

init_uart_baud

init_uart_baud is the initial UART baud rate. The default value is 115200.

init_uart_clock

init_uart_clock is the initial UART clock frequency. The default value is 48000000 (48 MHz). Note that this clock only applies to UART0 (ttyAMA0 in Linux), and that the maximum baudrate for the UART is limited to 1/16th of the clock. The default UART on the Raspberry Pi 3 and Raspberry Pi Zero is UART1 (ttyS0 in Linux), and its clock is the core VPU clock – at least 250 MHz.

bootcode_delay

该bootcode_delay command delays for a given number of seconds in bootcode.bin before loading start.elf: the default value is 0.

这在读取显示器的 EDID 之前插入延迟时特别有用。例如,当 Raspberry Pi 和显示器由同一电源供电,但显示器的启动时间比 Raspberry Pi 长时。如果在初次启动时显示检测错误,但在不断开显示器电源的情况下对 Raspberry Pi 进行 soft-reboot 后显示检测正确,请尝试设置此值。

boot_delay

该boot_delay command forces a wait for a given number of seconds in start.elf before loading the kernel: the default value is 0. The total delay in milliseconds is calculated as (1000 x boot_delay) + boot_delay_ms. This can be useful if your SD card needs a while to get ready before Linux is able to boot from it.

boot_delay_ms

该boot_delay_ms command means wait for a given number of milliseconds in start.elf, together with boot_delay, before loading the kernel. The default value is 0.

enable_gic (Raspberry Pi 4 Only)

在 Raspberry Pi 4B 上,如果将此值设置为0 then the interrupts will be routed to the Arm cores using the legacy interrupt controller, rather than through the GIC-400. The default value is 1.

upstream_kernel

替换为您的实际地址:upstream_kernel=1 is used, the firmware sets os_prefix改为 "upstream/",除非它已被显式设置为其他值,但与其他的类似os_prefix values it will be ignored if the required kernel and .dtb file can’t be found when using the prefix.

固件还会优先使用上游 Linux 的 DTB 名称(bcm2837-rpi-3-b.dtb instead of bcm2710-rpi-3-b.dtb, for example). If the upstream file isn’t found the firmware will load the downstream variant instead and automatically apply the "upstream" overlay to make some adjustments. Note that this process happens 之后[11] 图像信号处理器os_prefix has been finalised.

遗留超频选项

(另见config.txt 超频选项。)

超频

never_over_voltage

在一次性可编程(OTP)存储器中设置一位,以防止设备承受过压。此举旨在锁定 Raspberry Pi,使得保修位无法被意外或恶意设置(通过无效过压方式)。

disable_auto_turbo

在 Raspberry Pi 2 和 3 上,设置此标志将禁止 GPU 进入 turbo 模式,而在特定负载下 GPU 本可进入该模式。

遗留条件过滤器

该[HDMI:*] filter

此过滤器仅适用于 Raspberry Pi 4。

Raspberry Pi 4 拥有两个 HDMI 端口,对于许多config.txt commands related to HDMI, it is necessary to specify which HDMI port is being referred to. The HDMI conditional filters subsequent HDMI configurations to the specific port.

 [HDMI:0]
   hdmi_group=2
   hdmi_mode=45
 [HDMI:1]
   hdmi_group=2
   hdmi_mode=67

一种替代方案variable:index syntax is available on all port-specific HDMI commands. You could use the following, which is the same as the previous example:

 hdmi_group:0=2
 hdmi_mode:0=45
 hdmi_group:1=2
 hdmi_mode:1=67

遗留内存选项

[4] Raspberry Pi 5 不会代表 OS 分配 GPU 内存,因此以下设置无效。

gpu_mem

指定保留多少兆字节的内存仅供 GPU 独占使用:剩余内存将分配给 Arm CPU 供 OS 使用。对于内存小于 1 GB 的 Raspberry Pi 设备,默认值为64; for Raspberry Pi devices with 1 GB or more of memory the default is 76.

指定以 MB 为单位保留供 GPU 独占使用的内存量:剩余内存将分配给 Arm CPU 供 OS 使用。对于内存小于 1 GB 的 Raspberry Pi 设备,默认值为与 x86 机器上常见的 GPU 不同(增加显存可提升 3D 性能),VideoCore 的架构意味着指定超过必要值的数值并不会带来性能优势,

反而可能损害性能。gpu_mem to the lowest possible value. If a particular graphics feature is not working correctly, try increasing the value of gpu_mem, being mindful of the recommended maximums shown below.

为确保 Linux 获得最佳性能,您应设置gpu_mem allocation. Instead memory is allocated dynamically within Linux. This allows a smaller value to be specified for gpu_mem on the Raspberry Pi 4, compared to previous models.

在 Raspberry Pi 4 上,GPU 的 3D 组件拥有独立的内存管理单元(MMU),且不从

在传统内核中,分配给 GPU 的内存用于显示、3D 渲染、编解码器和相机功能,以及部分基础固件维护工作。以下指定的最大值假设您已启用所有这些功能。若未使用,则应采用较小的 gpu_mem 值。

推荐的最高限值如下: gpu_mem recommended maximum

total RAM

128

256 MB

384

512 MB

512, 76 on the Raspberry Pi 4

1 GB 或更高

[18] Raspberry Pi OS 上的相机堆栈(libcamera)使用 Linux CMA 内存来分配缓冲区而非 GPU 内存,因此增加 GPU 内存大小并无益处。gpu_mem to larger values, however this should be avoided since it can cause problems, such as preventing Linux from booting. The minimum value is 16, however this disables certain GPU features.

您也可以使用gpu_mem_256, gpu_mem_512, and gpu_mem_1024 to allow swapping the same SD card between Raspberry Pi devices with different amounts of RAM without having to edit config.txt each time:

gpu_mem_256

该gpu_mem_256 command sets the GPU memory in megabytes for Raspberry Pi devices with 256 MB of memory. It is ignored if memory size is not 256 MB. This overrides gpu_mem.

gpu_mem_512

该gpu_mem_512 command sets the GPU memory in megabytes for Raspberry Pi devices with 512 MB of memory. It is ignored if memory size is not 512 MB. This overrides gpu_mem.

gpu_mem_1024

该gpu_mem_1024 command sets the GPU memory in megabytes for Raspberry Pi devices with 1 GB or more of memory. It is ignored if memory size is smaller than 1 GB. This overrides gpu_mem.

disable_l2cache

可以设置1 disables the CPU’s access to the GPU’s L2 cache and requires a corresponding L2 disabled kernel. Default value on BCM2835 is 0. On BCM2836, BCM2837, BCM2711, and BCM2712, the Arm CPUs have their own L2 cache and therefore the default is 1. The standard Raspberry Pi kernel.img and kernel7.img builds reflect this difference in cache setting.

您也可以使用

(请参阅将其设置为)

HDMI 模式

Legacy video options<command>:<port>, where port is 0 or 1, to specify which port the setting should apply to. If no port is specified, the default is 0. If you specify a port number on a command that does not require a port number, the port is ignored. Further details on the syntax and alternative mechanisms can be found in the HDMI sub-section of the conditionals 部分config.txt Video Options

hdmi_safe

设置hdmi_safe to 1 will lead to "safe mode" settings being used to try to boot with maximum HDMI compatibility. This is the same as setting the following parameters:

hdmi_force_hotplug=1
hdmi_ignore_edid=0xa5000080
config_hdmi_boost=4
hdmi_group=2
hdmi_mode=4
disable_overscan=0
overscan_left=24
overscan_right=24
overscan_top=24
overscan_bottom=24

hdmi_ignore_edid

设置hdmi_ignore_edid to 0xa5000080 enables the ignoring of EDID/display data if your display does not have an accurate [25] 对于具备多个 HDMI 端口的设备,某些 HDMI 命令可应用于任意端口。您可以使用语法. 它需要这个特殊值,以确保不会意外触发。

hdmi_edid_file

设置hdmi_edid_file to 1 will cause the GPU to read EDID data from the edid.dat file, located in the boot partition, instead of reading it from the monitor.

hdmi_edid_filename

在 Raspberry Pi 4B 上,您可以使用hdmi_edid_filename command to specify the filename of the EDID file to use, and also to specify which port the file is to be applied to. This also requires hdmi_edid_file=1 to enable EDID files.

例如:

hdmi_edid_file=1
hdmi_edid_filename:0=FileForPortZero.edid
hdmi_edid_filename:1=FileForPortOne.edid

hdmi_force_edid_audio

设置hdmi_force_edid_audio to 1 pretends that all audio formats are supported by the display, allowing passthrough of DTS/AC3 even when this is not reported as supported.

hdmi_ignore_edid_audio

设置hdmi_ignore_edid_audio to 1 pretends that all audio formats are unsupported by the display. This means ALSA will default to the analogue audio (headphone) jack.

hdmi_force_edid_3d

设置hdmi_force_edid_3d to 1 pretends that all CEA modes support 3D, even when the EDID does not indicate support for this.

hdmi_ignore_cec_init

设置hdmi_ignore_cec_init to 1 will stop the initial active source message being sent during bootup. This prevents a CEC-enabled TV from coming out of standby and channel-switching when you are rebooting your Raspberry Pi.

hdmi_ignore_cec

设置hdmi_ignore_cec to 1 pretends that CEC显示器完全不支持该功能。将不支持任何 CEC 功能。

cec_osd_name

该cec_osd_name command sets the initial CEC name of the device. The default is Raspberry Pi.

hdmi_pixel_encoding

该hdmi_pixel_encoding command forces the pixel encoding mode. By default, it will use the mode requested from the EDID, so you shouldn’t need to change it.

hdmi_pixel_encoding 结果

0

默认(CEA 标准下为受限 RGB,DMT 标准下为全范围 RGB)

1

受限 RGB(16-235)

2

全范围 RGB(0-255)

3

受限 YCbCr(16-235)

4

全范围 YCbCr(0-255)

hdmi_max_pixel_freq

像素频率由固件和 KMS 用于过滤 HDMI 模式。请注意,这与帧率不同。它指定了有效模式允许的最高频率,从而排除更高频率的模式。例如,如果您希望禁用所有 4K 模式,可将最大频率设为 200000000,因为所有 4K 模式的频率均高于此值。

hdmi_blanking

该hdmi_blanking command controls what happens when the operating system asks for the display to be put into standby mode, using DPMS, to save power. If this option is not set or set to 0, the HDMI output is blanked but not switched off. In order to mimic the behaviour of other computers, you can set the HDMI output to switch off as well by setting this option to 1: the attached display will go into a low-power standby mode.

\n在 Raspberry Pi 4 上,设置hdmi_blanking=1 will not cause the HDMI output to be switched off, since this feature has not yet been implemented. This feature can cause issues when using applications which don’t use the framebuffer, such as omxplayer.
hdmi_blanking 结果

0

HDMI 输出画面将被置黑

1

HDMI 输出将被关闭并置黑

hdmi_drive

该hdmi_drive command allows you to choose between HDMI and DVI output modes.

hdmi_drive 结果

1

普通 DVI 模式(无声音)

2

普通 HDMI 模式(若支持且启用则发送音频)

config_hdmi_boost

配置 HDMI 接口的信号强度。最小值为0 and the maximum is 11.

原始 Model B 和 A 的默认值为2. The default value for the Model B+ and all later models is 5.

如果遇到 HDMI 问题(如雪花点、干扰),请尝试7. Very long HDMI cables might need up to 11, but values this high should not be used unless absolutely necessary.

此选项在 Raspberry Pi 4 上会被忽略。

hdmi_group

该hdmi_group command defines the HDMI output group to be either CEA (Consumer Electronics Association, the standard typically used by TVs) or DMT (Display Monitor Timings, the standard typically used by monitors). This setting should be used in conjunction with hdmi_mode.

hdmi_group 结果

0

从 EDID 自动检测

1

CEA

2

DMT

hdmi_mode

与hdmi_group, hdmi_mode defines the HDMI output format. Format mode numbers are derived from the CTA规范.

并非所有模式在所有机型上均可用。

这些值在满足以下条件时有效:hdmi_group=1 (CEA):

hdmi_mode 分辨率 频率 屏幕比例 注释

1

VGA (640x480)

60Hz

4:3

2

480p

60Hz

4:3

3

480p

60Hz

16:9

4

720p

60Hz

16:9

5

1080i

60Hz

16:9

6

480i

60Hz

4:3

7

480i

60Hz

16:9

8

240p

60Hz

4:3

9

240p

60Hz

16:9

十

480i

60Hz

4:3

像素四倍化

十一

480i

60Hz

16:9

像素四倍化

英国皇家学会圣诞讲座:抢先看

240p

60Hz

4:3

像素四倍化

13

240p

60Hz

16:9

像素四倍化

十四

480p

60Hz

4:3

像素加倍

十五

480p

60Hz

16:9

像素加倍

十六

1080p

60Hz

16:9

17

576p

50Hz

4:3

18

576p

50Hz

16:9

https://www.raspberrypi.org/?p=65103

720p

50Hz

16:9

20

1080i

50Hz

16:9

https://www.raspberrypi.org/blog/christmas-lights/

576i

50Hz

4:3

22

576i

50Hz

16:9

23

288p

50Hz

4:3

24

288p

50Hz

16:9

25

576i

50Hz

4:3

像素四倍化

26

576i

50Hz

16:9

像素四倍化

27

288p

50Hz

4:3

像素四倍化

28

288p

50Hz

16:9

像素四倍化

29

576p

50Hz

4:3

像素加倍

30

576p

50Hz

16:9

像素加倍

31

1080p

50Hz

16:9

三十二

1080p

24Hz

16:9

33

1080p

25Hz

16:9

34

1080p

30Hz

16:9

35

480p

60Hz

4:3

像素四倍化

36

480p

60Hz

16:9

像素四倍化

37

576p

50Hz

4:3

像素四倍化

38

576p

50Hz

16:9

像素四倍化

39

1080i

50Hz

16:9

缩减消隐

40

1080i

100Hz

16:9

41

720p

100Hz

16:9

42

576p

100Hz

4:3

四十三

576p

100Hz

16:9

44

576i

100Hz

4:3

45

576i

100Hz

16:9

46

1080i

120Hz

16:9

2016年7月13日,星期三,22:22:30 +0000

720p

120Hz

16:9

48

480p

120Hz

4:3

49

480p

120Hz

16:9

50

480i

120Hz

4:3

51

480i

120Hz

16:9

52

576p

200Hz

4:3

53

576p

200Hz

16:9

54

576i

200Hz

4:3

55

576i

200Hz

16:9

56

480p

240Hz

4:3

正在进行的项目

480p

240Hz

16:9

58

480i

240Hz

4:3

59

480i

240Hz

16:9

60

720p

24Hz

16:9

61

720p

25Hz

16:9

62

720p

30Hz

16:9

63

1080p

120Hz

16:9

64

1080p

100Hz

16:9

65

自定义

六十六

720p

25Hz

64:27

Pi 4

67

720p

30Hz

64:27

Pi 4

68

720p

50Hz

64:27

Pi 4

69

720p

60Hz

64:27

Pi 4

70

720p

100Hz

64:27

Pi 4

71

720p

120Hz

64:27

Pi 4

72

1080p

24Hz

64:27

Pi 4

73

1080p

25Hz

64:27

Pi 4

74

1080p

30Hz

64:27

Pi 4

75

1080p

50Hz

64:27

Pi 4

76

1080p

60Hz

64:27

Pi 4

77

1080p

100Hz

64:27

Pi 4

78

1080p

120Hz

64:27

Pi 4

79

1680x720

24Hz

64:27

Pi 4

八十

1680x720

25z

64:27

Pi 4

81

1680x720

30Hz

64:27

Pi 4

82

1680x720

50Hz

64:27

Pi 4

83

1680x720

60Hz

64:27

Pi 4

84

1680x720

100Hz

64:27

Pi 4

85

1680x720

120Hz

64:27

Pi 4

86

2560x720

24Hz

64:27

Pi 4

87

2560x720

25Hz

64:27

Pi 4

88

2560x720

30Hz

64:27

Pi 4

89

2560x720

50Hz

64:27

Pi 4

90

2560x720

60Hz

64:27

Pi 4

91

2560x720

100Hz

64:27

Pi 4

92

2560x720

120Hz

64:27

Pi 4

93

2160p

24Hz

16:9

Pi 4

94

2160p

25Hz

16:9

Pi 4

95

2160p

30Hz

16:9

Pi 4

96

2160p

50Hz

16:9

Pi 4

97

2160p

60Hz

16:9

Pi 4

98

4096x2160

24Hz

256:135

Pi 4

99

4096x2160

25Hz

256:135

Pi 4

一百

4096x2160

30Hz

256:135

Pi 4

101

4096x2160

50Hz

256:135

Pi 41

102

4096x2160

60Hz

256:135

Pi 41

103

2160p

24Hz

64:27

Pi 4

104

2160p

25Hz

64:27

Pi 4

105

2160p

30Hz

64:27

Pi 4

106

2160p

50Hz

64:27

Pi 4

107

2160p

60Hz

64:27

Pi 4

1.仅在核心频率超频时可用:设置core_freq_min=600 and core_freq=600. See 超频.

像素翻倍与四倍表示更高的时钟频率,每个像素分别重复两次或四次。

这些值在满足以下条件时有效:hdmi_group=2 (DMT):

hdmi_mode 分辨率 频率 屏幕比例 注释

1

640x350

85Hz

2

640x400

85Hz

16:10

3

720x400

85Hz

4

640x480

60Hz

4:3

5

640x480

72Hz

4:3

6

640x480

75Hz

4:3

7

640x480

85Hz

4:3

8

800x600

56Hz

4:3

9

800x600

60Hz

4:3

十

800x600

72Hz

4:3

十一

800x600

75Hz

4:3

英国皇家学会圣诞讲座:抢先看

800x600

85Hz

4:3

13

800x600

120Hz

4:3

十四

848x480

60Hz

16:9

十五

1024x768

43赫兹

4:3

与 Raspberry Pi 不兼容

十六

1024x768

60Hz

4:3

17

1024x768

70Hz

4:3

18

1024x768

75Hz

4:3

https://www.raspberrypi.org/?p=65103

1024x768

85Hz

4:3

20

1024x768

120Hz

4:3

https://www.raspberrypi.org/blog/christmas-lights/

1152x864

75Hz

4:3

22

1280x768

60Hz

15:9

缩减消隐

23

1280x768

60Hz

15:9

24

1280x768

75Hz

15:9

25

1280x768

85Hz

15:9

26

1280x768

120Hz

15:9

缩减消隐

27

1280x800

60

16:10

缩减消隐

28

1280x800

60Hz

16:10

29

1280x800

75Hz

16:10

30

1280x800

85Hz

16:10

31

1280x800

120Hz

16:10

缩减消隐

三十二

1280x960

60Hz

4:3

33

1280x960

85Hz

4:3

34

1280x960

120Hz

4:3

缩减消隐

35

1280x1024

60Hz

5:4

36

1280x1024

75Hz

5:4

37

1280x1024

85Hz

5:4

38

1280x1024

120Hz

5:4

缩减消隐

39

1360x768

60Hz

16:9

40

1360x768

120Hz

16:9

缩减消隐

41

1400x1050

60Hz

4:3

缩减消隐

42

1400x1050

60Hz

4:3

四十三

1400x1050

75Hz

4:3

44

1400x1050

85Hz

4:3

45

1400x1050

120Hz

4:3

缩减消隐

46

1440x900

60Hz

16:10

缩减消隐

2016年7月13日,星期三,22:22:30 +0000

1440x900

60Hz

16:10

48

1440x900

75Hz

16:10

49

1440x900

85Hz

16:10

50

1440x900

120Hz

16:10

缩减消隐

51

1600x1200

60Hz

4:3

52

1600x1200

65Hz

4:3

53

1600x1200

70Hz

4:3

54

1600x1200

75Hz

4:3

55

1600x1200

85Hz

4:3

56

1600x1200

120Hz

4:3

缩减消隐

正在进行的项目

1680x1050

60Hz

16:10

缩减消隐

58

1680x1050

60Hz

16:10

59

1680x1050

75Hz

16:10

60

1680x1050

85Hz

16:10

61

1680x1050

120Hz

16:10

缩减消隐

62

1792x1344

60Hz

4:3

63

1792x1344

75Hz

4:3

64

1792x1344

120Hz

4:3

缩减消隐

65

1856x1392

60Hz

4:3

六十六

1856x1392

75Hz

4:3

67

1856x1392

120Hz

4:3

缩减消隐

68

1920x1200

60Hz

16:10

缩减消隐

69

1920x1200

60Hz

16:10

70

1920x1200

75Hz

16:10

71

1920x1200

85Hz

16:10

72

1920x1200

120Hz

16:10

缩减消隐

73

1920x1440

60Hz

4:3

74

1920x1440

75Hz

4:3

75

1920x1440

120Hz

4:3

缩减消隐

76

2560x1600

60Hz

16:10

缩减消隐

77

2560x1600

60Hz

16:10

78

2560x1600

75Hz

16:10

79

2560x1600

85Hz

16:10

八十

2560x1600

120Hz

16:10

缩减消隐

81

1366x768

60Hz

16:9

不适用于 Raspberry Pi 4

82

1920x1080

60Hz

16:9

1080p

83

1600x900

60Hz

16:9

缩减消隐

84

2048x1152

60Hz

16:9

缩减消隐

85

1280x720

60Hz

16:9

720p

86

1366x768

60Hz

16:9

缩减消隐

存在像素时钟限制。Raspberry Pi 4 之前的型号支持的最高模式为 1920×1200 在 60Hz(使用缩减消隐),而 Raspberry Pi 4 最高可支持 4096×2160(俗称 4k)在 60Hz。此外请注意,如果您使用 Raspberry Pi 4 的两个 HDMI 端口输出 4k 画面,则两者均将被限制在 30Hz。

hdmi_timings

此选项允许为自定义模式设置原始 HDMI 时序值,通过以下方式选择:hdmi_group=2 and hdmi_mode=87.

hdmi_timings=<h_active_pixels> <h_sync_polarity> <h_front_porch> <h_sync_pulse> <h_back_porch> <v_active_lines> <v_sync_polarity> <v_front_porch> <v_sync_pulse> <v_back_porch> <v_sync_offset_a> <v_sync_offset_b> <pixel_rep> <frame_rate> <interlaced> <pixel_freq> <aspect_ratio>
<h_active_pixels> = horizontal pixels (width)
<h_sync_polarity> = invert hsync polarity
<h_front_porch>   = horizontal forward padding from DE active edge
<h_sync_pulse>    = hsync pulse width in pixel clocks
<h_back_porch>    = vertical back padding from DE active edge
<v_active_lines>  = vertical pixels height (lines)
<v_sync_polarity> = invert vsync polarity
<v_front_porch>   = vertical forward padding from DE active edge
<v_sync_pulse>    = vsync pulse width in pixel clocks
<v_back_porch>    = vertical back padding from DE active edge
<v_sync_offset_a> = leave at zero
<v_sync_offset_b> = leave at zero
<pixel_rep>       = leave at zero
<frame_rate>      = screen refresh rate in Hz
<interlaced>      = leave at zero
<pixel_freq>      = clock frequency (h_active_pixels + h_front_porch + h_sync_pulse + h_back_porch)
                                    * (v_active_lines + v_front_porch + v_sync_pulse + v_back_porch)
                                    * framerate
<aspect_ratio>    = [see footnote]

宽高比可设置为八个值之一。请从下方选择一个与您的屏幕最相似的宽高比值:

宽高比 姓名 价值感

4:3

HDMI_ASPECT_4_3

1

14:9

HDMI_ASPECT_14_9

2

16:9

HDMI_ASPECT_16_9

3

5:4

HDMI_ASPECT_5_4

4

16:10

HDMI_ASPECT_16_10

5

15:9

HDMI_ASPECT_15_9

6

21:9

HDMI_ASPECT_21_9

7

64:27

HDMI_ASPECT_64_27

8

hdmi_force_mode

设置为1 will remove all other modes except the ones specified by hdmi_mode and hdmi_group from the internal list, meaning they will not appear in any enumerated lists of modes. This option might help if a display seems to be ignoring the hdmi_mode and hdmi_group settings.

edid_content_type

将 EDID 内容类型强制指定为特定值。

可选值如下:

  • 0 = EDID_ContentType_NODATA, content type none

  • 1 = EDID_ContentType_Graphics, content type graphics, ITC must be set to 1

  • 2 = EDID_ContentType_Photo, content type photo

  • 3 = EDID_ContentType_Cinema, content type cinema

  • 4 = EDID_ContentType_Game, content type game

我的显示器支持哪些有效值?

您的 HDMI 显示器可能仅支持有限的格式。要查看支持的格式,请使用以下方法:

  • 将输出格式设置为 VGA 60Hz(hdmi_group=1 and hdmi_mode=1) and boot up your Raspberry Pi

  • 输入以下命令以列出 CEA 支持的模式:/opt/vc/bin/tvservice -m CEA

  • 输入以下命令以列出 DMT 支持的模式:/opt/vc/bin/tvservice -m DMT

  • 输入以下命令以显示当前状态:/opt/vc/bin/tvservice -s

  • 输入以下命令以从显示器导出更详细的信息:/opt/vc/bin/tvservice -d edid.dat; /opt/vc/bin/edidparser edid.dat

该edid.dat should also be provided when troubleshooting problems with the default HDMI mode.

自定义模式

如果您的显示器需要上述表格中未列出的模式,则可以为其定义自定义 CVT 模式:

hdmi_cvt=<width> <height> <framerate> <aspect> <margins> <interlace> <rb>
价值感 默认 说明

Architecture

(必需)

像素宽度

高度

(必需)

像素高度

帧率

(必需)

帧率(Hz)

纵横比

3

宽高比 1=4:3, 2=14:9, 3=16:9, 4=5:4, 5=16:10, 6=15:9

边距

0

0=禁用边距,1=启用边距

隔行扫描

0

0=逐行扫描,1=隔行扫描

rb

0

0=正常,1=缩减消隐

末尾的 Fields 可省略以使用默认 values。

请注意这仅创建the mode (group 2 mode 87)。为使 Raspberry Pi 默认使用此设置,您需添加额外配置。例如,选择 800×480 resolution 并启用 audio drive:

hdmi_cvt=800 480 60 6
hdmi_group=2
hdmi_mode=87
hdmi_drive=2

若您的 monitor 不支持标准 CVT timings,此方法可能无效。

复合视频模式

sdtv_mode

该sdtv_mode command defines the TV standard used for composite video output:

sdtv_mode 结果

0(默认)

标准 NTSC

1

Japanese version of NTSC — no pedestal

2

标准 PAL

3

Brazilian version of PAL — 525/60 rather than 625/50, different subcarrier

十六

逐行扫描 NTSC

18

逐行扫描 PAL

sdtv_aspect

该sdtv_aspect command defines the aspect ratio for composite video output. The default value is 1.

sdtv_aspect 结果

1

4:3

2

14:9

3

16:9

sdtv_disable_colourburst

设置sdtv_disable_colourburst to 1 disables colourburst on composite video output. The picture is displayed in monochrome, but it might appear sharper.

LCD 显示器和触摸屏

display_default_lcd

如检测到 Raspberry Pi Touch Display,它将作为默认 display 并显示 framebuffer。设置display_default_lcd=0 will ensure the LCD is not the default display, which usually implies the HDMI output will be the default. The LCD can still be used by choosing its display number from supported applications, for example, omxplayer.

lcd_framerate

指定 Raspberry Pi Touch Display 的 framerate,单位为 Hz/fps。默认为 60Hz。

lcd_rotate

此选项利用 LCD 内置的 flip 功能翻转画面,其计算开销低于基于 GPU 的 rotate 操作。

例如,lcd_rotate=2 will compensate for an upside-down display.

enable_dpi_lcd

启用连接至 DPI GPIOs 的 LCD displays。此为允许使用采用 parallel display interface 的第三方 LCD displays。

dpi_group, dpi_mode, dpi_output_format

该dpi_group and dpi_mode config.txt parameters are used to set either predetermined modes (DMT or CEA modes as used by HDMI above). A user can generate custom modes in much the same way as for HDMI (see dpi_timings section).

dpi_output_format is a bitmask specifying various parameters used to set up the display format.

dpi_timings

允许为自定义模式设置原始 DPI 时序值,所选模式使用dpi_group=2 and dpi_mode=87.

dpi_timings=<h_active_pixels> <h_sync_polarity> <h_front_porch> <h_sync_pulse> <h_back_porch> <v_active_lines> <v_sync_polarity> <v_front_porch> <v_sync_pulse> <v_back_porch> <v_sync_offset_a> <v_sync_offset_b> <pixel_rep> <frame_rate> <interlaced> <pixel_freq> <aspect_ratio>
<h_active_pixels> = horizontal pixels (width)
<h_sync_polarity> = invert hsync polarity
<h_front_porch>   = horizontal forward padding from DE active edge
<h_sync_pulse>    = hsync pulse width in pixel clocks
<h_back_porch>    = vertical back padding from DE active edge
<v_active_lines>  = vertical pixels height (lines)
<v_sync_polarity> = invert vsync polarity
<v_front_porch>   = vertical forward padding from DE active edge
<v_sync_pulse>    = vsync pulse width in pixel clocks
<v_back_porch>    = vertical back padding from DE active edge
<v_sync_offset_a> = leave at zero
<v_sync_offset_b> = leave at zero
<pixel_rep>       = leave at zero
<frame_rate>      = screen refresh rate in Hz
<interlaced>      = leave at zero
<pixel_freq>      = clock frequency (h_active_pixels + h_front_porch + h_sync_pulse + h_back_porch)
                                    * (v_active_lines + v_front_porch + v_sync_pulse + v_back_porch)
                                    * framerate
<aspect_ratio>    = [see footnote]

宽高比可设置为八个值之一。请从下方选择一个与您的屏幕最相似的宽高比值:

纵横比 姓名 价值感

4:3

HDMI_ASPECT_4_3

1

14:9

HDMI_ASPECT_14_9

2

16:9

HDMI_ASPECT_16_9

3

5:4

HDMI_ASPECT_5_4

4

16:10

HDMI_ASPECT_16_10

5

15:9

HDMI_ASPECT_15_9

6

21:9

HDMI_ASPECT_21_9

7

64:27

HDMI_ASPECT_64_27

8

通用显示选项

hdmi_force_hotplug

设置hdmi_force_hotplug to 1 pretends that the HDMI hotplug signal is asserted, so it appears that a HDMI display is attached. In other words, HDMI output mode will be used, even if no HDMI monitor is detected.

hdmi_ignore_hotplug

设置hdmi_ignore_hotplug to 1 pretends that the HDMI hotplug signal is not asserted, so it appears that a HDMI display is not attached. HDMI output will therefore be disabled, even if a monitor is connected.

disable_overscan

……的默认值为disable_overscan is 0 which gives default values of overscan for the left, right, top, and bottom edges of 48 for HD CEA modes, 32 for SD CEA modes, and 0 for DMT modes.

将disable_overscan to 1 to disable the default values of overscan that are set by the firmware.

overscan_left

该overscan_left command specifies the number of pixels to add to the firmware default value of overscan on the left edge of the screen. The default value is 0.

若文本超出屏幕左边缘,请增大此值;若屏幕左边缘与文本间存在黑边,请减小此值。

overscan_right

该overscan_right command specifies the number of pixels to add to the firmware default value of overscan on the right edge of the screen. The default value is 0.

若文本超出屏幕右边缘,请增大此值;若屏幕右边缘与文本间存在黑边,请减小此值。

overscan_top

该overscan_top command specifies the number of pixels to add to the firmware default value of overscan on the top edge of the screen. The default value is 0.

若文本超出屏幕上边缘,请增大此值;若屏幕上边缘与文本间存在黑边,请减小此值。

overscan_bottom

该overscan_bottom command specifies the number of pixels to add to the firmware default value of overscan on the bottom edge of the screen. The default value is 0.

若文本超出屏幕下边缘,请增大此值;若屏幕下边缘与文本间存在黑边,请减小此值。

overscan_scale

将overscan_scale to 1 to force any non-framebuffer layers to conform to the overscan settings. The default value is 0.

通常不建议启用此功能:由于显示器的所有图层都将由 GPU 执行缩放,因此会导致画质下降。为避免图像被双重缩放(由 GPU 和显示器分别处理),推荐直接禁用显示器自身的过扫描(overscan)功能。

framebuffer_width

该framebuffer_width command specifies the console framebuffer width in pixels. The default is the display width minus the total horizontal overscan.

framebuffer_height

该framebuffer_height command specifies the console framebuffer height in pixels. The default is the display height minus the total vertical overscan.

max_framebuffer_height, max_framebuffer_width

指定内部 framebuffer 的最大尺寸。

framebuffer_depth

使用framebuffer_depth to specify the console framebuffer depth in bits per pixel. The default value is 16.

framebuffer_depth 结果 备注

8

8位 framebuffer

默认 RGB 调色板会导致屏幕内容不可读

十六

16位 framebuffer

24

24位 framebuffer

可能导致显示异常

三十二

32位 framebuffer

可能需要与……配合使用framebuffer_ignore_alpha=1

framebuffer_ignore_alpha

将framebuffer_ignore_alpha to 1 to disable the alpha channel. Can help with the display of a 32-bit framebuffer_depth.

framebuffer_priority

在配备多显示器的系统中,若使用传统(预 KMS)图形驱动程序,此选项会强制指定的内部显示设备作为第一个 Linux framebuffer(/dev/fb0).

可设置的选项包括:

显示 ID

主 LCD

0

辅助 LCD

1

HDMI 0

2

Composite

3

HDMI 1

7

max_framebuffers

此配置项设置可创建的最大固件帧缓冲数量。有效选项为 0、1 和 2。在 Raspberry Pi 4 之前的设备上,该值默认为 1,因此在使用多个显示器(例如 HDMI 与 DSI 或 DPI 显示器)时需将其增加至 2。Raspberry Pi 4 的配置默认将此值设为 2,因其配备两个 HDMI 端口。

在大多数情况下,将该值设为 2 是安全的,因为仅在实际检测到所接设备时才会创建帧缓冲。

在无头模式(headless mode)下使用时,将该值设为 0 可用于降低内存需求,因为它会阻止分配任何帧缓冲。

test_mode

该test_mode command displays a test image and sound during boot (over the composite video and analogue audio outputs only) for the given number of seconds, before continuing to boot the OS as normal. This is used as a manufacturing test; the default value is 0.

display_hdmi_rotate

使用display_hdmi_rotate to rotate or flip the HDMI display orientation. The default value is 0.

display_hdmi_rotate 结果

0

无旋转

1

顺时针旋转 90 度

2

顺时针旋转 180 度

3

顺时针旋转 270 度

0x10000

水平翻转

0x20000

垂直翻转

请注意,90 度和 270 度旋转选项需要占用额外的 GPU 内存,因此它们无法在 16 MB GPU 内存分割模式下运行。

您可以通过将数值相加来组合旋转设置与翻转选项。同样方式也可同时启用水平和垂直翻转。例如,带有垂直和水平翻转的 180 度旋转将计算为 0x20000 + 0x10000 + 2 = 0x30002。

display_lcd_rotate

对于旧版图形驱动程序(Raspberry Pi 4 之前机型的默认驱动),请使用display_lcd_rotate to rotate or flip the LCD orientation. Parameters are the same as display_hdmi_rotate. See also lcd_rotate.

display_rotate

在最新固件中,display_rotate is deprecated. It has only been retained for backwards compatibility. Use display_lcd_rotate and display_hdmi_rotate instead.

使用display_rotate to rotate or flip the screen orientation. Parameters are the same as display_hdmi_rotate.

其他选项

dispmanx_offline

强制dispmanx composition to be done offline in two offscreen framebuffers. This can allow more dispmanx elements to be composited, but is slower and might limit screen framerate to around 30 fps.

Raspberry Pi 4 HDMI 管线

当使用 VC4 KMS 图形驱动程序时,完整的显示管线由 Linux 管理——这包括 HDMI 输出。这些设置仅适用于旧的 FKMS 和基于固件的图形驱动程序。

Raspberry Pi 4 无法通过 HDMI 以 1366×768 @ 60Hz 进行输出。在某些显示器上,可配置其使用 1360×768 @ 60Hz。它们通常不会通过 EDID 广播此模式,因此无法自动选择,但可通过添加以下内容手动指定:

hdmi_group=2
hdmi_mode=87
hdmi_cvt=1360 768 60

……至config.txt.

通过手动指定时序的hdmi_timings= line in config.txt will also need to comply with the restriction of all horizontal timing parameters being divisible by two.

dpi_timings= are not restricted in the same way, as that pipeline still only runs at a single pixel per clock cycle.

旧版杂项选项

avoid_warnings

avoid_warnings=2 allows turbo mode even when low-voltage is present.

logging_level

设置 VideoCore 日志级别。该值为 VideoCore 专用位掩码。