Go Back   nV News Forums > Linux Support Forums > NVIDIA Linux

Newegg Daily Deals

Reply
 
Thread Tools
Old 03-01-07, 10:11 PM   #1
r.c.
Registered User
 
Join Date: May 2006
Posts: 13
Default XVideoTextureSyncToVBlank, xorg high cpu

Hi, I've been trying to eliminate some tearing on rendered YUV frames. I'm using SDL to render them to a YUV overlay, and couldn't find a decent way to sync draws with the vertical retrace (vsync). I thought I'd finally found the answer when I came across XVideoTextureSyncToVBlank as a setting inside the nvidia-settings tool, and indeed it did fix the tearing (none of the other X sync oriented settings seemed to make any difference). Then the problem reared it's ugly head...

When running just one rendering task at a time, it worked ok, but it quickly killed performance when I started doing more than one. The symptom is that the X server would start climbing to higher and higher CPU usage, for example, with XVideoTextureSyncToVBlank=0, xorg cpu usage with one overlay going would be < 2%. With it =0 and 8 windows going, it would still be under 10% or so. But with XVideoTextureSyncToVBlank=1, it would be maybe 20% for one, but would climb over the course of a few seconds from 40 or to 95+ for 2 or more, and would be basically be unusable for any more than 1 or 2 windows. I've seen this happen across recent nvidia driver releases (87.56 and 97.46 at least) and across a wide range of distributions, X versions, and kernels, both 32 and 64 bit.

I'm wondering why, and whether there is another way to get vsync functionality via the X and XVideo type functions used by SDL, or if not, perhaps a suggestion for an alternate rendering approach (as two extremes, I've considered both GL and DirectFB - wasn't sure about hardware assisted YUV support for either though).

Also, as a heads up to anyone else that may be affected - perhaps MythTV users, mplayer folks, etc., it looks like the default of XVideoTextureSyncToVBlank has been changed from 0 to 1 in the latest drivers (97.46), so this might start hitting more people. You can change it back with nvidia-settings -a XVideoTextureSyncToVBlank=0 but then of course, you may get tearing again.

Thanks for any explanations, help, etc.
r.c. is offline   Reply With Quote
Old 03-02-07, 05:58 AM   #2
kokoko3k
Registered User
 
Join Date: Jan 2007
Posts: 120
Default Re: XVideoTextureSyncToVBlank, xorg high cpu

Quote:
I'm using SDL to render them to a YUV overlay
XVideoTextureSyncToVBlank is not related to overlay video adaptor, but to video texture adaptor.
If you're lucky and you driver/gpu supports YUV overlays, try to use them!

with mplayer. you can speedup the rendering of opengl video (plus nicer scaling) using:
mplayer movie.xxx -vo gl:yuv=6:lscale=1:cscale=1
(it will still use some more cpu power compared to XV texture/blitter adaptor and, of course, YUV overlay).
You may also want to benchmark with different "yuv=[1..6]" to see what's better for your card.
kokoko3k is offline   Reply With Quote
Old 03-02-07, 10:28 AM   #3
phelin
Registered User
 
Join Date: Jan 2006
Posts: 30
Default Re: XVideoTextureSyncToVBlank, xorg high cpu

Try setting this in the device section of xorg.conf:

Option "UseEvents" "True"
phelin is offline   Reply With Quote
Old 03-02-07, 04:11 PM   #4
r.c.
Registered User
 
Join Date: May 2006
Posts: 13
Default Re: XVideoTextureSyncToVBlank, xorg high cpu

kokoko3k, thanks. I'm not using mplayer, but rather our own code. I just mentioned mplayer as an example of a similar program that might be affected in the same ways (if multiple instances at once are run across multiple screens).

I am using YUV overlays, however we have multiple displays. My understanding is that in the second display driven off of the nvidia card, you fake YUV overlays with blits. The rendering is definitely sync'd when XVideoTextureSyncToVBlank is set to 1, and is not when it is set to 0, and the performance with multiple windows being rendered is most definitely as I described. I'm not positive that SDL is actually using hardware surfaces in all cases (I just need to add some code to check), and like I mentioned we are using multiple displays, so some of this could be related to the way display 2 is handled by the driver (not sure if it happens in 2 X screen configs, but it is definitely happening in twinview configs). However, performance is great with the XVideoTextureSyncToVBlank turned off, so thought I'd bring it up here.


Thanks for the tip Phalin, will look into it.
r.c. is offline   Reply With Quote
Old 03-02-07, 04:54 PM   #5
kokoko3k
Registered User
 
Join Date: Jan 2007
Posts: 120
Default Re: XVideoTextureSyncToVBlank, xorg high cpu

@Phelin: i don't know how that will affect the smoothness of my videos, but interface redrawings seems A LOT better now, thanks!
kokoko3k is offline   Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


Similar Threads
Thread Thread Starter Forum Replies Last Post
Maintain Your Privacy by Manually Accepting and Rejecting "Cookies" (nV News) MikeC Open Forum 2 02-02-13 07:15 PM
xorg locks-up with newest nvidia drivers w/ vdpau. theroot NVIDIA Linux 1 06-24-12 11:04 AM
173.14.34 -- Xorg 1.12.1 & 1.11.4, glx module fails to load mereset NVIDIA Linux 17 06-10-12 01:24 AM
295.40 Drivers and Xorg 1:7.6+12 HIGH cpu usage norrland NVIDIA Linux 2 05-13-12 09:11 AM
CPU limitations abound! PCarr78 NVIDIA GeForce 7, 8, And 9 Series 11 10-03-02 07:49 AM

All times are GMT -5. The time now is 10:18 PM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright 1998 - 2014, nV News.