OS: iMac Sonoma 14.0, Apple M1
PsychoPy version (e.g. 2024.2.4 Py 3.8): v2025.1.1 (Python 3.10.11)
Standard Standalone Installation? (y/n) Yes
Do you want it to also run online? (y/n) No
What are you trying to achieve?: Timing accuracy of stimuli in the millisecond range
We are setting up a paradigm using the builder to show a stimulus for 16.667ms (our screen’s refresh rate is 60 Hz).
The stimulus is a PNG of 1.5MB (although the actual size varies as the stimulus will periodically change).
A single trial in the builder is set up as having an ISI fixation routine of 5s (using the static component). And then comes the 16.667ms stimulus routine. In the stimulus Properties, we set the stimulus to be “set during ISI”, i.e., during the previous 5s routine.
Now, when we run this paradigm, sometimes (~25% of the time) the actual stimulus is on screen for longer than 16.667ms (which we can tell just visually).
However, when we look into the csv output to check the “stop” and “start” times of our stimulus, the stimulus duration is not at all consistent. So instead of being 0.016667s it varies a lot from 0.0003s to 0.022s. But this duration is not accurate at all since we can tell that sometimes the stimulus whose supposed visual duration was 0.0003s was on screen for much much longer.
The same variation in the millisecond scale shows up in the csv output when instead of 16.667ms we have the stimulus for 33.333ms
My question is, is it possible this is a limitation of the computer we are using given our image sizes/screen properties/software or is there some other way we should be setting this paradigm up to ensure accuracy of visual stimulus duration in the millisecond scale?
Link to the most relevant existing thread you have found: The timing mega-study (2020)
The issue here is I think has to deal with how psychopy operates in relation to screen refreshing (as well as your monitor).
You are trying to present stimuli for a single frame. Now if your monitor is 60hz that’s fine, but if your response rate/delay is anything other than 1ms you will have some delay inherent in the monitor’s ability to change pixels. Similarly, your computers input lag (how long it takes for the GPU to tell the monitor to change also can also vary based on your GPU (this is still different than your monitor’s refresh rate and response rate).
It seems like based on a combination of factors your stimuli are either skipped (0.0003ms) or last for an extra frame (33.333ms). Maybe due to rounding or how the internal clock lines up with your setup this frame slipping and skipping occurs? Not really sure though.
The standard setting for psychopy uses time to control stimuli presenation. In your image component you can set objects to appear on frame N and end on frame N+1.
Give that a try instead.
Issac
1 Like
thanks, we had tried the frame duration/start-stop time and we repeated it again after your suggestion and unfortunately it’s the same problem. it works OK most of the time, but not consistently (i.e. we will still see the image on the screen sometimes).
Does it only not appear for that frame sometimes, or will the other problem also occur (it lasts for 2 frames).
It’s the standard 7-core gpu that comes with the M1 chip. Nothing advanced.
I think that’s your problem. The M1 is roughly equivalent to a GTX 1650. More importantly I don’t think the M1 chips have dedicated visual RAM, therefore it’s ability to process and work is greatly impacted.
I would recommend on trying to acquire a system with a dedicated GPU, or re-evaluate your experiment design/question with the limits of the equipment. I don’t there is any workarounds when the GPU can’t keep up for this type of task.
Issac
Appreciate the advice! That’s our thinking too, that we cannot do better with our mac equipment and it’s worth upgrading to sth that can handle the graphics better.
Thanks!