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

Newegg Daily Deals

Reply
 
Thread Tools
Old 10-29-10, 08:35 AM   #1
Johann Baudy
Registered User
 
Join Date: Oct 2010
Posts: 4
Angry glX VSYNC does not work with ACER GD245HQ

Hi, I'm trying to implement vertical sync using openGL X with an ACER 19" 1920x1080 120Hz GD245HQ.

Please find below my simple GL code for each frame:

glClearColor(0.0, 0.0, 0.0, 1.0);
glClear(GL_COLOR_BUFFER_BIT);
glBegin(GL_QUADS);
if (i_current) {
glVertex2f(-1.0, -1.0);
glVertex2f(-0.1, -1.0);
glVertex2f(-0.1, 1.0);
glVertex2f(-1.0, 1.0);
} else {
glVertex2f( 0.1, -1.0);
glVertex2f( 1.0, -1.0);
glVertex2f( 1.0, 1.0);
glVertex2f( 0.1, 1.0);
}
glEnd();
glFinish();

glXGetVideoSyncSGI(&i_before_count);
glXWaitVideoSyncSGI(2, (i_before_count+1)%2, &i_after_count);
glutSwapBuffers();

Concerning software timings, everything seems to be perfect. glutSwapBuffers() occurs at 119.98 Hz (sqrt(var): 79.74 us). (nvidia-settings also indicates this frequency for refresh rate)

But at screen, I can notice that sw swap (glutSwapBuffers()) is not "aligned" with my screen vsync. I still observe vsync side effects and flickering. Sw sync freq and Hw sync freq seem to be slightly different (clock drift).

I can't reproduce this issue with a Samsung SyncMaster 2233RZ which is also 120Hz but 1680x1050.

I use ubuntu 10.04 with nvidia driver 260.19.12 (GTX 470).

I'm running out of ideas. So I was wondering if this drift can be due to linux nvidia driver in metamode 1920x1080_120.00 (DUAL LINK)?

Any ideas ???

Thanks
Johann Baudy is offline   Reply With Quote
Old 10-29-10, 01:00 PM   #2
AaronP
NVIDIA Corporation
 
AaronP's Avatar
 
Join Date: Mar 2005
Posts: 2,487
Default Re: glX VSYNC does not work with ACER GD245HQ

glXWaitVideoSyncSGI only waits on the CPU for that particular vblank count to be reached. It does not guarantee that anything else happens during vblank. In particular, the SwapBuffers call schedules a swap for some unspecified time in the future. In addition, your call to glFinish() is an unnecessary bottleneck in your program: it waits on the CPU for all of the rendering to complete.

It sounds like what you want instead is to set the swap interval for your drawable to 1: this causes SwapBuffers to wait until the next vblank interval to actually perform the swap. This allows the CPU to start processing the next frame and also helps reduce tearing. You can do that by deleting your calls to glFinish(), glXGetVideoSyncSGI(), and glXWaitVideoSyncSGI(), and adding a call to either glXSwapIntervalEXT() or glXSwapIntervalSGI() to your program's initialization (you only need to set the swap interval once, rather than once per frame).
AaronP is offline   Reply With Quote
Old 10-30-10, 08:40 AM   #3
Johann Baudy
Registered User
 
Join Date: Oct 2010
Posts: 4
Default Re: glX VSYNC does not work with ACER GD245HQ

Thanks AaronP, I've just tried with glXSwapIntervalSGI() or glXSwapIntervalEXT().

Unfortunately, graphic results are the same:
- Tearing ... flickering .. for ACER GD245HQ
- Perfect with Samsung SyncMaster 2233RZ

With glXSwapIntervalEXT or glXSwapIntervalSGI or glXWaitVideoSyncSGI(), buffer swap seems to not be done during vertical blanking interval with ACER GD245HQ.

Below my GL code:

Init after window creation:
glXSwapIntervalSGI(1);

Idle:
glClearColor(0.0, 0.0, 0.0, 1.0);
glClear(GL_COLOR_BUFFER_BIT);

