Mac Triple buffering and EEG triggers

Hi there,

I just wanted to clarify the issue with MacOS and triple buffering, and how this would effect stimuli timings. If my code are subject to the 1 frame output delay, how would this manifest on an EEG trace when using (pseudo code):

win.callonflip(pingPort)
for frame in xrange(frames):
      stim.draw()
      win.flip()
pingPort()

I’m running an EEG study, and the trigger timings are falling about 8ms short of the intended duration (120Hz monitor, so 1 frame). This sounds to me like the mac frame delay. I’m trying to figure out where the 8ms discrepancy is coming from, and how to fix it.

Any input would be great. Thanks!

Martin.

No, buffering doesn’t affect duration, it just adds an absolute lag in time, which is constant for all frames. i.e. frames are all drawn at a steady flow of 120 Hz. The time between any pair of frames should always be correct. In your code above, if you draw 120 frames, the last one should appear exactly 1 second after the first, but the absolute time that the first frame appears (if there was a pause in drawing beforehand) may be one frame duration later than intended.

So if you are seeing an impact on duration, we need to know more about your code and how you determine that the measured duration is shorter than intended. It’s always possible that your code is subject to the dreaded off-by-one error…