Search

January 6, 2013

Nvidia Overscan in Ubuntu 12.10

A few weeks ago I upgraded my HTPC to Ubuntu 12.10 and was treated to a nasty surprise: the overscan settings for the nvidia driver were no longer recognized. The HTPC is connected to my television (naturally) which is a 40" LG LCD HDTV. If you have ever tried to connect your PC to an HDTV before, you probably encountered the problem of that the visible portion of the screen is smaller than the drawable portion of the screen. The result is that the edges of the screen are not visible. In my case that meant the dash and the universal menu of Unity could not be seen. That makes for a less than usable experience.

In the past nvidia included an overscan setting slider in the GUI configuration tool (nvidia-settings). When I opened it up however, the setting was nowhere to be found. A short time on google confirmed the worst: nvidia had removed the setting.

The good news is that the setting can be twiddled via the command line. Then, once you find the magic numbers that work with your particular graphics card and monitor, you can put them in your .nvidia-settings-rc file to automatically apply them on login. Also, the command is safe: if you try something that would push the screen too far, the driver simply ignores it.

The first step is to run the command with a bunch of values until you find the values that work best:

nvidia-settings --assign 0/CurrentMetaMode="DFP-0: 1280x720 { ViewPortIn=12
80x720, ViewPortOut=1190x680+44+20 }"

The first set of numbers, the ViewPortIn and the value before that, are determined by the native resolution of your HDTV. Mine is a 720p, so the native resolution is 1280x720. The next set of numbers, the ViewPortOut, are the ones you will want to experiment with. They are telling the driver how to transform the viewport so the screen ends up in the visible area of the HDTV. The first part, the 1190x680, indicates how much to scale the viewport. The second part, +44+20, indicates how much to shift the image.

Once you have the values you want, edit your ~/.nvidia-settings-rc file adding the following at the end:

0/CurrentMetaMode=DFP-0: 1280x720 { ViewPortIn=1280x720, ViewPortOut=1190x680+44+20 }

Obviously you will want to use the correct values for your system.

4 comments:

  1. Wow! I ran into this problem some time ago and haven't been able to fully fix it yet. I did mess around with the scaling values until I got them right. But I hadn't yet found a way to permanently adjust the settings so I've been pasting the adjustments into the terminal every time I turn the TV and/or computer back on. This will be so helpful!!!

    However, I'm enough of a noob to not fully understand how/where to type this command in. What do I have to type to get into the nvidia-settings-rc file so that I can add my command?

    If it helps, here's my specific adjustments:

    nvidia-settings --assign 0/CurrentMetaMode="DFP-1: 1920x1080 { ViewPortOut=1800x1020+60+30 }"

    I can't thank you enough for this!!

    ReplyDelete
    Replies
    1. Run the command "gedit ~/.nvidia-settings-rc" (either in a terminal or via Alt-F2). Add everything after --assign in your command to the end of the file. If there already exists a line beginning with 0/CurrentMetaMode replace it instead.

      Delete
    2. I'm having the same problem as Tim below. I enter the new setting at the end of the rc and save it, but every time I shut my monitor/TV off and turn it back on, it's like it resets to the initial configuration and my new command is gone. Is there a way to stick it so that it doesn't default to the original settings?

      Delete
  2. Thanks for the great post I finally got my screen to fit into my tv. But I'm having an issue with the last part when I simply add 0/CurrentMetaMode="DFP-1: 1920x1080 { ViewPortIn=1920x1080, ViewPortOut=1820x1020+45+30 }" to the end of my nvidia rc it seems to never work. Am i missing a step?

    ReplyDelete