Archive:Configuring resolution via xorg.conf: Difference between revisions
m (Bot: Automated text replacement (-class="wikitable" +class="prettytable" & -Available Tags +Available tags & -<source +<syntaxhighlight & -</source> +</syntaxhighlight>)) |
m (Bot: automated adding of 'enclose="div"' to syntaxhighlight) |
||
Line 20: | Line 20: | ||
{{how-to | {{how-to | ||
|Step1= | |Step1= | ||
<syntaxhighlight lang="bash">cp /etc/X11/xorg.conf /etc/X11/xorg.conf.bak</syntaxhighlight> | <syntaxhighlight lang="bash" enclose="div">cp /etc/X11/xorg.conf /etc/X11/xorg.conf.bak</syntaxhighlight> | ||
Then generate a new clean xorg.conf to have a base which to build on later, | Then generate a new clean xorg.conf to have a base which to build on later, | ||
Line 27: | Line 27: | ||
|Step2= | |Step2= | ||
<syntaxhighlight lang="bash">sudo nvidia-xconfig -s --no-logo --no-composite --no-dynamic-twinview --force-generate --output-xconfig=/etc/X11/xorg.conf</syntaxhighlight> | <syntaxhighlight lang="bash" enclose="div">sudo nvidia-xconfig -s --no-logo --no-composite --no-dynamic-twinview --force-generate --output-xconfig=/etc/X11/xorg.conf</syntaxhighlight> | ||
|Step3= | |Step3= | ||
Now we need to edit the new xorg.conf to add some options. | Now we need to edit the new xorg.conf to add some options. | ||
<syntaxhighlight lang="bash">sudo nano /etc/X11/xorg.conf</syntaxhighlight> | <syntaxhighlight lang="bash" enclose="div">sudo nano /etc/X11/xorg.conf</syntaxhighlight> | ||
then add the following lines in the correct section of that file: | then add the following lines in the correct section of that file: | ||
<syntaxhighlight lang="xml">Section "monitor" | <syntaxhighlight lang="xml" enclose="div">Section "monitor" | ||
Option "ExactModeTimingsDVI" "true" | Option "ExactModeTimingsDVI" "true" | ||
Option "DPI" "96 x 96" | Option "DPI" "96 x 96" | ||
Line 46: | Line 46: | ||
<syntaxhighlight lang="xml">Section "Device" | <syntaxhighlight lang="xml" enclose="div">Section "Device" | ||
Option "ModeValidation" "NoVesaModes, NoXServerModes"</syntaxhighlight><br /> | Option "ModeValidation" "NoVesaModes, NoXServerModes"</syntaxhighlight><br /> | ||
Line 59: | Line 59: | ||
Kill xbmc if it's running by | Kill xbmc if it's running by | ||
<syntaxhighlight lang="bash">sudo stop xbmc</syntaxhighlight> | <syntaxhighlight lang="bash" enclose="div">sudo stop xbmc</syntaxhighlight> | ||
Then we need to setup a logfile which logs your '''TV/AVR''' EDID modes: | Then we need to setup a logfile which logs your '''TV/AVR''' EDID modes: | ||
<syntaxhighlight lang="bash">cd ~ | <syntaxhighlight lang="bash" enclose="div">cd ~ | ||
sudo X -verbose 6 > ~/xlog.txt 2>&1</syntaxhighlight> | sudo X -verbose 6 > ~/xlog.txt 2>&1</syntaxhighlight> | ||
Line 108: | Line 108: | ||
To create a modeline from this is easy. From my example above the first line would be "1920x1080" and then 74.25 and then 1920 2008 and 2052 2200 and so on. you just read the values from top to bottom. | To create a modeline from this is easy. From my example above the first line would be "1920x1080" and then 74.25 and then 1920 2008 and 2052 2200 and so on. you just read the values from top to bottom. | ||
So in this example the modeline that section gives me would be: | So in this example the modeline that section gives me would be: | ||
<syntaxhighlight lang="xml">ModeLine "1920x1080_24" 74.16 1920 2558 2602 2750 1080 1084 1089 1125 +hsync +vsync</syntaxhighlight> | <syntaxhighlight lang="xml" enclose="div">ModeLine "1920x1080_24" 74.16 1920 2558 2602 2750 1080 1084 1089 1125 +hsync +vsync</syntaxhighlight> | ||
}} | }} | ||
Line 116: | Line 116: | ||
|Step1= | |Step1= | ||
Issue from terminal: | Issue from terminal: | ||
<syntaxhighlight lang="bash">sudo nano /etc/X11/xorg.conf</syntaxhighlight> | <syntaxhighlight lang="bash" enclose="div">sudo nano /etc/X11/xorg.conf</syntaxhighlight> | ||
|Step2= | |Step2= | ||
Then add from what you wrote down earlier. | Then add from what you wrote down earlier. | ||
<syntaxhighlight lang="xml">Section "Monitor" | <syntaxhighlight lang="xml" enclose="div">Section "Monitor" | ||
HorizSync 15 - 50 | HorizSync 15 - 50 | ||
VertRefresh 48 - 62 | VertRefresh 48 - 62 | ||
Line 126: | Line 126: | ||
(or edit the ones there already if your xorg.conf already contains some modelines) | (or edit the ones there already if your xorg.conf already contains some modelines) | ||
<syntaxhighlight lang="xml">SubSection "Display" | <syntaxhighlight lang="xml" enclose="div">SubSection "Display" | ||
Modes "1920x1080"</syntaxhighlight> | Modes "1920x1080"</syntaxhighlight> | ||
{{redv|IMPORTANT:|This line must match the modeline you created ! In this example it was "'''1920x1080'''", However '''"1280x720"''' Modelines are also ok if your TV is only '''HD Ready'''}} | {{redv|IMPORTANT:|This line must match the modeline you created ! In this example it was "'''1920x1080'''", However '''"1280x720"''' Modelines are also ok if your TV is only '''HD Ready'''}} | ||
Line 133: | Line 133: | ||
|Step4= | |Step4= | ||
Start xbmc by running it: | Start xbmc by running it: | ||
<syntaxhighlight lang="bash">sudo xbmc start</syntaxhighlight> | <syntaxhighlight lang="bash" enclose="div">sudo xbmc start</syntaxhighlight> | ||
You should get a nice correct screen, make sure to go into settings - screen and calibrate/adjust your new resolution. | You should get a nice correct screen, make sure to go into settings - screen and calibrate/adjust your new resolution. |
Revision as of 06:42, 14 March 2014
Outline
The xorg.conf is a integral part of running XBMC in X via for e.g. xinit in some controllable manner. While in recent Linux the device drivers have improved considerably and deem xorg.conf unneeded, it still has its niche.
If you ever had problems getting the correct resolution or correct modelines on your HTPC this is an easy guide. You can also use this guide to tweak 23.976p and 24p modelines for smoother playback..
Introduction
This instructions and methods outlined here should be quite "generic", use this guide on your own risk. if you end up without a picture on your screen restore the backup xorg.conf or rename existing if no backup exists. References[1][2][3]
Preparing xorg.conf for tweaking
Backing up any existing xorg.conf is a integral step in assuring your can revert any errors.
1 | cp /etc/X11/xorg.conf /etc/X11/xorg.conf.bak Then generate a new clean xorg.conf to have a base which to build on later, Note: You probably can use this for other non-NVidia systems, this is something you need to research how-to generate a xorg.conf for ATI or Intel and if you need one to begin with. feel free to update this guide. |
---|---|
2 | sudo nvidia-xconfig -s --no-logo --no-composite --no-dynamic-twinview --force-generate --output-xconfig=/etc/X11/xorg.conf |
3 | Now we need to edit the new xorg.conf to add some options.
sudo nano /etc/X11/xorg.conf then add the following lines in the correct section of that file: Section "monitor" Option "ExactModeTimingsDVI" "true" Option "DPI" "96 x 96" Option "DPMS" "false" |
4 | The validation lines vary from setup to setup and depend very much on how well your TV handles EDID,
Telling xorg to ignore EDID may result in low resolution being shown in xbmc, if you dont offer correct and valid modelines for xbmc-xandrc to pick from. In this example we are not disabling EDID data. We definitely dont want vesa modes or xserver modes
Section "Device" Option "ModeValidation" "NoVesaModes, NoXServerModes" Note: Some difficult TV/AVR Edid can be turned off by appending |
Refresh rate & Modelines values
These are very important values to get right.
1 | Now we need to figure out what kind of HorizSync/VertRefresh and resolution your TV/AVR supports by its EDID info:
Kill xbmc if it's running by sudo stop xbmc Then we need to setup a logfile which logs your TV/AVR EDID modes: cd ~ sudo X -verbose 6 > ~/xlog.txt 2>&1 This process needs interrupting via Ctrl+C after a few seconds. In the root of your home directory you will find a xlog.txt |
---|---|
2 | Open the (/home/xbmc/xlog.txt) file and browse until you see something like this section:
(II) NVIDIA(0): Frequency information for SAMSUNG (DFP-0): (II) NVIDIA(0): HorizSync : 26.000-76.000 kHz (II) NVIDIA(0): VertRefresh : 23.000-61.000 Hz (II) NVIDIA(0): (HorizSync from EDID) (II) NVIDIA(0): (VertRefresh from EDID) Write Down or make a note of the HorizSync and VertRefresh values. |
3 | Browse further on (/home/xbmc/xlog.txt) and find all the validated modes. Like the example below:
(II) NVIDIA(GPU-0): Validating Mode "1920x1080": (II) NVIDIA(GPU-0): 1920 x 1080 @ 24 Hz (II) NVIDIA(GPU-0): Mode Source: EDID (II) NVIDIA(GPU-0): Pixel Clock : 74.16 MHz (II) NVIDIA(GPU-0): HRes, HSyncStart : 1920, 2558 (II) NVIDIA(GPU-0): HSyncEnd, HTotal : 2602, 2750 (II) NVIDIA(GPU-0): VRes, VSyncStart : 1080, 1084 (II) NVIDIA(GPU-0): VSyncEnd, VTotal : 1089, 1125 (II) NVIDIA(GPU-0): H/V Polarity : +/+ (II) NVIDIA(GPU-0): Viewport 1920x1080+415+22 (II) NVIDIA(GPU-0): Horizontal Taps 0 (II) NVIDIA(GPU-0): Vertical Taps 0 (II) NVIDIA(GPU-0): Base SuperSample x1 (II) NVIDIA(GPU-0): Base Depth 32 (II) NVIDIA(GPU-0): Distributed Rendering 1 (II) NVIDIA(GPU-0): Overlay Depth 32 (II) NVIDIA(GPU-0): Mode is valid. Note: Make sure that the "(II)NVIDIA(0): Mode is valid." line exists on the one you pick. |
4 | To create a modeline from this is easy. From my example above the first line would be "1920x1080" and then 74.25 and then 1920 2008 and 2052 2200 and so on. you just read the values from top to bottom.
So in this example the modeline that section gives me would be: ModeLine "1920x1080_24" 74.16 1920 2558 2602 2750 1080 1084 1089 1125 +hsync +vsync
|
Assembling your xorg.conf
Now that we got both HorizSync and VertRefresh and a working modeline lets put it in our xorg.conf.
1 | Issue from terminal:
sudo nano /etc/X11/xorg.conf |
---|---|
2 | Then add from what you wrote down earlier.
Section "Monitor" HorizSync 15 - 50 VertRefresh 48 - 62 ModeLine "1920x1080" 74.25 1920 2008 2052 2200 1080 1084 1094 1124 +hsync +vsync Interlace (or edit the ones there already if your xorg.conf already contains some modelines) SubSection "Display" Modes "1920x1080" IMPORTANT: This line must match the modeline you created ! In this example it was "1920x1080", However "1280x720" Modelines are also ok if your TV is only HD Ready |
3 | Now close and save the file by hitting Ctrl+X on your keyboard. Then press Y followed by ↵ Enter |
4 | Start xbmc by running it:
sudo xbmc start You should get a nice correct screen, make sure to go into settings - screen and calibrate/adjust your new resolution. If not try another modeline using same methods and see if that works. Note: Almost ready to use xorg.conf to get you started see Minimal NVidia xorg.conf |
Discussion
See the HOW-TO setup XBMC and Linux with correct resolution for discussion and more information. |