glBegin(GL_QUADS);
if (i_current) {
glVertex2f(-1.0, -1.0);
glVertex2f(-0.1, -1.0);
glVertex2f(-0.1, 1.0);
glVertex2f(-1.0, 1.0);
} else {
glVertex2f( 0.1, -1.0);
glVertex2f( 1.0, -1.0);
glVertex2f( 1.0, 1.0);
glVertex2f( 0.1, 1.0);
}
glEnd();

glutSwapBuffers();
Johann Baudy is offline   Reply With Quote
Old 10-31-10, 12:29 AM   #4
AaronP
NVIDIA Corporation
 
AaronP's Avatar
 
Join Date: Mar 2005
Posts: 2,487
Default Re: glX VSYNC does not work with ACER GD245HQ

Are you running a composite manager?

Also, unless you're using a Quadro with the Unified Back Buffer enabled, the hardware can't use flipping to guarantee that SwapBuffers actually happens during vblank unless your window is full-screen. It's possible that the 120 Hz mode has too short of a vblank for the hardware to perform the swap before the screen starts scanning out the new frame.
AaronP is offline   Reply With Quote
Old 11-02-10, 02:12 AM   #5
Johann Baudy
Registered User
 
Join Date: Oct 2010
Posts: 4
Default Re: glX VSYNC does not work with ACER GD245HQ

No, I've just tested with a

Quadro 570
+
Section "Device"
....
Option "UBB" "True"
EndSection
+
Section "Extensions"
Option "Composite" "Disable"
EndSection

in my xorg.conf. I still have the same issue on ACER GD245HQ
Johann Baudy is offline   Reply With Quote
Old 11-02-10, 10:49 AM   #6
AaronP
NVIDIA Corporation
 
AaronP's Avatar
 
Join Date: Mar 2005
Posts: 2,487
Default Re: glX VSYNC does not work with ACER GD245HQ

Check /var/log/Xorg.0.log to see if UBB is getting disabled for some reason. Also, please make sure that no other OpenGL applications are running at the same time. It can only swap by flipping when one OpenGL application is visible.
AaronP is offline   Reply With Quote
Old 11-03-10, 03:19 AM   #7
Johann Baudy
Registered User
 
Join Date: Oct 2010
Posts: 4
Default Re: glX VSYNC does not work with ACER GD245HQ

There is no other OpenGL application.

Below nvidia part of my /var/log/Xorg.0.log:

