hi,
looking through the source code for flip i have a suggestion/request
for an alternate method for syncing to the vbl. Instead of calling
glfinish() as in when dontsync=0, can we have a version that simply
calls glflush() and then returns with the beamposition query?
Alternately, simply enabling beampos queries from within matlab would
suffice via using flip with dontsync=1 (or just returning beamposition
queries when using this flag).
i would like this because i think it would help to avoid the latency
jitter in windows due to the sleeping involved in the glfinish call.
Obviously there will still be latencies in glflush, but they should be
much lower. After flip returns, i can then use a busy waiting routine
within matlab (without putting the process to sleep) using the
predicted time to VBL or stimulus onset. This will help guarantee
syncing to VBL and returning before stimulus onset which is crucial
for the electrophysiology experiments i'm designing, as it would
enable, say, sending a TTL pulse precisely aligned with stimulus onset
with ~microsecond accuracy. Although my current rig works very well
with the standard flip calls (using my new nvidia 7950), there are
still occaisional frames where flip returns after SOT which i would
like to avoid, and i think this simple software fix would really help.
I have played with the hidden vbl_synclevel=3 as another option. It
generally gives much higher timing accuracy for me but fails
frequently (missing a frame) for reasons I can't pinpoint, as I
somewhat expected from the inline comments saying it's 'dangerous.'
Thoughts?
Scott
looking through the source code for flip i have a suggestion/request
for an alternate method for syncing to the vbl. Instead of calling
glfinish() as in when dontsync=0, can we have a version that simply
calls glflush() and then returns with the beamposition query?
Alternately, simply enabling beampos queries from within matlab would
suffice via using flip with dontsync=1 (or just returning beamposition
queries when using this flag).
i would like this because i think it would help to avoid the latency
jitter in windows due to the sleeping involved in the glfinish call.
Obviously there will still be latencies in glflush, but they should be
much lower. After flip returns, i can then use a busy waiting routine
within matlab (without putting the process to sleep) using the
predicted time to VBL or stimulus onset. This will help guarantee
syncing to VBL and returning before stimulus onset which is crucial
for the electrophysiology experiments i'm designing, as it would
enable, say, sending a TTL pulse precisely aligned with stimulus onset
with ~microsecond accuracy. Although my current rig works very well
with the standard flip calls (using my new nvidia 7950), there are
still occaisional frames where flip returns after SOT which i would
like to avoid, and i think this simple software fix would really help.
I have played with the hidden vbl_synclevel=3 as another option. It
generally gives much higher timing accuracy for me but fails
frequently (missing a frame) for reasons I can't pinpoint, as I
somewhat expected from the inline comments saying it's 'dangerous.'
Thoughts?
Scott