Last ROI.timesOff is after Response.rt even though a response ends my routine. Is this just a delay in ending Eyelink ROIs?

If this template helps then use it. If not then just delete and start from scratch.

OS (e.g. Win10): Win10
PsychoPy version (e.g. 1.84.x): 2023.1.2
Standard Standalone? Yes
What are you trying to achieve?:
I am trying to run a simple eyetracking experiment with an Eyelink 1000. On a given trial, a subject is presented with a fixation cross (that they must fixate on in order to continue). This fixation cross is its own routine. After the fixation cross, two items are presented on the screen, one on the left, one on the right. The subject has up to 10 seconds to look between the items and make their choice of their preferred option using the left or right arrow keys. This choice screen is its own routine. As soon as the subject makes a choice, the choice routine ends, a feedback routine is presented, and then the the trial ends with a 1 second blank screen routine (intertrial interval, or ITI).

Routines:
Fixation Cross (must fixate for .5s) → Choice (up to 10s) → Feedback (1s) → ITI (1s)

What did you try to make it work?:
Some other PsychoPy Forum threads suggested that Eyelink might be a bit slow to start and stop recording. To deal with this, I’ve put eyetracker.setRecordingState(True) in my fixation cross routine to give the Eyelink time to start up. I’ve also put eyetracker.setRecordingState(False) in my ITI routine at the end of the trial. I’m only interested in fixation data during my choice routine.

In my Choice routine, I have two ROI components, one corresponding to the left item, one corresponding to the right item. They are set to measure time with respect to the ROI onset. In my csv output, the time of my ROI onset is always the same as the time of my Response onset.

What specifically went wrong when you tried that?:
In my Choice routine, I find that if I make a choice while looking at one of the items, the final time recorded for that particular ROI’s timesOff variable is later than my Response.rt. This is typically at or below a 50 ms difference. Here’s a picture from my csv output for example:
issue
(Response.rt 2.795 > max(LROI.timesOff) 2.849)

I’m not sure if this is just a delay in the Eyelink when it stops recording, in which case I can just replace the final ROI.timesOff time with Response.rt? It has me questioning the accuracy of both the timesOn and timesOff data. Hopefully timesOn is alright since the ROI onset time is the same as the Response onset time. (Would also be great to hear if this is the correct intuition or not!)

I suspect it has something to do with the fact that my Choice routine ends depending on when the subject makes a response, so perhaps there is a delay in stopping the ROI recording. Does anyone happen to have any insight into what might be going on and what I can do to fix it?

Thanks!

After reading through some other threads, I believe this response on another thread may explain what is happening, but I’m not certain.

Forum thread about stimulus timing accuracy

The timing of visual stimuli must be a multiple of the refresh rate. Furthermore, simple keyboard responses are not measured on a millisecond basis. So my guess is that the ‘fixation to ROI’ and ‘keyboard response’ are being checked at different intervals, which results in slight differences in their end timing.

Since my data indicates that the onset of the response component and ROI components started at the same time, my hope is that I can simply adjust the ROI.timesOff to match the time of keyboard response if my ROI.timesOff records a time after the keyboard response.