Raspberry Pi HDMI output: configuring the correct resolution for a crappy TV

by krisrowland

TL;DR

edit the /boot/config.txt file to disable EDID detection and force the correct HDMI group and mode. Namely, add these lines:
hdmi_ignore_edid=0xa5000080
hdmi_group=GROUP
hdmi_mode=MODE

where ‘GROUP’ is the HDMI group number (1 or 2) and ‘MODE’ is the HDMI mode number, discussed below.

To force HDMI output if it isn’t detected correctly, and disable CEC (assuming your crappy TV doesn’t support it), also add:
hdmi_ignore_cec_init=1
hdmi_ignore_cec=1
hdmi_force_hotplug=1

For stability’s sake, I also turned off overclocking by setting these variables :
arm_freq=700
core_freq=250

—–

I’ve recently come back to playing with my Raspberry Pi (Model A). I had set it up a while ago as a home theatre PC using RaspBMC. It was OK, but I lost interest after a while due to other commitments. When I came across XBian a few days ago, I thought I’d give it a go.

XBian is wonderful.

The only problem was the resolution was defaulting to 1280×768 @ 60Hz. My television is a crappy AWA “720p” HDTV purchased from Big W years ago. It has served me well, but it has all of the quirks of a cheap TV. The main problem here, though, is that the native resolution is actually 1366×768 @ 60Hz. No matter what settings I changed within any of the XBian menus (within XBMC or the xbian-config startup script), the video output would break in some way when changes were made. In particular, when the 1280×768 resolution was used, there was a vertical band of corrupt video data displayed on the right of the screen – otherwise, everything looked great. The TV would even display an overlay telling me that it was using the 1366×768 @ 60Hz resolution, just to goad me.

How I changed the HDMI out resolution:

The Embedded Linux Wiki has a thorough entry on configuring the RPi, especially for video. After hours of searching and tweaking, the sentence that caught my attention was “hdmi_ignore_edid Enables the ignoring of EDID/display data if your display is a crappy Chinese one”.

To find your supported video modes, ssh (or directly login) into your RPi and execute the tvservice command.

tvservice -m CEA displays the HDMI CEA group (group 1)

tvservice -m DMT displays the HDMI DMT group (group 2)

My problem was that the native 1366×768 resoltion of my AWA TV wasn’t shown. WHAT!?! My TV was telling me that it was using it, but the RPi didn’t know about it. *sigh*

This turns out to be the EDID issue mentioned above. I forced EDID detection off by adding hdmi_ignore_edid=0xa5000080 to my /boot/config.txt file (as per the ELinux Wiki) and rebooted my RPi.

Running the tvservice commands again, the resolution I was after was listed in HDMI DMT mode (group 2) as mode 81. Note that this is different to a few of the 1360×768 resolution options, such as modes 39 and 40. I accidentally tried these first and they defaulted back to 640×480.

I then added this group and mode to config.txt so by adding these lines:

hdmi_ignore_edid=0xa5000080
hdmi_group=2
hdmi_mode=81

and the resolution worked on reboot! ^__^

I then noticed that if my TV wasn’t on and set to the HDMI input on boot, the HDMI output wouldn’t work; the TV wouldn’t see the signal. I guess this was due to the poor communication from the TV to the RPi, as for the EDID issue above. So, I forced HDMI output, regardless of whether the TV told the RPi that it could do it, and disabled any CEC support for good measure, by also adding these lines:

hdmi_ignore_cec_init=1
hdmi_ignore_cec=1
hdmi_force_hotplug=1

and the HDMI output worked even if the TV was off or set to a different input at the RPi boot time. Perfect!

I had also noticed some instability with my system – many different issues. To be sure it wasn’t the default XBian overclocking, I turned all overclocking off by also setting:

arm_freq=700
core_freq=250

which seemed to maintain a more stable system (purely anecdotal evidence so far).

This left me with a final config.txt of:

initramfs initramfs.gz 0x00a00000
disable_overscan=1
hdmi_ignore_cec_init=1
hdmi_ignore_cec=1
hdmi_force_hotplug=1
hdmi_ignore_edid=0xa5000080
hdmi_group=2
hdmi_mode=81
gpu_mem_256=128
gpu_mem_512=128
arm_freq=700
core_freq=250
sdram_freq=400
over_voltage=0

(Note: your config.txt may look different depending on other settings you require.)

These tricks should also work for any other RPi distro using the /boot/config.txt boot time configuration, such as Raspbian, RaspBMC, …

Hope that helps anyone having similar issues with achieving the correct HDMI resolution from a Raspberry Pi on a cheap TV.

Advertisements