You are here

Adjusting display / screen position using xvidtune

Submitted by Druss on Mon, 2007-05-21 14:09

Many moons ago, I had to run an update to the nVidia driver for my Kubuntu box. After installing it, I found that the next time I ran X, my display was offset by about 50px to the right. Normally, it would have been possible to fix this via the monitor, most of which have a convenient "auto" button to solve such issues. However, my set-up involves the use of a KVM switch, which allows me to use a single keyboard, mouse and monitor for more than one PC (four in my case). Ergo, I couldn't just click the auto button to sort this issue out as that would mean ruining the display on the other three systems. I was too lazy to search for a fix at the time, but I finally got annoyed enough to fix it last night.

The fix goes as follows:

  1. Open up Konsole / your terminal of choice and navigate to /etc/X11.
  2. Back up your xorg.conf file : sudo cp xorg.conf xorg.conf.pre.xvidtune.
  3. Type sudo nano xorg.conf.
  4. Open up another Konsole terminal and type xvidtune. Read and heed the warning message.
  5. To make things easier at a later stage, note down all the values listed on a piece of paper or in a text editor.
  6. Use the left, right, up, down etc. buttons to adjust the display. Preferably, do this one click at a time and use the test button to check the results.
  7. The values that control horizontal alignment are HSyncStart and HsyncEnd. Similary, vertical positioning is controlled by VSyncStart and VsyncEnd respectively. HTotal and VTotal control width and height.
  8. Once you are satisfied with the display position, note down the values of the variables you have modified.
  9. Go back to the terminal where you are editing xorg.conf. Look for something like Section "Monitor" where you will find a ton of modeline listings.
  10. Look for the modeline pertaining to your current display resolution - for e.g. 1280x1024. Use the values from step 5 to isolate the correct line.
  11. Once you have the correct line, you will very likely not know which number to replace with the new variables. Again use the values from step 5 to narrow things down.
  12. Replace the values with the new values. For e.g., on my machine the original line was:
    modeline  "1280x1024@60" 108.0 1280 1328 1440 1688 1024 1025 1028 1066 +hsync +vsync.
    After adjusting my display's horizontal position, the new line with new HSyncStart and HSyncEnd values looked like the following:
    modeline  "1280x1024@60" 108.0 1280 1348 1460 1688 1024 1025 1028 1066 +hsync +vsync.
  13. Once this is done, save the file by pressing CTRL + X, close xvidtune and other applications and restart your display manager using CTRL + ALT + Backspace.
  14. Ideally, you will see your screen correctly positioned now. If you encounter any problems or require more information on xvidtune, type man  xvidtune in a terminal to bring up the help page. If you would like to go back to the old configuration, use the backup file you created in step 2 to overwrite the current xorg.conf and restart your display manager again.

Comments

When i click test, i get: sorry you have requested a mode-linethat is not possible, or not supported by your hardware configuration.