[visionegg] Re: OpenGL latency

Dear Gabriel -- there is no triple buffering going on, so I'm pretty sure this is not the issue.

Dear Martin -- IIRC, I was actually getting a 10 msec delay on somewhat older graphics cards (nVidia GeForce 4 Ti). So if this is a "pipeline latency" perhaps it is dependent on the complexity of the scene (a bit higher for my stimuli, I think) and the speed of the graphics card.

If you turn off "sync swaps to vsync", is the latency reduced? (Yes, I know this causes other problems, but perhaps they could be largely worked around, especially if you have feedback from a DAQ card about when your frames are actually being drawn.)

I wonder if DirectX would have this same issue. I'd be surprised if it didn't, but the driver code paths may be substantially different, so I suppose it's a possibility.

This is really the only issue that's holding up submission of a methods manuscript on the Vision Egg. I keep wanting to do "just one more calibration" to get to the bottom of this issue, but I simply haven't had time without it being my #1 priority. Anyhow, it's good to keep the issue on my radar screen -- I hope I'll get back to it myself before too long.

Cheers!
Andrew

Gabriel Nevarez wrote:
Hi, Martin,

A colleague of mine has the following suggestions... dunno if it's applicable, but here goes anyway... cheers
-=gabe



From: Simon xxxxxxx <xxxxxxxxxxxxxxxxxxxx> Subject: Re: [visionegg] OpenGL latency Date: Mon, 7 Mar 2005 15:41:08 +0000 To: Gabriel Nevarez <xxxxxxxxxxxxxxx>

sounds like triple buffering to me. if latency is an issue then take a look at the opengl extensions for your video card (check the ATI or nVidia website as appropriate) and you should be able to find an option to turn the triple buffering off. think about what you need though because if you want high frame rates and you don't need to make the display responsive - such as making it change dependent upon the instantaneous state of an input device then stick with triple buffering. triple buffering is designed to raise the frame rate and make animation smoother by making sure the CPU/GPU is always working on something rather than waiting for a buffer swap.

simon


Hello all,

Armed with a photodiode, a scope, a data translations dt340 I/O board and
a single frame target stimulus, we just noticed that the buffer_swap()
function swaps buffers not on the next vsync, but on the subsequent one.
This means that everything on the CRT is lagged by 1 frame with respect to
anything else we have happening in our code. This is the case for both our
Intel and AMD systems, with either an ATI or Nvidia card, in Windows 2000.
After some disbelief that this was happening, I came across a few
indications that OpenGL commands have an inherent latency. A posting by
Andrew over a year ago:


---
After plenty of trial-and-error with these issues myself, I'm also forced
to conclude that the photodiode technique is best for absolute timing
accuracy. I have some new (to me) knowledge about OpenGL cards that's not
on the website yet: as I understand it, the OpenGL "pipeline" has a
driver-dependent duration of a couple of frames, so commands sent to
OpenGL don't actually get to the display until a few frames have been
drawn. I think this explains the latency you're seeing. I'm still trying
to understand this issue, though, so I'd really like to get some feedback
from someone who knows (does anyone have any contacts with video card
driver experts?). I believe that such asynchronous operation and related
issues was on the agenda for improvements in OpenGL 2. However, a recent
scan of OpenGL 2 documents (particularly the OpenGL ARB meeting minutes)
seems to show diminished interest in this issue. Hopefully I'm wrong, but
it appears that all the ARB members are devoting most or all of their
resources to vertex and pixel shading.
---

The delay I see is only ever a single frame (5 ms), so we might just
subtract that constant off at our data collection end. Still, there's a
change it could vary. I've searched through the recently released OpenGL 2
spec, and there's no mention of latency. Does anyone know if anything can
be done about this? This is quite different from the AGP or PCI bus
latency on the system board I gather?



====================================== The Vision Egg mailing list Archives: http://www.freelists.org/archives/visionegg Website: http://www.visionegg.org/mailinglist.html

Other related posts: