Welcome! Log In Create A New Profile

Advanced

Skipped Frames

Posted by Mitch 
Skipped Frames
October 02, 2019 03:03PM
When I run MonkeyLogic I get a bunch of skipped frames on a subset of my computers, either during the screen latency test or any actual task. The problem is clearly dependent on the computer, as a different machine connected to the same monitors, etc. performs just fine. Unfortunately the machines with the skipped frames are the ones I need to use for running ML (eg with the NI card). The computers with the skipped frame problem have exactly the same hardware as each other, and the hardware is superior in every way I can think of compared to computers that are able to run ML without any/noticeable skipped frames. All of the drivers are up to date on all computers. I’ve attached two example latency test results. I’m not even sure how to begin troubleshooting this problem and was looking for some advice as to where to start. I appreciate the help. Please let me know if any additional information is needed.

I’m not sure if this issue is related but my display monitors support various refresh rates (30, 59, 60, 144 Hz, etc) but if in Windows I change the refresh rate to anything except 59 or 60Hz MonkeyLogic will not display anything on the screen. It’s not critical for me to resolve the refresh rate problem but I thought I would include it in case it provides some useful hint as to what might be happening.

Thanks for your help.
Attachments:
open | download - SkipComputer-LatencyTest.PNG (76.3 KB)
open | download - NoSkipComputer-LatencyTest.PNG (77.7 KB)
Re: Skipped Frames
October 02, 2019 06:35PM
What are the screen resolution of both of your monitors and the size of video memory of the computers? Have you tried increasing "Vsync spinlock", like to 2 or 3 msec?

It shouldn't be a problem that your monitors support various refresh rates, but, if they support any sort of "Free Sync" technology, you may want to disable it.
Re: Skipped Frames
October 03, 2019 01:10PM
Thanks for the tips. I changed vsync spinlock to both 2 and 3 ms and neither one solved the skipped frames problem during the latency test or while running a task.

The screen resolution is 1920x1080, with no G-sync/FreeSync support.

The computer with the problem has a dedicated graphics card with 11GB video memory while the one that doesn't have the problem is using Intel integrated graphics and windows says it has 128MB dedicated video memory.

Thanks again for your help.
Re: Skipped Frames
October 04, 2019 10:48AM
Did you test different resolutions and refresh rates? You can also try switching the main display or plugging in a third display. It seems related to how the graphics board controls multiple monitors, but I don't have a definitive answer yet.
Re: Skipped Frames
October 10, 2019 06:00PM
Over the past few days I've tried many combinations of monitors, screen resolutions, and refresh rates but none of them appear to have any influence on the problem.
Re: Skipped Frames
October 17, 2019 10:46AM
There are a few more things you can try. Windows keeps all previous monitor configurations and restores them when the same monitors are connected again. Sometimes this prevents you from starting a new, fresh configuration. So I would delete all previous configurations from the registry first, although it may not solve the problem. To do so, open regedit, go to \HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\GraphicsDrivers and delete all the keys under Configuration, Connectivity, MonitorDataStore and ScaleFactors. Those keys will be recreated when you reboot the computer.

Try factory reset of your graphics driver and turn off all the driver functions that you don't know. Recent graphic drivers have some unique features that allow you to control monitors beyond the basic functions of Windows and they can cause conflict with NIMH ML.

Also you can try adjusting flip timing. To do it, 1) assign any analog input channel to PhotoDiode (you can delete it later). 2) Set the Photodiode trigger to anything but "None". It will activate the [Tune] button. Click it. 3) In the Photodiode Tuner, change the "Threshold" to a smaller value and save. 4) Try the latency test again.
kms
Re: Skipped Frames
November 12, 2019 02:15PM
Hi Jaewon,

I have not been able to get rid of the skipped frames warning that shows up on the msg box for every trial that runs completely during my task. I mean if I let only the stimuli to show up but the not make a choice using the joystick as required (which makes it a much shorter trial), the warning doesn't appear. Trying a range of ITI values also didn't have an effect. Latency test looks fine I think (please see attached).

I tried increasing the VSYNC spinlock value to 2 or 3, it didn't help. The screen resolution is 1920x1080 60Hz though the ML menu shows it as 59 Hz (and I am unable to change that). I tried the graphics settings that either makes the display synchronize with the screen refresh rate or doesn't and neither seemed to change the skipped frame warning.

I also tried your suggestion above about adjusting flip timing. But somehow reducing the threshold value increased the no. of skipped frames per trial from 1-4 to hundreds of frames.

If the latency test looks fine, does that mean the warning can be ignored?

Thanks!
Attachments:
open | download - LatencyTest12Nov2019.JPG (89.3 KB)
Re: Skipped Frames
November 12, 2019 06:52PM
You don't need to (and should not) change anything if the latency test looks fine. It is just because your computer is too busy. Using a smaller resolution will be helpful, if you don't mind a little blurriness. I think 1 to 4 skipped frames are not that critical, although it depends on what you want to do.
kms
Re: Skipped Frames
November 17, 2019 02:16PM
Thanks, Jaewon! Do the event timings recorded in the data file take into account the shift in timing (of stimuli presentation/ ITI etc.) resulted due to the skipped frames?
Re: Skipped Frames
November 18, 2019 01:01PM
I am not sure what you mean by "take into account the shift in timing", but skipped frames matter mostly when visual stimuli are turned off. For example, you want to present something for 100 ms, but it can be shown longer than 100 ms, if skipped frames occur unfortunately right at the time you try to turn it off. If frames are skipped when stimuli are about to be presented, both onset and offset are shifted together, so the duration won't change. Skipping that occurred between onset and offset can be just ignored.

There are lots of things to explain about skipped frames, so I will post something on Tips later when I have time.
kms
Re: Skipped Frames
November 20, 2019 08:01PM
Thank you, Jaewon! What I meant to confirm was whether the timings recorded in the monkey logic data file for 'stim on' and 'stim off' give us the actual time for when the stim was presented for or do we need to (at our end) estimate the actual duration of stim display in any given trial by adjusting for the no. of skipped frames in that trial?
Re: Skipped Frames
November 20, 2019 11:55PM
The timestamp of an eventmarker always indicates the actual time that the event occurred. There is no need to estimate or adjust anything.
Re: Skipped Frames
November 17, 2020 10:00AM
Hi Jaewon,
I would also be interested in a "tips" post on skipped frames when presenting movies in ML. There are a number of related help-posts in the forum (all helpful, so thanks for that) but having the info all in one place and systematically organized in terms of problems/possible solutions would be super useful. I can also provide info on our setup (in which we are currently working thru this issue) if helpful.
thank you.
Re: Skipped Frames
November 17, 2020 12:38PM
If you have any solution/suggestion that is not listed in the manual already, please let me know.
https://monkeylogic.nimh.nih.gov/docs_MonitorSetup.html#Troubleshooting

The National Institute of Mental Health (NIMH) is part of the National Institutes of Health (NIH), a component of the U.S. Department of Health and Human Services.