Page 1 of 7

STICKY: HOWTO: Create Custom HDMI modes

Posted: Tue Dec 04, 2012 11:03 pm
by dom
We've had a steady stream of requests for supporting HDMI modes that aren't from the official CEA/DMT list of modes.

I've implemented CVT:
http://en.wikipedia.org/wiki/Coordinated_Video_Timings
You specify the new mode in config.txt with the following config string:

Code: Select all

hdmi_cvt=<width> <height> <framerate> <aspect> <margins> <interlace> <rb>
width        width in pixels
height       height in pixels
framerate    framerate 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
The first three arguments are required. The remaining ones are optional. aspect defaults to 16:9 if not specified.

It should appear if you do

Code: Select all

tvservice -m DMT
An example:

Code: Select all

hdmi_cvt=1680 1050 60 5 0 0 1

Code: Select all

tvservice -m DMT
...
mode 87: 1680x1050 @ 60Hz 16:10, clock:119MHz progressive
(The custom mode will be 87). You might want to test it:

Code: Select all

tvservice -e "DMT 87"
fbset -depth 8 && fbset -depth 16
(The fbset gets the console back after closing the display).

You can also do the usual:

Code: Select all

hdmi_group=2
hdmi_mode=87
to make the custom mode the default.

Please note. There is no guarantee your display will support the resolution/framerate produced by this.
But if you are currently running a monitor at a non native resolution, then this may be worth a try.

Re: Custom HDMI modes

Posted: Wed Dec 05, 2012 2:02 am
by tzj
What about 21:9 aspect ratio... I know they are rare but some may have them.

Re: Custom HDMI modes

Posted: Wed Dec 05, 2012 2:21 am
by JeremyF
So just to be clear, does this support the coveted 800x480 found on many eBay LCDs?

Re: Custom HDMI modes

Posted: Wed Dec 05, 2012 8:23 am
by devnull
Thanks very much;

1) I have updated to latest firmware: d77ec8c482df21ac8eba5e2906bdb5ca8fdf892d
2) in config.txt I have set:

hdni_safe = 1
hdmi_group=2
hdmi_mode=87
cvt_width=480
cvt_height=272
cvt_framerate=60
cvt_aspect=3
cvt_margins=0
cvt_interlace=0
cvt_rb=1

3) rebooted
4) When I execute "tvservice -m DMT" I am getting: "[E] Failed to initialize VCHI (ret=-1)"

Did I miss a step ??

Re: Custom HDMI modes

Posted: Wed Dec 05, 2012 12:25 pm
by dom
devnull wrote:4) When I execute "tvservice -m DMT" I am getting: "[E] Failed to initialize VCHI (ret=-1)"
You might need this added to cmdline.txt

Code: Select all

coherent_pool=6M

Re: Custom HDMI modes

Posted: Wed Dec 05, 2012 12:27 pm
by dom
tzj wrote:What about 21:9 aspect ratio... I know they are rare but some may have them.
rpi_newbie2 tells me 21:9 is a CEA aspect ratio and not supported by DMT (which CVT supports).
I think we'll need someone with a 21:9 display to post their EDID (if anyone has one).

Re: Custom HDMI modes

Posted: Wed Dec 05, 2012 12:28 pm
by dom
JeremyF wrote:So just to be clear, does this support the coveted 800x480 found on many eBay LCDs?
Good question. It depends on how their timing are derived. Does anyone have one who can test?

Re: Custom HDMI modes

Posted: Tue Dec 11, 2012 12:57 pm
by devnull
Hi all;

Is there such a thing as a framebuffer test card, similar to the one they used to show on TV to help you view and setup the optimum screen settings ??

Thanks

Pete

Re: Custom HDMI modes

Posted: Wed Dec 12, 2012 1:39 pm
by dom
latest "next" firmware has some changes to custom hdmi modes.

CVT now uses a single config string to set up. (First post edited)

