라즈베리파이 HDMI 해상도 강제 설정

HDMI 케이블로 연결을 하면 보통 최적의 해상도로 화면에 출력을 해 주는데, 특별한 경우(크게 보고 싶다거나, 작게 보고싶다거나.. 등) 해상도를 조정했으면 하는 생각이 들 때가 있다. 아니면 최적의 해상도가 있는데 이상한 해상도로 나온다거나 하는..

config.txt파일에 HDMI 모드 값을 변경하면 해결할 수 있다.

나같은 경우는 HDMI-DVI 케이블로 모니터를 연결했더니 1920×1080으로 설정되는게 아니라 1680×1050로 자동 설정이 되었다. 1920으로 어떻게 바꿔야 되나 한참을 찾아 해결 방법을 알게되었다.

$ tvservice -d edid.dat
Written 128 bytes to edid.dat

$ edidparser edid.dat > edid.txt

$ cat edid.txt
Enabling fuzzy format match...
Parsing edid.dat...
HDMI:EDID version 1.3, 0 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 56-75 Hz, horizontal is 30-83 kHz, max pixel clock is 150 MHz
HDMI:EDID monitor range does not support GTF
HDMI:EDID found monitor name descriptor tag 0xfc
HDMI:EDID monitor name is W2261
HDMI:EDID failed to find a matching detail format for 1920x1080p hfp:48 hs:32 hbp:80 vfp:3 vs:5 vbp:23 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 preferred CEA detail timing format: 1920x1080p @ 60 Hz (16)
HDMI:EDID found CEA detail timing format: 1920x1080p @ 60 Hz (16)
HDMI:EDID established timing I/II bytes are A7 6B 80
HDMI:EDID found DMT format: code 4, 640x480p @ 60 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 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 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: 0xB300 8180 8140 714F 0101 0101 0101 0101 
HDMI:EDID found DMT format: code 58, 1680x1050p @ 60 Hz (16:10) 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 21, 1152x864p @ 75 Hz (4:3) in standard timing 3
HDMI:EDID moving support for CEA mode 16 to DMT mode 82 because sink does not support HDMI
HDMI:EDID filtering formats with pixel clock > 162 MHz or h. blanking > 1023
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 DMT (4) 640x480p @ 60 Hz with pixel clock 25 MHz (score 18432)
HDMI:EDID best score mode is now DMT (6) 640x480p @ 75 Hz with pixel clock 31 MHz (score 23040)
HDMI:EDID best score mode is now DMT (8) 800x600p @ 56 Hz with pixel clock 36 MHz (score 26880)
HDMI:EDID best score mode is now DMT (9) 800x600p @ 60 Hz with pixel clock 40 MHz (score 28800)
HDMI:EDID best score mode is now DMT (11) 800x600p @ 75 Hz with pixel clock 49 MHz (score 36000)
HDMI:EDID best score mode is now DMT (16) 1024x768p @ 60 Hz with pixel clock 65 MHz (score 47185)
HDMI:EDID best score mode is now DMT (18) 1024x768p @ 75 Hz with pixel clock 78 MHz (score 58982)
HDMI:EDID best score mode is now DMT (21) 1152x864p @ 75 Hz with pixel clock 108 MHz (score 99649)
HDMI:EDID DMT mode (32) 1280x960p @ 60 Hz with pixel clock 108 MHz has a score of 98728
HDMI:EDID best score mode is now DMT (35) 1280x1024p @ 60 Hz with pixel clock 108 MHz (score 103643)
HDMI:EDID DMT mode (36) 1280x1024p @ 75 Hz with pixel clock 135 MHz has a score of 98304
HDMI:EDID best score mode is now DMT (58) 1680x1050p @ 60 Hz with pixel clock 146 MHz (score 130840)
HDMI:EDID DMT mode (82) 1920x1080p @ 60 Hz with pixel clock 148 MHz has a score of 124416
HDMI:EDID preferred mode is updated to DMT (58) 1680x1050p @ 60 Hz with pixel clock 146250000 Hz
HDMI:EDID has only DVI support and no audio support
edid_parser exited with code 0

위의 출력 결과를 보면 best score mode가 1680x1050p이라 되어있다.. -_-

위의 값들이 지원되는 모드이므로 1920×1080을 찾아 값을 강제로 써주면 된다. DMT mode (82)번이 1920×1080으로 되어있다. DMT 모드는 hdmi group 2이고, CEA라고 나오면 이것이 HDMI group 1이다. 괄호 안의 숫자가 mode 번호이다.

따라서 아래와 같이 /boot/config.txt에 적어준다.

# uncomment to force a specific HDMI mode (this will force VGA)
hdmi_group=2
hdmi_mode=82

재부팅해보면 1920×1080으로 잘 나온다. 🙂