Welcome! Log In Create A New Profile

Advanced

Stimulus fliptime inconcistencies

Posted by thomasc 
Stimulus fliptime inconcistencies
October 30, 2021 01:33AM
Hi,

We are currently facing an issue with the consistency of stimulus flip-times which further affects the stimulus durations on screen also. Our system specs are as follows:

Windows 10 Pro v10.0.19043
Intel Core i9 9900K
32 GB Ram
Nvidia RTX 2060
NIMH MonkeyLogic 2.2.20
MATLAB R2020b
Psychtoolbox 3.0.17

Monitors connected:
Subject screen: Elo 1593L RevB PCAP touchscreen, 1366px by 768px, 60 Hz framerate.
Control screen: Dell P2419H, 1920px by 1080px, 60 Hz framerate.

Description of the issue being faced:

We have setup a fixation task (8 stimuli per trial, 200ms stimulus presentation and 200 ms ISI, stimulus is a white screen and ISI is black screen) using the timing script v1 method in MonkeyLogic. To measure actual screen flip times, we have attached a photodiode onto the subject screen whose signal we are sampling at 25kSps in an external DAQ (eCube server). Using toggleobject(), we are flipping on the stimuli and concurrently sending digital eventmarker (with strobe) to the external DAQ. We observed that the latency between the eventmarker sent in toggleobject() and deflection in photodiode signal was not a constant value (was bimodally distributed in general) which furthermore lead to variation in stimuli display duration. This is major issue for us as we are interested in recording neurophysiological data from behaving macaques.

To understand if the issue was a monitor/driver related issue, we coded up a very similar task in Psychtoolbox and measured the delay in change of photodiode signal from the eventmarker and also the stimulus display duration. We observed consistent delay and expected stimulus display duration as per instruction in the code.

We are a bit baffled by this as the above observation suggests that it is possible to present stimuli very consistently using the same system and monitor.

I have attached a figure summarizing our analysis of this with the following presentation methods:
- Psychtoolbox
- MonkeyLogic timing script v1
- MonkeyLogic timing script v2

I can further share the exact codes we ran to present the stimulus if needed. We would really appreciate any and all help in rectifying this issue at the earliest. Please let me know if any further information is required.

Sincerely,

Thomas
Vision Lab
Centre for Neuroscience
Indian Institute of Science

Thomas
Attachments:
open | download - analysisCombined.png (1.3 MB)
Re: Stimulus fliptime inconcistencies
October 30, 2021 08:02AM
Re: Stimulus fliptime inconcistencies
October 30, 2021 02:44PM
Hi Jaewon,

Please find the results of the latency test and the photodiode tuner tests attached. I have done multi shot photodiode tuners tests with scanline thresholds set at 352 and 078. The default threshold setting of 690 (~90% of screen height of 768px) gave highly similar results. I hope these are useful in solving our issues. Thank you.

Thomas
Attachments:
open | download - eloMonitorLatencyTest.jpg (519.4 KB)
open | download - eloMultiShotScanline352.jpg (79.7 KB)
open | download - eloMultiShotScanline078.jpg (85.7 KB)
Re: Stimulus fliptime inconcistencies
October 30, 2021 08:44PM
It appears that your monitor has a long internal lag and cannot reduce it within one frame range anyhow. Set the new threshold to 0 in the photodiode tuner, run all the tests you did again and see if there is any difference.
Re: Stimulus fliptime inconcistencies
October 31, 2021 01:58AM
Dear Jaewon,

We also initially believed that the monitor might be having a large and inconsistent display lag. Hence, we tried out the same stimulus presentation sequence on the same system with the same monitor using Psychtoolbox. Our analysis of the same strongly suggests that the monitor is not at fault as we are able to present stimuli consistently and with expected durations each and every time.

As you have asked for setting scanline threshold to 0 in photodiode tuner and running the same analysis in MonkeyLogic, do find the results attached. The issue is still present with scanline threshold set at 0. I have also attached the photodiode tuner results (for scanline 0 and 690).

Thomas
Attachments:
open | download - analysisSingle.png (151 KB)
open | download - eloMonitorMultiShotScanline0.jpg (111.4 KB)
open | download - eloMonitorMultiShotScanline690.jpg (110.8 KB)
Re: Stimulus fliptime inconcistencies
October 31, 2021 02:55AM
In the very first figure you uploaded, there was a delay of one frame every time, even when you programmed with Psychtoolbox. The photodiode tuning result also showed that the monitor did not respond within one frame, although you tried a very small threshold number. So your monitor does have a display lag, but it does not necessarily mean that your monitor is at fault.

I noticed something in the results you showed but need to think about how to test it. In the meantime, can you test the system with a different video card other than NVIDIA? I believe your CPU supports the Intel integrated graphics.
Re: Stimulus fliptime inconcistencies
November 01, 2021 07:06AM
Hi Jaewon,

