As Diederick says, and explained in our intro pdf.
The rule for Screen('Flip', window, tWhen)
was and is “flip as soon as possible, but no earlier than tWhen”, ie. at the smallest t with t >= tWhen.
That rule won’t change, because we don’t break backwards compatibility without very good reasons. If that doesn’t work, then it is either a PTB bug (unlikely, given the amount of testing wrt. timing), or an operating-system / graphics driver bug or system misconfiguration which needs to be fixed.
Half a frame early is the recommended method for all standard fixed refresh rate displays, as it maximizes headroom for dealing with timing noise. This is not really needed on Linux with open-source drivers, where you could go very close to the true frame boundary, but it is helpful for more primitive operating systems like macOS or Windows, or the NVidia proprietary driver on Linux.
The exception is fine-grained timing mode on supported OS + gpu + display combos, ie. atm. only Linux + AMD + FreeSync/DP-adaptive sync monitor for reasonable quality, or Linux + Nvidia for poor quality. There you must specify the true desired onset time, and the system will try to get stimulus onset as close as possible to the desired tWhen. But this mode is not on by default, and our VRRTest
shows how to use it.
@xiangrui I’m not sure if i misundertstand what you mean, but to clarify: The onset time reported by Screen('Flip')
is not a prediction, but a measurement. Either done and reported by the operating system (on Linux with open-source drivers), or calculated by PTB from measurement of hardware state (Linux + NVidia proprietary, Windows in one of the working configurations, or macOS with properly working PsychtoolboxKernelDriver on AMD or NVidia, or on Intel if the feature is explicitely forced on by the user). The cases in which our timestamping would fail are the same ones in which waiting after Screen('Flip')
then sending a trigger would fail, which are the same ones where PTB will usually detect and report timing trouble. In terms of precision, a trigger after Flip will always be a bit less accurate than what the Flip timestamp reports, due to scheduling delays etc.