Slashdot Mirror


Configuring Monitors in X

Another Anonymous Coward submitted this question: " Everyone that I know, myself included, has had some trouble getting X11 configured under Linux. If your monitor doesn't happen to "work with X" right off the bat, it seems that you're out of luck. Why is it that I can plug my generic 17" monitor into any old Windows box and get 1024x768, but it won't work at ALL with my Linux box yet I can plug in my Sony Trinitron 15" and it works just fine? We're using the latest version of X, of course. Even Windows 3.1 didn't have the sort of monitor problems that plague X. I see this as being one of the biggest installation headaches for beginners *and* advanced users of the Linux OS." Ah yes: Modelines. I know there are programs that help with this. Which ones do you all suggest?

Actually, I could have sworn we had done an Ask Slashdot on this, but as time passes improvements are made, so I don't mind doing another article on the subject. Just via a quick search on the web, I've found:

  • Modeline
  • and kvideogen (I'd bet there is a Gnome version of this as well)
  • This page that has a simple, web based, Modeline calculator.

So if anyone has tried the above resources, we'd be interested in hearing your thoughts on how they work. If you know of other Modeline resources, please post links. I don't see why X11 has to have the reputation as "difficult to configure" when the tools to do such are out there.

Just a thought: Would including Modeline functionality in configurators like Linuxconf be a good idea?

3 of 408 comments (clear)

  1. Can we leech of Windows? by specht · · Score: 5

    I've done more than my share of pencil and paper work in order to configure X11 (even before the days of XFree86). What still puzzles me is that for Windows you get some .inf files with your monitor that contains everything there is to know about it (at least I assume that's what these files are for, I acutally never opened one).

    Would it be possible to just use these .inf files and extract just the information XFree86 needs to configure the monitor?

  2. Modelines? by redhog · · Score: 5

    It is strange that the Xfree86 manual is that bad at describing how modelines works. It even uses the word "magic"! In fact, the SVGATextMode docs are quite good at describing, by example, how they work. The description is in the file creating_textmodes_from_scratch.HOWTO in the SVGATextMode dist.
    In fact, modelines aren't as hard as people likes to say. I'l try to explain them roughtly (Please read the SVGATextMode doc before creating any modelines, though, while I won't cover all aspects):
    A modeline consists of five parts - name, dot pitch, horizontal values, vertical values and optional parameters. The name is a name to assign the modeline to be able to refere to it later on (In the screen section, for instance). The dot pitch is the number of pixels to draw each second, in Mhz (Note that you should check the abilities of your graphics card before setting this value). Each of the vertical and horizontal part has the same format. They consists of bfour values each - the size of the visible area, the sync start and end and the size of the total area.
    A monitor needs some extra "black" space at the end of each line and at the end of the screen. The visible area, plus this "margin" forms the total area. For most monitors, the unviewable area should be about 25% of the visible area horizontally, and about 5% of the visible area vertically.
    The sync is a signal sent after each completed line, and after each completed screen, in order for the monitor to start drawing pixels at the same moment as the graphics card starts sending pixels.
    Note that the start and end of the sync is stated in pixels, not microseconds (Remember that we know the number of pixels per second). This may crate the somewhat obscure situation of sync start and ends being fragments of pixels (i.g. 800.25).
    For most monitors, this signal is to be emitted just after the visible area. The vertical sync should be just a few lines for most monitors. The horizontal sync should be about 2 microseconds in with, or for really low-frequency monitors, somewhat longer (3ms).
    The start of the syncs is what centers your visible area on the monitor. You may experiment with adding or subtracting some microseconds to them after calculating them, to center the image nicely.
    Note that the start of the sync may _never_ be before the end of the visible are as well as the end of it may _never_ end after the end of the total area!
    As a last not, there is one parameter to add at the end of the modeline that I'l describe: DoubleScan. It forces the graphics card to draw each line twice. This will reduce the the resolution to the half vertically. This is to any use mostly when you need some low resolution (For displaying MPEG videos, for instance) on a fixed sync monitor.


    --
    --The knowledge that you are an idiot, is what distinguishes you from one.
  3. xvidcalc by gregbaker · · Score: 5
    I've been working on a program recently that does just these calculations. It's still pretty rough, but you can try it if you want (seems like a good opportunity to get some testers).

    It gets better refresh rates than KVideoGen or the other calculators I've found.

    If you have Perl/Tk, you can run the X version with the command xvidcalc, or the command line version with vidcalc (try "vidcalc -h" first).

    I did a lot of work on the caclulations to ensure that the resulting modeline was optimal in terms of refresh rate. You have to enter the specs for your monitor (either in the X interface or a settings file), so it's not for the faint of heart; you should probably look through ESR's VideoTimings HOWTO first.

    Let me know how it works for you, ggbaker@sfu.ca.

    Greg