Setting up HDMI output


318 posts   Page 1 of 13   1, 2, 3, 4, 5 ... 13
by Gert van Loo » Mon May 14, 2012 9:30 am
This is an important post from 'rpi_newbie' (our Broadcom HDMI expert) which tells you how to set up the Raspberry-Pi HMDI output. I am repeating it here. At some point this information might move to a different place (e.g. elinux WIKI page) but for now I am putting it here and making it sticky.

Here is a list of all CEA and DMT formats (as of CEA-861 E and DMT V1 r12 respectively).

If you want to use any of these modes explicitly, set hdmi_group and hdmi_mode to the correct values in the config file. Note that NOT all modes are supported by the Raspberry Pi hardware (mainly the high resolution/high frame rate modes) and all explicit modes are subject to EDID* support of the monitor/TV.

*EDID: When starting the raspberry-Pi asks the TV for information about itself. This information is returned by the TV in a data structure called an 'EDID' block.

CEA (hdmi_group = 1)

HDMI_CEA_VGA = 1,
HDMI_CEA_480p60 = 2,
HDMI_CEA_480p60H = 3,
HDMI_CEA_720p60 = 4,
HDMI_CEA_1080i60 = 5,
HDMI_CEA_480i60 = 6,
HDMI_CEA_480i60H = 7,
HDMI_CEA_240p60 = 8,
HDMI_CEA_240p60H = 9,
HDMI_CEA_480i60_4x = 10,
HDMI_CEA_480i60_4xH = 11,
HDMI_CEA_240p60_4x = 12,
HDMI_CEA_240p60_4xH = 13,
HDMI_CEA_480p60_2x = 14,
HDMI_CEA_480p60_2xH = 15,
HDMI_CEA_1080p60 = 16,
HDMI_CEA_576p50 = 17,
HDMI_CEA_576p50H = 18,
HDMI_CEA_720p50 = 19,
HDMI_CEA_1080i50 = 20,
HDMI_CEA_576i50 = 21,
HDMI_CEA_576i50H = 22,
HDMI_CEA_288p50 = 23,
HDMI_CEA_288p50H = 24,
HDMI_CEA_576i50_4x = 25,
HDMI_CEA_576i50_4xH = 26,
HDMI_CEA_288p50_4x = 27,
HDMI_CEA_288p50_4xH = 28,
HDMI_CEA_576p50_2x = 29,
HDMI_CEA_576p50_2xH = 30,
HDMI_CEA_1080p50 = 31,
HDMI_CEA_1080p24 = 32,
HDMI_CEA_1080p25 = 33,
HDMI_CEA_1080p30 = 34,
HDMI_CEA_480p60_4x = 35,
HDMI_CEA_480p60_4xH = 36,
HDMI_CEA_576p50_4x = 37,
HDMI_CEA_576p50_4xH = 38,
HDMI_CEA_1080i50_rb = 39,
HDMI_CEA_1080i100 = 40,
HDMI_CEA_720p100 = 41,
HDMI_CEA_576p100 = 42,
HDMI_CEA_576p100H = 43,
HDMI_CEA_576i100 = 44,
HDMI_CEA_576i100H = 45,
HDMI_CEA_1080i120 = 46,
HDMI_CEA_720p120 = 47,
HDMI_CEA_480p120 = 48,
HDMI_CEA_480p120H = 49,
HDMI_CEA_480i120 = 50,
HDMI_CEA_480i120H = 51,
HDMI_CEA_576p200 = 52,
HDMI_CEA_576p200H = 53,
HDMI_CEA_576i200 = 54,
HDMI_CEA_576i200H = 55,
HDMI_CEA_480p240 = 56,
HDMI_CEA_480p240H = 57,
HDMI_CEA_480i240 = 58,
HDMI_CEA_480i240H = 59,
HDMI_CEA_720p24 = 60,
HDMI_CEA_720p25 = 61,
HDMI_CEA_720p30 = 62,
HDMI_CEA_1080p120 = 63,
HDMI_CEA_1080p100 = 64

DMT (hdmi_group = 2)

