<html><head><meta http-equiv="Content-type" content="text/html; charset=iso-8859-1">
<title>Framebuffer console mode generator</title>
<style type="text/css"><!--
TABLE.toc {border:0px}
A:link,A:visited{text-decoration:none;color:#2A3B83}
A:hover{text-decoration:underline;color:#002040}
A:active{text-decoration:underline;color:#004060;background:#CCD8FF}
TD.toc {font-size:80%; font-family:Tahoma; text-align:left}
H1 {font-size:250%; font-weight:bold} .level1 {text-align:center}
H2 {font-size:200%; font-weight:bold} .level2 {margin-left:1%}
H3 {font-size:160%; font-weight:bold} .level3 {margin-left:2%}
H4 {font-size:145%; font-weight:bold} .level4 {margin-left:3%}
H5 {font-size:130%; font-weight:bold} .level5 {margin-left:4%}
H6 {font-size:110%; font-weight:bold} .level5 {margin-left:5%}
BODY{background:white;color:black}
CODE{font-family:lucida console,courier new,courier;color:#105000}
PRE.smallerpre{font-family:lucida console,courier new,courier;font-size:80%;color:#500010;margin-left:30px}
SMALL {font-size:70%}
--></style></head>
<body>
<h1>Framebuffer console mode generator</h1>
<h2 class=level2> 0. Contents </h2>
This is the documentation of fbmodes-1.2.3. <div class=toc><table cellspacing=0 cellpadding=0 class=toc><tr><td width="50%" valign=middle align=left nowrap class=toc> 1. <a href="h0">Purpose</a><br> 2. <a href="h1">Usage</a><br> 2.1. <a href="h2">modetest (the newer and easier program)</a><br> 2.1.1. <a href="h3">fbdev</a><br> 2.1.2. <a href="h4">X11</a><br> 2.2. <a href="h5">fbmodes (older and not so flexible program)</a><br> 3. <a href="h6">Some examples</a><br></td> <td width="50%" valign=middle align=left nowrap class=toc> 4. <a href="h7">fb.modes -> modeline converter</a><br> 5. <a href="h8">Online demo</a><br> 6. <a href="h9">Copying</a><br> 7. <a href="h10">Drawbacks</a><br> 8. <a href="contact">Feedback</a><br> 9. <a href="h11">Requirements</a><br> 10. <a href="h12">Installation</a><br> 11. <a href="#download">Downloading</a><br></td> </tr></table></div><H2 id="h0" class="level2"><a name="h0"></a>1. Purpose</H2><div class="level2">
Give it the requested screen resolution and refresh time (vsync period),
and it gives you the modelines for fbset (/etc/fb.modes),
SVGATextMode (/etc/TextConfig) and XFree86 (/etc/XF86Config).
<p>
On modern monitors, you probably have to specify the blank part lengths
for left, right, top and bottom of screen too.
</div><H2 id="h1" class="level2"><a name="h1"></a>2. Usage</H2><div class="level2">
(Both are found in the same archive)
</div><H3 id="h2" class="level3"><a name="h2"></a>2.1. modetest (the newer and easier program)</H3><div class="level3">
<pre class=smallerpre>Missing options.
modetest - video mode composer v1.2.2 (C) 1992,2002 Bisqwit
Developes a screen mode.
Usage: modetest <options> [<...>]
Options:
-V, --version Version information
-X, --hslen <num> Horizontal sync length. Range: 0..1 s, default: 1e-6 (1 microsecond)
-Y, --vslen <num> Vertical sync length. Range: 0..1 s, default: 46e-6 (46 microseconds)
-h, --help Help
-n, --ignoretest Ignore mode testing
-r, --refresh <num> Screen refresh rate.
-x, --xres <visible>[+<invisible>[/<left%>]] Horizontal resolution. -y, --yres <visible>[+<invisible>[/<top%>]] Vertical resolution.
You must specify at least xres, yres and refresh. Current assumed monitor and display card limits (used in warnings):
Horizontal sync (hsync) range: 30 .. 70 kHz Vertical sync (refresh) range: 50 .. 120 Hz atyfb maxs: h_disp=2048, h_sync_start=4096, hslen=248,
v_disp=2048, v_sync_strt=2048, vslen=31
The program tries to set the screenmode with fbset command. You might want to redirect the stderr to a file in case the fbset command fails and renders the screen garbled: modetest [<options>] 2>logfile.txt
Example: modetest 2>tmptmp -x1280+296 -y1024+39 -r60
(gives the screenmode I'm using with my framebuffer console)
(actually -x1280+296/78.4 -y1024+39/99 to center it)
</pre>
Upon compilation you have two choices:
</div><H4 id="h3" class="level4"><a name="h3"></a>2.1.1. fbdev</H4><div class="level4">
You need write access to <code>/dev/vcsa0</code> and a working fbset (v2.1) program to test the display modes.
</div><H4 id="h4" class="level4"><a name="h4"></a>2.1.2. X11</H4><div class="level4">
You need a working XFree86 server with XVidMode extension enabled.<br>
As of the writing of this document, XFree-4.3.0 is not working.<br>
To make it working, you may need to do the following:
<ol>
<li>Download and unpack XFree86 source code.</li>
<li>Patch <code>programs/Xserver/Xext/xf86vmode.c</code>
<ol>
<li>
Add <code>VidModeSetModeValue(mode, VIDMODE_CLOCK, stuff->dotclock);</code>
to the function <code>ProcXF86VidModeAddModeLine</code>
</li>
<li>
Add <code>VidModeSetModeValue(modetmp, VIDMODE_CLOCK, stuff->dotclock);</code>
to the function <code>ProcXF86VidModeValidateModeLine</code>
</li>
</ol></li>
<li>Patch <code>programs/Xserver/hw/xfree86/common/xf86VidMode.c</code>
<ol>
<li>
Add <code>mode->VScan = 1;</code>
to the function <code>VidModeCreateMode</code>
</li>
</ol></li>
<li>And recompile it. (Just ensuring <code>XFree86</code> and
<code>libextmod.a</code> are updated is enough.)</li> </ol>
After applying these updates, <code>XF86VidModeAddModeLine()</code> works
randomly (previously never).
<p>
Yes I know - this is far from tolerable. I'm sorry.
Until XFree86 is officially fixed, there's nothing better to offer for this.
</div><H3 id="h5" class="level3"><a name="h5"></a>2.2. fbmodes (older and not so flexible program)</H3><div class="level3"> <pre class=smallerpre>fbmodes version 1.2.2 Copyright (C) 1992,1999 Bisqwit (http://iki.fi/bisqwit/)
Generates various type of video mode entries with given settings
Usage: fbmodes [-?xyfrdXYmV]
-?, --help Help
-x, --xres n Requested horizontal resolution (default: 256)
-y, --yres n Requested vertical resolution (default: 256)
-f, --hfreq n Horizontal pixel clock/Hz (default: 31500)
-r, --refresh n Specify (vertical) display refreshment rate/Hz
(default: hfreq/ylen or 120)
-xl,--xlen n Specify video line width/pixels (default: xres*3/2)
-yl,--ylen n Specify number of scanlines (default: hfreq/refresh)
-d, --depth n Specify bitness (used in fb.modes) (default: 8)
-X, --xofs n Specify hsyncstart-xres (default: (xlen-xres)/2)
-Y, --yofs n Specify vsyncstart-yres (default: (ylen-yres)/3)
-xs,--hslen n Specify hsync length/pixels
(default: min(40,(xlen-xres)/2-1))
-ys,--vslen n Specify vsync length/pixels
(default: min(10,(ylen-yres)/2-1))
-fx,--fontxres n Specify fontxres (used in TextConfig) (default: 8) -fy,--fontyres n Specify fontyres (used in TextConfig) (default: 8)
-m, --mem n Video memory size/kB (default: 4000) -V, --version Version information
The order of the parameter elements is not important. Also any of them can be omitted.
Pparameter translation algorithm:
If hfreq was specified and refresh was not specified,
refresh gets calculated from hfreq/ylen. Else if refresh was not specified, it is assumed as 120. Next if ylen was not specified, it is calculated from hfreq/refresh. If ylen, refresh and hfreq were specified, ignore hfreq. Next, if hslen and vslen were not specified, calculates them as documented. </pre>
</div><H2 id="h6" class="level2"><a name="h6"></a>3. Some examples</H2><div class="level2"> (For my "ATY Mach64" framebuffer and Belinea 10 70 20 monitor)
<pre>
mode "2000x1750-40"
# D: 186.602 MHz, H: 70.683 kHz, V: 39.687 Hz
geometry 2000 1750 2000 1750 8
timings 5359 434 70 29 1 136 1
hsync high
vsync high
endmode
#~/src/fbmodes/fbmodes -x360 -y256 -d32 -ys3 -xs48 -f50000 -m1024
mode "360x256-120"
geometry 360 256 360 1000 32
timings 39746 24 72 104 53 48 3
endmode
#~/src/fbmodes/fbmodes -x320 -y256 -d32 -ys3 -xs48 -f50000 -m1024
mode "320x256-120"
geometry 320 256 320 1000 32
timings 43642 22 69 104 53 48 3
endmode
#~/src/fbmodes/fbmodes -x360 -xl460 -y240 -d32 -ys3 -X30 -xs20 -f35000 -m256 -r120
mode "360x240-120"
geometry 360 240 360 728 32
timings 62254 50 30 31 17 20 3
endmode
#~/src/fbmodes/fbmodes -x320 -y240 -d32 -ys2 -xs48 -f45000 -m1024
mode "320x240-120"
geometry 320 240 320 1000 32
timings 48414 22 69 88 45 48 2
endmode
#~/src/fbmodes/fbmodes -x576 -y432 -d32 -ys3 -xs48 -f50000 -m512
mode "576x432-120"
geometry 576 432 576 910 32
timings 23328 32 79 33 18 48 3
endmode
#~/src/fbmodes/modetest -x320+50/20 -y200+100/70 -r120 -X2.5e-6 -Y58e-6 mode "320x200-120"
# D: 14.799 MHz, H: 36.360 kHz, V: 120.000 Hz
geometry 320 200 320 200 8
timings 67574 10 40 70 30 37 3
vsync high
hsync high
endmode
#~/src/fbmodes/modetest -x384+50/35 -y288+40/80 -r120 -X2.5e-6 -Y58e-6 mode "384x288-120"
# D: 19.145 MHz, H: 39.720 kHz, V: 120.000 Hz
geometry 384 288 384 288 8
timings 52232 17 33 32 8 48 3
endmode
# Generated with: modetest -x256+95/40 -y320+30 -r120 -X0 -Y1e-6 mode "256x320-120"
# D: 14.784 MHz, H: 42.120 kHz, V: 120.000 Hz
geometry 256 320 256 320 32
timings 67640 38 57 27 3 0 1
vsync high
hsync high
endmode
# Generated with: modetest -x400+60/48 -y320+50/60 -r120 mode "400x320-120"
# D: 21.472 MHz, H: 44.640 kHz, V: 120.000 Hz
geometry 400 320 400 320 8
timings 46572 28 32 30 20 21 2
vsync high
hsync high
endmode
# Generated with: modetest -x 432+70/50 -y 320+30 -r 120 mode "432x320-120"
# D: 22.071 MHz, H: 42.120 kHz, V: 120.000 Hz
geometry 432 320 432 320 8
timings 45308 35 35 27 3 22 1
vsync high
hsync high
endmode
# Generated with: modetest -x352+116/35 -y288+120/70 -r124 mode "352x288-124"
# D: 25.064 MHz, H: 50.840 kHz, V: 124.000 Hz
geometry 352 288 352 288 8
timings 39897 40 76 84 36 25 2
vsync high
hsync high
endmode
# Generated with: modetest -x640+100/97 -y360+30 -r120 mode "640x360-120"
# D: 36.503 MHz, H: 47.040 kHz, V: 120.000 Hz
geometry 640 360 640 360 8
timings 27394 97 3 27 3 36 2
vsync high
hsync high
endmode
# Generated with: modetest -x640+200 -y480+50 -r120 mode "640x480-120"
# D: 57.264 MHz, H: 63.840 kHz, V: 120.000 Hz
geometry 640 480 640 480 8
timings 17462 160 40 45 5 57 2
vsync high
hsync high
endmode
# Generated with: modetest -x512+110/90 -y384+30 -r120 mode "512x384-120"
# D: 32.648 MHz, H: 49.920 kHz, V: 120.000 Hz
geometry 512 384 512 384 8
timings 30630 99 11 27 3 32 2
vsync high
hsync high
endmode
# Generated with: modetest -x720+250/45 -y480+200/50 -r100 mode "720x480-100"
# D: 71.100 MHz, H: 68.300 kHz, V: 100.000 Hz
geometry 720 480 720 480 8
timings 14064 112 138 100 100 71 3
vsync high
hsync high
endmode
# Generated with: modetest -x640+160/58 -y272+240/60 -r120 mode "640x272-120"
# D: 52.551 MHz, H: 61.680 kHz, V: 120.000 Hz
geometry 640 272 640 272 8
timings 19029 92 68 144 96 52 2
vsync high
hsync high
endmode
# Generated with: modetest -x632+240/42 -y476+180/50 -r100 mode "632x476-100"
# D: 61.485 MHz, H: 65.900 kHz, V: 100.000 Hz
geometry 632 476 632 476 8
timings 16264 100 140 90 90 61 3
vsync high
hsync high
endmode
# Generated with: modetest -x512+160/53 -y480+146/60 -r100 mode "512x480-100"
# D: 45.028 MHz, H: 62.800 kHz, V: 100.000 Hz
geometry 512 480 512 480 8
timings 22208 84 76 87 59 45 2
vsync high
hsync high
endmode
# Generated with: modetest -x1600+380/90 -y1070+30/75 -r60 -X1.5e-6 -Y90e-6 Modeline "1600x1070-60" 145.727 1600 1638 1856 2198 1070 1078 1083 1105
</pre>
Most of these I made to be able to play mpeg4 videos
full screen without software rescaling.
<p>
The utilities to use MPlayer in Linux framebuffer console
can be found at <a href="http://iki.fi/bisqwit/source/mplayscript.html"
>http://iki.fi/bisqwit/source/mplayscript.html</a>.
</div><H2 id="h7" class="level2"><a name="h7"></a>4. fb.modes -> modeline converter</H2><div class="level2">
The package now contains fb2x.rb, a Ruby script to
convert the mode descriptions from fb.modes to modeline
format used by X11.<br>
Usage:<br><code>
ruby fb2x.rb < fb.modes > modelines.txt</code>
</div><H2 id="h8" class="level2"><a name="h8"></a>5. Online demo</H2><div class="level2">
<form method=GET action="/source/fbmodes.html">
Desired resolution:
<input type=text size=4 maxlength=5 name=xres value="">x
<input type=text size=4 maxlength=5 name=yres value="">,
<input type=text size=4 maxlength=5 name=refr value=""> Hz<br>
Sync area:
<input type=text size=4 maxlength=5 name=xwid value="">x
<input type=text size=4 maxlength=5 name=ywid value=""><br>
Screen position:
<input type=text size=4 maxlength=3 name=xpro value="">% left,
<input type=text size=4 maxlength=3 name=ypro value="">% top<br>
<input type=submit value="Get modeline"><br>
<em>Note: All fields must be filled!</em><br>
Set the desired resolution to be what you want. 640x480, 90 Hz is a nice example.<br>
Sync area is the amount of blank space the video card must render. It's usually
something like 25% of the screen width and height. Try 100 for starters, grow
or shrink it then if it seems too small or big.<br>
And screen position decides how much of the sync area is at left/right and top/bottom.
50 and 50 are good starters.<br>
</form>
</div><H2 id="h9" class="level2"><a name="h9"></a>6. Copying</H2><div class="level2">
modetest has been written by Joel Yliluoma, a.k.a.
<a href="http://iki.fi/bisqwit/">Bisqwit</a>,<br>
and is distributed under the terms of the
<a href="http://www.gnu.org/licenses/licenses.html#GPL">General Public License</a> (GPL).
<p>
If you happen to see this program useful for you, I'd
appreciate if you tell me :) Perhaps it would motivate
me to enhance the program.<br>
As of 21.8.2002, still nobody has emailed me anything
about this program, although I have seen hits and downloads
from this page many times a day for half a year already.
</div><H2 id="h10" class="level2"><a name="h10"></a>7. Drawbacks</H2><div class="level2">
<ul><li>
Doublescan-modes and interlaced modes are not yet supported,
and they won't work in Linux atyfb anyway.<br>
Therefore, the low resolution modes (320x200 for example) don't look as good
as you might expect.</li>
<li>
Being able to produce screenmodes like 320x1024 @ 120 fps, you might damage
your monitor while playing with these utilities. Newer monitors don't usually
suffer a lot, but older ones might. I offer no warranty whatsoever. However,
if you happen to make your monitor explode or at least damage when using this
program, you are encouraged to <a href="#contact">tell me</a>
about it.</li>
<li>
The programs have no kind of database of standard video modes. Therefore,
when using modetest, you almost always <em>have</em> to specify the blank area
sizes and positions explicitly. It has been made as easy as possible though.</li>
<li>
Flat displays (LCD, TFT) are not so flexible in clocking as CRT displays are.
If you have a 1024x768 flat display, there most probably is no way to get 1280x1024
resolution with it. I have a 1280x1024 Belinea monitor (model 10 70 20),
and it can display even 2000x1750 when given suitable input.</li>
</ul>
</div><H2 id="contact" class="level2"><a name="contact"></a>8. Feedback</H2><div class="level2">
If you have problems using this program or ideas how to
develop it, email me your questions or ideas.<br>
Please do not omit the details.<br>
<table cellspacing=0 cellpadding=0>
<tr><td class=email>My email address:</td>
<td class=email>Joel Ylilu</td>
<td class=email>oma <bisqw</td>
<td class=email>it@iki.fi></td>
</tr></table>
</div><H2 id="h11" class="level2"><a name="h11"></a>9. Requirements</H2><div class="level2">
Only tested with GNU make and GCC version 3.03 in Linux.<br> Mode tester (visualizer and tester) part works only on Linux (it uses /dev/vcsa0 and fbset).<br>
</div><H2 id="h12" class="level2"><a name="h12"></a>10. Installation</H2><div class="level2">
<pre class=smallerpre
>$ make
$ su
# make install</pre>
If you do not want to install
<a href="http://oktober.stc.cx/source/libargh.html">libargh</a>
(included in the archive), do not use "make install" and edit
Makefile and enable the STATIC linking instead of DYNAMIC.
</div><H2 id="download" class="level2"><a name="download"></a>11. Downloading</H2><div class="level2">
The official home page of fbmodes
is at <a href="http://iki.fi/bisqwit/source/fbmodes.html">http://iki.fi/bisqwit/source/fbmodes.html</a>.<br>
Check there for new versions.
</div> <p align=right><small>Generated from
<code>progdesc.php</code> (last updated: Fri, 12 Sep 2003 06:03:17 +0300)<br>
with <code>docmaker.php</code> (last updated: Thu, 13 Feb 2003 15:11:29 +0200)<br>
at Fri, 12 Sep 2003 06:03:20 +0300</small>
</p>
</body>
</html>
