Troubleshooters.Com and T.C Linux Library Present

The Lazy Man's Way to Configuring a Video Card

Copyright (C) 2001 by Steve Litt
[ Linux Library | Troubleshooters.Com | Email Steve Litt | Copyright Notice ]
Remember the bad old days of biting your nails wondering whether XConfigurator would freeze or do something else stupid? Remember those XF86Config files so unfathomable that you refused to touch them? Remember Modelines? Remember when you figured if your install didn't correctly configure your video you were toast?

Forget all that stuff!

XFree86 version 4 enables gives you a safe and sane method of configuring (and reconfiguring) your video. It works with any reasonably mainstream video card and monitor.

Contents

Quick Tips

Video Card Installation Procedures

The following procedure usually produces a working X (GUI) environment. Maybe not an optimal one, but a good one that you can easily optimize with simple edits to your XF86Config-4 file. In rare cases it might overdrive your monitor. That's not a problem. Just Ctrl+Alt+Backspace to kill X and go back to character mode, and then fix the overdrive with a simple change to /etc/X11/XF86Config-4.
  1. Back up your existing XF86Config-4 and XF86Config files in the /etc/X11 directory.
  2. With the old video card in place, set the system to boot to character mode (level 3) rather than GUI mode (level 5). Here are some instructions...
  3. Physically insert the video card taking all necessary static precautions. Make sure power is off, and make sure you're grounded. If your power supply has a power switch, turn it to the zero position. If the power supply doesn't have a power switch, unplug the computer completely because ATX cases have power even when turned off with the front power button.
  4. Connect the monitor cable to the newly inserted video card.
  5. Power up the computer. You should see it count memory and then boot to a login prompt.
  6. Log in as root. Stay in the /root directory.
  7. Run the following command:

  8. XFree86 -configure 2>xf.log
    The preceding command tells the XFree86 server to configure a file called XF86Config.new, sending all messages to xf.log. The log file might be helpful in troubleshooting, but that probably won't be necessary. Note that depending on video card and other things the preceding command could take up to 5 minutes, although it usually completes in less than 30 seconds, and sometimes as quickly as 1 second.
  9. cp -p /root/XF86Config.new /etc/X11/XF86Config-4
  10. Run your normal command to start X. On most computers that command is:

  11. startx
  12. If your monitor overdrives, Ctrl+Alt+Backspace immediately. You fix that problem by configuring the color depth and resolution.
At this point unless your monitor overdrove, you probably have a working (if not optimal) X. Now it's time to optimize your X for your needs.

Optimizing X for Your Needs

So now you have a working but not necessarily optimal video setup, or you have an overdrive condition. Let's start by configuring color depth and resolution.

Configuring color depth and resolution