You can also play with the raw hdmi timings:

The hdmi_timings parameters are:

Code: Select all

hdmi_timings=<h_active_pixels> <h_sync_polarity <h_front_porch> <h_sync_pulse> <h_back_porch> <v_active_lines> <v_sync_polarity> <v_front_porch> <v_sync_pulse> <v_back_porch> <v_sync_offset_a> <v_sync_offset_b> <pixel_rep> <frame_rate> <interlaced> <pixel_freq> <aspect_ratio>
You wil obviously need a timing data sheet for the display, and quite possibly a scope to debug what is happening, but it may allow non-standard displays to be driven.

The aspect ratio is:

Code: Select all

HDMI_ASPECT_4_3 = 1
HDMI_ASPECT_14_9 = 2
HDMI_ASPECT_16_9 = 3
HDMI_ASPECT_5_4 = 4
HDMI_ASPECT_16_10 = 5
HDMI_ASPECT_15_9 = 6
HDMI_ASPECT_21_9 = 7
HDMI_ASPECT_64_27 = 8
It will appear as the last hdmi_mode (87 for DMT, 65 for CEA). Use hdmi_group to determine CEA or DMT.

This was my test, for VGA@75

Code: Select all

hdmi_group=2
hdmi_mode=87
hdmi_timings=640 0 16 64 120 480 0 1 3 16 0 0 0 75 0 31500000 1
[edit: use hdmi_timings rather than hdmi_timing]

Re: Custom HDMI modes

Posted: Sun Dec 16, 2012 6:32 pm
by hada1011
dom wrote:
JeremyF wrote:So just to be clear, does this support the coveted 800x480 found on many eBay LCDs?
Good question. It depends on how their timing are derived. Does anyone have one who can test?
I have this one: http://tinyurl.com/cd6h748
If this post is old and ebay refuses to show the auction, try the spec sheets:
http://www.vslcd.com/Specification/VS-TY2662-V1.pdf and http://www.vslcd.com/Specification/at070tn90.pdf

Until I found this thread, I only managed to get it working at DMT mode 14 which isnt the native resolution (848*480) and made the image a bit blurry. The controller board takes a lot of different resolutions and scales them. There are no proper EDID entries so I had to use hdmi_ignore_edid=...

Now it seems to work just fine! At least it looks ok and "tvservice -m DMT" lists only one mode - 87. Your /boot/config.txt needs theese entries (no need of ignoring EDID with CVT):

Code: Select all

#increase HDMI signal strength (just a black screen if not set!)
config_hdmi_boost=4

#remove black borders
disable_overscan=1

#set specific CVT mode
hdmi_cvt 800 480 60 6 0 0 0

#set CVT as default
hdmi_group=2
hdmi_mode=87
Thank you very much, dom! :o
I'm quite happy I got my display a few days after you added CVT :D

Now it's time to get the USB/RS232 touch panel working. There are drivers shipped with the panel for debian x86. (source and precompiled). I hope I can build them on RPi

Re: Custom HDMI modes

Posted: Sun Dec 16, 2012 7:16 pm
by dom
hada1011 wrote: Now it seems to work just fine! At least it looks ok and "tvservice -m DMT" lists only one mode - 87.
Good to hear.

Re: Custom HDMI modes

Posted: Mon Jan 21, 2013 11:51 am
by ahoeben
I've been trying to get my RPi to work with a Matrox TripleHead2Go. This creates a virtual very-wide screen, which is split to multiple screens.

Many of the 3 display modes that it supports require a dual-link DVI connection, and frankly I would not expect the RPi to cope with a resolution of - say - 5760x1080. But there are very interesting lower resolution modes that would enable the RPi to use two displays, eg: 2x 1024x768, 2x 1280x800, 3x 800x600. Obviously these modes have quite extreme aspectratios (24:9, 32:10, 36:9 respectively, for the example above). Could this work with the new firmware?

