如何在 Raspberry Pi 上读取显示器的 EDID
在本篇文章中,我们将告诉您如何在 Raspberry Pi 上正确理解显示器的扩展显示识别数据 (EDID)。
注意:以前,PiDoctor的独立版本曾有一个读取EDID的功能。这个版本已经停止使用,读取EDID的功能也没有实现在新的 码头 医师(PiDoctor 因此,我将在这篇文章中给你提供如何读取EDID的手动说明。
PiDoctor包括显示器模式的输出
在我们深入探讨如何提取Raspberry Pi上的EDID之前,请注意,新的 PiCockpit的 医师(PiDoctor 应用程序包括很多你通过阅读EDID所期望的输出(支持的分辨率模式、显示器名称、音频支持......),这里有两个屏幕截图样本。
在Raspbian / Raspberry Pi操作系统下读取EDID
在命令行上运行以下命令。
tvservice -d /tmp/edid.dat
这将在/tmp目录下创建edid.dat。
注意:在Raspberry Pi 4和400上,可以使用microHDMI端口连接两个显示器。在这种情况下,你要指定从哪个显示器读取EDID。
tvservice --list
然后传入你感兴趣的显示器的设备ID,像这样。
tvservice --device 2 -d /tmp/edid.dat
使用edidparser对EDID进行解码
你可以在这个文件上运行edidparser(如果你的系统上没有这个文件,请先安装它)。
edidparser /tmp/edid.dat
这将为你提供大量的输出,例如在我的显示器上,它给出了。
Enabling fuzzy format match…
Parsing /tmp/edid.dat…
HDMI:EDID version 1.3, 1 extensions, screen size 48x27 cm
HDMI:EDID features - videodef 0x80 standby suspend active off; colour encoding:RGB444|YCbCr422; sRGB is not default colourspace; preferred format is native; does not support GTF
HDMI:EDID found monitor range descriptor tag 0xfd
HDMI:EDID monitor range offsets: V min=0, V max=0, H min=0, H max=0
HDMI:EDID monitor range: vertical is 50-76 Hz, horizontal is 30-83 kHz, max pixel clock is 170 MHz
HDMI:EDID monitor range does not support GTF
HDMI:EDID found monitor name descriptor tag 0xfc
HDMI:EDID monitor name is VE228
HDMI:EDID found monitor S/N descriptor tag 0xff
HDMI:EDID found preferred CEA detail timing format: 1920x1080p @ 60 Hz (16)
HDMI:EDID established timing I/II bytes are BF EF 00
HDMI:EDID found DMT format: code 4, 640x480p @ 60 Hz in established timing I/II
HDMI:EDID found DMT format: code 5, 640x480p @ 72 Hz in established timing I/II
HDMI:EDID found DMT format: code 6, 640x480p @ 75 Hz in established timing I/II
HDMI:EDID found DMT format: code 8, 800x600p @ 56 Hz in established timing I/II
HDMI:EDID found DMT format: code 9, 800x600p @ 60 Hz in established timing I/II
HDMI:EDID found DMT format: code 10, 800x600p @ 72 Hz in established timing I/II
HDMI:EDID found DMT format: code 11, 800x600p @ 75 Hz in established timing I/II
HDMI:EDID found DMT format: code 16, 1024x768p @ 60 Hz in established timing I/II
HDMI:EDID found DMT format: code 17, 1024x768p @ 70 Hz in established timing I/II
HDMI:EDID found DMT format: code 18, 1024x768p @ 75 Hz in established timing I/II
HDMI:EDID found DMT format: code 36, 1280x1024p @ 75 Hz in established timing I/II
HDMI:EDID standard timings block x 8: 0x714F 8180 8140 9500 A940 B300 D1C0 0101
HDMI:EDID found DMT format: code 21, 1152x864p @ 75 Hz (4:3) in standard timing 0
HDMI:EDID found DMT format: code 35, 1280x1024p @ 60 Hz (5:4) in standard timing 1
HDMI:EDID found DMT format: code 32, 1280x960p @ 60 Hz (4:3) in standard timing 2
HDMI:EDID found DMT format: code 47, 1440x900p @ 60 Hz (16:10) in standard timing 3
HDMI:EDID found DMT format: code 51, 1600x1200p @ 60 Hz (4:3) in standard timing 4
HDMI:EDID found DMT format: code 58, 1680x1050p @ 60 Hz (16:10) in standard timing 5
HDMI:EDID found DMT format: code 82, 1920x1080p @ 60 Hz (16:9) in standard timing 6
HDMI:EDID parsing v3 CEA extension 0
HDMI:EDID monitor support - underscan IT formats:yes, basic audio:yes, yuv444:yes, yuv422:yes, #native DTD:1
HDMI:EDID failed to find a matching detail format for 1920x1080p hfp:48 hs:32 hbp:80 vfp:3 vs:5 vbp:22 pixel clock:138 MHz
HDMI:EDID calculated refresh rate is 60 Hz
HDMI:EDID guessing the format to be 1920x1080p @60 Hz
HDMI:EDID found CEA detail timing format: 1920x1080p @ 60 Hz (16)
HDMI:EDID found DMT detail timing format: 1366x768p @ 60 Hz (81)
HDMI:EDID found CEA detail timing format: 1280x720p @ 60 Hz (4)
HDMI:EDID found CEA detail timing format: 720x480p @ 60 Hz (2)
HDMI:EDID found CEA detail timing format: 1920x1080i @ 60 Hz (5)
HDMI:EDID found CEA format: code 16, 1920x1080p @ 60Hz (native)
HDMI:EDID found CEA format: code 5, 1920x1080i @ 60Hz
HDMI:EDID found CEA format: code 4, 1280x720p @ 60Hz
HDMI:EDID found CEA format: code 3, 720x480p @ 60Hz
HDMI:EDID found CEA format: code 2, 720x480p @ 60Hz
HDMI:EDID found CEA format: code 1, 640x480p @ 60Hz
HDMI:EDID found CEA format: code 17, 720x576p @ 50Hz
HDMI:EDID found CEA format: code 18, 720x576p @ 50Hz
HDMI:EDID found CEA format: code 19, 1280x720p @ 50Hz
HDMI:EDID found CEA format: code 20, 1920x1080i @ 50Hz
HDMI:EDID found CEA format: code 31, 1920x1080p @ 50Hz
HDMI:EDID found audio format 2 channels PCM, sample rate: 32|44|48 kHz, sample size: 16|20|24 bits
HDMI:EDID found HDMI VSDB length 5
HDMI:EDID HDMI VSDB has physical address 1.0.0.0
HDMI:EDID HDMI VSDB has no extension fields
HDMI:EDID filtering formats with pixel clock unlimited MHz or h. blanking unlimited
HDMI:EDID best score mode initialised to CEA (1) 640x480p @ 60 Hz with pixel clock 25 MHz (score 0)
HDMI:EDID best score mode is now CEA (1) 640x480p @ 60 Hz with pixel clock 25 MHz (score 61864)
HDMI:EDID best score mode is now CEA (2) 720x480p @ 60 Hz with pixel clock 27 MHz (score 3066472)
HDMI:EDID CEA mode (3) 720x480p @ 60 Hz with pixel clock 27 MHz has a score of 66472
HDMI:EDID best score mode is now CEA (4) 1280x720p @ 60 Hz with pixel clock 74 MHz (score 3635592)
HDMI:EDID DMT mode (4) 640x480p @ 60 Hz with pixel clock 25 MHz has a score of 18432
HDMI:EDID CEA mode (5) 1920x1080i @ 60 Hz with pixel clock 74 MHz has a score of 2773832
HDMI:EDID DMT mode (5) 640x480p @ 72 Hz with pixel clock 31 MHz has a score of 5529
HDMI:EDID DMT mode (6) 640x480p @ 75 Hz with pixel clock 31 MHz has a score of 5760
HDMI:EDID DMT mode (8) 800x600p @ 56 Hz with pixel clock 36 MHz has a score of 26880
HDMI:EDID DMT mode (9) 800x600p @ 60 Hz with pixel clock 40 MHz has a score of 28800
HDMI:EDID DMT mode (10) 800x600p @ 72 Hz with pixel clock 50 MHz has a score of 8640
HDMI:EDID DMT mode (11) 800x600p @ 75 Hz with pixel clock 49 MHz has a score of 9000
HDMI:EDID best score mode is now CEA (16) 1920x1080p @ 60 Hz with pixel clock 148 MHz (score 5398248)
HDMI:EDID DMT mode (16) 1024x768p @ 60 Hz with pixel clock 65 MHz has a score of 47185
HDMI:EDID CEA mode (17) 720x576p @ 50 Hz with pixel clock 27 MHz has a score of 66472
HDMI:EDID DMT mode (17) 1024x768p @ 70 Hz with pixel clock 75 MHz has a score of 13762
HDMI:EDID CEA mode (18) 720x576p @ 50 Hz with pixel clock 27 MHz has a score of 66472
HDMI:EDID DMT mode (18) 1024x768p @ 75 Hz with pixel clock 78 MHz has a score of 14745
HDMI:EDID CEA mode (19) 1280x720p @ 50 Hz with pixel clock 74 MHz has a score of 117160
HDMI:EDID CEA mode (20) 1920x1080i @ 50 Hz with pixel clock 74 MHz has a score of 128680
HDMI:EDID DMT mode (21) 1152x864p @ 75 Hz with pixel clock 108 MHz has a score of 43662
HDMI:EDID CEA mode (31) 1920x1080p @ 50 Hz with pixel clock 148 MHz has a score of 232360
HDMI:EDID DMT mode (32) 1280x960p @ 60 Hz with pixel clock 108 MHz has a score of 98728
HDMI:EDID DMT mode (35) 1280x1024p @ 60 Hz with pixel clock 108 MHz has a score of 103643
HDMI:EDID DMT mode (36) 1280x1024p @ 75 Hz with pixel clock 135 MHz has a score of 24576
HDMI:EDID DMT mode (47) 1440x900p @ 60 Hz with pixel clock 106 MHz has a score of 102760
HDMI:EDID DMT mode (51) 1600x1200p @ 60 Hz with pixel clock 162 MHz has a score of 140200
HDMI:EDID DMT mode (58) 1680x1050p @ 60 Hz with pixel clock 146 MHz has a score of 130840
HDMI:EDID DMT mode (81) 1366x768p @ 60 Hz with pixel clock 85 MHz has a score of 4062945
HDMI:EDID DMT mode (82) 1920x1080p @ 60 Hz with pixel clock 148 MHz has a score of 149416
HDMI0:EDID preferred mode remained as CEA (16) 1920x1080p @ 60 Hz with pixel clock 148 MHz
HDMI:EDID has HDMI support and audio support
edidparser exited with code 0
在线解码器工具
你也可以把这个文件上传到一个在线解码工具,例如 edid.tv
注意:在我的测试中,edid.tv抱怨我的一个EDID的校验和不正确 - 我不知道目前有什么解决方法。
故障排除 tvservice / EDID转储
没写什么
当我运行
tvservice -device 2 -d tmp/edid.dat
我得到的是 "什么都没写!"
现在,请尝试检查以下内容:
- 你的显示器是否连接到你的HDMI端口(不,认真的)。
- 设备ID是否正确? 请使用 呼叫中心-列表 以获得一个ID列表,不要只是复制和粘贴我的例子设备ID 2
- 试着用tvservice,不使用-设备2
- 尝试重新启动Raspberry Pi(当显示器被热插拔时,在这个特定的使用案例中会出现问题,AFAIK),并再次运行命令。
- 试试其他的tvservice参数,以调试该特定监视器的任何输出是否可能(这里有一个tvservice的文档)
- 有些电视/显示器有缺陷,不能提供EDID--试试另一台显示器,看看是否会有不同。
总结
现在,显示器的扩展显示识别数据终于有了意义,您可以开始下一个 Raspberry Pi 项目了!
想了解一些想法?查看 我们的百利宫项目系列.
Bonjour, j'obtiens cette erreur :
当使用vc4-kms-v3d驱动时,不支持tvservice。
标准的linux工具也有类似的功能
比如libdrm-test中的modetest。
你有别的选择吗?
谢谢。
你好,Yoann,我在Pi Zero 2上遇到了这个问题,也许这个修正对你有用。 https://picockpit.com/raspberry-pi/the-big-raspberry-pi-zero-2-w-troubleshooting-guide/#Command_tvservice_throws_error