XBMC and fixing the 24p issue

In this tutorial I’ll explain everything you need to do in order to play 24p video’s within XBCM without losing frames.

First we need to cleanup the xorg.conf file. Create a new one with the following command:

sudo nvidia-xconfig

After we’ve created a new configuration file we need to kill X. If you can’t kill the X server try to reboot the system and select the safe mode from the grub boot menu. Kill X with the following command:

kill -9 `ps ax | grep xbmc.bin| grep -v grep | awk ‘{print $1}’`
kill -9 `ps ax | grep startx | grep -v grep | awk '{print $1}'`

Next step is to start the X server using the verbose parameter. We need to log the result to a temporary file:

sudo X -verbose 6 > ~/xlog.txt 2>&1

Open the log file. You should see the following lines of code. These are the resolutions:

(II) NVIDIA(0): Frequency information for ONK TX-SR507 (DFP-1):
(II) NVIDIA(0): HorizSync : 15.000-68.000 kHz
(II) NVIDIA(0): VertRefresh : 23.000-61.000 Hz
(II) NVIDIA(0): (HorizSync from EDID)
(II) NVIDIA(0): (VertRefresh from EDID)
(II) NVIDIA(0): --- Building ModePool for ONK TX-SR507 (DFP-1) ---
(II) NVIDIA(0): Validating Mode "1920x1080":
(II) NVIDIA(0): 1920 x 1080 @ 50 Hz
(II) NVIDIA(0): For use as DFP backend.
(II) NVIDIA(0): Mode Source: EDID
(II) NVIDIA(0): Pixel Clock : 148.50 MHz
(II) NVIDIA(0): HRes, HSyncStart : 1920, 2448
(II) NVIDIA(0): HSyncEnd, HTotal : 2492, 2640
(II) NVIDIA(0): VRes, VSyncStart : 1080, 1084
(II) NVIDIA(0): VSyncEnd, VTotal : 1089, 1125
(II) NVIDIA(0): H/V Polarity : +/+
(II) NVIDIA(0): Mode is valid.

Scroll a bit further and you’ll see the following lines. These are the general settings of your display:

HorizSync 15 - 68
VertRefresh 23 - 61

Now it’s time to do something. We need to translate the resolutions and general settings to modelines. Open the xorg.conf  file with the following command “sudo nano /etc/X11/xorg.conf“. Scroll down till the Section Monitor.

Let’s go back to the resolutions (see below). When we examine the debug log file a bit more in detail we see different kind of resolutions. In my example I found the 50hz, 60hz and the 24hz resolutions. You have to be sure that the modes are valid!

Resolutions:

(II) NVIDIA(0): Validating Mode "1920x1080":
(II) NVIDIA(0): 1920 x 1080 @ 50 Hz
(II) NVIDIA(0): For use as DFP backend.
(II) NVIDIA(0): Mode Source: EDID
(II) NVIDIA(0): Pixel Clock : 148.50 MHz
(II) NVIDIA(0): HRes, HSyncStart : 1920, 2448
(II) NVIDIA(0): HSyncEnd, HTotal : 2492, 2640
(II) NVIDIA(0): VRes, VSyncStart : 1080, 1084
(II) NVIDIA(0): VSyncEnd, VTotal : 1089, 1125
(II) NVIDIA(0): H/V Polarity : +/+
(II) NVIDIA(0): Mode is valid.

(II) NVIDIA(0): Validating Mode "1920x1080":
(II) NVIDIA(0): 1920 x 1080 @ 60 Hz
(II) NVIDIA(0): For use as DFP backend.
(II) NVIDIA(0): Mode Source: EDID
(II) NVIDIA(0): Pixel Clock : 148.50 MHz
(II) NVIDIA(0): HRes, HSyncStart : 1920, 2008
(II) NVIDIA(0): HSyncEnd, HTotal : 2052, 2200
(II) NVIDIA(0): VRes, VSyncStart : 1080, 1084
(II) NVIDIA(0): VSyncEnd, VTotal : 1089, 1125
(II) NVIDIA(0): H/V Polarity : +/+
(II) NVIDIA(0): Mode is valid.

