Help Understanding "Dropped" Frames

518 views
Skip to first unread message

Derric Williams

unread,
Feb 25, 2013, 2:29:02 PM2/25/13
to psychop...@googlegroups.com
Hello,
I am trying to get a bead on exactly what is happening when a frame is "dropped."  From my understanding, a "dropped" frame is still displayed, only slightly later.  For example, if the frame interval between frame 4 and 5 is 40 ms (instead of 16.67 ms), then frame 5 is not skipped, it is only displayed 23ms later than it should have, and the software then proceeds to display frame 6 afterward.  Or am I wrong and frame 5 is skipped entirely?

If my understanding is correct, then if you are using a set presentation time for your stimulus, then a "dropped" frame in the middle of the presentation actually just cuts off frames from the end of the presentation.

To distill my question down to a single sentence: "Is a frame that is 'dropped' skipped or just delayed?"

Thanks in advance,
Derric

Sol Simpson

unread,
Feb 26, 2013, 7:35:18 PM2/26/13
to psychop...@googlegroups.com
Another way to think of 'dropped frames' is as 'missed retrace intervals'. As you say, in standard psychopy lingo a 'dropped frame' (or more) basically means that the time from the last call to window.flip and the current window.flip call took longer than 1 retrace interval, so 60 Hz is 16.666.. msec. If you get errors that frames are being dropped, it means that you are not able to update / redraw your display on every retrace.  Depending on how the frame drop detection is implemented, this may simply be due to the 'draw / build time' of your stimuli taking longer than 1 retrace and this is being reported as dropped frames, or if draw / build time is being factored into the frame drop equation, then it would suggest the OS may be stealing longer than acceptable periods of time from your script causing it to actually miss vertical blanks / retrace intervals.

Jon / Jeremy, is this a fair summary?

Thanks,

Sol

Jonathan Peirce

unread,
Feb 27, 2013, 5:24:53 AM2/27/13
to psychop...@googlegroups.com
--
Basically, it depends how you write your code. You could write it based on frames like this::

for frameN in range(10):
    stim.SetPos([frameN*10,0])
    stim.draw()
    win.flip()

Or based on time (a clock) like this::

t=0
trialClock.reset()
while t<0.5:
    t=trialClock.getTime()
    stim.setPos([t*100,0])
    stim.draw()
    win.flip()

In the former case the stimulus will always appear at every location. A dropped frame will cause one double-length frame in the middle of the sequence and the overall period will be one frame longer. In the second case you'd end up with a double-length frame but then the next frame would be essentially omitted and the overall time will be the intended duration. If you aren't dropping frames then using frames as the timing mechanism is definitely the most accurate method, but if you are then I would recommend you use clocks for timing.

Jon

-- 
Jonathan Peirce
Nottingham Visual Neuroscience

http://www.peirce.org.uk



Derric Williams

unread,
Feb 28, 2013, 1:21:37 PM2/28/13
to psychop...@googlegroups.com
Thanks a lot guys.  My display loop is frame-based and not time-based so your first example is applicable.  This has helped a lot.
Reply all
Reply to author
Forward
0 new messages