Custom HDMI modes


55 posts   Page 1 of 3   1, 2, 3
by dom » Tue Dec 04, 2012 11:03 pm
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.
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 4042
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge
by tzj » Wed Dec 05, 2012 2:02 am
What about 21:9 aspect ratio... I know they are rare but some may have them.
http://www.themagpi.com <---- Checkout the MagPi
(The MagPi - Co-Founder)
User avatar
Posts: 300
Joined: Thu Jan 05, 2012 3:09 pm
Location: Barnsley, SY, UK
by JeremyF » Wed Dec 05, 2012 2:21 am
So just to be clear, does this support the coveted 800x480 found on many eBay LCDs?
{sig} Setup: Original version Raspberry Pi (B, rev1, 256MB), Dell 2001FP monitor (1600x1200), 8GB Class 4 SD Card with Raspbian and XBMC, DD-WRT wireless bridge
Posts: 516
Joined: Wed Jan 25, 2012 9:06 pm
by devnull » Wed Dec 05, 2012 8:23 am
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 ??
> /dev/null 2>&1
Posts: 65
Joined: Sat Dec 24, 2011 7:46 am
by dom » Wed Dec 05, 2012 12:25 pm
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
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 4042
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge
by dom » Wed Dec 05, 2012 12:27 pm
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).
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 4042
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge
by dom » Wed Dec 05, 2012 12:28 pm
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?
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 4042
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge
by devnull » Tue Dec 11, 2012 12:57 pm
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
> /dev/null 2>&1
Posts: 65
Joined: Sat Dec 24, 2011 7:46 am
by dom » Wed Dec 12, 2012 1:39 pm
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_timing parameters are:
Code: Select all
hdmi_timing=<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
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 4042
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge
by hada1011 » Sun Dec 16, 2012 6:32 pm
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
Posts: 1
Joined: Sun Dec 16, 2012 3:40 pm
by dom » Sun Dec 16, 2012 7:16 pm
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.
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 4042
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge
by ahoeben » Mon Jan 21, 2013 11:51 am
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).
Attachments
edid.zip
RPi edid.dat with Matrox Triplehead2Go attached.
(1.28 KiB) Downloaded 163 times
Posts: 6
Joined: Mon Jan 21, 2013 10:41 am
by jfornango » Sat Jan 26, 2013 3:36 pm
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.
I'm only wearing black until they find something darker.
Posts: 113
Joined: Fri Sep 14, 2012 7:46 pm
Location: St. Louis, MO USA
by Stevemo1 » Sat Feb 16, 2013 12:45 pm
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.
Posts: 2
Joined: Sat Feb 16, 2013 12:38 pm
by kay110 » Mon Feb 25, 2013 12:04 pm
I'm another one that would like to use it for 405line TV signal generation!
Posts: 1
Joined: Mon Feb 25, 2013 12:01 pm
by sgunther » Tue Apr 02, 2013 2:59 pm
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.
Posts: 3
Joined: Mon Feb 11, 2013 8:11 pm
by dom » Tue Apr 02, 2013 4:21 pm
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
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 4042
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge
by darseneau » Thu Apr 18, 2013 8:41 am
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
Posts: 2
Joined: Thu Apr 18, 2013 2:59 am
by dom » Thu Apr 18, 2013 11:28 am
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.
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 4042
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge
by darseneau » Thu Apr 18, 2013 7:56 pm
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?
Posts: 2
Joined: Thu Apr 18, 2013 2:59 am
by jtheath » Tue Jun 04, 2013 2:11 pm
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?
Posts: 1
Joined: Tue Mar 05, 2013 4:55 pm
by fluke » Fri Jun 07, 2013 5:29 pm
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.
Posts: 2
Joined: Fri Jun 07, 2013 5:24 pm
by fluke » Fri Jun 07, 2013 5:47 pm
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.
Posts: 2
Joined: Fri Jun 07, 2013 5:24 pm
by scottnla » Tue Jun 11, 2013 9:02 pm
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?
Posts: 6
Joined: Wed May 29, 2013 7:57 pm
by dom » Wed Jun 12, 2013 8:32 pm
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.
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 4042
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge