Linux HOW-TO achieve perfect playback at 23.97 or 59.94 Hz with NVIDIA GPU hardware

  Thread Rating:
  • 15 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
magiza83 Offline
Junior Member
Posts: 5
Joined: Apr 2012
Reputation: 0
Post: #451
(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!
find quote
pumkinut Offline
Posting Freak
Posts: 875
Joined: May 2006
Reputation: 9
Post: #452
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.
find quote
robo989 Offline
Senior Member
Posts: 176
Joined: Apr 2010
Reputation: 2
Post: #453
(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.
find quote
FernetMenta Offline
Team-XBMC Member
Posts: 1,630
Joined: Jul 2010
Reputation: 34
Location: Munich
Post: #454
This entire thread is outdated with NVIdia driver 302.17. I have updated the first post. See also #445
find quote
Rachel Offline
Senior Member
Posts: 157
Joined: Jun 2009
Reputation: 0
Post: #455
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...
find quote
Rachel Offline
Senior Member
Posts: 157
Joined: Jun 2009
Reputation: 0
Post: #456
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...
find quote
Rachel Offline
Senior Member
Posts: 157
Joined: Jun 2009
Reputation: 0
Post: #457
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]
find quote
FernetMenta Offline
Team-XBMC Member
Posts: 1,630
Joined: Jul 2010
Reputation: 34
Location: Munich
Post: #458
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.
find quote
Rachel Offline
Senior Member
Posts: 157
Joined: Jun 2009
Reputation: 0
Post: #459
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.
find quote
Rachel Offline
Senior Member
Posts: 157
Joined: Jun 2009
Reputation: 0
Post: #460
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?
find quote
Post Reply