HDMI_DMT_640x350_85 = 0x1, /**<640x350 */
HDMI_DMT_640x400_85 = 0x2, /**<640x400 */
HDMI_DMT_IBM_VGA_85 = 0x3, /**<720x400 */
HDMI_DMT_VGA_60 = 0x4, /**<640x480 (60Hz is same as VGA in CEA above) */
HDMI_DMT_VGA_72 = 0x5,
HDMI_DMT_VGA_75 = 0x6,
HDMI_DMT_VGA_85 = 0x7,
HDMI_DMT_SVGA_56 = 0x8, /**<800x600 */
HDMI_DMT_SVGA_60 = 0x9,
HDMI_DMT_SVGA_72 = 0xA,
HDMI_DMT_SVGA_75 = 0xB,
HDMI_DMT_SVGA_85 = 0xC,
HDMI_DMT_SVGA_120 = 0xD,
HDMI_DMT_848x480_60 = 0xE, /**<848x480 */
HDMI_DMT_XGA_43 = 0xF, /**<1024x768 – interlaced, DO NOT USE */
HDMI_DMT_XGA_60 = 0x10, /**<1024x768 */
HDMI_DMT_XGA_70 = 0x11,
HDMI_DMT_XGA_75 = 0x12,
HDMI_DMT_XGA_85 = 0x13,
HDMI_DMT_XGA_120 = 0x14,
HDMI_DMT_XGAP_75 = 0x15, /**<1152x864 */
HDMI_DMT_WXGA_RB = 0x16, /**<1280x768 reduced blanking */
HDMI_DMT_WXGA_60 = 0x17,
HDMI_DMT_WXGA_75 = 0x18,
HDMI_DMT_WXGA_85 = 0x19,
HDMI_DMT_WXGA_120 = 0x1A, /**<120Hz with reduced blanking */
HDMI_DMT_1280x800_RB = 0x1B, /**<1280x800 reduced blanking */
HDMI_DMT_1280x800_60 = 0x1C,
HDMI_DMT_1280x800_75 = 0x1D,
HDMI_DMT_1280x800_85 = 0x1E,
HDMI_DMT_1280x800_120 = 0x1F, /** reduced blanking */
HDMI_DMT_1280x960_60 = 0x20, /**<1280x960 */
HDMI_DMT_1280x960_85 = 0x21,
HDMI_DMT_1280x960_120 = 0x22, /** reduced blanking */
HDMI_DMT_SXGA_60 = 0x23, /**<1280x1024 */
HDMI_DMT_SXGA_75 = 0x24,
HDMI_DMT_SXGA_85 = 0x25,
HDMI_DMT_SXGA_120 = 0x26, /** reduced blanking */
HDMI_DMT_1360x768_60 = 0x27, /**<1360x768 */
HDMI_DMT_1360x768_120 = 0x28, /**<120 Hz with reduced blanking */
HDMI_DMT_SXGAP_RB = 0x29, /**<1400x1050 reduced blanking */
HDMI_DMT_SXGAP_60 = 0x2A,
HDMI_DMT_SXGAP_75 = 0x2B,
HDMI_DMT_SXGAP_85 = 0x2C,
HDMI_DMT_SXGAP_120 = 0x2D, /** reduced blanking */
HDMI_DMT_1440x900_RB = 0x2E, /**<1440x900 reduced blanking */
HDMI_DMT_1440x900_60 = 0x2F,
HDMI_DMT_1440x900_75 = 0x30,
HDMI_DMT_1440x900_85 = 0x31,
HDMI_DMT_1440x900_120 = 0x32, /** reduced blanking */
HDMI_DMT_UXGA_60 = 0x33, /**<1600x1200 60Hz */
HDMI_DMT_UXGA_65 = 0x34,
HDMI_DMT_UXGA_70 = 0x35,
HDMI_DMT_UXGA_75 = 0x36,
HDMI_DMT_UXGA_85 = 0x37,
HDMI_DMT_UXGA_120 = 0x38, /** reduced blanking */
HDMI_DMT_SWXGAP_RB = 0x39, /**<1680x1050 reduced blanking */
HDMI_DMT_SWXGAP_60 = 0x3A, /**<1680x1050 60Hz */
HDMI_DMT_SWXGAP_75 = 0x3B,
HDMI_DMT_SWXGAP_85 = 0x3C,
HDMI_DMT_SWXGAP_120 = 0x3D, /** reduced blanking */
HDMI_DMT_1792x1344_60 = 0x3E, /**<1792x1344 60Hz */
HDMI_DMT_1792x1344_75 = 0x3F, /**<1792x1344 75Hz */
HDMI_DMT_1792x1344_120 = 0x40, /** reduced blanking */
HDMI_DMT_1856x1392_60 = 0x41, /**<1856x1392 60Hz */
HDMI_DMT_1856x1392_75 = 0x42, /**<1856x1392 75Hz */
HDMI_DMT_1856x1392_120 = 0x43, /** reduced blanking */
HDMI_DMT_WUXGA_RB = 0x44, /**<1920x1200 reduced blanking */
HDMI_DMT_WUXGA_60 = 0x45, /**<1920x1200 60Hz */
HDMI_DMT_WUXGA_75 = 0x46, /**<1920x1200 75Hz */
HDMI_DMT_WUXGA_85 = 0x47, /**<1920x1200 85Hz */
HDMI_DMT_WUXGA_120 = 0x48, /** reduced blanking */
HDMI_DMT_1920x1440_60 = 0x49, /**<1920x1440 60Hz */
HDMI_DMT_1920x1440_75 = 0x4A, /**<1920x1440 75Hz */
HDMI_DMT_1920x1440_120 = 0x4B, /** reduced blanking */
HDMI_DMT_2560x1600_RB = 0x4C, /**<2560x1600 reduced blanking */
HDMI_DMT_2560x1600_60 = 0x4D, /**<2560x1600 60 Hz */
HDMI_DMT_2560x1600_75 = 0x4E, /**<2560x1600 75 Hz */
HDMI_DMT_2560x1600_85 = 0x4E, /**<2560x1600 85 Hz */
HDMI_DMT_2560x1600_120 = 0x50, /** reduced blanking */
HDMI_DMT_1366x768_60 = 0x51, /**<1366x768 60Hz */
HDMI_DMT_1080p_60 = 0x52, /**<Same as 1080p60 in CEA above */
HDMI_DMT_1600x900_RB = 0x53, /**<1600x900 reduced blanking */
HDMI_DMT_2048x1152_RB = 0x54, /**<2048x1152 reduced blanking */
HDMI_DMT_720p_60 = 0x55, /**<Same as 720p60 in CEA above */
HDMI_DMT_1366x768_RB = 0x56, /**<1366x768 reduced blanking */