I'm attaching an edid.dat from the TripleHead2Go. The box comes with software that lets the user select up to 4 modes to put in the edid. In this case I had selected 3x1280x800, 3x1024x768 (both of which I don't expect to work with the RPi), 2x1280x800 and 2x1024x768 (both of which I think could be made to work).

Re: Custom HDMI modes

Posted: Sat Jan 26, 2013 3:36 pm
by jfornango
Ok... got an odd one.

Raspberry Pi, Rev 3 (China) running the latest Raspian with all firmware updates mentioned above.

HDMI works great on my big Vizio in the living room. However, on my Insignia in the office, I don't get much. Config.txt is

Code: Select all

# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1

# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
#disable_overscan=1

# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16

# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720

# uncomment if hdmi display is not detected and composite is being output
#hdmi_force_hotplug=1

# uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=2
#hdmi_mode=16

# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
hdmi_drive=2

# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
config_hdmi_boost=4

# uncomment for composite PAL
#sdtv_mode=2

#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800
tvservice -m DMT returns
Group DMT has 4 modes:
mode 4: 640x480 @ 60Hz 4:3, clock:25MHz progressive
mode 9: 800x600 @ 60Hz 4:3, clock:40MHz progressive
mode 16: 1024x768 @ 60Hz 4:3, clock:65MHz progressive
(native) mode 57: 1680x1050 @ 60Hz 16:10, clock:119MHz progressive

In modes 16 and 57, the TV says 'No Signal.' Mode 4 just shows a black screen and Mode 9 flashes red "static" for a half second, every five seconds.

I tried HDMI_SAFE=1, but the tv came back with 'Unsupported Mode' (fun, for a "safe mode").

I'll admit, I'm a little out of my element on this one, so any suggestions are appreciated.

Re: Custom HDMI modes

Posted: Sat Feb 16, 2013 12:45 pm
by Stevemo1
How programmable are the timings for the sdtv (composite video) interface?. Is it possible to set non - standard line and frame rates, other than 625 line 50Hz and 525 line 60Hz?. It would be really useful to be able to use the Pi as a test card generator, maybe even stream video, for the old 405 line Tv standard (405 lines, 50Hz Interlaced) for us odd people who like to restore the odd vintage TV.

Re: Custom HDMI modes

Posted: Mon Feb 25, 2013 12:04 pm
by kay110
I'm another one that would like to use it for 405line TV signal generation!

Re: Custom HDMI modes

Posted: Tue Apr 02, 2013 2:59 pm
by sgunther
I am trying to run an LCD display at 480 x 272 connected through a TI DVI to 24-Bit RGB chip. Should the mode commands work down even at this very low resolution? I have been unable to get a viable image.

Re: Custom HDMI modes

Posted: Tue Apr 02, 2013 4:21 pm
by dom
sgunther wrote:I am trying to run an LCD display at 480 x 272 connected through a TI DVI to 24-Bit RGB chip. Should the mode commands work down even at this very low resolution? I have been unable to get a viable image.
@devnull had a 480x272 LCD working.

Code: Select all

I think these were his settings:
## TIMING OVERRIDES
hdmi_ignore_edid=0xa5000080
hdmi_group=2
hdmi_mode=87
hdmi_timings=480 0 1 41 2 272 0 2 10 2 0 0 0 60 0 9009000 3

Re: Custom HDMI modes

Posted: Thu Apr 18, 2013 8:41 am
by darseneau
I couldn't figure out how to use the hdmi_timing mentioned in this thread, in order to get 2560x1080 (21:9) resolution on a Dell ultrawide monitor. I tried putting:

Code: Select all

hdmi_group=2
hdmi_mode=87
hdmi_timing=2560 0 0 0 0 1080 0 0 0 0 0 0 0 60 0 230000000 7
into config.txt, but the result was 640x480. Note that 230M is the pixel clock reported by

Code: Select all

cvt 2560 1080 60
.

