NVIDIA Linux Overscan
I was away for a few months and come back to find NVIDIA removed the option to calibrate “overscan” from their driver, in Linux at least, I do not know how things are in Windows land these days. From their release notes:
Removed overscan compensation configurability from NV-CONTROL and nvidia-settings. This can be configured, with finer granularity, through the ViewPortIn and ViewPortOut MetaMode attributes. See “Configuring Multiple Display Devices on One X Screen” in the README for details.
Overscan was useful to fix an issue I have on my second screen. The image was going “beyond” the screen. I could put my mouse upwards and go completely outside of the view, maximized windows would have their titlebar completely out of view, etc. Older NVIDIA settings had an option called “Overscan” and a simple slidebar to adjust things.
In the current version (304.34 on my ArchLinux box) this option has been removed from the GUI and the new command line options took me a few times to get right. In the end it is obvious, but you have to find it. Especially since the few things I found did not seem to take into account having a second screen.
To sketch my situation: I have two screens, one is my main screen at 1680x1050, the other has a double use as my TV. NVIDIA reports it as 1920x1080, I keep it to the right of my main screen. It is this second screen that gives me troubles, having areas on all sides of it that are simply invisible. I used to set overscan to “100” and that would fix it for me. I had found the value “100” by simple trial-and-error.
To adjust to this new method, you have to set the correct MetaModes
in your
xorg.conf
file or adjust them on the fly with nvidia-settings
. I will show
the solution with nvidia-settings
, though the edit to xorg.conf
should be
simple enough to make out with the info provided here. We will be using the
command like this
nvidia-settings -a CurrentMetaMode="VALUE"
Even though I only need to change options for the second screen, I also have to
enter values for the first one. If not, NVIDIA will think you are ditching the
first screen altogether. First off we need the names of our screens, this
information I found in the NVIDIA X Server Settings GUI under the tab “X Server
Display Configuration”. For me, screen one is DFP-0
and screen two is
DFP-1
. Updating our command with this info:
nvidia-settings -a CurrentMetaMode="DFP-0: VIEWINFO, DFP-1: VIEWINFO"
Where VIEWINFO
is of the format
widthxheight+offset_width+offset_height
followed by optional attributes in curly braces. For the first screen, which I
want to keep as-is, I make that the following: 1680x1050+0+0
.
For the second screen, I had to use the extra attributes as well. First off we
mention the dimension as reported by NVIDIA, as well as the position in
relation to the other screen. I wanted it to the right of the first one, so I
added the width of the first one (1680) 1920x1080+1680+0
. Now to make our
overscan adjustment, we use the extra attribute ViewPortOut
. To convert the
earlier mentioned value 100, I assumed this was width pixels (and as far as I
can tell now, that assumption was correct). So to adjust my screen, I had to
subtract 100 width and 100 / 16 * 9=56.25 height, which I rounded to 58 (“/ 16 * 9”
because the screen ratio is 16:9, rounded to even because of dividing by
two further on). This makes for 1820x1022. Now I still had to adjust the screen
position within that monitor. My issue was on each side, so I divided the
just calculated values in half to find the offset. That makes 50 and 29.
Plugging all this info together for my second screen gives
1920x1080+1680+0 { ViewPortOut=1820x1022+50+29 }
Using the info for both screens, the command to run becomes
nvidia-settings -a CurrentMetaMode="DFP-0: 1680x1050+0+0, DFP-1: 1920x1080+1680+0 { ViewPortOut=1820x1022+50+29 }"
Your screens will briefly go blank after entering this, but should pop back correctly rather soon.
Note: Some report that there are applications (like MythTV or XMBC) that have
troubles with this approach. This trouble should be solved by also specifying
ViewPortIn
as a special attribute for the second screen. For example
adjusting the previous command (untested).
nvidia-settings -a CurrentMetaMode="DFP-0: 1680x1050+0+0, DFP-1: 1920x1080+1680+0 { ViewPortIn=1920x1080, ViewPortOut=1820x1022+50+29 }"
Some sources and further reading
- Appendix B. X Config Options, NVIDIA
- Chapter 13. Configuring Multiple Display Devices on One X Screen, NVIDIA
- New Nvidia driver - no overscan compensation?, PCLinuxOS
- Removal of overscan options in 302.07…, nV News
Tom Kenney comments:
I’m using Linux Mint for my HTPC, with HDMI output from the nVidia GT 430 card. The resolution on the TV is reported as 1920x1080, but the actual visible space is 1824x1026. I used the ViewPortIn and ViewPortOut options, and it works well for most apps, but XBMC will not honor these settings if I expand the video to fullscreen (with the \ key while watching, or if XBMC is in fullscreen mode when I start a video).
It was a bit tricky to work out the ViewPortIn and ViewPortOut values, but your article makes it much clearer. Excellent!!!
Anonymous commenter comments:
In case anyone ever looks here, I looked at Xorg.0.log and saw that it determined the resolution to be 1279x720. No idea why. I changed ViewPortIn to be 1281x720 and poof, 1280x720 worked without issues.
Tristan Schmelcher comments:
Thanks for this! I have my computer connected to a plasma TV that cuts off the outer 5% and I used this to counteract it by setting the ViewPortOut dimensions to 95% of the true resolution with offsets set to half of the difference. Working great so far.
I found that the ViewPortIn part was necessary for the Unity top panel in Ubuntu to be sized correctly.