If the file config.txt is not present or the output format is not set explicitly, the default output format is chosen as follows:

1. If the preferred format in EDID is supported, this will be chosen.
2. If the preferred format is not supported, then all the formats supported will be ranked according to some heuristics. The format with the highest score will be chosen.

If the chosen format is a DMT format, the default driven mode will be DVI. The user will need to explicitly set driving mode to 2 if HDMI output is desired. In DVI mode there will be no sound!

How to override the default format in config.txt:
1. Set hdmi_group = 1 (for CEA formats) or hdmi_group = 2 (for DMT formats)
2. Set hdmi_mode = x (where x is the code of the format of the respective group, see the list of CEA/DMT formats for details.)
3. If the chosen format is DMT, set hdmi_drive = 2 to enable HDMI output. (CEA modes are output as HDMI by default).

If you are unsure what formats are supported, set the output format to VGA 60Hz and then follow the instructions below to parse the EDID to find out what formats are supported. All executables are found under /opt/vc/bin.

1. Run “tvservice –m CEA” to give a list of CEA supported modes.
2. Run “tvservice –m DMT” to give a list of DMT supported modes.
3. Run “tvservice -s” to give you the current state.

Alternatively you can:
1. Run “tvservice –d <file>” to capture a monitor’s EDID.
2. Pass this file to edidparser. Run “edidparser <file>”.