(**) NVIDIA(0): Depth 24, (--) framebuffer bpp 32
(==) NVIDIA(0): RGB weight 888
(==) NVIDIA(0): Default visual is TrueColor
(==) NVIDIA(0): Using gamma correction (1.0, 1.0, 1.0)
(**) NVIDIA(0): Option "NoLogo" "True"
(**) NVIDIA(0): Option "UBB" "True"
(**) NVIDIA(0): Option "TwinView" "0"
(**) NVIDIA(0): Option "MetaModes" "DFP-0: 1920x1080_120 +0+0"
(**) Nov 03 08:59:27 NVIDIA(0): Enabling RENDER acceleration
(II) Nov 03 08:59:28 NVIDIA(GPU-0): Display (Acer GD245HQ (DFP-0)) supports NVIDIA 3D Vision
(II) Nov 03 08:59:28 NVIDIA(GPU-0): stereo.
(II) Nov 03 08:59:28 NVIDIA(0): NVIDIA GPU Quadro FX 570 (G84GL) at PCI:1:0:0 (GPU-0)
(--) Nov 03 08:59:28 NVIDIA(0): Memory: 262144 kBytes
(--) Nov 03 08:59:28 NVIDIA(0): VideoBIOS: 60.84.63.00.11
(II) Nov 03 08:59:28 NVIDIA(0): Detected PCI Express Link width: 16X
(--) Nov 03 08:59:28 NVIDIA(0): Interlaced video modes are supported on this GPU
(--) Nov 03 08:59:28 NVIDIA(0): Connected display device(s) on Quadro FX 570 at PCI:1:0:0
(--) Nov 03 08:59:28 NVIDIA(0): Acer GD245HQ (DFP-0)
(--) Nov 03 08:59:28 NVIDIA(0): Acer GD245HQ (DFP-0): 330.0 MHz maximum pixel clock
(--) Nov 03 08:59:28 NVIDIA(0): Acer GD245HQ (DFP-0): Internal Dual Link TMDS
(II) Nov 03 08:59:28 NVIDIA(0): Display Device found referenced in MetaMode: DFP-0
(II) Nov 03 08:59:28 NVIDIA(0): Assigned Display Device: DFP-0
(II) Nov 03 08:59:28 NVIDIA(0): Validated modes:
(II) Nov 03 08:59:28 NVIDIA(0): "DFP-0:1920x1080_120+0+0"
(II) Nov 03 08:59:28 NVIDIA(0): Virtual screen size determined to be 1920 x 1080
(--) Nov 03 08:59:28 NVIDIA(0): DPI set to (93, 94); computed from "UseEdidDpi" X config
(--) Nov 03 08:59:28 NVIDIA(0): option
(==) Nov 03 08:59:28 NVIDIA(0): Disabling 32-bit ARGB GLX visuals.
(--) Depth 24 pixmap format is 32 bpp
(II) Nov 03 08:59:28 NVIDIA: Using 768.00 MB of virtual memory for indirect memory access.
(II) Nov 03 08:59:28 NVIDIA(0): Initialized GPU GART.
(II) Nov 03 08:59:28 NVIDIA(0): Setting mode "DFP-0:1920x1080_120+0+0"
(II) Loading extension NV-GLX
(II) Nov 03 08:59:28 NVIDIA(0): Initialized OpenGL Acceleration
(==) NVIDIA(0): Disabling shared memory pixmaps
(II) Nov 03 08:59:28 NVIDIA(0): Initialized X Rendering Acceleration
(==) NVIDIA(0): Backing store disabled
(==) NVIDIA(0): Silken mouse enabled
(==) NVIDIA(0): DPMS enabled
(II) Loading extension NV-CONTROL
...
(II) Nov 03 08:59:35 NVIDIA(0): Setting mode "DFP-0:1920x1080_120+0+0"
Johann Baudy is offline   Reply With Quote
Old 01-14-11, 04:56 PM   #8
thorolson
Registered User
 
Join Date: Jan 2011
Posts: 1
Default Re: glX VSYNC does not work with ACER GD245HQ

I have been fighting the same symptoms with the same monitor, but on Windows (Win7). The SwapBuffers update rate seems to be ever so slightly different from the display vertical sync. I am displaying alternate frames of a stereo pair, and every few seconds, the right-left sync reverses.

Further, with shutter glasses synced with the SwapBuffers call, shows the frames gradually drifting out of sync during each two or three-second cycle.

I recognize that SwapBuffers merely schedules the actual swap, but I don't think I would be seeing the gradual shift of the display unless the actual frequency of my SwapBuffer calls did not match the physical refresh on the display itself.

Is it possible that the NVidia driver or hardware (GEForce 240) is somehow decoupled from the display and is free running at close to, but not locked at, its actual refresh?

Johann, did you ever resolve this issue?

Oh, I have also attempted to synchronize via Direct3D getRasterStatus scanline tracking. The exact same symptoms result.

Any clues for solving this?
Thanks.
thorolson is offline   Reply With Quote

Old 09-21-11, 01:47 AM   #9
kokoko3k
Registered User
 
Join Date: Jan 2007
Posts: 120
Default Re: glX VSYNC does not work with ACER GD245HQ

This seems like a monitor issue; maybe the monitor real refresh rate is different from the driver one.
It happened to me in the past with a panasonic flat display connected via VGA; the panel just ignored any non 60hz refresh rate.
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


All times are GMT -5. The time now is 10:07 AM.


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