Kodi Community Forum
Linux HOW-TO achieve perfect playback at 23.97 or 59.94 Hz with NVIDIA GPU hardware - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Tips, tricks, and step by step guides (https://forum.kodi.tv/forumdisplay.php?fid=110)
+--- Thread: Linux HOW-TO achieve perfect playback at 23.97 or 59.94 Hz with NVIDIA GPU hardware (/showthread.php?tid=70068)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36


RE: HOW-TO achieve perfect playback at 23.97 or 59.94 Hz with NVIDIA GPU hardware - magiza83 - 2012-07-06

(2012-07-05, 19:02)pumkinut Wrote: You can't have it both ways. For XBMC to work well, compositing needs to be turned off. For eye-candy on the desktop, it needs to be turned on. At best, when you want to switch to the desktop, you can kill X, enable compositing in xorg.conf and then restart X. To go back to XBMC, you could reverse the process. This could all be scripted to work with a single command, but it needs to be a workaround.

So, using XBMC under linux has not HWAcceleration on desktop, right? Or there is some distribution that allow that?

Anyway, make an script to do that is not complitated, but it's not an elegant solution.

Thanks!


RE: HOW-TO achieve perfect playback at 23.97 or 59.94 Hz with NVIDIA GPU hardware - pumkinut - 2012-07-06

Quote:So, using XBMC under linux has not HWAcceleration on desktop, right? Or there is some distribution that allow that?
It's not a distribution thing, it's a software conflict. That's just the way it is. You could go with the Windows version if you want.


RE: HOW-TO achieve perfect playback at 23.97 or 59.94 Hz with NVIDIA GPU hardware - robo989 - 2012-07-07

(2012-06-26, 21:22)Rachel Wrote: i had to modify the script too to run on 12.04. My modifications:

Lines 50 & 51, change gdm to lightdm

Line 59 (this might be the one you need) change "cut -c32-" to "cut -c31-". It was truncating the first character of each line of the edid.

With those changes the script ran flawlessly here.

This worked a treat for me right off the bat on 12.04 frodo release from xbmcfreak.

Thanks ever so much.


RE: HOW-TO achieve perfect playback at 23.97 or 59.94 Hz with NVIDIA GPU hardware - FernetMenta - 2012-07-07

This entire thread is outdated with NVIdia driver 302.17. I have updated the first post. See also #445


RE: HOW-TO achieve perfect playback at 23.97 or 59.94 Hz with NVIDIA GPU hardware - Rachel - 2012-07-07

aw and i'd just finished [re-]installing ubuntu precise on my nvidia mac mini and got it working and now i have to break it again! ;-)

([re-] because bad sectors killed the previous install stone dead.)

Anyway, looks like precise's xrandr is already 1.3.5 and you can get the newer nvidia drivers by adding ppa:ubuntu-x-swat/x-updates to your repositories and installing package nvidia-graphics-driver (and otherwise updating).

I'll actually be trying it in a little while...


RE: HOW-TO achieve perfect playback at 23.97 or 59.94 Hz with NVIDIA GPU hardware - Rachel - 2012-07-07

correction; just add the ppa and do the upgrade; installing a separate thing called 'nvidia-graphics-driver' is wrong.

oh and fix up the xorg.conf...


RE: HOW-TO achieve perfect playback at 23.97 or 59.94 Hz with NVIDIA GPU hardware - Rachel - 2012-07-07

well, it didn't break my system, and movie playback looks OK so far. Too soon to tell if it's helped - I'm chasing such a rare glitch from *before* that i might only notice it once or twice in the length of a movie. But the refresh rate xbmc pref shows more options so I presume XBMC knows how to pick the one it wants.

My xorg.conf - edited from that generated by the (fixed) script in post #1:

Code:
Section "Monitor"
    # by hand
    Identifier     "Monitor0"
    VendorName     "Panasonic"
    ModelName      "Viera"
    ModeLine       "1920x1080_23.976" 74.175 1920 2558 2602 2750 1080 1084 1089 1125 +hsync +vsync
EndSection

Section "Device"
        Identifier "nvidia"
        Driver  "nvidia"
        Option  "NoLogo"              "true"
        Option  "DynamicTwinView"     "false"
        Option  "FlatPanelProperties" "Scaling = Native"
        Option  "ModeValidation"      "NoVesaModes, NoXServerModes, NoVertRefreshCheck, NoHorizSyncCheck"
        Option  "UseDisplayDevice"    "DFP-1"
        Option  "ModeDebug"           "true"
    Option  "HWCursor"            "false"
EndSection

Section "Screen"
        Identifier      "screen"
        Device          "nvidia"
        Option         "VertRefresh"  "DFP-1: 23-60"
        Option         "HorizSync"    "DFP-1: 25-100"
#        SubSection      "Display"
#                Modes "1920x1080_60_0" "1920x1080_50" "1920x1080_24"
#        EndSubSection
EndSection

Section "Extensions"
        Option  "Composite"           "false"
EndSection


# -- Modes in ModePool for Panasonic-TV (DFP-1) ---
# nvidia-auto-select" : 1920 x 1080 @  50.0 Hz  
# 1920x1080"          : 1920 x 1080 @  50.0 Hz  
# 1920x1080_50"       : 1920 x 1080 @  50.0 Hz  
# 1920x1080_60"       : 1920 x 1080 @  60.0 Hz  
# 1920x1080_60_0"     : 1920 x 1080 @ 59.94/60 Hz (CEA-861B Format 16)
# 1920x1080_24"       : 1920 x 1080 @ 23.97/24 Hz (CEA-861B Format 32)
# 1920x1080_60i"      : 1920 x 1080 @ 59.94/60 Hz (CEA-861B Format 5)
# 1920x1080_50i"      : 1920 x 1080 @ 50 Hz Interlace (CEA-861B Format 20)
# 1280x720"           : 1280 x  720 @  60.0 Hz  
# 1280x720_60"        : 1280 x  720 @  60.0 Hz  
# 1280x720_60_0"      : 1280 x  720 @ 59.94/60 Hz (CEA-861B Format 4)
# 1280x720_50"        : 1280 x  720 @  50.0 Hz  
# 720x576"            :  720 x  576 @  50.0 Hz  
# 720x576_50"         :  720 x  576 @  50.0 Hz  
# 720x576_50i"        : (1440)x 576 @ 50 Hz Interlace (CEA-861B Format 22)
# 720x480"            :  720 x  480 @ 59.94/60 Hz (CEA-861B Format 3)
# 720x480_60"         :  720 x  480 @ 59.94/60 Hz (CEA-861B Format 3)
# 720x480_60i"        : (1440)x 480 @ 59.94/60 Hz Interlace (CEA-861B Format 7)
# 640x480"            :  640 x  480 @ 59.94/60 Hz Interlace (CEA-861B Format 1)
# 640x480_60"         :  640 x  480 @ 59.94/60 Hz Interlace (CEA-861B Format 1)
# -- End of ModePool for Panasonic-TV (DFP-1): ---[/code]



RE: HOW-TO achieve perfect playback at 23.97 or 59.94 Hz with NVIDIA GPU hardware - FernetMenta - 2012-07-08

With driver 302 you can easily verify your setup. Run xbmc-xrandr (same directory as xbmc.bin) from a terminal. It will list all available modes with refresh rates as floating point values. There will be that wrong 23.971 (NVidia bug) refresh rate. With the additional modeline you should also see a 23.976 or something very close to it.
XBMC looks for those values when picking a resolution.

The occasional glitches you are observing is a different problem.


RE: HOW-TO achieve perfect playback at 23.97 or 59.94 Hz with NVIDIA GPU hardware - Rachel - 2012-07-08

right, it looks like it's not showing up then.

(ssh to box while tv off, but not sure if that makes a difference; i'd kind of expect it to be *more* likely to show the hard-configured modeline than the stuff it would have to detect but...)


Code:
rachel@rarity:~$ DISPLAY=':0' /usr/lib/xbmc/xbmc-xrandr
<screen id="0" minimum_w="8" minimum_h="8" current_w="1920" current_h="1080" maximum_w="8192" maximum_h="8192">
  <output name="DP-0" connected="false">
  </output>
  <output name="HDMI-0" connected="true" w="1920" h="1080" x="0" y="0" wmm="698" hmm="392">
    <mode id="0x1c5" name="1920x1080" w="1920" h="1080" hz="50.00000" current="true" preferred="true"/>
    <mode id="0x1c6" name="1920x1080" w="1920" h="1080" hz="60.00000" current="false" preferred="false"/>
    <mode id="0x1c7" name="1920x1080" w="1920" h="1080" hz="59.93939" current="false" preferred="false"/>
    <mode id="0x1c8" name="1920x1080" w="1920" h="1080" hz="23.97091" current="false" preferred="false"/>
    <mode id="0x1c9" name="1920x1080" w="1920" h="1080" hz="30.02669" current="false" preferred="false"/>
    <mode id="0x1ca" name="1920x1080" w="1920" h="1080" hz="29.99838" current="false" preferred="false"/>
    <mode id="0x1cb" name="1920x1080" w="1920" h="1080" hz="25.02224" current="false" preferred="false"/>
    <mode id="0x1cc" name="1280x720" w="1280" h="720" hz="60.00000" current="false" preferred="false"/>
    <mode id="0x1cd" name="1280x720" w="1280" h="720" hz="59.94344" current="false" preferred="false"/>
    <mode id="0x1ce" name="1280x720" w="1280" h="720" hz="50.00000" current="false" preferred="false"/>
    <mode id="0x1cf" name="720x576" w="720" h="576" hz="50.00000" current="false" preferred="false"/>
    <mode id="0x1d0" name="720x576" w="720" h="576" hz="25.04006" current="false" preferred="false"/>
    <mode id="0x1d1" name="720x480" w="720" h="480" hz="59.94006" current="false" preferred="false"/>
    <mode id="0x1d2" name="720x480" w="720" h="480" hz="30.02723" current="false" preferred="false"/>
    <mode id="0x1d3" name="640x480" w="640" h="480" hz="59.92857" current="false" preferred="false"/>
  </output>
  <output name="DP-1" connected="false">
  </output>
</screen>

Guessing there's an error with the use of "DFP-1" in the xorg.conf, which differed from your example but matched other references in the constructed configuration. Off to look at the xorg logfile.


RE: HOW-TO achieve perfect playback at 23.97 or 59.94 Hz with NVIDIA GPU hardware - Rachel - 2012-07-08

hmm, Xorg logfile is very fulsome, and has a long section where it logs how it considers each mode (and rejects many on the basis of "Mode is rejected: Only EDID-provided modes are allowed on Panasonic-TV (DFP-1).") But there's no mention anywhere in the logfile of the modeline, even in the context of it being validated and rejected. It does mention the VertRefresh and HorizSync options so I know it's reading the right xorg.conf file!

DFP-1 in my xorg.conf would appear to be right based on:


Code:
[    16.284] (--) NVIDIA(0): Valid display device(s) on GeForce 320M at PCI:5:0:0
[    16.284] (--) NVIDIA(0):     DFP-0
[    16.284] (--) NVIDIA(0):     Panasonic-TV (DFP-1) (connected)
[    16.284] (--) NVIDIA(0):     DFP-2

and

Code:
[    16.284] (--) NVIDIA(0): Panasonic-TV (DFP-1): 165.0 MHz maximum pixel clock
[    16.284] (--) NVIDIA(0): Panasonic-TV (DFP-1): Internal Single Link TMDS
[    16.284] (--) NVIDIA(0): Name Aliases for Panasonic-TV (DFP-1):
[    16.284] (--) NVIDIA(0):   DFP
[    16.284] (--) NVIDIA(0):   DFP-1
[    16.284] (--) NVIDIA(0):   DPY-1
[    16.284] (--) NVIDIA(0):   HDMI-0
[    16.284] (--) NVIDIA(0):   DPY-EDID-4a0d05da-594b-e05a-aab9-3cbd819aad51

Can't help thinking this might be something to do with it:

Code:
Option  "ModeValidation"      "NoVesaModes, NoXServerModes, NoVertRefreshCheck, NoHorizSyncCheck"

specifically the "NoXServerModes"; but Google seems to be full of nvidia users for whom that option seems to fix problems, but also seems unable to find some piece of documentation that actually tells me what it means and does! I'll try removing it in a bit, when I'm next physically in front of it.

In the meantime, the modeline itself: Would those timings be right for everyone with an edid-line like:

Code:
# 1920x1080_24"       : 1920 x 1080 @ 23.97/24 Hz (CEA-861B Format 32)

or do they need to be generated for specific devices/TVs using some tool?


RE: HOW-TO achieve perfect playback at 23.97 or 59.94 Hz with NVIDIA GPU hardware - FernetMenta - 2012-07-08

This xorg.conf has worked on all systems TV I have tried:
http://xbmclogs.com/show.php?id=4386

DFP-0 might be changed to DFP-1


RE: HOW-TO achieve perfect playback at 23.97 or 59.94 Hz with NVIDIA GPU hardware - Rachel - 2012-07-08

(2012-07-08, 10:31)FernetMenta Wrote: This xorg.conf has worked on all systems TV I have tried:
http://xbmclogs.com/show.php?id=4386

DFP-0 might be changed to DFP-1

ok, i now have:

Code:
<mode id="0x1c6" name="1920x1080" w="1920" h="1080" hz="23.97576" current="true" preferred="false"/>

so that looks hopeful. (I notice the values to 5 decimal places but assuming things are rounded properly it should match I presume?) Ah, the 'current="true"' when i start playing a movie is a bit of a giveaway isn't it. it's using it. Smile

The fps: figure on the 'o' pane is more consistently staying at 23.98 now, though with occasional fluctuations to 23.95 and 24.00. I don't know if that fluctuation (not associated with any visible playback glitches) is important, but there's less of it at this speed now.

Yes, I think I have other, unrelated occasional glitches that I suppose are going to be my next project to track down. An occasional drop in framerate but not associated with a rise in the dropped-frame count (huh?). I am playing raw bluray rips through this now - ie: not transocded, so with a bitrate typically beween 30-40 MBit/sec - which shouldn't be a problem on a gigabit network of course. But that's another topic for another day; tennis final on soon...


RE: HOW-TO achieve perfect playback at 23.97 or 59.94 Hz with NVIDIA GPU hardware - FernetMenta - 2012-07-08

Don't bother about the fluctuating fps shown on the codec screen. This is a measured value and not expected to be too precise.

I have been working on this occasional glitches for more than a year. In case you use vdpau you can try this testing branch mentioned here:
http://forum.xbmc.org/showthread.php?tid=116996
The thread is about XvBA but it does also include other work.


RE: HOW-TO achieve perfect playback at 23.97 or 59.94 Hz with NVIDIA GPU hardware - Rachel - 2012-07-08

(2012-07-08, 14:46)FernetMenta Wrote: Don't bother about the fluctuating fps shown on the codec screen. This is a measured value and not expected to be too precise.

I have been working on this occasional glitches for more than a year. In case you use vdpau you can try this testing branch mentioned here:
http://forum.xbmc.org/showthread.php?tid=116996
The thread is about XvBA but it does also include other work.

i do use vdpau yes; currently ubuntu 12.04 64-bit with the xbmc eden from the ubuntu repos.

I'll try https://launchpad.net/~wsnipex/+archive/xbmc-xvba-testing later as that one seems the most relevant. (wimbledon on now...)


RE: HOW-TO achieve perfect playback at 23.97 or 59.94 Hz with NVIDIA GPU hardware - Rachel - 2012-07-08

well, i was about to say it's too broken to use, but then I thought I'd delete ~/.xbmc and start again and it was much better. Wink I think this is me onto audio engine as well, presumably, and that seems to be working, having also found and configured my audio devices right away (beforehand that was a chore on this mac until i found the exact custom incantation). Also for the first time in linux i have working gui sounds *and* audio tracks in playback. however, truehd playback (in software) breaks horribly and truehd-passthru to capable amp is unselectable at present.

Some issues i'm having to think about before committing to it. For some reason it seems to have problems selecting the right refresh rate for *some* content. for instance starting to play for a few seconds and *then* deciding to switch, and on one example never switching at all. So far this seems to be the output of handbrake from off-air recordings; both progressive and interlaced; but not a big enough sample to be sure of that pattern yet.

Also still seeing the fps value wandering around a bit on tv content (eg: interlaced stuff with any of the bob/weave deinterlace types selected, it shows rates fluctuating around the 50 or 59.94 figure appropriate to content. Looks OK to the eye though.

OTOH watching a movie it *does* look to be rock-solid at 23.98 so far, which is the problem for which you suggested i tried this build. Smile