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


Sponsored Ad

Reply
 
Thread Tools
Old 01-23-08, 12:19 PM   #1
mlfarrell
Registered User
 
Join Date: Mar 2005
Posts: 65
Default sync to vblank

So here's the burning question.

why is it that sync to vblank sucks?

I've been programming graphics for roughly 7 years now and even back in the DOS days, I'd dread the use of calling vsync() once per loop because I know it'd kill the fluidity of the game. Sure you'd eliminate the tearing effect, but at what price?

The same thing goes to date with pc's all the way up to now, including linux openGL. Even with a laptop that has a gpu connected to my system with a tight PCI-X bus, it seems as if the system just can't keep a good syncrhonization with the refresh rate clock. I admit that performance of the apps running is a big determinant (if you miss your refresh by 60.01 hz, then you have to wait for the next cycle to draw dropping a whole frame), however I've seen the simplist fastest programs still suffer from this non-fluidity.

what I believe to be happening is an inaccuracy of the synch. between the clocking mechanism that the system is using (internal motherboard or gpu clock) and the display device itself.

it also doesn't help i'm sure that i'm running a geforce go with a tickless kernel

linux by far is not the only OS I've seen suffer from this. windows vista's responsiveness and refresh speed sucks because aero syncs to the refresh rate.

However, I must admit that using Mac OSX seems much more fluid to me. Which wouldn't surprise me since the same company that makes the displays also makes the motherboard.

Nvidia hardware gurus, what is your take on this? Any way to increase the accuracy sync to vblank?
mlfarrell is offline   Reply With Quote
Old 01-23-08, 02:49 PM   #2
lduguay
Hey! Lemme smoke
 
lduguay's Avatar
 
Join Date: Oct 2004
Location: Montreal, Canaduh!
Posts: 1,971
Default Re: sync to vblank

Write your app to use triple-buffered VSync. That will give game/app fluidity and with no tearing.
__________________

Evga X58|I7 965 3.8GHz|Ultra 120 Extreme|2 x EVGA GTX 480 SC SLI|2 x Intel X25-M 80GB RAID 0|WD Black Caviar 1TB|6GB Corsair XMS3 1600C8 |Corsair 1000W PSU|Antec Twelve-Hundred|Samsung 305T|Logitech G9|Logitech G15 2ed|LG BH10LS30
lduguay is offline   Reply With Quote

Sponsored Ads - Guests Only

Old 01-23-08, 04:35 PM   #3
mlfarrell
Registered User
 
Join Date: Mar 2005
Posts: 65
Default Re: sync to vblank

what about with compiz though? compiz seems to suck with fluidity when I'm updating the whole screen (cupe spin, alt+tab, etc), all those are quite choppy

kde4 is worse (fluidity), the user interface speed of vista isn't much better. but i maintain that osx has it down pretty well.
mlfarrell is offline   Reply With Quote
Old 03-07-08, 04:05 PM   #4
wolf08
Registered User
 
Join Date: Mar 2008
Posts: 4
Default Re: sync to vblank

I'm curious if anyone has any ideas on how to improve the fluidity of composited window managers such as compiz or kwin (kde4)? I'm also experiencing this (on both a NVidia 7600GT and an Intel X3100) and it really destroys the whole 'fluidity' and 'smoothness' image normally given by a composited environment.
wolf08 is offline   Reply With Quote
Old 03-07-08, 05:04 PM   #5
txf
Registered User
 
Join Date: Feb 2008
Posts: 272
Default Re: sync to vblank

I'd give a lot to understand why sync to vblank makes compositing choppy. When forcing it on compiz, it benches always at 60 frames a second as it should, but its really lumpy(I read somewhere that its because nvidia does funky hacks with refresh rates...). In 3d games 60 frames a second is silky smooth, I can't understand why I have to have vsync turned off... it ruins all my videos too.

Its the main reason I don't use a composited environment under linux. (note that I've never had any sync problems with aero, the framerate chugs esp when powermizer kicks in, but no texture tearing)
txf is offline   Reply With Quote
Old 03-07-08, 05:35 PM   #6
ctheo
Registered User
 
Join Date: Mar 2007
Posts: 74
Default Re: sync to vblank

Quote:
Originally Posted by txf
I'd give a lot to understand why sync to vblank makes compositing choppy. When forcing it on compiz, it benches always at 60 frames a second as it should, but its really lumpy(I read somewhere that its because nvidia does funky hacks with refresh rates...). In 3d games 60 frames a second is silky smooth, I can't understand why I have to have vsync turned off... it ruins all my videos too.

