frameN seems far too low/ slow for a 60Hz refresh rate

Hello good psychopy users, I seem to have either a fundamental misunderstanding of what frameN actually is or some terrible set up of my monitor or something even less known to me. I’d like to understand what has happened.

OS (e.g. Win10): 10.14.60
PsychoPy version (e.g. 1.84.x): 3.10
Standard Standalone? (y/n) Y
What are you trying to achieve?:

Understand why frameN is far lower than it should be based on clock timing and refresh rate

What did you try to make it work?:

In an attempt to make my code timed by frames rather than milliseconds, I recorded how many frames passed during each routine by creating a global_frame_counter that would add all frameN that occurred in each routine. I then realized that it was way too low relative to the using several core.Clock comparisons that tracked beginning times and durations based on the beginning of the routine where the global_frame_counter was first declared.

To understand why it was so low, I printed frameN to the console with the code below in the “each frame tab”.

print('frameN: ’ + str(frameN) + ‘\n’)

The number of frames was 206 for a routine that lasted for just about 10 seconds. Given that there should be a frame every 16 and 2/3 milliseconds it should have been 600 frames.

There is no error message, but timing is very wrong. What is going on here? Why is my frame rate so low? The monitor is set to “testMonitor” but my computer is a MacBookPro with a 60Hz rate. Am I misunderstanding what FrameN is? I thought it was the number of frames in a routine. Some please enlighten!

Thank you.

Hi @MZMG, are you running your task from Builder and trying to print the the dialog box? If so, try compiling your script to the Coder window, and running it from there. If you are running from Builder, there is a long standing issue where the print buffer would fill up and eventually crash the experiment. This was fixed in PsychoPy 3.2 . Give that a go and let me know the output.

Hi @dvbridges, thanks for the reply. I ran it again using the code and this is what I got. The frame-based duration is in ms calculated by doing: frameN_total * 1000/60. The FrameN counter only went up to 280. It looks like this may not be it. Any other thoughts?

Gray Balloon Trial duration (frame-based): 4766.666666666667
Gray Balloon Trial duration (time-based:12.357714932993986

Thank you!

Ok, would you mind sharing your task? I ran the attached, a trial for 10 seconds, updating a frame counter on each frame, and I get exactly 600 frames, where:

frameDuration = 1/60
trialTime = 10
totalFrame = ( trialTime / frameDuration) = 600

frameDur.psyexp (5.3 KB)

By the way, I am using the latest version of PsychoPy (3.2.3).

I ran your code and got 291 frames. So it is absolutely is something with my computer… or maybe the monitor settings? There is no reason why my refresh rate should have been changed…