You mean 0.4.5, right? The stimulus display code changed significantly between 0.4.4 and 0.4.5 (e.g. that’s when we started using the display link), so I really hope we haven’t been talking about results obtained under 0.4.4.
Yep, sorry about that. 0.4.5 is what I was talking about.
If I’m interpreting your time stamps correctly, what these results show is a single instance of glFinishFenceAPPLE returning “late”, by which I mean “later than we’d like”, since the API makes no guarantee about when it will return, other than that it will be after all subsequent GL actions have completed.
The API does guarantee that it will return after all prior GL commands are processed. If it does not guarantee that it immediately returns, what’s the point of using it? The only thing I am really interested in is having a solid estimate for the VBL, if the Fence does not return now and then, it should not be reason for the timestamp.
Despite the late return, drawing for the next refresh does complete on time, which is why the time stamp for the next announcement is +8554.000000 (i.e. half a refresh cycle after the previous announcement, and coincident with the next VBI and buffer swap). Hence, the “short” interval here is just an artifact of the method you’re using to compare display update times, and the corresponding display update is actually right on time.
In this case, that is true. However, I think I gave you enough evidence already (post 7) that also the opposite, namely first a short, then a long delay happens. Hence the short timings are not artifacts in general, although the short interval in this specific example is. From what I have seen so far, the ‘off-time’ seems to be at least one quarter of the display refresh rate. It can also be half of a cycle or three quarters. I can’t confirm this with data, but maybe it means something to you.
** I tried solution 2 today and succeeded in building a fully functional version of MWorks**, which means that I can run my tests and I don’t see any irregularities, whatsoever. As for your implementation, I would suggest to not use the outputTime estimate but wait for the next Now value.
I think you received the messages of Kenneth Dyke as well. Although he claims that the Now value has nothing to do with the VBL, it is different from the estimate given by the previous invocation of CVDisplayLinkCallback. It’s just a feeling, but I would trust it more.
For this approach to be reliable, we would need to be confident that if frames were skipped, then the previously-drawn frame actually appeared on screen during the most recent refresh. As far as I know, the display link in no way guarantees this, so this approach makes me nervous.
Me too. We would have to compare the estimates of CVDisplayLink with the actual output of the screen. It’s quite easy to build a closed loop with photo-diode connected to the IO-Device. If then the timestamps of the DisplayLink and the diode activity are perfectly correlated I would trust the technique more. However, it is the first time since I use MWorks that I see perfectly smooth motion on the screen. That makes me think that the estimate of CVDisplayLink can’t be that bad.
More problematically, updating MWorks to use OpenGL 3.2 would require rewriting the drawing code for most stimuli, as 3.2 breaks compatibility with 2.1. That would require a significant amount of work. However, we will have to make that jump eventually, so the question is really “how soon?”.
I agree that updating to OpenGL 3.2 looks very promising. I installed Lion about three days ago and since then I am trying to get it to run. You are perfectly right about it being a fair amount of work, and I don’t have, neither now nor in the future, time to do it.
I you ask me to make up a list of priorities: Let’s get one stable version for Snow Leopard first and then switch to OpenGL 3.2 in MWorks 0.6
One other quick thing to add: there are hardware solutions to this problem as well. In my lab, we always measure the screen with photodiodes.
Hi Dave, thank you for your suggestions! Are you sure that we need GL_ARB_timer_query at all? There are these nice functions called glWaitSync() and glClientWaitSync() that come with GL 3.2. Is this not exactly what we want to have?
We have a special stimulus that is persistently queued in the bottom corner of the screen, and a photodiode array affixed to the screen over it.
I was thinking about something similar already, but your version (4-bit code) sounds very promising. Setting up the hardware doesn’t sound too complicated to me, it’s just four times the diode-device we already have, right? Having the stimulus and the analysis routines for the signal would be a real step forward for me. I would be very happy to share knowledge with you, although there is not much I can offer you at this point :). Did you talk to Stefan about this array?
Cheers,
Philipp