[mythtv-users] Custom Modeline

David myth at dgreaves.com
Sun Jun 20 05:33:41 EDT 2004


Hi

Here's some text I've put together for Modelines

It's up at www.mythtv.info/moin.cgi/ModeLineHowTo

Any comments please feel free to visit and edit.


    Modelines

OK, so you want to generate a modeline for X for your HDTV / Projector...


        What's a modeline?

It tells your videocard how to draw a picture on your display 
(monitor/TV/projector etc) Each display has different capabilities. Most 
obviously they have different sizes and resolutions.

Each modeline describes how to achieve a given resolution.


        And why would I care?

When ever you look at something on your display it's shown at a certain 
resolutions and certain refresh frequencies. Some displays will happily 
accept video signals for different resolutions and convert them for you 
- the problem is that this can reduce the quality of the video signal. 
So ideally you'll get myth or xine to convert your signal once to the 
right resolution for your tv/projector and avoid unnecessary degradation.

Simply - it can look better.


      My Problem

I have a Panasonic AE100 LCD projector. I want to set it up to get the 
best posible resolution.

The book tells me it has a native pixel size of 858 x484. It also lists 
the video modes it supports with various frequencies.

I pick 856 x 480 with the following frequencies:

    *

      30.057 kHz Horiz scanning frequency

    *

      60.114 Hz Vert scanning frequency

    *

      31.500 MHz Dot clock

So the problem is "How do I create a modeline given this input data?"

A google returns a few options (some listed below) the most promising 
seemed to be videogen.

Being a Debian user a quick apt-get install videogen has me up and running.

man videogen is useful - the most important options being:

      -m=XxY describes the mode you want a modeline for

      -mdc=xx sets the maximum Dot-clock /of the videocard/, not the
      monitor

      -mhf=xx sets the maximum horizontal frequency for your monitor

      -mvf=xx sets the maximum vertical frequency for your monitor

      -dvf=xx sets the desired vertical frequency for your monitor (I
      use pal so I'd like it to refresh at 50Hz)

It's not obvious how to use it though, the HTPC How To 
<http://www.mythtv.info/moin.cgi/HowTo> suggestion didn't work but after 
a bit this command produces the desited results:

$ videogen -m=856x480 -mdc=34 -mhf=31 -mvf=61 -dvf=60.114 -nnv
Modeline "856x480" 33.27 856 880 896 1096 480 482 483 505  # 33 MHz, 30.4 kHz, 60.1 Hz

It turns out that only some resolutions are allowed; eg 
videogen -m=858x480 won't work and gives

argument 2 (-m=858x480) has an invalid parameter

OK, now we have a modeline - time to use it.

Edit your XF86 Config <http://www.mythtv.info/moin.cgi/F86Config>-4 file 
and find the Section "Monitor" part. Now simply insert the modeline 
generated above. Note the part in "s is the name of this mode.

Now find the Section "Screen" part of the file. There should be a 
"Display" subsection and that should have a Modes line. This line 
contains a space seperated list of mode names - you cycle through these 
when you press *Ctrl Alt +* and *Ctrl Alt -* (that plus and minus keys) 
As always an example should make it easier:

Section "Screen"
        Identifier "ProjScreen"
        Device     "GeForce"
        Monitor    "Projector"
        DefaultColorDepth 24
        DefaultFbbpp  32
        SubSection "Display"
                Depth     24
                FbBpp     32
                Modes "856x480"
        EndSubSection
EndSection



Now start X and you should have a shiny new mode.

Useful Links:


        Linux HTPC How-to

In particular this page:

      http://www.sllug.org/how-to/linux-htpc/video_card_configuration.html 

provides a useful overview.


        Videogen

http://www.dynaweb.hu/opensource/videogen/

It's similar to Powerstrip.


        A quick calculator

http://www.hut.fi/Misc/Electronics/faq/vga2rgb/calc.html

It needs Front & back porch and sync pulse info - I'm not sure what they 
are. Can I get this from the h/v frequency?




More information about the mythtv-users mailing list