Tuesday, August 17, 2010

Linux Nvidia Overscan Fix

The ATI graphics card in this media center recently died and I decided to avoid all the ATI-related issues and just put a Nvidia card in instead.

This allowed me to upgrade the operating system to the (current) Ubuntu 10.04 Lucid Lynx - well, I decided I like the Linux Mint 9 version a bit better. Nvidia's Linux drivers are much, much better than ATI's.

The last problem remaining was the "overscan" - well, for me it was actually UNDERSCAN, which puts black border all the way around the picture. The newest Nvidia drivers do have a slider and text entry box for overscan correction. This works for some people, but I was in the camp for whom the control panel crashes if I touch the slider.

The default values the Nvidia driver inserts vary and I don't know what determines what they are but I suspect it's tied to resolution as it was "13" at 1024x768 and "8" at 800x600. Most sites that talk about how to fix this talk about "Modelines" and other Xorg.conf fixes, but thanks to THIS POST there is a MUCH easier fix to implement! Enter the following line in a terminal:

$ sudo nvidia-settings -c :0.0 -a 'TVOverScan[TV-0]=15'

Your value may be different, but for my set-up "15" is the magic number that fills the screen. I found that even using "sudo" permissions and saving settings to xorg.conf with the Nvidia Control Panel that this setting didn't stick after a reboot. It's annoying to have to re-enter it on every boot and I also realized it doesn't HAVE to be entered with "sudo" which makes it a cinch to execute at startup. Just take that line and (without the sudo) paste it into a text file and save with a simple name like "nvidia-fix" into your home folder. Right+Click, go to Permissions, and check the "executable" box. Then, I used the "Start Up Programs" control panel and created a new entry with the command to execute that text file as a program (the same as if I'd typed it in a terminal):

./nvidia-fix

and name the entry something that will make it execute AFTER the Nvidia Panel is loaded (I named mine "Overscan").

Now, every time I reboot the media center it loads the Nvidia stuff (with the black border all the way around) and within a second the fix script executes and expands the picture to fill the screen, then XBMC launches full screen. Simple! Fully automatic fix at every boot, no mucking with the Nvidia control panel, no editing your xorg.conf file.

Note: When you run the overscan fix without sudo permissions and you launch the Nvidia Control Panel the fix will be over-ridden by whatever setting is in the panel (the screen will shrink and the black border will re-appear). Make whatever changes you were going to make, save them to your xorg.conf file (if you want them to persist beyond the current session), and then either re-run the overscan fix script or reboot the system so is auto-runs again.

No comments: