Inconsistent software and hardware durations

I got inconsistent stimulus durations when measuring it in software and hardware ways. Software duration means the time stamp returned after win.flip(), with vsync enabled in both NVIDIA and psychopy settings. Hardware one means the voltage up duration calculated from photodiode reads.

Although all the software duration is correct, in my case 100 ms (6 frames), but the hardware one will be occasionally either 5 or 7 frames. I tried lots of debugging, and it seems to be related to my pyqt window ot other windows in the OS in general. After interactions with other windows, the hardware timing in psychopy window becomes inaccurate, althouth the software ones returned from psychopy functions remains the same.

Does anyone encounter similar issue? As vsync is enabled, it’s hard for me to understand why this could happen. In principle, what we get from software reads should be what photodiodes give as well.

Below is my setup:

  • windows 10 build 1903
  • python 3.8.3
  • psychopy 2020.1.2
  • pyglet 1.5.5
  • pyqt 5.14.2

Update: this happens in a more or less periodic way, ~22 seconds to have inconsistent results.

Did you try to turn off vsync? What happens in this case?

Cheers Jens