Fix HDMI monitor not working with Raspberry PI
Last Updated on 6th February 2022 by peppe8o
With the increasing hardware variety of monitor / TV, using Raspberry PI with a different HDMI monitor or TV can lead to video issues from first boot. In these cases, both Raspberry PI OS Lite and Desktop distributions can suffer problems in showing their interfaces on screen, resulting in unusable video. This kind of problem doesn’t involves OS working state by itself (networking and SSH will work if configured from flashing phase and remotely accessed), but makes your device not usable from directly attached monitor. This happens also with different distributions installed on Raspberry PI.
In this tutorial I’m going to show you how to configure your Raspberry PI OS to start from first boot with a pre-defined resolution.
Before Changing Resolution: Check Hardware
Before starting with configuration files to manage and edit (as classic Linux geek habits), you need to check that available hardware is ok.
First test involves Raspberry PI + HDMI cable: if it is possible to you, connect them to a different HDMI monitor / TV (maybe from your friend, if you don’t have a second one). If this test is passed you can move on next paragraph. If this test fails, you could need to re-check:
- Operating System flashing operation
- HDMI cable quality
- Power Supply capacity (I always suggest to use at least a power supply capable to give 2,5 / 3 A, expecially if you could use your RPI also with external devices)
Set HDMI Mode From Configuration Files
Ok, if you are here you are (quite) sure that hardware is ok.
Before going in linux configuration, please get list of supported resolutions by your HDMI monitor/TV.
In many Linux distributions (like Raspberry PI OS but also Debian, Fedora, Ubuntu, etc) HDMI video options can be set from a file named “config.txt” available in SD card boot partition. Once distribution image is flashed on micro SD Card, you will be able to explore this partition from whatever external PC (Windows, MAC or Linux).
config.txt is a simple plain text file which setup system configuration parameters which traditionally are stored using a BIOS. This is read by the GPU before the CPU and Linux are initialised. In Linux systems, this file must be edited as root.
Any changes will only take effect after you have rebooted your Raspberry Pi.
To set HDMI video resolution options you will add 2 parameters: “hdmi_group” and “hdmi_mode”. These parameters must be appended to the end of config.txt.
For example, setting resolution to 1280×720, with frequency at 60Hz and screen ratio to 16:9 (720p) will require following final rows appended to config.txt:
hdmi_group=2 hdmi_mode=85
hdmi_group and hdmi_mode Values
The 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). Possible values are:
hdmi_group | result |
---|---|
0 | Auto-detect from EDID |
1 | CEA |
2 | DMT |
Hdmi_mode, in conjunction with hdmi_group, defines video output settings. Hdmi_mode reults depend on hdmi_group value. Possible values for hdmi_mode are:
When hdmi_group=1:
hdmi_mode | Resolution | Frequency | Screen Aspect | Notes |
---|---|---|---|---|
1 | VGA (640×480) | 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 | |
10 | 480i | 60Hz | 4:3 | pixel quadrupling |
11 | 480i | 60Hz | 16:9 | pixel quadrupling |
12 | 240p | 60Hz | 4:3 | pixel quadrupling |
13 | 240p | 60Hz | 16:9 | pixel quadrupling |
14 | 480p | 60Hz | 4:3 | pixel doubling |
15 | 480p | 60Hz | 16:9 | pixel doubling |
16 | 1080p | 60Hz | 16:9 | |
17 | 576p | 50Hz | 4:3 | |
18 | 576p | 50Hz | 16:9 | |
19 | 720p | 50Hz | 16:9 | |
20 | 1080i | 50Hz | 16:9 | |
21 | 576i | 50Hz | 4:3 | |
22 | 576i | 50Hz | 16:9 | |
23 | 288p | 50Hz | 4:3 | |
24 | 288p | 50Hz | 16:9 | |
25 | 576i | 50Hz | 4:3 | pixel quadrupling |
26 | 576i | 50Hz | 16:9 | pixel quadrupling |
27 | 288p | 50Hz | 4:3 | pixel quadrupling |
28 | 288p | 50Hz | 16:9 | pixel quadrupling |
29 | 576p | 50Hz | 4:3 | pixel doubling |
30 | 576p | 50Hz | 16:9 | pixel doubling |
31 | 1080p | 50Hz | 16:9 | |
32 | 1080p | 24Hz | 16:9 | |
33 | 1080p | 25Hz | 16:9 | |
34 | 1080p | 30Hz | 16:9 | |
35 | 480p | 60Hz | 4:3 | pixel quadrupling |
36 | 480p | 60Hz | 16:9 | pixel quadrupling |
37 | 576p | 50Hz | 4:3 | pixel quadrupling |
38 | 576p | 50Hz | 16:9 | pixel quadrupling |
39 | 1080i | 50Hz | 16:9 | reduced blanking |
40 | 1080i | 100Hz | 16:9 | |
41 | 720p | 100Hz | 16:9 | |
42 | 576p | 100Hz | 4:3 | |
43 | 576p | 100Hz | 16:9 | |
44 | 576i | 100Hz | 4:3 | |
45 | 576i | 100Hz | 16:9 | |
46 | 1080i | 120Hz | 16:9 | |
47 | 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 | |
57 | 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 | Custom | |||
66 | 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 | 1680×720 | 24Hz | 64:27 | Pi 4 |
80 | 1680×720 | 25z | 64:27 | Pi 4 |
81 | 1680×720 | 30Hz | 64:27 | Pi 4 |
82 | 1680×720 | 50Hz | 64:27 | Pi 4 |
83 | 1680×720 | 60Hz | 64:27 | Pi 4 |
84 | 1680×720 | 100Hz | 64:27 | Pi 4 |
85 | 1680×720 | 120Hz | 64:27 | Pi 4 |
86 | 2560×720 | 24Hz | 64:27 | Pi 4 |
87 | 2560×720 | 25Hz | 64:27 | Pi 4 |
88 | 2560×720 | 30Hz | 64:27 | Pi 4 |
89 | 2560×720 | 50Hz | 64:27 | Pi 4 |
90 | 2560×720 | 60Hz | 64:27 | Pi 4 |
91 | 2560×720 | 100Hz | 64:27 | Pi 4 |
92 | 2560×720 | 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 | 4096×2160 | 24Hz | 256:135 | Pi 4 |
99 | 4096×2160 | 25Hz | 256:135 | Pi 4 |
100 | 4096×2160 | 30Hz | 256:135 | Pi 4 |
101 | 4096×2160 | 50Hz | 256:135 | Pi 4 |
102 | 4096×2160 | 60Hz | 256:135 | Pi 4 |
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 |
When hdmi_group=2:
hdmi_mode | Resolution | Frequency | Screen Aspect | Notes |
---|---|---|---|---|
1 | 640×350 | 85Hz | ||
2 | 640×400 | 85Hz | 16:10 | |
3 | 720×400 | 85Hz | ||
4 | 640×480 | 60Hz | 4:3 | |
5 | 640×480 | 72Hz | 4:3 | |
6 | 640×480 | 75Hz | 4:3 | |
7 | 640×480 | 85Hz | 4:3 | |
8 | 800×600 | 56Hz | 4:3 | |
9 | 800×600 | 60Hz | 4:3 | |
10 | 800×600 | 72Hz | 4:3 | |
11 | 800×600 | 75Hz | 4:3 | |
12 | 800×600 | 85Hz | 4:3 | |
13 | 800×600 | 120Hz | 4:3 | |
14 | 848×480 | 60Hz | 16:9 | |
15 | 1024×768 | 43Hz | 4:3 | incompatible with the Raspberry Pi |
16 | 1024×768 | 60Hz | 4:3 | |
17 | 1024×768 | 70Hz | 4:3 | |
18 | 1024×768 | 75Hz | 4:3 | |
19 | 1024×768 | 85Hz | 4:3 | |
20 | 1024×768 | 120Hz | 4:3 | |
21 | 1152×864 | 75Hz | 4:3 | |
22 | 1280×768 | 60Hz | 15:9 | reduced blanking |
23 | 1280×768 | 60Hz | 15:9 | |
24 | 1280×768 | 75Hz | 15:9 | |
25 | 1280×768 | 85Hz | 15:9 | |
26 | 1280×768 | 120Hz | 15:9 | reduced blanking |
27 | 1280×800 | 60 | 16:10 | reduced blanking |
28 | 1280×800 | 60Hz | 16:10 | |
29 | 1280×800 | 75Hz | 16:10 | |
30 | 1280×800 | 85Hz | 16:10 | |
31 | 1280×800 | 120Hz | 16:10 | reduced blanking |
32 | 1280×960 | 60Hz | 4:3 | |
33 | 1280×960 | 85Hz | 4:3 | |
34 | 1280×960 | 120Hz | 4:3 | reduced blanking |
35 | 1280×1024 | 60Hz | 5:4 | |
36 | 1280×1024 | 75Hz | 5:4 | |
37 | 1280×1024 | 85Hz | 5:4 | |
38 | 1280×1024 | 120Hz | 5:4 | reduced blanking |
39 | 1360×768 | 60Hz | 16:9 | |
40 | 1360×768 | 120Hz | 16:9 | reduced blanking |
41 | 1400×1050 | 60Hz | 4:3 | reduced blanking |
42 | 1400×1050 | 60Hz | 4:3 | |
43 | 1400×1050 | 75Hz | 4:3 | |
44 | 1400×1050 | 85Hz | 4:3 | |
45 | 1400×1050 | 120Hz | 4:3 | reduced blanking |
46 | 1440×900 | 60Hz | 16:10 | reduced blanking |
47 | 1440×900 | 60Hz | 16:10 | |
48 | 1440×900 | 75Hz | 16:10 | |
49 | 1440×900 | 85Hz | 16:10 | |
50 | 1440×900 | 120Hz | 16:10 | reduced blanking |
51 | 1600×1200 | 60Hz | 4:3 | |
52 | 1600×1200 | 65Hz | 4:3 | |
53 | 1600×1200 | 70Hz | 4:3 | |
54 | 1600×1200 | 75Hz | 4:3 | |
55 | 1600×1200 | 85Hz | 4:3 | |
56 | 1600×1200 | 120Hz | 4:3 | reduced blanking |
57 | 1680×1050 | 60Hz | 16:10 | reduced blanking |
58 | 1680×1050 | 60Hz | 16:10 | |
59 | 1680×1050 | 75Hz | 16:10 | |
60 | 1680×1050 | 85Hz | 16:10 | |
61 | 1680×1050 | 120Hz | 16:10 | reduced blanking |
62 | 1792×1344 | 60Hz | 4:3 | |
63 | 1792×1344 | 75Hz | 4:3 | |
64 | 1792×1344 | 120Hz | 4:3 | reduced blanking |
65 | 1856×1392 | 60Hz | 4:3 | |
66 | 1856×1392 | 75Hz | 4:3 | |
67 | 1856×1392 | 120Hz | 4:3 | reduced blanking |
68 | 1920×1200 | 60Hz | 16:10 | reduced blanking |
69 | 1920×1200 | 60Hz | 16:10 | |
70 | 1920×1200 | 75Hz | 16:10 | |
71 | 1920×1200 | 85Hz | 16:10 | |
72 | 1920×1200 | 120Hz | 16:10 | reduced blanking |
73 | 1920×1440 | 60Hz | 4:3 | |
74 | 1920×1440 | 75Hz | 4:3 | |
75 | 1920×1440 | 120Hz | 4:3 | reduced blanking |
76 | 2560×1600 | 60Hz | 16:10 | reduced blanking |
77 | 2560×1600 | 60Hz | 16:10 | |
78 | 2560×1600 | 75Hz | 16:10 | |
79 | 2560×1600 | 85Hz | 16:10 | |
80 | 2560×1600 | 120Hz | 16:10 | reduced blanking |
81 | 1366×768 | 60Hz | 16:9 | NOT on Pi4 |
82 | 1920×1080 | 60Hz | 16:9 | 1080p |
83 | 1600×900 | 60Hz | 16:9 | reduced blanking |
84 | 2048×1152 | 60Hz | 16:9 | reduced blanking |
85 | 1280×720 | 60Hz | 16:9 | 720p |
86 | 1366×768 | 60Hz | 16:9 | reduced blanking |
For more detailed info, please refer to Raspberry PI config.txt video documentation.
Enjoy!