Vsync problem in linux

Intro:
I am not an experienced OpenGL programmer, but with the help of our resident programmer we have identified a possible source for a recurrent problem with video synchronization on linux PCs

The Program:
We are studying perception and using stimuli which flash on the screen for a 150 milliseconds. We are using swapbuffers and very simple stimuli (Big solid sqaures).

The Problem:
No matter how simple the display, we get a screen swap that is not tied to the moniter refresh (causing a very noticable flicker). The monitor runs at 76Hz, but it seems that OpenGL is defaulting to 60Hz for video sync. Furthermore, we have been unable to get access to the video blank signal to identify the start of a refresh. We have also used glXGetVideoSync without a success.

Is this problem our…
A. code. Is there some trick we don’t
know about?
B. video. Unsupported video card?
C. OS. Does Linux support video sync?
D. PC. Do PC’s have a video blank
command for vsync access?

The Equipment:
[The same program had run without this problem on a SGI O2] We are using a Matrox G100 videocard and a good Mitsubishi monitor, Pentium 2 about 350MHz. This problem has also been seen with a newer machine running an Riva TNT card.

If you have any suggestions please email me at:
jasonpro@netscape.net

The problem is probably the drivers or your code. Some drivers have vsync as default, some do not. To control vsync you can use the WGL_EXT_swap_control extension, but it’s perhaps not available in linux (WGL_* is windows only extensions i think …) but there may be something simililar.

The monitor runs at 76Hz, but it seems that OpenGL is defaulting to 60Hz for video sync.

That’s impossible. OpenGL has no any default frequency for a screen swap.

Furthermore, we have been unable to get access to the video blank signal to identify the start of a refresh. We have also used glXGetVideoSync without a success.

How can access to the video blank signal help you to synchronize swapping?

You can try glXWaitVideoSyncSGI ( GLX_SGI_video_sync ).
But GLX_SGI_swap_control is much more convenient (and it’s supported better).