OS: Windows 10
PsychoPy version: 2024.2.4, Python 3.8
Standard Standalone Installation?: Yes
Do you want it to also run online?: No
What are you trying to achieve?:
I’m running an eye-tracking experiment using PsychoPy with an EyeLink 1000 Plus (v5.1.5). The goal is to present stimuli in a PsychoPy window (pyglet backend) after EyeLink calibration, while recording eye data. Calibration (copied from SR Research’s example scripts) works fine, and interest areas display correctly on the Host PC screen. However, after calibration, the PsychoPy window on the participant’s computer shows a gray screen, and no experimental stimuli appear, though the program seems to run.
What did you try to make it work?:
I’ve tried the following to fix the gray screen:
Added pylink.closeGraphics() after calibration to close the Pygame interface.
Saved and restored the PsychoPy window’s background color (win.color=[0,0,0]).
Re-activated the window (win.setMouseVisible(False), win.winHandle.raise_()).
Forced multiple refreshes (win.flip() several times with core.wait(0.1) delays).
Added a test stimulus post-calibration:
python
test_text = visual.TextStim(win, text=“Post-calibration test”, color=[1, 1, 1], units=‘norm’)
test_text.draw()
win.flip()
core.wait(1.0)
win.flip()
This text displays briefly, proving the window can render.
Checked EyeLink connection (IP 100.1.1.1, connection fine).
Link to the most relevant existing thread you have found:
None found exactly matching. Searched SR Research and PsychoPy Discourse for “EyeLink PsychoPy gray screen” and “Pygame pyglet conflict,” but no clear solution.
What specifically went wrong when you tried that?:
Despite the above attempts, the gray screen persists after calibration, and experimental stimuli don’t show. The test text displays for 1 second, but the main experiment remains gray. Task Manager shows two Python processes, suggesting a possible Pygame (calibration) and pyglet (PsychoPy) conflict. Print outputs are delayed until I interrupt the program, indicating an event loop issue. The program runs (logs appear post-interruption), and Host PC interest areas are correct, but the PsychoPy window stays gray. I suspect Pygame isn’t fully releasing the display, but I’m unsure how to fix it with minimal code changes.
Thanks for any help!