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

+- XBMC Community Forum (http://forum.xbmc.org)
+-- Forum: Announcements, Info, and General Discussion (/forumdisplay.php?fid=85)
+--- Forum: Tips, tricks, and step by step guides (/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


- Rrrr - 2010-11-17 16:30

Hat off!! Amazing work and very clear instructions, thank you very much.

I have an issue with video OSD being out of bounds when I set the modes value to "1920x1080_60i_0". This does not happen when I set the mode to "1280x720_60_0" or (even) "1920x1080_50i"

With "1920x1080_60i_0", I get a refresh rate output of 59.94 Hz 59.94 Hz, but the video OSD is only partially visible. I have calibrated the screen.

What should I do to get the OSD back onto the screen? I have spent hours trying all options but am left clueless.

thanks in advance.

PS I have a preference for 1080 (even though the plasma is HD Ready and does the upscaling very nicely: Panasonic TH42PH10) since it all seems to look just a little better. Granted that most of my content seems to be 50fps, 50i does not do it for me, because it makes the XBMC interface look less nice (especially scrolling text for movie info and RSS looks bad).

Below is my xorg.conf.
Within XBMC: "Render method" to Auto, "Adjust display refresh..." to On, "Sync playback to display" to On, A/V sync method to "Audio" and "Vertical blank sync" to Always.

"Sync playback to display" to Off did not help.



Code:
Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    HorizSync       28.0 - 33.0
    VertRefresh     43.0 - 72.0
    Option         "DPMS"
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"
        SubSection      "Display"
                Modes  "1920x1080_60i_0"
        EndSubSection
EndSection

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


#  --- Modes in ModePool for PANASONIC-TV (DFP-0) ---
#  "nvidia-auto-select" : 1920 x 1080 @  60.1 Hz Interlace  
#  "1920x1080"          : 1920 x 1080 @  60.1 Hz Interlace  
#  "1920x1080_60i"      : 1920 x 1080 @  60.1 Hz Interlace  
#  "1920x1080_60i_0"    : 1920 x 1080 @ 59.94/60 Hz (CEA-861B Format 5)
#  "1920x1080_50i"      : 1920 x 1080 @  50.0 Hz Interlace  
#  "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  
#  "720x480"            :  720 x  480 @  59.9 Hz  
#  "720x480_60"         :  720 x  480 @  59.9 Hz  
#  "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-0): ---



- Th3R00st3r - 2010-11-17 17:39

Superorb Wrote:I remember reading in the Revo thread that you need to set the video RAM to 512 instead of the factory setting. I couldn't play things correctly until I got a video card with 512mb RAM.

Yeah, you mean in the BIOS right? I did change that when I first setup the Revo.

bobo1on1 Wrote:A debug log might provide some more info

I will try to post a debug log..


- Th3R00st3r - 2010-11-17 18:14

bobo1on1 Wrote:A debug log might provide some more info
Debug
Quote:23:22:54 T:3024570240 M:670375936 DEBUG: HttpApi Start command: broadcastlevel paras: broadcastlevel; MediaChanged:<li>MovieTitle:The Nightmare Before Christmas
;1
23:22:54 T:2979433360 M:661745664 DEBUG: UDPCLIENT TX: 32052 -> '<b>MediaChanged:<li>MovieTitle:The Nightmare Before Christmas;1</b>'
23:22:54 T:2633816976 M:660062208 NOTICE: (VDPAU) Total Output Surfaces Available: 2 of a max (tmp: 2 const: 4)
23:22:54 T:2633816976 M:660062208 NOTICE: (VDPAU) Creating the video mixer
23:22:54 T:2642209680 M:650231808 DEBUG: CVideoReferenceClock: detected 1 vblanks, missed 3, refreshrate might have changed
23:22:54 T:2633816976 M:640901120 NOTICE: Setting Noise Reduction to 0.500000
23:22:54 T:2633816976 M:640901120 NOTICE: Setting Sharpness to -0.200000
23:22:54 T:2633816976 M:640901120 NOTICE: fps: 23.976025, pwidth: 1920, pheight: 1080, dwidth: 1920, dheight: 1080
23:22:54 T:2633816976 M:640901120 DEBUG: OutputPicture - change configuration. 1920x1080. framerate: 23.98. format: VDPAU
23:22:54 T:2633816976 M:640901120 NOTICE: Display resolution ADJUST : default: 1920x1080 @ 24.00Hz (14)
23:22:54 T:2633816976 M:640901120 DEBUG: CVideoReferenceClock: Clock speed 100.099997%
23:22:54 T:3024570240 M:640901120 NOTICE: Using GL_TEXTURE_2D
23:22:54 T:3024570240 M:640901120 NOTICE: GL: Using VDPAU render method
23:22:54 T:3024570240 M:640901120 NOTICE: GL: NPOT texture support detected
23:22:54 T:3024570240 M:640901120 NOTICE: GL: Using GL_ARB_pixel_buffer_object
23:22:54 T:2738879376 M:640622592 DEBUG: CDVDPlayer::HandleMessages - player started 2
23:22:54 T:2738879376 M:640622592 DEBUG: CDVDPlayer::SetCaching - caching state 3
23:22:54 T:2625424272 M:640622592 DEBUG: CDVDPlayerAudio:: synctype set to 1: skip/duplicate
23:22:54 T:2625424272 M:640622592 DEBUG: CDVDPlayerAudio:: Discontinuity - was:807017700.000000, should be:807049720.834029, error:32020.834029
23:22:54 T:2738879376 M:638812160 DEBUG: CDVDPlayer::SetCaching - caching state 0
23:22:54 T:3024570240 M:636334080 DEBUG: Activating window ID: 12005
23:22:54 T:3024570240 M:636334080 DEBUG: Checking if window ID 12005 is locked.
23:22:54 T:3024570240 M:636334080 DEBUG: ------ Window Deinit (MyVideoNav.xml) ------
23:22:54 T:3024570240 M:636334080 INFO: XRANDR: /usr/lib/xbmc/xbmc-xrandr --output default --mode 0x125
23:22:54 T:2642209680 M:635564032 DEBUG: CVideoReferenceClock: Vblank counter has reset
23:22:54 T:2642209680 M:635564032 DEBUG: CVideoReferenceClock: Detaching glX context
23:22:55 T:2642209680 M:627015680 DEBUG: CVideoReferenceClock: Attaching glX context
23:22:55 T:2642209680 M:627163136 DEBUG: CVideoReferenceClock: detected 1 vblanks, missed 28, refreshrate might have changed
23:22:55 T:2642209680 M:627163136 DEBUG: CVideoReferenceClock: Received RandR event 122
23:22:55 T:3024570240 M:611106816 ERROR: GLX: Same window as before, refreshing context
23:22:55 T:3024570240 M:610480128 INFO: GL: Maximum texture width: 8192
23:22:55 T:2642209680 M:625029120 DEBUG: CVideoReferenceClock: output of nvidia-settings -nt -q RefreshRate3: 23.971 Hz
23:22:55 T:2642209680 M:625029120 DEBUG: CVideoReferenceClock: Detected refreshrate by nvidia-settings: 23.971000 hertz, rounding to 24 hertz
23:22:55 T:2642209680 M:619388928 DEBUG: CVideoReferenceClock: detected 5 vblanks, missed 10, refreshrate might have changed
23:22:55 T:3024570240 M:618901504 DEBUG: ------ Window Init (VideoFullScreen.xml) ------
23:22:55 T:3024570240 M:618901504 INFO: Loading skin file: VideoFullScreen.xml
23:22:55 T:3024570240 M:618901504 DEBUG: Load VideoFullScreen.xml: 4.58ms
23:22:55 T:3024570240 M:618901504 DEBUG: Alloc resources: 4.91ms (4.91 ms skin load)
23:22:55 T:3024570240 M:617091072 DEBUG: ------ Window Deinit (VideoOverlay.xml) ------
23:22:55 T:2642209680 M:650117120 DEBUG: CVideoReferenceClock: detected 1 vblanks, missed 2, refreshrate might have changed
23:22:55 T:2633816976 M:681742336 WARNING: CRenderManager::FlipPage - timeout waiting for flip to complete
23:22:56 T:3024570240 M:701386752 ERROR: VDPAU Device Preempted - attempting recovery
23:22:56 T:2633816976 M:701317120 ERROR: CVDPAU::FFGetBuffer - No Video surface available could be created
23:22:56 T:2633816976 M:701317120 ERROR: ffmpeg[9CFCDB90]: [h264_vdpau] get_buffer() failed (-1 1073741838 2 (nil))
23:22:56 T:2633816976 M:701317120 ERROR: ffmpeg[9CFCDB90]: [h264_vdpau] decode_slice_header error
23:22:56 T:2633816976 M:701177856 ERROR: ffmpeg[9CFCDB90]: [h264_vdpau] no frame!
23:22:56 T:2633816976 M:701177856 ERROR: Decode - avcodec_decode_video returned failure
23:22:56 T:2633816976 M:701177856 DEBUG: CDVDPlayerVideo - video decoder returned error
23:22:56 T:2633816976 M:701177856 NOTICE: Attempting recovery
23:22:56 T:2633816976 M:701177856 NOTICE: (VDPAU) FiniVDPAUOutput
23:22:56 T:3024570240 M:701177856 ERROR: (VDPAU) Error: The display was pre-empted, or a fatal error occurred.(2) at VDPAU.cpp:1301
23:22:56 T:3024570240 M:701177856 DEBUG: GL: Disabling non-linear stretch
23:22:56 T:3024570240 M:701177856 NOTICE: Created m_glPixmapTexture (45)
23:22:56 T:2633816976 M:700895232 NOTICE: vdp_device = 0x00000001 vdp_st = 0x00000000
23:22:56 T:2633816976 M:700895232 DEBUG: CDVDPlayerVideo - video decoder was flushed
23:22:56 T:2633816976 M:700895232 NOTICE: Attempting recovery
23:22:56 T:2633816976 M:701378560 NOTICE: vdp_device = 0x00000001 vdp_st = 0x00000000
23:22:56 T:2633816976 M:701378560 DEBUG: CDVDPlayerVideo - video decoder was flushed
23:22:56 T:2633816976 M:688635904 NOTICE: (VDPAU) screenWidth:1920 vidWidth:1920
23:22:56 T:2633816976 M:688635904 NOTICE: (VDPAU) screenHeight:1080 vidHeight:1080
23:22:56 T:2642209680 M:666214400 DEBUG: CVideoReferenceClock: detected 1 vblanks, missed 2, refreshrate might have changed
23:22:56 T:2633816976 M:643833856 NOTICE: (VDPAU) Total Output Surfaces Available: 2 of a max (tmp: 2 const: 4)
23:22:56 T:2633816976 M:643833856 NOTICE: (VDPAU) Creating the video mixer
23:22:56 T:2633816976 M:625020928 NOTICE: Setting Noise Reduction to 0.500000
23:22:56 T:2633816976 M:625020928 NOTICE: Setting Sharpness to -0.200000
23:22:56 T:2633816976 M:625020928 WARNING: Decode - avcodec_decode_video didn't consume the full packet. size: 11746, consumed: 0
23:22:56 T:2625424272 M:625016832 DEBUG: CDVDPlayerAudio:: Duplicating 1 packet(s) of 32.00 ms duration
23:22:58 T:2633816976 M:621862912 DEBUG: CPullupCorrection: detected pattern of length 1: 41708.62
23:22:59 T:3024570240 M:622010368 INFO: CheckIdle - Closing session to http://xoap.weather.com (easy=0x9529660, multi=0x93c03d0)
23:22:59 T:2633816976 M:621658112 WARNING: Decode - avcodec_decode_video didn't consume the full packet. size: 12988, consumed: 0
23:22:59 T:2633816976 M:621658112 WARNING: Decode - avcodec_decode_video didn't consume the full packet. size: 16582, consumed: 0
23:22:59 T:2633816976 M:621658112 WARNING: Decode - avcodec_decode_video didn't consume the full packet. size: 12886, consumed: 0
23:23:03 T:2633816976 M:619380736 WARNING: Decode - avcodec_decode_video didn't consume the full packet. size: 20234, consumed: 0
23:23:03 T:2633816976 M:619380736 WARNING: Decode - avcodec_decode_video didn't consume the full packet. size: 19018, consumed: 0
23:23:05 T:3024570240 M:617730048 DEBUG: LIRC: Update - NEW at 44978:0000000000001012 00 play harmony_kls_vdr (play)
23:23:05 T:3024570240 M:617730048 DEBUG: OnKey: 229 pressed, action is CodecInfo
23:23:06 T:3024570240 M:617152512 INFO: CheckIdle - Closing session to http://api.themoviedb.org (easy=0xaa6f02b0, multi=0xaa691790)
23:23:06 T:2633816976 M:616947712 WARNING: Decode - avcodec_decode_video didn't consume the full packet. size: 9841, consumed: 0
23:23:06 T:2633816976 M:616931328 WARNING: Decode - avcodec_decode_video didn't consume the full packet. size: 10504, consumed: 0
23:23:06 T:2633816976 M:616931328 WARNING: Decode - avcodec_decode_video didn't consume the full packet. size: 6918, consumed: 0
23:23:07 T:2633816976 M:615874560 WARNING: Decode - avcodec_decode_video didn't consume the full packet. size: 17730, consumed: 0
23:23:07 T:2633816976 M:615874560 WARNING: Decode - avcodec_decode_video didn't consume the full packet. size: 14880, consumed: 0
23:23:09 T:2633816976 M:615628800 WARNING: Decode - avcodec_decode_video didn't consume the full packet. size: 14935, consumed: 0
23:23:10 T:2633816976 M:615018496 WARNING: Decode - avcodec_decode_video didn't consume the full packet. size: 14215, consumed: 0
23:23:10 T:2633816976 M:615018496 WARNING: Decode - avcodec_decode_video didn't consume the full packet. size: 14569, consumed: 0
23:23:12 T:2633816976 M:614641664 WARNING: Decode - avcodec_decode_video didn't consume the full packet. size: 12593, consumed: 0
23:23:12 T:2633816976 M:614641664 WARNING: Decode - avcodec_decode_video didn't consume the full packet. size: 12253, consumed: 0



- Th3R00st3r - 2010-11-17 18:17

Quote:23:22:56 T:2633816976 M:701317120 ERROR: ffmpeg[9CFCDB90]: [h264_vdpau] get_buffer() failed (-1 1073741838 2 (nil))
23:22:56 T:2633816976 M:701317120 ERROR: ffmpeg[9CFCDB90]: [h264_vdpau] decode_slice_header error
23:22:56 T:2633816976 M:701177856 ERROR: ffmpeg[9CFCDB90]: [h264_vdpau] no frame!
23:22:56 T:2633816976 M:701177856 ERROR: Decode - avcodec_decode_video returned failure
23:22:56 T:2633816976 M:701177856 DEBUG: CDVDPlayerVideo - video decoder returned error
23:22:56 T:2633816976 M:625020928 WARNING: Decode - avcodec_decode_video didn't consume the full packet. size: 11746, consumed: 0
23:22:56 T:2625424272 M:625016832 DEBUG: CDVDPlayerAudio:: Duplicating 1 packet(s) of 32.00 ms duration
23:22:58 T:2633816976 M:621862912 DEBUG: CPullupCorrection: detected pattern of length 1: 41708.62
23:22:59 T:3024570240 M:622010368 INFO: CheckIdle - Closing session to http://xoap.weather.com (easy=0x9529660, multi=0x93c03d0)
23:22:59 T:2633816976 M:621658112 WARNING: Decode - avcodec_decode_video didn't consume the full packet. size: 12988, consumed: 0
23:22:59 T:2633816976 M:621658112 WARNING: Decode - avcodec_decode_video didn't consume the full packet. size: 16582, consumed: 0
23:22:59 T:2633816976 M:621658112 WARNING: Decode - avcodec_decode_video didn't consume the full packet. size: 12886, consumed: 0
23:23:03 T:2633816976 M:619380736 WARNING: Decode - avcodec_decode_video didn't consume the full packet. size: 20234, consumed: 0
23:23:03 T:2633816976 M:619380736 WARNING: Decode - avcodec_decode_video didn't consume the full packet. size: 19018, consumed: 0

I read a post on the "WARNING: Decode - avcodec_decode_video didn't consume the full packet"
Quote:I have the acer revo 330 and my solution was to upgrade libvdpau. (I'm using XBMC Live).

sudo apt-get update
sudo apt-get install libvdpau1

It did install and I rebooted. Won't be able to try it until I get home this evening.

I don't even know if I am on the right track..


- bobo1on1 - 2010-11-17 18:55

Set noise reduction and sharpness to 0.


- Th3R00st3r - 2010-11-17 19:01

bobo1on1 Wrote:Set noise reduction and sharpness to 0.

Will try that too.

Thanks!

I'll change the settings and have my kid take a screenshot.. Remote Testing..kids are good for something.. haha


- Th3R00st3r - 2010-11-18 06:00

Set NR and Sharpness to 0

Tested 1920x1080 Avatar and it seems to run good, Still dropping frames, but not like before.
[Image: fsorS.jpg]

Nightmare b4 xmas still at around 21-22 fps and drops alot of frames
[Image: VEm9Ml.jpg]


- Flomaster - 2010-11-18 17:01

anyone using these instructions with XbmcFreak beta4 Vanilla and can this be done with my amp and tv turned off or do they both need to be on?

I would assume they need to be as to get that EED or EDD resolution thing.

-=Jason=-


- bobo1on1 - 2010-11-18 20:35

Th3R00st3r Wrote:Set NR and Sharpness to 0

Tested 1920x1080 Avatar and it seems to run good, Still dropping frames, but not like before.
http://imgur.com/fsorS.jpg

Nightmare b4 xmas still at around 21-22 fps and drops alot of frames
http://imgur.com/VEm9Ml.jpg

Did you choose "apply to all movies" to turn off sharpness and noise removal by default for all movies?


- boba23 - 2010-11-20 14:08

Did some more digging into my framedrop issue ... seems that I only get the problem if "Force full GPU Scaling" is disabled in nvidia-settings. This seems to be default with the nvidia-driver or is it caused by the nvidia-settings set by the howto in post #1?
Anyone else experiencing this? Do you guys have Force Full GPU Scaling on or off in nvidia-settings?
I can reproduce it here, as soon as I turn it off, frame drops start happening plus vdpau h264 playback gets choppy as well ...

boba


- bobo1on1 - 2010-11-20 16:10

If you have force full gpu scaling turned on, then the refreshrate will be fixed at 60 hertz, so that is probably the reason.
You could turn off adjust refreshrate to match video in XBMC to get the same thing.


- boba23 - 2010-11-20 16:21

bobo1on1 Wrote:If you have force full gpu scaling turned on, then the refreshrate will be fixed at 60 hertz, so that is probably the reason.
You could turn off adjust refreshrate to match video in XBMC to get the same thing.

Hmm, well but I am pretty sure, that xbmc still tells me it switches refresh rates even with gpu scaling on. pressing O shows me 24hz for my 24hz content.
Will check debug log to see if xrandr actually switches refresh rates while gpu scaling is enabled.
Anyway, I still don't get it why I get the frame drops / choppy playback issue without gpu scaling enabled ... any ideas?

EDIT: debug log says:

15:23:42 T:140523293488912 M:1630822400 NOTICE: Display resolution ADJUST : default: 1920x1080 @ 24.00Hz (14)

WITH gpu scaling set to enabled.

boba


- bobo1on1 - 2010-11-20 17:10

The facts that the debug log says that doesn't mean it's true.
It's of course possible that nvidia has fixed this recently.


- Superorb - 2010-11-20 17:40

XBMC might say 24p, but does your TV say 24p as well?

I don't even have an option to go into nvidia-settings on my Live machine.


- boba23 - 2010-11-20 19:18

Superorb Wrote:XBMC might say 24p, but does your TV say 24p as well?

I don't even have an option to go into nvidia-settings on my Live machine.

My TV, Panasonic Plasma, only shows 720p,1080p etc. as source signal, not the actual refresh rate ....