Is there further information on how to use this approach?

Even better, will built-in support for 21:9 modes be coming soon? I can test updates and send EDID tables if that helps.

Donald

Re: Custom HDMI modes

Posted: Thu Apr 18, 2013 11:28 am
by dom
darseneau wrote:I couldn't figure out how to use the hdmi_timing mentioned in this thread, in order to get 2560x1080 (21:9) resolution on a Dell ultrawide monitor. I tried putting:
2560x1080 is not possible. 1920x1200 is the maximum resolution supported.

Re: Custom HDMI modes

Posted: Thu Apr 18, 2013 7:56 pm
by darseneau
dom wrote: 2560x1080 is not possible. 1920x1200 is the maximum resolution supported.
Is that a firmware limitation at present, as I had supposed, or a hardware limit of the gpu?

Re: Custom HDMI modes

Posted: Tue Jun 04, 2013 2:11 pm
by jtheath
Mine is a "banner" display - 1280x400, definitely different. With that aspect ratio being 32:10 what settings are suggested?

I have a functioning modeline which works well for Ubuntu. Is there a straight-forward conversion from that to the hdmi-timing fields?

Re: Custom HDMI modes

Posted: Fri Jun 07, 2013 5:29 pm
by fluke
my screen is a 1024x600 LCD.

I just cannot get it display X correctly.

I test hdmi under windows. the resolution below works:
800x600 works with left and right blanking.
1280x768 works with top and bottom blanking.
1280x800 works almost perfectly.

I then test under RPi:
800x600, 1280x768, 1280x800 works with these problems: text in console displays with positive y offset. X displays out of the screen.

my config:
1.
config_hdmi_boost=4
hdmi_cvt 800 600 60 6 1 0 0
hdmi_group=2
hdmi_mode=87
keep blinking but not display.

2.
config_hdmi_boost=4
hdmi_cvt 800 600 60 6 0 0 1
hdmi_group=2
hdmi_mode=87

display larger than the screen.

Re: Custom HDMI modes

Posted: Fri Jun 07, 2013 5:47 pm
by fluke
when i use a 1024x600 screen i need to use other resolution such as 800x600,1280x800,1280x768 and use overscan_* to addjust the screen display.

Re: Custom HDMI modes

Posted: Tue Jun 11, 2013 9:02 pm
by scottnla
I have a square (yes, square! aspect ratio of one!) screen that has a screen resolution of 960 x 960, and i'm trying to use my raspberry pi to play videos on it in response to various sensor stimuli.

I managed to get the resolution of the desktop on boot to be correct by adding a custom HDMI mode:

<code>
hdmi_cvt=960 960 60
</code>

To test it, I cropped a video to 960 x 960 to play with omxplayer (which seems the right resolution when I play it on another computer); however, when I play it with omxplayer on my raspberry pi, it's highly distorted -- it looks like it's playing at something like 960 px tall x 320 px wide.

Any thoughts on why it is so highly distorted?

Re: Custom HDMI modes

Posted: Wed Jun 12, 2013 8:32 pm
by dom
scottnla wrote:I have a square (yes, square! aspect ratio of one!) screen that has a screen resolution of 960 x 960, and i'm trying to use my raspberry pi to play videos on it in response to various sensor stimuli.

I managed to get the resolution of the desktop on boot to be correct by adding a custom HDMI mode:

<code>
hdmi_cvt=960 960 60
</code>

To test it, I cropped a video to 960 x 960 to play with omxplayer (which seems the right resolution when I play it on another computer); however, when I play it with omxplayer on my raspberry pi, it's highly distorted -- it looks like it's playing at something like 960 px tall x 320 px wide.

Any thoughts on why it is so highly distorted?
Might be the aspect ratio. Is it better with:
hdmi_cvt=960 960 60 1
and worse with
hdmi_cvt=960 960 60 3

I'm afraid you can't currenly specify a square screen.