Monday, July 15, 2013

Custom HDMI Resolution

UPDATE:  If you buy a small LCD, I suggest getting one with slightly higher resolution.  I am wising in particular I had a bit more vertical resolution when running the Axis GUI for LinuxCNC.

As follow-up to my post on how to force HDMI Resolution, I recently obtained a small 7" 800x480 LCD display with HDMI input and found I need to not only force a particular resolution, but a resolution that is non-standard as well.

It turns out this is pretty easy once you filter through all the hints that don't work (lots of fbset and xrandr instructions).  If you want a custom display mode, all you have to do is give the kernel your desired resolution and tell it to calculate the cvt timings.  There are some details in the kernel documentation for modedb.txt, and the following uEnv.txt entry (which turns into a kernel command line argument) got my display working properly:
Note the "M" after the resolution and before the "@", which is what tells the kernel to calculate timings for this resolution rather than try to find it as a pre-existing standard.  You can specify other details, like reduced blanking or interlaced mode, see the modedb.txt documentation for details.

This setting works with my latest MachineKit Debian image, based on Robert C Nelson's Debian image, with xfce and xdm added for a desktop environment.  The kms_force_mode uEnv.txt variable is supported in Robert's latest images, and the actual kernel command line parameter you want to set is "video=HDMI...".

For those of you still running Angstrom, the above setting only affects the display while the kernel is booting.  Once the system is running, Angstrom's custom version of Gnome takes over, blindly ignores any prior resolution settings, and forces the HDMI output into whatever video mode it considers "best" based on your EDID settings.  This is all well and good for most monitors, but my low-end LCD panel doesn't have it's native resolution listed as any of it's EDID options.  I tried "lying" to the system by crafting a custom EDID and overriding the EDID from the display, which seems like it should work, but absolutely nothing changed.  Probably because the default BeagleBone kernel is compiled with CONFIG_DRM_LOAD_EDID_FIRMWARE disabled.

Here's a screen shot of my BeagleBone Black happily running in 800x480 mode, nicely mapping 1:1 to the native resolution of my $79 eBay HDMI special:

And here's the actual display: 


  1. For Angstrom you can change de resolution with xrandr.
    For example: xrandr -s 640x480

    1. That doesn't work for all resolutions though. It didn't let me choose 800x480

  2. To for the resolution on system startup you can put xrandr command on the end of the file: /etc/gdm/Init/Default

  3. Hello,

    I'm looking for a similar LCD touch screen to connect my BBB to.
    It seems that the touchscreen feature is handled through a USB link.
    I would like to know if it fully supported with the BBB and the amrstrong distribution ?


    1. Most touch screen controllers should be supported by Linux, but I am unfamiliar with the armstrong distribution. This would be a good question for the BeagleBone Google Group or the armstrong community.

    2. Thanks for your reply.
      If it works with a debain based distribution it means it works for most of the linux distributions.

  4. Do you have GNOME Desktop installed in the pictures? How did you get that GUI for screen settings?

    1. Not Gnome. IIRC that was running xfce, but more recent images have switched to using lxde.

  5. This is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value. Im glad to have found this post as its such an interesting one! I am always on the lookout for quality posts and articles so i suppose im lucky to have found this! I hope you will be adding more in the future... link