nV News Forums


nV News Forums (http://www.nvnews.net/vbulletin/index.php)
-   NVIDIA Linux (http://www.nvnews.net/vbulletin/forumdisplay.php?f=14)
-   -   VSync Failing under load? (http://www.nvnews.net/vbulletin/showthread.php?t=132748)

bwheaton 05-10-09 07:41 AM

VSync Failing under load?
I have a fairly complex OpenGL based app, and after some struggling, I have a working vsync setup. I can increase the number of frames between swaps and see it, and I have a white flash test pattern that shows a good sync when my app starts. The problem is when I start to run video - I start to get tearing in the center of the screen.

In my app, I do have:
a thread per screen,
a shared context that does nothing,
a thread per video I play.

The video threads, which I use to upload frames so that any screen can use them, and to stop shader recompilations etc. (as the video type changes) affecting the screen threads, use a fence so I know when they have completed drawing a frame, at which point they become available to the screen threads.

The exact same situation appears if I only have one screen running, full screen on one display of a twinview pair.

As I say, it seems that the load is making the vsync fail. This is with driver 180.44 on a current Arch Linux based system, and a built in laptop 9300 or an 8200 on a Mini-ITX mobo, or 8800 cards.

Any clues? I'm a bit under the gun on this issue.


bwheaton 05-10-09 01:10 PM

Re: VSync Failing under load?
1 Attachment(s)
Here's the compulsory bug report for my development machine - maybe it shows the failure, don't know.

But meanwhile, on a hunch, I made my 'fullscreen' object fill the whole twinview display as opposed to the single display it's meant to be on. Then it seemed that both displays - even though one is an internal LCD I've had no luck setting 59.95 Hz on and the other is/should be outputting 720p at 59.94 seemed to be clean of any tearing.

This is a bit of problem for me. I guess the notes on flipping should have said that only a single fullscreen OpneGL app filling the whole TwinView screen would flip? Even on another system with two - theoretically - identical outputs (displays) running as separate threads with their own swap buffer calls we get tearing. Is this a limitation of tearing and TwinView?

So, what's the solution? Can I use two X Screens now? I was having trouble sharing contexts between two screens before - is that supported on 180.xx drivers? Or is the flipping limitation not present on other drivers (hopefully later?)


Bruce Wheaton

AaronP 05-10-09 05:04 PM

Re: VSync Failing under load?
Flipping on GeForce GPUs does indeed require your window to fill the entire framebuffer (including both displays in TwinView). You should be able to have your screens flip independently with separate X screens, but I can never remember what the sharing rules are between OpenGL contexts on different screens.

Quadro GPUs can do flipping in a window as long as only one OpenGL window is active at a time.

bwheaton 05-11-09 10:27 AM

Re: VSync Failing under load?
OK, thanks for that confirmation Aaron. I can rework some of my screens to do shared swapping, but I'm curious - is there a way around this on a TV out? How does TV out vsync swapping work? Is that different than flipping in a way we can exploit?


AaronP 05-11-09 02:24 PM

Re: VSync Failing under load?
TV-out shouldn't be any different from any other output type as far as flipping and vsync are concerned.

bwheaton 05-13-09 05:03 AM

Re: VSync Failing under load?
Thanks for your help.

Just before I go too crazy with a switch-around, can I ask two more questions:

Is there a compositor that uses OpenGL enough that I could have a window with one OpenGL view on one screen (of a twinview pair) and the other display fullscreen?

Could I roll my own triple-buffering? Is that what alternate solutions are doing (SDL)? I my case I would do all my drawing to a back back buffer then use a non-vsynced swap. I presume that's what compositors and Mac OS X do?


All times are GMT -5. The time now is 05:38 AM.

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