Hi Chris!
In a simple script that just runs one dynamic stimulus (either drifting grating or dynamic random dots), I noticed some glitches in the movement that sometimes occur. It is very hard to see at first, but it made me analyze the timestamps of the ‘#announceStimulus’ and ‘#stimDisplayUpdate’ events.
Apparently, one or two frames are being updated too early or too late and that causes the movement to be not uniformly because the dot- or grating-speed varies quite a bit. Attached to this message you can find a graph that shows event number versus event time for the ‘#stimDisplayUpdate’ in blue and the ‘#announceStimulus’ events for the background and the dynamic stimulus (in this case a grating) in red.
As one can see, there is one rather long and one (incredible) short delay between two updates. If this (Understanding display update time stamps / Timing / Knowledge Base - MWorks Support) is true, this would mean that the vertical blank period (VBL) is not regularly timed, which should absolutely not be the case. To test for that anyway, I ran the script on a mac with a precision TFT that guarantees proper vsync-timing and found the same error. There is also no additional load to the system while it runs the script. Furthermore, I can see no regularities in the occurrence of the issue.
I was wondering whether this behavior has anything to do with the value one sets for the frame-rate in the configuration of the dynamic stimulus, or with the value for the display refresh rate that is defined in the configuration file. Both settings do not seem to have anything to do with the issue. The frame-rate for the dynamic stimulus can be set to equal the display refresh rate, or to a much higher value (e.g. 500hz) to replicate the behavior one can see in the attached graph. If it is set to a lower value than the display refresh rate the update rate decreases, but you still see the glitches. The setting in the configuration file for the server application does not seem to have any effect at all.
I spend the last two days trying to fix the problem myself, but it seems like the core code is a little too advanced for me. However, I believe that the problem gets a little better when the framerate of the monitor is not truncated to an integer in the StandardDynamicStimulus section, especially when I run the program with the precision monitor (obviously because it’s framerate is not 60Hz). Apart from that I found nothing else that could cause the error.
Oh… and of course everything happens with both the 0.4.5 release and yesterdays nightly build. I hope you can reproduce it!
Thank you,
Philipp