Latency Between Port Signals and Image Display

OS = Windows 10
PsychoPy version = 2022.2.4
Standard Standalone = YES
GPU drivers = Dual drivers, one INTEL one NVIDIA
We were testing the latency between a serial port signal (a stimulus marker for EEG analysis) and the display (measured by a photocell on the screen). Ideally, the delay should not be variable; even if it is variable, it should vary along the screen refresh rate (~16Hz). However, we get a variance that is independent of screen refresh rate (see attached: Histogram1). This led us to think that something in the software is faulty. This problem can be related to:

• Using dual GPUs (we tried to disable NVIDIA, variance in latency persisted though with smaller delays (see attached: Histogram2)
• Something in the Psychopy code or image loading



processes delays the display (we have no idea what this could be and need help on this).
• Screens we use. We’ve tried this with laptop screen as well as an external screen. Latency jitter and delay were comparable between these screens. So we don’t think this could be the problem. Though we are open to suggestions.

We would appreciate if you can share more potential problems that can cause the jitter and delay on our data.

Windows-based laptops are pretty notorious for this type of behavior (at least in my experience). Have you tried using a tower/base station computer instead of a laptop. Also, the make and model of the LCD display can have a profound influence on the display onset variability. I am interested in reading other replies to this inquiry as I have not done any deep-dives into Windows display timing since Windows XP/early Win 7 Pro. Thereafter, Microsoft changed the way the display was implemented (i.e., the Display Manager and the end of ‘exclusive mode’) and display timing became much more difficult to control (Just ask Mario K. at the Psychtoolbox project).
On the upside, the DURATION of the stimulus display is usually quite consistent. If you hit a brick wall with the onset latency variability, you might want to use the output of your display sensor to trigger your external apparatus. There a many ways to implement such a hack.
Sorry that I could not be more helpful at this time.

Agree that we need more information to be of much help. In addition to knowing @FrankS questions, please let us know:

  1. Which EEG system are you using?
  2. Are you sending the serial port signal using callOnFlip( )?

Hi @FrankS @pmolfese

Thanks for the replies!

  1. Brain Products (amplifier: actiCHamp plus), Brainvision Recorder software, Neurospec’s MMBTS USB serial port device for sending signals from a laptop, Psychopy 2022.2.4.

  2. Yes we are using callOnFlip(). Initialy, we didn’t used it. Then we saw the online Psychopy documentation for it and added to the code. However, it neither changed mean delay nor the standard deviation.

Thanks in advance!