Message-ID:
<CAB+QPJDj3ykyJ=B+P4m4WDzkCwvQP2c20Cdp-6oN-bVY58EdnQ at mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1
While a high resolution timer is indeed useful for timing the interval
between the screen update and the time of response (by the way, there
is also a high res timer in SDL 1.3:
http://hg.libsdl.org/SDL/rev/6bd701987ba9), most critical would be
knowing when the screen pixels actually changed. Simply putting the
start of a timer right after a call to SDL_Flip() isn’t sufficient
because SDL_Flip() doesn’t wait to return when the pixels change, but
instead returns immediately, meaning that it’s possible that the timer
starts anywhere up to a refresh too early. The consequent variability
in the degree to which the timer starts too early (i.e. for some
stimuli it will be, say, half a refresh too early, for others it’ll be
a whole refresh too early, etc) adds variance to the recorded response
times that undermines my ability to detect differences between
experimental conditions.
So, to reiterate my question (and by now I’m thinking that the answer
is “no”): Is there a way to know the time at which the screen was
actually changed following a call to SDL_Flip()?
I believe that the answer is CLOSE ENOUGH to “no”. Particularly since
high-enough resolution could run afoul of the video card/display
anyways. I’d suggest that you seek a hardware solution:
Find a high-speed shutter device. Rig it up so that when it opens, a
high-accuracy timer starts, and when a button is pressed the timer is
paused. The shutter will respond to a signal, displaying the image (I
assume by way of a projector display) and starting the timer at the
same time, the user will press the button pausing the timer, and your
computer (which controls both the shutter & the display that the
shutter hides/displays) will read back the reading from the timer,
providing a much more accurate timing value than you could otherwise
obtain (admittedly, this might be over-kill).
SDL would be useful for displaying the image, but for high-accuracy
things I’d normally suggest something specialty where you don’t have
to worry about other issues (consider, modern operating systems can
pause your program, potentially interfering with your research).
If you need something motion-based, I’d suggest some sort of
high-speed movie projector setup. Before everything moved to digital,
sound was commonly encoded with a black and white strip on the side of
the film, which could be used for the timing signals instead. I don’t
know where you’d find the equipment, but I’d expect it to be available
from somewhere.> Date: Wed, 15 Feb 2012 11:35:19 -0400
From: Mike Lawrence <Mike.Lawrence at dal.ca>
To: SDL Development List
Subject: Re: [SDL] Time of screen update?