marcus-nystrom / Titta

Python and PsychoPy interface to Tobii eye trackers using Tobii Pro SDK
Other
71 stars 27 forks source link

Calibration choppy when using operator screen #57

Closed dev-jam closed 1 month ago

dev-jam commented 1 month ago

I implemented the dual screen option and a gaze plot in the OpenSesame plugin, and I noticed when using the dual screen option, the calibration on the operator screen becomes slow and choppy (on an Intel integrated GPU, 60Hz). The same applies when I draw the gaze in real time on both screens. Because it flips the screens serially and the screens are not exactly in sync, have small drifts, it sometimes is too late with the flip and has to wait another refresh. Resulting in the gaze sometimes to be drawn at half the refresh rate on the monitor and fluctuating between these refresh rates.

I solved this by disabling the wait for blank on the operator screen with waitBlanking option:

win_op = visual.Window(monitor = mon_op, fullscr = FULLSCREEN_OP,
                screen=0, size=SCREEN_RES_OP, units = 'norm', waitBlanking=False)

When using this option, the calibration is as smooth as when using a single screen. Same applies to my real time gaze plotting. I also got a report from a researcher, that the calibration was very poor when using the default dual screen setup and that this change made the calibration much better. I did not notice this myself with the calibrations during testing and debugging the plugin code but I also was not focusing on it as well.

dcnieho commented 1 month ago

thanks for the report. I have no idea what this would affect calibration quality, but i see its not a good experience. Is it possible to per flip set the waitBlanking variable, instead of globally for the screen? That's what i do with PTB, i don't mess with whatever the user gives me, but i make sure my interface works correctly when it has control.

On Mon, Oct 7, 2024 at 2:11 PM Bob Rosbag @.***> wrote:

I implemented the dual screen option and a gaze plot in the OpenSesame plugin, and I noticed when using the dual screen option, the calibration on the operator screen becomes slow and choppy (on an Intel integrated GPU, 60Hz). The same applies when I draw the gaze in real time on both screens. Because it flips the screens serially and the screens are not exactly in sync, have small drifts, it sometimes is too late with the flip and has to wait another refresh. Resulting in the gaze sometimes to be drawn at half the refresh rate on the monitor and fluctuating between these refresh rates.

I solved this by disabling the wait for blank on the operator screen with waitBlanking option:

win_op = visual.Window(monitor = mon_op, fullscr = FULLSCREEN_OP, screen=0, size=SCREEN_RES_OP, units = 'norm', waitBlanking=False)

When using this option, the calibration is as smooth as when using a single screen. Same applies to my real time gaze plotting. I also got a report from a researcher, that the calibration was very poor when using the default dual screen setup and that this change made the calibration much better. I did not notice this myself with the calibrations during testing and debugging the plugin code but I also was not focusing on it as well.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

dev-jam commented 1 month ago

Gonna do some more testing on the calibration. Yup, you can enable and disable the waitBlanking at any time with:

win_op.waitBlanking = False

Maybe worth noting here, Intel does not seem to sync the blanks of both screens but I have at least one nvidia card that does. So when drawing on both screens, with Intel, I get concentrated points in time where frame rates fluctuate. I can see this when drawing circles on both screens. I haven't tried it yet with nvidia but this would predict, a stable drawing speed at half the frame rate. You are always late for the opposing blank. This all under the assumption of equal refresh rates of the monitors/screens. If your experiment needs an effective 144 Hz refresh rate on your monitor, I would not attach a 60 Hz operator screen behind it. That effects your main screen dramatically. Have to study the behavior of waitBlanking some more if it can solve this but it does not seem to.

marcus-nystrom commented 1 month ago

Thanks for reporting and testing! I'll change the read_me.py script such that waitBlanking=False. Will also document this issue in the read_me demo.