XFree86 typically configures XF86Config.new to the finest resolution the monitor can support. Unless you have a huge monitor you don't want it that fine. Also, you might want to decrease the color depth for more performance or increase it for more faithful color reproduction. And of course if you're experiencing monitor overdrive, you'll want to decrease your resolution, color depth or both.
  1. Back up your new /etc/X11/XF86Config-4 so if you mess up you can start over.
  2. Edit /etc/X11/XF86Config-4
  3. Go down to the line saying Section "Screen". This is the section governing color depths and resolutions.
  4. Notice the structure of this section. It starts with header lines describing the device, monitor, and maybe some other things. Then it has a number of subsections, one for each color depth.
  5. In the header section define your preferred color depth with the following line:

  6. DefaultColorDepth 16
    The preceding example sets color depth to 16, but you could choose any number with a subsection.
  7. Now go down to the subsection for the color depth you chose, and insert the resolutions you'd like to see:

  8. Modes       "800x600"
    Note that the resolution must be something supportable by the monitor. XFree86 cannot compensate for an inadequate monitor.
    The preceding example sets the resolution to 800x600. You can choose any common resolution such as 640x480, 800x600, 1024x768,
  9. If you want the ability to pan in a reduced resolution, append smaller resolutions. For instance, the following allows you to switch to a panning 640x480 using the Ctrl+Alt+Plus (that's the keypad plus), use the following line:

  10. Modes "800x600" "640x480"
  11. Save the file.
  12. Run X however you usually do.
  13. If the resolution or color depth is not what you configured, or if you see screen flicker on a monitor you know should be able to support a high enough refresh rate to cancel flicker, you need to configure the monitor section...

Configuring Your Monitor Section

If your XFree86, video card and monitor are standard and fairly recent, XFree86 probably configured the horzontal sync and vertical refresh rate of the monitor. If not, use the xf86cfg program (new with XFree86 version 4.x) to snoop on the monitor. In worst cases, you may need to configure the lines manually. Look up your monitor in your computer's Monitors database. You can find that database using the locate command:
locate -i Monitors | less
On my Mandrake 8 system the file is at /usr/share/ldetect-lst/MonitorsDB, but of course your mileage may vary.

The proper file will have semicolon delimited records of the following form:

#   <Manufacturer>; <Monitor name>; <EISA ID (if any)>; <horiz sync in Khz>; <verc sync in Hz>
Find your monitor or a similar but less sophisticated one, and try its suggested settings. If worst comes to worst you can try some of the Generic settings.

Once you have your horizontal and vertical ranges, input them into the monitor section. Here's what XFree86 autodetected for my KDS Visual Sensations 19" monitor using a GeForce2 MX400 64meg card:

Section "Monitor"
        Identifier   "Monitor0"
        VendorName   "KDS"
        ModelName    "1983"
        HorizSync    30.0 - 95.0
        VertRefresh  50.0 - 160.0
EndSection
DO NOT copy the preceding to your system -- you have a different monitor. If you don't have a HorizSync nd VertRefresh line, you'll default to 640x480 and you'll get screen flicker. If you set too aggressive numbers on these two settings, you'll overdrive the monitor. Try to get fairly accurate.

Speeding Up Your Mouse

Default mouse resolution on typical Linux systems is much too small, meaning you must move your mouse many inches to traverse the screen. Can you spell repetitive motion injury?

Some people try to "speed up" the mouse with an xset command, but an xset command sufficient to address the issue makes the mouse uncontrollable. Instead, fix the mouse resolution.

Go to the InputDevice section corresponding to your mouse, and within that section, insert the following line:

Option      "resolution" "1600"
Restart X and your mouse should be much faster. If your mouse pointer tends to "get caught" or "snag" on parts of the screen, you can try reducing the resolution to a value like 400. Try to achieve the minimum value that gives you maximum pointer travel per inch of mouse movement.

Fonts

If your fonts aren't right, we have a discussion of fonts entitled Fixing those unreadable cookie crumb fonts. That discussion might help, especially if you have a Mandrake system.

Summary

Video configuration was a trial by fire in the bad old day of XFree86 version 3.X. Configuration files were convoluted and nasty, configuration programs often blew X to pieces, and many people reinstalled to get their video back. Those days are gone. Now we have XFree86 version 4.X, with its wonderful configuration facility.

Start by reading the Quick Tips section for tips so you don't make silly mistakes. Then you can do the simple configuration.

Today, with XFree86 version 4.X you can use the following command:

XFree86 -configure 2>xf.log
to create a working, if not totally perfect, X configuration. Better yet, that command produces a very simple configuration file. The Video Card Installation Procedures section walks you through use of the preceding command.

The resulting configuration file will be simple and will probably work, but you'll want to customize it for resolution, color depth, mouse resolution and fonts. The Optimizing X for Your Needs section discusses those issues.

Steve Litt

Other Video Resources




See also: [ Linux Library | Troubleshooters.Com | Email Steve Litt | Copyright Notice ]

Copyright (C)2001 by Steve Litt. -- Legal