(II) NVIDIA(0): Validating Mode "1920x1080":
(II) NVIDIA(0): 1920 x 1080 @ 24 Hz
(II) NVIDIA(0): For use as DFP backend.
(II) NVIDIA(0): Mode Source: EDID
(II) NVIDIA(0): Pixel Clock : 74.16 MHz
(II) NVIDIA(0): HRes, HSyncStart : 1920, 2558
(II) NVIDIA(0): HSyncEnd, HTotal : 2602, 2750
(II) NVIDIA(0): VRes, VSyncStart : 1080, 1084
(II) NVIDIA(0): VSyncEnd, VTotal : 1089, 1125
(II) NVIDIA(0): H/V Polarity : +/+
(II) NVIDIA(0): Mode is valid.

General display settings:

HorizSync 15 - 68
VertRefresh 23 - 61

We can now translate the resolutions and general settings to ModeLines. Look very close to the numbers and put them in right order. This is very important!

ModeLine "1920x1080@50p" 148.50 1920 2448 2492 2640 1080 1084 1089 1125 +hsync +vsync
ModeLine "1920x1080@60p" 148.50 1920 2008 2052 2200 1080 1084 1089 1125 +hsync +vsync
ModeLine "1920x1080@24p" 74.16 1920 2558 2602 2750 1080 1084 1089 1125 +hsync +vsync

Also add the following line to the monitor sub section:

Option "ExactModeTimingsDVI" "TRUE"

Your xorg.conf Monitor section should now look like this:

Section "Monitor"
Identifier "Monitor0"
VendorName "ONK"
ModelName "ONK TX-SR507"
Option "DPMS"
Option "ExactModeTimingsDVI" "TRUE"
HorizSync 15-68
VertRefresh 23-61
ModeLine "1920x1080@50p" 148.50 1920 2448 2492 2640 1080 1084 1089 1125 +hsync +vsync
ModeLine "1920x1080@60p" 148.50 1920 2008 2052 2200 1080 1084 1089 1125 +hsync +vsync
ModeLine "1920x1080@24p" 74.16 1920 2558 2602 2750 1080 1084 1089 1125 +hsync +vsync
EndSection

We also need to adjust the Section Monitor section. Add to the SubSection Display the following line:

Modes "1920x1080@24p" "1920x1080@50p" "1920x1080@60p"

The names of the modes should match the names of the Modelines!

Also add the following line to the Screen section

Option "DynamicTwinView" "False"

The Screen section now should like like this:

Section "Screen"
Identifier "Screen0"
Device "Device0"
Monitor "Monitor0"
DefaultDepth 24
SubSection "Display"
Depth 24
Modes "1920x1080@24p" "1920x1080@50p" "1920x1080@60p"
EndSubSection
Option "DynamicTwinView" "False"
Option "NoLogo" "True"
EndSection

To it’s time to restart the machine. Go to Settings section within XBMC and set turn on the Adjust Auto Refreshrate function.

Comments

  1. Edward says:

    Really appreciate this post! One thing I am struggling with myself is my TV that only supports 50hz. So any 24hz content creates stutter on my TV. Is there any way to solve this? I guess the only solution would be to get a 24p-capable TV?

  2. Edward :

    Really appreciate this post! One thing I am struggling with myself is my TV that only supports 50hz. So any 24hz content creates stutter on my TV. Is there any way to solve this? I guess the only solution would be to get a 24p-capable TV?

    There should also be an option called “smooth video” just below the adjust auto refresh rate. I’m not very experienced with that settings but with smooth video it’s possible to adjust the number of frames displayed, or make it work for situations like you’re handling with.

  3. Michal says:

    Thanks for nice post.
    I have two quick questions:
    – Can the wrong ModeLine break lcd/plasma/led TV? I remember that there was small risk on the old CRT’s

    – I have few 1920×1080@60p discovered as valid modes. Which one should I pick up? The one with the highest “Pixel Clock” or based on other parameter, or should I include all of them in the xorg.conf.

  4. snal says:

    Nice and extensive post! I’m gonna try this when I get home. I’m wondering though, could you explain the difference between this solution and the solution posted in this thread http://forum.xbmcfreak.nl/topic/xbmcfreak-livecd-v10-problemen ?

  5. Irek Makowski says:

    Can you send me xbmc.conf file from v10? After upgrade to v11 my screen turn of for a second and turn on when I go to fullscreen. Is this issue known?

  6. Frank Black says:

    Just wanted to say a major thank you for this guide. I’m now viewing 24p content as it should be, judder free :)

    Merry Xmas!!!!

  7. Terr1 says:

    thanks :)

Leave a Comment

*