2011-07-07, 12:41
This little howto will demonstrate how to solve problems with judder when the automated script from this great guide doesn't work. I've been able to solve many judder problems with this procedure, so you I thought I'd share it with you.
First, make a backup of your current xorg.conf and replace it with this bare xorg.conf:
http://pastebin.com/tUrd26eX
It puts X in debug mode so we can see what's going on. Then start X(BMC), look if it starts properly and then close the X session.
Now let's have a look at the log of this last session, located in /var/log/Xorg.0.log. Search for "Building ModePool for" and scroll down from there until you see something like this for 1920 x 1080 @ 24 Hz:
There may be more than one; it may also look like this:
First calculate if this mode is correct by using the following formula:
PixelClock / HTotal / VTotal * 1.000.000
This number has to be close to 24000/1001, i.e. ~23,976.
The warning about the VertRefresh is probably harmless, but let's get rid of it anyway. Add the line to the Device section. This disables the VertRefresh checks and gets rid of all the modes we don't need anyway.
Then start and close X again and look at the log. Look for "Modes in ModePool for". It should look similar to this (the modes for 1920 x 1080 anyway):
What we want to do is give Nvidia, X and XBMC as little room as possible to make mistakes. So what you should do is make a subsection in the Screen section whitelisting the modes that are permitted:
Like I said we only want the modes that are really necessary. In particular I think you should not pick nvidia-auto-select or any interlaced modi. CEA-861B Formats 16, 33 and 32 should suffice. In my case this translates to
Also, make sure these modes are enforced as strictly as possible by adding the following line to the Device section:
Finally, we don't want the GPU to try and interfere with the video. It will mess up our nice 24p stream, so add this to the Device section as well:
The resulting should look VERY familiar to this:
http://pastebin.com/wBaFGANU.
You can also copy the final version, but ALWAYS verify whether the modes are correct via the xorg log. For instance, sometimes "1920x1080_24" is called "1920x1080_24_0" or "1920x1080_24_1" or something. Always pick the mode "CEA-861B Format 32".
So now you have a good xorg.conf. Now modify your XBMC as following:
- In Settings => System => Video output, set the refresh rate to 60Hz for the most fluid GUI experience and set "Vertical Blank Sync" to "always enabled".
- In Settings => Video => Playback, enable "Adjust display refresh rate to match video" and "Sync display to playback" and set "A/V Sync method" to "Audio Clock". When you're there anyway also enable "VDPAU Studio level colour conversion". It doesn't have anything to do with judder, but it might prevent some chroma smear on TVs that accept 4:4:4 input, but don't really handle it well.
If everything went ok, you shouldn't have any judder anymore!
First, make a backup of your current xorg.conf and replace it with this bare xorg.conf:
http://pastebin.com/tUrd26eX
It puts X in debug mode so we can see what's going on. Then start X(BMC), look if it starts properly and then close the X session.
Now let's have a look at the log of this last session, located in /var/log/Xorg.0.log. Search for "Building ModePool for" and scroll down from there until you see something like this for 1920 x 1080 @ 24 Hz:
Code:
[293848.093] (II) NVIDIA(0): Validating Mode "1920x1080":
[293848.093] (II) NVIDIA(0): 1920 x 1080 @ 24 Hz
[293848.093] (II) NVIDIA(0): For use as DFP backend.
[293848.093] (II) NVIDIA(0): Mode Source: EDID
[293848.093] (II) NVIDIA(0): Pixel Clock : 74.16 MHz
[293848.093] (II) NVIDIA(0): HRes, HSyncStart : 1920, 2558
[293848.093] (II) NVIDIA(0): HSyncEnd, HTotal : 2602, 2750
[293848.093] (II) NVIDIA(0): VRes, VSyncStart : 1080, 1084
[293848.093] (II) NVIDIA(0): VSyncEnd, VTotal : 1089, 1125
[293848.093] (II) NVIDIA(0): H/V Polarity : +/+
[293848.093] (WW) NVIDIA(0): The EDID for ONK TX-NR509 (DFP-2) contradicts itself: mode
[293848.093] (WW) NVIDIA(0): "1920x1080" is specified in the EDID; however, the EDID's
[293848.093] (WW) NVIDIA(0): valid VertRefresh range (48.000-62.000 Hz) would exclude
[293848.093] (WW) NVIDIA(0): this mode's VertRefresh (24.0 Hz); ignoring VertRefresh
[293848.093] (WW) NVIDIA(0): check for mode "1920x1080".
[293848.093] (II) NVIDIA(0): Mode is valid.
There may be more than one; it may also look like this:
Code:
[293848.102] (II) NVIDIA(0): Validating Mode "1920x1080":
[293848.102] (II) NVIDIA(0): 1920 x 1080 @ 24 Hz
[293848.102] (II) NVIDIA(0): Mode Source: EDID
[293848.102] (II) NVIDIA(0): Pixel Clock : 74.16 MHz
[293848.102] (II) NVIDIA(0): HRes, HSyncStart : 1920, 2558
[293848.102] (II) NVIDIA(0): HSyncEnd, HTotal : 2602, 2750
[293848.102] (II) NVIDIA(0): VRes, VSyncStart : 1080, 1084
[293848.102] (II) NVIDIA(0): VSyncEnd, VTotal : 1089, 1125
[293848.102] (II) NVIDIA(0): H/V Polarity : +/+
[293848.102] (WW) NVIDIA(0): The EDID for ONK TX-NR509 (DFP-2) contradicts itself: mode
[293848.102] (WW) NVIDIA(0): "1920x1080" is specified in the EDID; however, the EDID's
[293848.102] (WW) NVIDIA(0): valid VertRefresh range (48.000-62.000 Hz) would exclude
[293848.102] (WW) NVIDIA(0): this mode's VertRefresh (24.0 Hz); ignoring VertRefresh
[293848.102] (WW) NVIDIA(0): check for mode "1920x1080".
[293848.102] (II) NVIDIA(GPU-0): BestFit Scaled and BestFit AspectScaled are identical;
[293848.102] (II) NVIDIA(GPU-0): collapsing BestFit AspectScaled.
[293848.102] (II) NVIDIA(GPU-0): BestFit Centered and BestFit Scaled are identical;
[293848.102] (II) NVIDIA(GPU-0): collapsing BestFit Scaled.
[293848.102] (II) NVIDIA(GPU-0): Native Scaled and Native AspectScaled are identical;
[293848.102] (II) NVIDIA(GPU-0): collapsing Native AspectScaled.
[293848.102] (II) NVIDIA(GPU-0): Native Centered and Native Scaled are identical;
[293848.102] (II) NVIDIA(GPU-0): collapsing Native Scaled.
[293848.102] (II) NVIDIA(GPU-0): BestFit Centered 1920x1080
[293848.102] (II) NVIDIA(GPU-0): Horizontal Taps 0
[293848.102] (II) NVIDIA(GPU-0): Vertical Taps 0
[293848.102] (II) NVIDIA(GPU-0): Base SuperSample x4
[293848.102] (II) NVIDIA(GPU-0): Base Depth 32
[293848.102] (II) NVIDIA(GPU-0): Distributed Rendering 1
[293848.102] (II) NVIDIA(GPU-0): Overlay Depth 32
[293848.102] (II) NVIDIA(GPU-0): Native Centered 1920x1080
[293848.102] (II) NVIDIA(GPU-0): Horizontal Taps 0
[293848.102] (II) NVIDIA(GPU-0): Vertical Taps 0
[293848.102] (II) NVIDIA(GPU-0): Base SuperSample x4
[293848.102] (II) NVIDIA(GPU-0): Base Depth 32
[293848.102] (II) NVIDIA(GPU-0): Distributed Rendering 1
[293848.102] (II) NVIDIA(GPU-0): Overlay Depth 32
[293848.102] (II) NVIDIA(0): Mode is valid.
First calculate if this mode is correct by using the following formula:
PixelClock / HTotal / VTotal * 1.000.000
This number has to be close to 24000/1001, i.e. ~23,976.
The warning about the VertRefresh is probably harmless, but let's get rid of it anyway. Add the line
Code:
Option "ModeValidation" "NoVesaModes, NoXServerModes, NoVertRefreshCheck"
Then start and close X again and look at the log. Look for "Modes in ModePool for". It should look similar to this (the modes for 1920 x 1080 anyway):
Code:
[295635.531] (II) NVIDIA(0): --- Modes in ModePool for ONK TX-NR509 (DFP-2) ---
[295635.531] (II) NVIDIA(0): "nvidia-auto-select" : 1920 x 1080 @ 60.0 Hz (from: EDID)
[295635.531] (II) NVIDIA(0): "1920x1080" : 1920 x 1080 @ 60.0 Hz (from: EDID)
[295635.531] (II) NVIDIA(0): "1920x1080_60" : 1920 x 1080 @ 60.0 Hz (from: EDID)
[295635.531] (II) NVIDIA(0): "1920x1080_60_0" : 1920 x 1080 @ 59.94/60 Hz (CEA-861B Format 16) (from: EDID)
[295635.531] (II) NVIDIA(0): "1920x1080_50" : 1920 x 1080 @ 50.0 Hz (from: EDID)
[295635.531] (II) NVIDIA(0): "1920x1080_30" : 1920 x 1080 @ 29.97/30 Hz (CEA-861B Format 34) (from: EDID)
[295635.531] (II) NVIDIA(0): "1920x1080_25" : 1920 x 1080 @ 25 Hz (CEA-861B Format 33) (from: EDID)
[295635.531] (II) NVIDIA(0): "1920x1080_24" : 1920 x 1080 @ 23.97/24 Hz (CEA-861B Format 32) (from: EDID)
[295635.531] (II) NVIDIA(0): "1920x1080_60i" : 1920 x 1080 @ 59.94/60 Hz (CEA-861B Format 5) (from: EDID)
[295635.531] (II) NVIDIA(0): "1920x1080_50i" : 1920 x 1080 @ 50 Hz Interlace (CEA-861B Format 20) (from: EDID)
What we want to do is give Nvidia, X and XBMC as little room as possible to make mistakes. So what you should do is make a subsection in the Screen section whitelisting the modes that are permitted:
Code:
Section "Screen"
Identifier "screen"
Device "nvidia"
SubSection "Display"
Modes "1920x1080_60_0" "1920x1080_50" "1920x1080_24"
EndSubSection
EndSection
Like I said we only want the modes that are really necessary. In particular I think you should not pick nvidia-auto-select or any interlaced modi. CEA-861B Formats 16, 33 and 32 should suffice. In my case this translates to
Code:
Modes "1920x1080_60_0" "1920x1080_50" "1920x1080_24"
Also, make sure these modes are enforced as strictly as possible by adding the following line to the Device section:
Code:
Option "ExactModeTimingsDVI" "true"
Finally, we don't want the GPU to try and interfere with the video. It will mess up our nice 24p stream, so add this to the Device section as well:
Code:
Option "FlatPanelProperties" "Scaling = Native, Dithering = Disabled"
The resulting should look VERY familiar to this:
http://pastebin.com/wBaFGANU.
You can also copy the final version, but ALWAYS verify whether the modes are correct via the xorg log. For instance, sometimes "1920x1080_24" is called "1920x1080_24_0" or "1920x1080_24_1" or something. Always pick the mode "CEA-861B Format 32".
So now you have a good xorg.conf. Now modify your XBMC as following:
- In Settings => System => Video output, set the refresh rate to 60Hz for the most fluid GUI experience and set "Vertical Blank Sync" to "always enabled".
- In Settings => Video => Playback, enable "Adjust display refresh rate to match video" and "Sync display to playback" and set "A/V Sync method" to "Audio Clock". When you're there anyway also enable "VDPAU Studio level colour conversion". It doesn't have anything to do with judder, but it might prevent some chroma smear on TVs that accept 4:4:4 input, but don't really handle it well.
If everything went ok, you shouldn't have any judder anymore!