edidparser outputs the list of formats supported in EDID include formats not supported in Raspberry Pi, and it will show you which formats are filtered out. At the end of the output it will show which format is chosen as default. edidparser is the internal EDID parsing code of Raspberry Pi with a command line front end.

Users are encouraged to post the EDID of their monitors (and the output for the parser), if Raspberry Pi chooses a default resolution which is not expected (or strange).
Please include make and model number when you post EDID online.

[Only for the curious]
The ranking of formats is based on a combination of resolution, refresh rate, whether the format is progressive/interlaced/native, and where it appears in the EDID.

See http://elinux.org/RPi_config.txt for information on editing config.txt
User avatar
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2078
Joined: Tue Aug 02, 2011 7:27 am
by bredman » Mon May 14, 2012 9:53 am
Is this really appropriate in the "Absolute Beginners" section?
Posts: 1413
Joined: Tue Jan 17, 2012 2:38 pm
by rpi_newbie » Mon May 14, 2012 10:59 am
Maybe not, where do you suggest we should post this?
Posts: 27
Joined: Tue Apr 17, 2012 10:57 am
by abishur » Mon May 14, 2012 12:39 pm
Actually I'd say at the present this is absolutely vital to absolute beginners. :-) There's been a lot of issues with newbies getting the device to work just the way they want to on their screens. The directions are concise and easy to follow so even an absolute beginner should be able to type in the single line on the bash prompt to get the modes supported by their TV/monitor.

Side note, I'm using a 5 port HDMI switcher. I've noticed that if I change the active HDMI port off of the pi for a bit, when I swap it back I don't have HDMI output from the pi. It's not that the screen is just black, there is simply no output. I can still SSH into it, so it's not frozen either. Is there a setting in config.txt to add to constantly force HDMI output that might resolve this? I've already set hdmi_mode=16
Dear forum: Play nice ;-)
User avatar
Forum Moderator
Forum Moderator
Posts: 4298
Joined: Thu Jul 28, 2011 4:10 am
Location: USA
by prodata » Mon May 14, 2012 12:48 pm
What does 'reduced blanking' mean exactly? I presume it refers to an overscan setting? But which way round is it? If my text is spilling off the screen (ie insufficient visible border) would I want reduced blanking or not reduced blanking?
Posts: 113
Joined: Tue Jan 24, 2012 5:53 pm
by dom » Mon May 14, 2012 2:25 pm
@prodata
Neither. reduced blanking has no visible difference. It just allows for a lower HDMI clock for a given resolution/framerate.
For your problem see:
http://elinux.org/R-Pi_Troubleshooting
and use positve numbers for overscan_left etc.
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 4042
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge
by babaracus » Thu May 17, 2012 8:00 pm
I learnt something interesting today from my Linux guru at work (everybody should have one).
I was entering the commands as per the instructions 'tvservice -m CEA', but was getting an error '-bash: tvservice: command not found'. The solution is to start the line with './' making it './tvservice -m CEA', this works a treat. If I remember rightly it means something like "run from current location". Hope this helps other beginners out there.
User avatar
Posts: 4
Joined: Thu Jan 26, 2012 1:08 pm
by bredman » Fri May 18, 2012 2:05 pm
As I said earlier, I was unhappy that this post was not suitable for Absolute Beginners.

Rather than just complain, I got off my ass to improve it. I have rewritten the wiki page http://elinux.org/RPi_config.txt to be more suitable for beginners. It now includes instructions on how to edit the config.txt file and has a more logical presentation of the parameters and their values.

Does anybody know what the terms "2x", "4x" and "H" represent?

Feedback is welcome if somebody thinks it could be improved more.
Posts: 1413
Joined: Tue Jan 17, 2012 2:38 pm
by Harrkev » Mon May 21, 2012 7:38 pm
Can somebody tell me what the difference between CEA and DMT modes? There is considerable overlap in the resolutions and refresh rates. Which one should you choose for a monitor (DVI) vs. a TV (HDMI)?

