There are two modes that the Raspberry Pi supports. The two modes are abbreviated as:
- CEA: Consumer Electronics Association
- DMT: Display Monitor Timings
The CEA mode is the standard mode for displays such as TVs. The DMT mode is the standard mode of computer monitors. Choosing between the modes can be done through the tvservice commands on the Linux terminal. The commands to indicate the available modes for the display are as follows:
/opt/vc/bin/tvservice -m CEA
/opt/vc/bin/tvservice -m DMT
To check the resolution, mode and settings that are currently in use enter the tvservice command:
An export log is available of the processes the Raspberry Pi goes through in determining the resolution of the connected display. This can be done through terminal commands that show the EDID (Extended Display Identification Data) file of the determined display. The EDID data file is a more detailed resource for finding a display resolution compatible with the connected display. The following command will show the EDID file.
/opt/vc/bin/tvservice -d edid.dat;
The default firmware will use the EDID parser to try and identify the HDMI connected display and then will select the corresponding video mode and resolution. Through this command you will see the selection process of the parser and the alternative available modes. You will need to use a virtual connection to view the Linux kernel command line or have a view of the terminal.
Choose a mode that is the closest to the screen resolution specified on your displays data sheet. The tvservice command will offer the available resolutions for the display and the corresponding refresh rate. A previous application note further explains how to set the DMT mode resolution. In a similar process the CEA mode can be set to define the display resolution. This is done by adding the following settings in the config.txt file located in the boot file of the Raspberry Pi. The following example would be for an 800x480 resolution display (E70RC-FW850-R).
hdmi_mode=65 #65 is for custom modes
hdmi_cvt=800 480 60 6 1 0 0
The hdmi_cvt parameter requires the following information about the display.
width: width of display in pixels
height: height of display in pixels
FR: frame rate in Hz
aspect: aspect ratio
(1: 4/3, 2: 14/9, 3: 16/9, 4: 5/4, 5: 16/10, 6: 15/9)
margins: 0=margins disabled, 1=margins enabled
interlace: 0=progressive, 1=interlaced
rb: 0=normal, 1=reduced blanking
After the config.txt file is edited and saved, the Raspberry Pi can be rebooted into the new configuration mode and should display in the correct dimensions. If the display is not recognized after these changes have been made there are a few additional changes to consider. The first would be to boost the HDMI signal through the following command. Certain HDMI cables can occasionally be unreliable when the Linux kernel is identifying the display mode.
In some cases, the custom HDMI mode “hdmi_cvt” function does not work for the first group of CEA displays. To customize the parameters to fit the display you will pick the closest CEA mode and alter the overscan and framebuffer values. For example, the 480x800 display has a default CEA mode closest to mode 3 which has a resolution of 480x853. This mode can be chosen and adjusted using the overscan parameters to add or remove pixels from the edges to fit the display.
hdmi_group=1 #CEA group 1
disable_overscan=1 #remove default overscan values
overscan_right=26 #remove overflow pixels right
overscan_left=26 #remove overflow pixels left
The negative overscan parameters that are used to remove black borders will often not affect the display when using the HDMI interface. To remove the black borders around the edges of the display you can increase the frame buffer parameters in the config.txt file.
This will force the Raspberry Pi to define a frame buffer and resolution of 480x800. The true frame buffer value that the Raspberry Pi uses is the resolution combined with the defined or undefined overscan values. You can increase the framebuffer width and height values to force a negative overscan value which will remove the black borders around the display.