This tool tests the response characteristics of a monitor connected to NIMH ML and adjusts the timing of screen flips so that stimuli can be presented immediately during the next frame. It is not necessary to use this tool, though, if the result of the latency test is normal.
A frame is drawn by rasters scanning the screen (or scanlines; blue arrows in the figure below) from top left to bottom right. Some scanlines are not shown on the screen but used to fill in the vertical blank time (VBLANK; red arrows) between frames. It is a very common technique to replace screen contents during VBLANK, so that graphics may not be split into two frames. (Failure to avoid splits causes "tearing".) To use this technique, a memory buffer for new screen contents should be submitted sufficiently early before VBLANK occurs (green arrow). If the submission time is late and close to VBLANK, the contents may be delayed and displayed one frame later.
However, it does not necessarily mean that earlier buffer submission is always better. After the buffer submission, NIMH ML has to wait until the first scanline (scanline 8 in the above figure) begins, to record the exact time the new frame is displayed on the screen. This waiting takes away time for graphics and data processing. Therefore, we measure the optimal timing for buffer sumission to maximize the performance of NIMH ML.
To use the photodiode tuner, connect the photodiode input to a DAQ analoginput channel and assign the channel to "PhotoDiode" on the I/O menu.
Then choose a screen location for photodiode trigger display in the Video menu as shown below.
Note: 1. In NIMH ML, an eventmarker for a new frame is recorded when the first scanline is drawn from the upper left corner of the monitor. If the location of the photodiode is not upper left, the interval between the eventmarker and the photodiode response can be longer. 2. Flipping the screen upside-down in the Windows display settings changes the location of the photodiode trigger, but it does not affect the direction and location of scanlines.
Click the activated [Tune] button and the tuner window will pop up.
The results shown here are examples tested with a 3840x2160 monitor at 60 Hz. Each system is likely to have a different scanline range and a different threshold number.
In the figure below, the new threshold was set to 2110, which was closer to the last scanline (=2167), compared to the previous threshold (=1951). This number was too close to VBLANK so the photodiode trigger was pushed back by another frame, as shown by the estimated latencies (23.7 ms) and voltage traces in the figure below. Therefore, the value of 2110 would be a poor choice.
When the threshold was set to 2080, the photodiode trigger was presented in the frame drawn immediately after buffer submission, but sometimes it was delayed by another frame. This value would still not be a safe threshold.
With a threshold value of 2050, the photodiode trigger was presented in the immediate next frame every single time. This new threshold can be safely used. Click the [Save] button to keep the new threshold value.