Thanks.
Posts: 21
Joined: Mon Feb 27, 2012 4:56 pm
by Robert_M » Tue May 22, 2012 2:09 am
Harrkev wrote:Can somebody tell me what the difference between CEA and DMT modes? There is considerable overlap in the resolutions and refresh rates. Which one should you choose for a monitor (DVI) vs. a TV (HDMI)?

Thanks.


I'm not very knowledgeable about this stuff, but I sorted it out by looking at the values given. The CEA values are generally styled like 1080p and the DMT are generally styled like 800x600. So I decided to "interpret" DMT as useful for CRT style monitors and TV sets, since they use that format to define resolution, and conversely, modern TVs and displays are advertised as 720p, 1080p, etc., so look to CEA options for those type of screens.

As I say, this is not an educated or informed opinion -- just guessing for my own sake when I was trying to figure it out, and primarily based on what the format of the figures look like.
I sometimes ride my Pi to the Forum.
User avatar
Posts: 211
Joined: Fri Nov 25, 2011 12:50 am
by DavidJames » Thu May 24, 2012 11:50 pm
Using Debian, I found tvservice in /opt/vc/bin, but I can't find edidparser.

Can someone point me at its location,please?
Posts: 1
Joined: Thu May 24, 2012 11:45 pm
by dom » Fri May 25, 2012 12:36 am
It's in the firmware GitHub. I think you'll get it if you run Hexxeh's firmware updater.
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 4042
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge
by Hexxeh » Sat May 26, 2012 1:35 pm
I'm trying to get 720p output via my Kanex, but I'm having a bit of trouble.

Setting hdmi_group=1, hdmi_mode=4 results in state 0x40002, 720x480 @ 60Hz, interlaced, which my display doesn't support.

Not setting anything at all results in 1920x1200 being used, which my panel doesn't support either.

It DOES support 1280x720, but no combination of settings I've tried so far gets that working.
Posts: 90
Joined: Thu Apr 05, 2012 3:07 pm
by bredman » Sat May 26, 2012 1:44 pm
The following modes are valid for 720p

These values are valid if hdmi_group=1 (CEA)

hdmi_mode=4 720p 60Hz
hdmi_mode=19 720p 50Hz
hdmi_mode=41 720p 100Hz
hdmi_mode=47 720p 120Hz
Posts: 1413
Joined: Tue Jan 17, 2012 2:38 pm
by Hexxeh » Sat May 26, 2012 1:52 pm
Attempting to use any of those results in:

tvservice -s
state 0x40002, 720x480 @ 60Hz, interlaced
Posts: 90
Joined: Thu Apr 05, 2012 3:07 pm
by dom » Sat May 26, 2012 2:04 pm
@Hexxeh
hdmi_ignore_edid=0xa5000080
Will force a mode even if Pi thinks it is not supported.
Only use this if you are sure monitor supports requested mode.
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 4042
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge
by Hexxeh » Sat May 26, 2012 2:11 pm
Adding that gets me closer: state 0x120016, 1280x720 @ 50Hz, progressive

I need 60hz for this panel, though. What's the needed value to force that mode?

Edit: Oh I see, it's just a magic number to enable the option..!

Works perfectly display-wise now with:

disable_overscan=1
hdmi_mode=4
hdmi_drive=2
hdmi_group=1
force_hdmi_hotplug=1
hdmi_ignore_edid=0xa5000080

Still missing audio, though, any debugging I can to figure that one out?
Posts: 90
Joined: Thu Apr 05, 2012 3:07 pm
by dom » Sat May 26, 2012 5:29 pm
@Hexxeh
Can you post your edid. I'm guessing it's another case of edid reporting non-standard blanking which makes us reject the mode.
We're planning to do something better for these monitors, so having examples of misbehaving monitors is useful.

How are you trying to get audio out? Try the hello_audio app here:
http://elinux.org/R-Pi_Troubleshooting#Sound
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 4042
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge
by smartroad » Sat May 26, 2012 6:39 pm
I got my raspberry pictures this morning yay! connected it to my tv and I get some strange resolution. I am trying to follow this post and the wiki but I don't seem to be able to change the resolution. Once I startx I get a resolution of 1824x984, when I really want full 1080p. I got it to go to 720p but even that shows up at 1184x624 :-(

