Strange issue with frames

Dear psychopy community!
We’ve encountered a strange issue with code executed “each frame” (in builder).
Our intention is to measure joystick deviations at each frame. Thus, we have code in the “each frame” part of the builder/code component. This worked fine on one computer, but setting it up on another computer, we observed that under exactly the same conditions, we get systematically different amount of measurements. Although it was the same program and the different monitors have the same frame rate (60Hz), the timing of each frame was different.
In a more simple test experiment, we included a measurement of the time that passes for each new frame. In the “correct” computer, this seems fine and we have the expected ~240 measurements and the measured frame time for each switch is ~16ms.
For the “problem” computer, however we observe the following (see output list below). In the first ~2 sec of each trial, it seems to be correct (~16ms per frame), but then it suddenly switches to 33ms per frame. Depending on other things (more code/load) this happens earlier or later.
The weird thing is that the “correct” computer is a lower specs laptop with no dedicated graphics card. But the “issue” computer has higher specs (8GB RAM, dedicated graphics card, etc.). We have this issue with the newest Psychopy Version 3.1.2

It seems this issue is not connected to the monitor of the “issue” computer. As it works fine with the same monitor on the laptop. It is always 60 Hz. Framerate in the output file is 60. There was no warning about any issue related to frame rates at the end of the experiment.
What could be a potential reason for it?

program with test code : test_issue.psyexp (6.2 KB)

Normally this sort of issue would suggest a software conflict (eg backup or antivirus software running in the background and stealing resources from PsychoPy).

What processes are running on that computer compared to the other one?

But the sudden switch to 33 ms frames seems to then be permanent and consistent, which seems a little suspicious for that sort of explanation.

Hmm. It is less likely. As this shift from 16 to 33 ms lasts until the end of the experiment. It does shift back 16.
Besides, while psychopy was running I didn’t see huge load on the system in the Task Manager.

Hi, (I’m working together with the initial poster) and I have narrowed the problem further down.
It appears that the switch from 16ms to 33ms frame times happens at the time the full screen background color patch appears. At the time the background color appears it switches to 33ms. Attached is a very minimal example program (working without additional external files).

The computer is a

  • Intel i5-6400 (Win10, 64bit), 8GB ram
  • NVIDIA GeForce GT 730 (with the newest available drivers May2019 installed)

The same issue happens if I implement the background color via the “grading” component or the “polygon” component. Making a smaller, not full screen color patch with the polygon seems to result in no issue (consistent 16ms frame times).

Does anyone have any idea what could be the problem? Again, this issue does not appear on lower specs “office” laptops, but only on these laboratory machines.

If this issue cannot be solved, are there alternative ways to implement full screen background color (requires to be changed trial by trial)?

Thanks,
Torsten

frame_test_MIN_EXAMPLE.psyexp (9.7 KB)