You are correct, the results from Psychtoolbox in the very first figure shows that there is a display lag with the monitor. We are able to accept that for our purposes though, as the delay is consistent and as a result the duration of stimulus presentation is as expected. We would like to emulate this at the very least with the MonkeyLogic task.

I have now attached analysis of the photodiode signals after the subject and control monitors were unplugged from our Nvidia graphics card and plugged into the motherboards display connectors (subject screen on VGA port) . We installed the onboard Intel graphics drivers and ran the same task in MonkeyLogic as in the very first figure (timing script v1, scanline threshold at default value of 690). I've also attached the photodiode tuner results for your analysis.

Let me know if you need anything else. Thank you!

Thomas
Attachments:
open | download - analysisSingleOnboardGraphics.png (180.6 KB)
open | download - eloMonitorMultiShotOnboardScanline690.jpg (116.3 KB)
Re: Stimulus fliptime inconcistencies
November 01, 2021 10:21PM
Thanks! Please let me have some time to work on this. I am busy with my SfN poster but will get back to you as soon as possible.
Re: Stimulus fliptime inconcistencies
November 06, 2021 11:35AM
I sent you an email. Please try out the new package and let me know the result.
Re: Stimulus fliptime inconcistencies
November 07, 2021 11:02AM
Dear Jaewon,

Thank you for sending us updates to try. Pardon me for getting back late over this weekend. We had a go at measuring the stimulus durations with the new MonkeyLogic packages that you mailed and we have some interesting analysis results:

1. With photodiode scanline threshold at the default value of 690 (for a monitor height of 768 px), the issue of inconsistent delays in flipping the stimulus to the screen remained. But,
2. With the threshold set to 0 or 760 we are able to get a consistent screen flip after a delay of two frames! (we just tried these two extremes in the tuner application along with many values in between).
3. We ran the timing script v1 task as before using scanline threshold set at 0 in photodiode tuner for a total of 520 stimulus presentations and we observed a constant delay in stimulus flipping to the screen. As a result we are also getting the stimulus presented on screen for the expected durations (here 200ms / 12 frames).

This is great news for us! Though we are puzzled why a very early or a very late screen flip command give consistent delays but scanline threshold values in between do not. We look forward to your inputs here. Please find the photodiode signal analysis plots attached (both in photodiode tuner and timing script v1).

Let us know if there is anything else we can try to get the display lag down from two frames to one.

Note: Our subject screen was connected via Display Port on the Nvidia graphics card.
Attachments:
open | download - eloMonitorMultiShotScanline0NewMLUpdates.jpg (70.4 KB)
open | download - analysisSingleNvidiaScanline0Updated.png (175.4 KB)
Re: Stimulus fliptime inconcistencies
November 07, 2021 04:56PM
Thanks a lot! After all, it does not seem possible to present stimuli immediately in your system, but I would like to reduce the delay to one frame at least. I sent you more packages by email. It would be great if you could test them, too!
Re: Stimulus fliptime inconcistencies
December 03, 2021 11:47PM
Hi Jaewon,

Thanks for having looked at our particular issue and having helped address it. We were working with the updated packages on ML version 2.2.20 only till now. But after updating to ML version 2.2.21 (downloaded on 3rd Dec 2021) to solve issues faced by my colleague here (https://monkeylogic.nimh.nih.gov/board/read.php?3,1127) we are having some doubts as follows:

1. In the photdiode tuner, we see a warning message saying NVIDIA cards are not supported for setting scanline threshold any any value set will not be used. Can you explain what this means in terms of functionality? (We had solved the fliptime inconsistencies issues on the NVIDIA card only, so you can appreciate our concern).

2. We are also seeing one or two frames being delayed by more than two frames (You had helped us have a fixed delay of two frames) when using multi-shot triggers. For example, if we did a 1000-shot test, we see (by eyeballing the graph) one or two triggers that are delayed by roughly three frames for every fourth such test that we ran. We were not able to replicate this in an actual task with 520 stim ON periods using timing script v1 though, so does not seem to be an issue after all. What do you think?

I have attached a screenshot of photodiode tuner for your reference.

Thanks you,
Thomas
Attachments:
open | download - ml_2-2-21_03-12-2021_photodiode_tuner_nvidia_error_message_multishot_2.jpg (87.7 KB)
Re: Stimulus fliptime inconcistencies
December 06, 2021 09:19AM
Neither is what you need to be concerned about. As you have tested, any scanline threshold other than 0 produces unstable stimulus intervals in the NVIDIA boards, so I am enforcing the value of 0 regardless of the configured threshold, until I find another way. I have only AMD and Intel graphics boards and scanline thresholding works fine with them.

The photodiode tuner checks timing at the MATLAB script level for flexible control and can be slower than what NIMH ML does during actual tasks.
Re: Stimulus fliptime inconcistencies
December 07, 2021 03:58AM
Hi Jaewon,

Thank you a lot for these clarifications. We will keep a lookout for any further updates you may have regarding NVIDIA boards.

Regards,
Thomas

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.