2010-06-05, 09:41
Hi all,
I discovered three useful linux/xorg configuration tips that I want to share with the community, and that I hope will be useful to others.
I have an ASRock ION330HT running Ubuntu Lucid 10.04, hooked up via HDMI to a receiver (although these tips would apply as well if you have it hooked up via HDMI directly to a TV). I had 3 problems with the xserver that bugged me.
The first one was that I was suffering from overscan, eg the screen didn't fit entirely on the TV, and the top/bottom/left/right of the screen was not visible (most specifically, the top and bottom panel were not visible, so I always had to guess where the menus and logout button were). The nvidia-settings program contains a slider in one of its screens that you can use to adjust that, and to make your screen fit your TV.
So I logged on the PC and used the nvidia-settings GUI to correct my overscan (Alt-F2 to get a terminal, then start /usr/bin/nvidia-settings). I saved those settings to /home/xbmc/.nvidia-settings-rc. However, after logging out and in again, my overscan issue was back. So I fired up nvidia-settings again, and presto, overscan issue was immediately corrected: nvidia-settings loads the $HOME/.nvidia-settings-rc file automatically when you start it and applies those settings. But I did not want to have to run nvidia-settings manually everytime I started up this PC, so I needed to find a way to run this automatically.
In order to have these settings automatically applied for all users on the system I did the following:
The second issue I had was that these settings would only be applied after logon, which meant that my GDM login screen still suffered from the overscan problem, which caused me not to be able to see the bar at the bottom of the screen where you select the type of session (eg. GNOME, XBMC, KDE) that you want to start after login. In order to solve that:
This /etc/gdm/Init/:0 file will be executed by gdm when starting the X-server on display :0.
The final problem I had was that when I started the PC while the receiver was off, the Nvidia drivers would not detect the HDMI receiver, and therefore X would fall back to a "fail safe" session, which it would presumably run on the VGA connection of the PC. After switching on the receiver (and TV) you would therefore not see anything on the TV. Since this system is supposed to be used by my wife, I needed to come up with either a fix for that, or with an easy to execute procedure to recover from this. For myself, I'd SSH in from my laptop and kill the X failsafe session and restart GDM. For my wife that's not an option. Initially I tried to enable CTRL-ALT-BACKSPACE, which I succeeded in. That would shut down the failsafe X session. However, it would not restart the GDM session automatically. So that was not the solution I was looking for.
Then I had a careful read through the manual of the Nvidia xorg driver, and discovered 2 xorg.conf Options that fixed this issue for me:
First, I used the nvidia-settings GUI to "acquire EDID" for the display that represents my receiver (DFP-0). I told nvidia-settings to save that EDID information to /home/xbmc/.DFP-0.edid.bin. The EDID information is usually retrieved dynamically by the nvidia driver from the connected display, and it described the capabilities of that display. If your receiver/TV is off while starting the X-server, it will not be able to obtain this information, and therefore the X-server will fall back to one of the other available displays in the nvidia xorg driver (eg CRT-0).
I modified the "Screen" section in /etc/X11/xorg.conf to add the following 2 options (in bold):
This does two things:
To test this, switch your receiver/TV off, and reboot your PC. I first logged on via SSH to make sure that everything (eg. /usr/bin/X, gdm) was running, and then switched my receiver+tv on, and presto: I was presented immediately with the XBMC home screen. Wife happy... (and me too).
Hope this helps somebody,
Regards
I discovered three useful linux/xorg configuration tips that I want to share with the community, and that I hope will be useful to others.
I have an ASRock ION330HT running Ubuntu Lucid 10.04, hooked up via HDMI to a receiver (although these tips would apply as well if you have it hooked up via HDMI directly to a TV). I had 3 problems with the xserver that bugged me.
The first one was that I was suffering from overscan, eg the screen didn't fit entirely on the TV, and the top/bottom/left/right of the screen was not visible (most specifically, the top and bottom panel were not visible, so I always had to guess where the menus and logout button were). The nvidia-settings program contains a slider in one of its screens that you can use to adjust that, and to make your screen fit your TV.
So I logged on the PC and used the nvidia-settings GUI to correct my overscan (Alt-F2 to get a terminal, then start /usr/bin/nvidia-settings). I saved those settings to /home/xbmc/.nvidia-settings-rc. However, after logging out and in again, my overscan issue was back. So I fired up nvidia-settings again, and presto, overscan issue was immediately corrected: nvidia-settings loads the $HOME/.nvidia-settings-rc file automatically when you start it and applies those settings. But I did not want to have to run nvidia-settings manually everytime I started up this PC, so I needed to find a way to run this automatically.
In order to have these settings automatically applied for all users on the system I did the following:
Code:
sudo vi /etc/xprofile
>>> insert the following lines
CONFIG=/home/xbmc/.nvidia-settings-rc
/usr/bin/nvidia-settings -load-config-only --config=$CONFIG
The second issue I had was that these settings would only be applied after logon, which meant that my GDM login screen still suffered from the overscan problem, which caused me not to be able to see the bar at the bottom of the screen where you select the type of session (eg. GNOME, XBMC, KDE) that you want to start after login. In order to solve that:
Code:
sudo vi /etc/gdm/Init/:0 # colon zero
>>> insert the following lines
CONFIG=/home/xbmc/.nvidia-settings-rc
/usr/bin/nvidia-settings -load-config-only --config=$CONFIG
. /etc/gdm/Init/Default
This /etc/gdm/Init/:0 file will be executed by gdm when starting the X-server on display :0.
The final problem I had was that when I started the PC while the receiver was off, the Nvidia drivers would not detect the HDMI receiver, and therefore X would fall back to a "fail safe" session, which it would presumably run on the VGA connection of the PC. After switching on the receiver (and TV) you would therefore not see anything on the TV. Since this system is supposed to be used by my wife, I needed to come up with either a fix for that, or with an easy to execute procedure to recover from this. For myself, I'd SSH in from my laptop and kill the X failsafe session and restart GDM. For my wife that's not an option. Initially I tried to enable CTRL-ALT-BACKSPACE, which I succeeded in. That would shut down the failsafe X session. However, it would not restart the GDM session automatically. So that was not the solution I was looking for.
Then I had a careful read through the manual of the Nvidia xorg driver, and discovered 2 xorg.conf Options that fixed this issue for me:
First, I used the nvidia-settings GUI to "acquire EDID" for the display that represents my receiver (DFP-0). I told nvidia-settings to save that EDID information to /home/xbmc/.DFP-0.edid.bin. The EDID information is usually retrieved dynamically by the nvidia driver from the connected display, and it described the capabilities of that display. If your receiver/TV is off while starting the X-server, it will not be able to obtain this information, and therefore the X-server will fall back to one of the other available displays in the nvidia xorg driver (eg CRT-0).
I modified the "Screen" section in /etc/X11/xorg.conf to add the following 2 options (in bold):
Code:
Section "Screen"
# Removed Option "metamodes" "nvidia-auto-select +0+0"
Identifier "Screen0"
Device "Device0"
Monitor "Monitor0"
DefaultDepth 24
Option "TwinViewXineramaInfoOrder" "CRT-0"
Option "TwinView" "0"
Option "metamodes" "1360x768 +0+0"
[b]
Option "ConnectedMonitor" "DFP-0"
Option "CustomEDID" "DFP-0:/home/xbmc/.DFP-0.edid.bin"
[/b]
SubSection "Display"
Depth 24
EndSubSection
EndSection
This does two things:
- It forces the nvidia driver to use DFP-0 (digital flat panel, eg the HDMI output)
- It tells the nvidia xorg driver what the capabilities of the connected display are (eg. the capabilities of my receiver)
To test this, switch your receiver/TV off, and reboot your PC. I first logged on via SSH to make sure that everything (eg. /usr/bin/X, gdm) was running, and then switched my receiver+tv on, and presto: I was presented immediately with the XBMC home screen. Wife happy... (and me too).
Hope this helps somebody,
Regards