I’ve been trying to use PsychoPy for an experiment where subjects are required to focus on phase-changing checkerboards, while EEG is being recorded. While all experimental procedures are working just fine, I’m having some trouble with getting the delay between certain frames (the first frames when a phase change occurs) and parallel output trigger constant (mean=~30ms, std=~6.5ms). I measure delays using the BlackBox toolkit (using the opto-detector). First, I thought it was because of the graphics card or monitor I use, but when I implement the exact same experiment in E-Prime, the delay-variability looks really good (mean=~26ms, std=0.1 ms).
A figure showing the delays using PsychoPy (note the strange pattern… sync issue?):
A figure showing the delays using E-Prime:
A simplified version of the code I use:
Ntrials = 100 Nframe_image = 30 #0.5 seconds, assuming a refresh rate at 60Hz fname = resource_path("stimuli\\Checkerboard_check_" + checksize + "_phase2.png") checkerboard_phase1 = visual.ImageStim( win=win_sub, image=fname, units="pix" ) fname = resource_path("stimuli\\Checkerboard_check_" + checksize + "_phase1.png") checkerboard_phase2 = visual.ImageStim( win=win_sub, image=fname, units="pix" ) win_sub = visual.Window( size=(1280,1024), fullscr=True, screen=1, allowGUI=False, allowStencil=False, monitor='testMonitor', color=[-1,-1,-1], colorSpace='rgb', blendMode='avg', useFBO=False, waitBlanking = True) for iTrial in range(Ntrials): checkerboard_phase1.draw() win_sub.flip() port.setPin(PinCheckPhase1Trigger, 1) for iframe in range(Nframe_image - 1): checkerboard_phase1.draw() if iframe==9: port.setPin(PinCheckPhase1Trigger, 0) win_sub.flip() checkerboard_phase2.draw() win_sub.flip() port.setPin(PinCheckPhase2Trigger, 1) for iframe in range(Nframe_image - 1): checkerboard_phase2.draw() if iframe==9: port.setPin(PinCheckPhase2Trigger, 0) win_sub.flip()
Does anyone know how I can solve this? I guess I’m just missing an option somewhere…