my configuration file is
hdmi_drive=2
hdmi_group=1
hdmi_mode=4

this is for 720p.

I tried tvservice but doesn't run.
Posts: 28
Joined: Sat May 26, 2012 6:26 pm
by piglet » Sat May 26, 2012 9:36 pm
Posted details of my problem (no picture with the two DVI-D monitors I have). Details of edidparser for the better of the two monitors there. Any help appreciated. It's a Zalmon Trimon. Model details correct in the parsed output.

Details posted here: viewtopic.php?f=26&t=6631
User avatar
Posts: 569
Joined: Sat Aug 27, 2011 1:16 pm
by dom » Sat May 26, 2012 10:18 pm
@smartroad
Remove what you have in the config.txt and just have:
disable_overscan=1
That will give you 1080p
(See http://elinux.org/R-Pi_Troubleshooting# ... D_monitors for more)
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 4042
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge
by smartroad » Sun May 27, 2012 1:52 pm
@dom

Thank you for that :) I feel a little stupid now (2 counts, not reading totally and almost reporting that didn't work when I noticed that I wrote "disbable" not disable :oops: )

Cheers for the assist :)
Posts: 28
Joined: Sat May 26, 2012 6:26 pm
by rpi_newbie » Sun May 27, 2012 9:36 pm
bredman wrote:As I said earlier, I was unhappy that this post was not suitable for Absolute Beginners.

Rather than just complain, I got off my ass to improve it. I have rewritten the wiki page http://elinux.org/RPi_config.txt to be more suitable for beginners. It now includes instructions on how to edit the config.txt file and has a more logical presentation of the parameters and their values.

Does anybody know what the terms "2x", "4x" and "H" represent?

Feedback is welcome if somebody thinks it could be improved more.


"2x, 4x" are the pixel repetition factors, so 480p4x is exactly the same as normal 480p with 4x the pixel frequency. TVs know this and automatically display every 4th pixel it received. Such formats are used to increase the amount of "gaps" in the signal in the HDMI cable so the source can send higher bandwidth audio data. Formats with "H" suffix are exactly the same as the corresponding ones without "H". The only difference is the "shape" of the pixel. An "H" format tells the TV the pixels should be interpreted as 16:9, rather than the normal 4:3. Hence you only see the "H" associating with formats which are normally 4:3, e.g. 480p.
Posts: 27
Joined: Tue Apr 17, 2012 10:57 am
by Sunfield » Mon May 28, 2012 8:43 pm
abishur wrote:Side note, I'm using a 5 port HDMI switcher. I've noticed that if I change the active HDMI port off of the pi for a bit, when I swap it back I don't have HDMI output from the pi. It's not that the screen is just black, there is simply no output. I can still SSH into it, so it's not frozen either. Is there a setting in config.txt to add to constantly force HDMI output that might resolve this? I've already set hdmi_mode=16


Try setting the hdmi_force_hotplug option in the config.txt. This should disable the hotplug function of the HDMI output, thus making it think it is always enabled. This could also mean u have to manually set the display settings.
Posts: 3
Joined: Mon May 28, 2012 8:40 pm
by wigjohn » Mon May 28, 2012 10:23 pm
Hi
This is my first post! Be gentle, I'm very old, and not too bright!
Got my slice of pi up and running.
But sometimes it boots up on the composite op, and sometimes on the HDMI op. I would like it to boot up on the HDMI o/p. can I change something on the Pi, or is it this silly tv I'm using?
Next question :roll: , when it does boot up on the HDMI o/p the text is too small. Can this be changed?
Don't go all geeky on me, must have simple steps :?
If someone has already posted a reply, for my problems, and you can direct me to the best place to retrieve the info I require, I will be a happy man :D .
Thanks in advance for you helpful replies.
John
Posts: 2
Joined: Mon May 28, 2012 10:06 pm