Its the main reason I don't use a composited environment under linux. (note that I've never had any sync problems with aero, the framerate chugs esp when powermizer kicks in, but no texture tearing)
you play fps games with vsync on? huh? at 60Hz that would be terrible mouselag
ctheo is offline   Reply With Quote
Old 03-07-08, 05:45 PM   #7
wolf08
Registered User
 
Join Date: Mar 2008
Posts: 4
Default Re: sync to vblank

I guess the real question is why do I (and others in this thread) experience terrible tearing artifacts on linux but absolutely none on the same hardware with OSX? Is there something happening behind the scenes that can't be fixed?

I get tearing in games (with or without vsync), such as neverball, as well as in compiz and in kwin.

I can't speak for Aero - I have never used it.
wolf08 is offline   Reply With Quote
Old 03-07-08, 09:13 PM   #8
txf
Registered User
 
Join Date: Feb 2008
Posts: 272
Default Re: sync to vblank

I don't play fps games (there are non fps games too you know) with vsync on... not new ones anyway...old games i guess you can get away with it. If the minimum framerate in the game is greater than your refresh rate then the game should play fine.

I assume osx quartz and vista areo both use vsync because there is never any tearing...even in windowed direct3d animations (dunno about ogl in osx)... maybe wolf08 could say.

The thing about compiz with videos is that vsync for the xv texture adaptor is turned off for composite (or is it glx...one of the two). So even if you have vsync turned on for opengl the xv will tear... which is a pain.

In kwin I only get tearing when it has compositing enabled. However in neverball I can't seem to get any tearing whatsoever...even with sync to vblank disabled.
txf is offline   Reply With Quote
Old 03-08-08, 12:05 PM   #9
bearoso
Registered User
 
Join Date: Sep 2003
Posts: 42
Default Re: sync to vblank

There's no synchronization between GL apps when vsync is enabled. Therefore, when a compositor embeds a GL app inside itself with vsync, it's all up in the air which application gets control first after the interrupt.

Current GL-based compositors don't draw immediately after the interrupt, anyway--they use the VideoSync extension to do a poll within the compositor application and draw using dirty rectangles. When the server locks and is drawing for the embedded GL application, the compositor is asynchronously updating from their partially drawn framebuffer, giving you tearing effects.

Quartz and Windows have synchronous event systems and integrated window managers, making vsync handling fairly easy. X is a completely different beast to write drivers for. Also, I've extrapolated from the mailing lists that the majority of kwin and compiz authors don't use vsync within the compositor or even use any other GL applications. Chances are, this isn't going to be fixed--ever.

This is one of many issues why I don't use, and recommend not using a compositor until both driver and compositor developers make some significant changes.
bearoso is offline   Reply With Quote
Old 03-08-08, 01:42 PM   #10
Silverbak
Registered User
 
Join Date: Jun 2007
Posts: 47
Default Re: sync to vblank

If I have one major grip about the linux platform in general, it wouldn't be closed-source drivers, it wouldn't be flaky suspend and hibernate support, it wouldn't even be the 2nd rate wi-fi state of affairs.. it would be... visual tearing...

For me seeing visual tearing is like someone running their nails down a chalk-board. I don't have synaesthesia however through this sensation I gain some insight into their experiences!

I am using KDE 3.5 and have never been able to get vsync to work properly, period. This same machine dual-boots Vista and that syncs perfectly.

One day, I really hope that some kind of Kernel/Xorg/NVIDIA/ATI/Intel/KDE/Gnome/Compiz solution is proposed and implemented to solve this issue. There has to be a better way however I agree with your sentiment that this is something that may never be fixed.
Silverbak is offline   Reply With Quote
Old 03-08-08, 02:00 PM   #11
Vadim P.
Registered User
 
Join Date: Mar 2008
Posts: 27
Default Re: sync to vblank

Ohh.. well now I know at least what does sync to vblank does, it's that 'tearing' that I get sometimes when I'm making a screencast of the whole screen.

I've never ever seen it happen in normal usage though (ati radeon 7500 + compiz or geforce 8600 + compiz). What graphics are you people on?
Vadim P. is offline   Reply With Quote
Old 03-08-08, 02:11 PM   #12
txf
Registered User
 
Join Date: Feb 2008
Posts: 272
Default Re: sync to vblank

I use a 8600m gt, but tearing for me only happens when there is high motion (ie dragging wobbly windows very fast, fast transitions in videos). I could live with tearing if not for the videos where it is extremely distracting also triple buffering does not work with xv so no relief there
txf is offline   Reply With Quote
Reply


Most Popular NVIDIA Based Graphics Cards


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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


All times are GMT -4. The time now is 08:46 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
nV News - Copyright ©1998-2010. All rights reserved.