Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: EyeLink eye tracker seemingly unsupported after upgrade of Psychopy #5947

Open
oesteban opened this issue Oct 13, 2023 · 10 comments
Open
Assignees
Labels
🐞 bug Issue describes a bug (crash or error) or undefined behavior. 🔧 hardware/iohub Issue with hardware interfacing or calibration.

Comments

@oesteban
Copy link

PsychoPy Version

2023.2.3 (dev and stable)

What OS are your PsychoPy running on?

macOS Silicon, Linux-based systems

Bug Description

It seems like iohub cannot retrieve EyeLink hardware anymore after updating from 2022.3.2:

Traceback (most recent call last):
  File "/home/oesteban/.local/lib/python3.10/site-packages/psychopy/app/builder/builder.py", line 1249, in runFile
    self.app.runner.panel.runLocal(event)
  File "/home/oesteban/.local/lib/python3.10/site-packages/psychopy/app/runner/runner.py", line 749, in runLocal
    generateScript(experimentPath=currentFile.replace('.psyexp', '_lastrun.py'),
  File "/home/oesteban/.local/lib/python3.10/site-packages/psychopy/scripts/psyexpCompile.py", line 91, in generateScript
    compileScript(infile=exp, version=None, outfile=filename)
  File "/home/oesteban/.local/lib/python3.10/site-packages/psychopy/scripts/psyexpCompile.py", line 229, in compileScript
    _makeTarget(thisExp, outfile, targetOutput)
  File "/home/oesteban/.local/lib/python3.10/site-packages/psychopy/scripts/psyexpCompile.py", line 209, in _makeTarget
    script = thisExp.writeScript(outfile, target=targetOutput)
  File "/home/oesteban/.local/lib/python3.10/site-packages/psychopy/experiment/_experiment.py", line 297, in writeScript
    self_copy.settings.writeIohubCode(script)
  File "/home/oesteban/.local/lib/python3.10/site-packages/psychopy/experiment/components/settings/__init__.py", line 1242, in writeIohubCode
    inits['eyetracker'].val = ioDeviceMap[inits['eyetracker'].val]
KeyError: 'SR Research Ltd'

I've narrowed this down to this block of code:

from psychopy_eyetracker_sr_research.sr_research.eyelink import (
__file__,
EyeTracker,
MonocularEyeSampleEvent,
BinocularEyeSampleEvent,
FixationStartEvent,
FixationEndEvent,
SaccadeStartEvent,
SaccadeEndEvent,
BlinkStartEvent,
BlinkEndEvent
)
except (ModuleNotFoundError, ImportError, NameError):
logging.error(
"SR Research eyetracker support requires the package "
"'psychopy-eyetracker-sr-research' to be installed. Please install "
"this package and restart the session to enable support.")

This error does not seem to be logged. though. While I see packages homolog to psychopy-eyetracker-sr-research, e.g., for tobii, the package is not listed within the plugins/packages menu and there's no trace of it in pypi.

I have also installed the pylink wheel that comes with the SR Research debian packages, and successfully imported pylink. Also checked that the import is done from the newly installed wheel.

Finally, I can see a trace in the logfile:

3.0886  DEBUG   Looking for Tobii device configuration file...
3.7408  DEBUG   Found Tobii device configuration file.
3.7408  DEBUG   Looking for SR Research EyeLink device configuration file...
3.7409  DEBUG   No SR Research EyeLink device configuration file found.
3.7410  DEBUG   Looking for Gazepoint device configuration file...
3.7434  DEBUG   Found Gazepoint device configuration file.
3.7435  DEBUG   Looking for PupilLabs device configuration file...
3.7436  DEBUG   No PupilLabs device configuration file found.

The corresponding trace comes from:

try: # for SR Research EyeLink
logging.debug("Looking for SR Research EyeLink device configuration file...")
import psychopy_eyetracker_sr_research.sr_research.eyelink as eyelink
deviceConfig = _getDevicePaths(os.path.dirname(eyelink.__file__))
if deviceConfig:
logging.debug("Found SR Research EyeLink device configuration file.")
scs_yaml_paths.extend(deviceConfig)
except ImportError:
logging.debug("No SR Research EyeLink device configuration file found.")

However, the import in line 268 (import psychopy_eyetracker_sr_research.sr_research.eyelink as eyelink) is constantly failing.

Expected Behaviour

The SR Research EyeLink device is properly configured and usable.

Steps to Reproduce

  1. Install 2023.2.3 on python 3.8
  2. Check the SR Research Eyetracker is identified and works.
  3. Update Ubuntu from 20.04 to 22.04 (and Python from 3.8 to 3.10 with it)
  4. Update to 2023.3.2 by checking out the corresponding tag from the GH repo.
  5. Revise all other software is installed, in particular SR Research's pylink.

Tested on two different computers.

Additional context

No response

@oesteban oesteban added the 🐞 bug Issue describes a bug (crash or error) or undefined behavior. label Oct 13, 2023
@oesteban
Copy link
Author

I guess I've figured it out myself:

pip install git+https://github.com/oesteban/psychopy-eyetracker-eyelink.git

Happy to send it back to psychopy org if you want.

@peircej
Copy link
Member

peircej commented Oct 16, 2023

Hi there. I think this is basically just that, yes, we've been moving hardware support out to plugin packages and those have hit a few wrinkles. The SRR plugin has kind of halted for now because of difficulties auto-installing the necessary dependency libs (srr pylink is not directly available). Working with their engineers we believe this is going to be resolved soon and we will have a working psychopy-eyetracker-eyelink plugin very much in keeping with what you've done.

@Malen2
Copy link

Malen2 commented Nov 28, 2023

Hi guys, I've encountered the same issue recently. While I know that the plugin will be released soon, I was wondering if Oesteban was able to make his eyelink work completely? We're running a project that requires eyetracking and is a bit time sensitive.

I have followed the steps on the post but it looks like tracker.runSetupProcedure() is not running through: the experimental window is hidden and then re-opened, as if a calibration had been ran without actually running. I don't get any errors with it and it does not crush tho. This is the only output I get:

  • displayAPI: init_net() start use_tcp_only=0
  • displayAPI: Connecting
  • ioHub Server Process Completed With Code: 0

Any help would be super appreaciated!

@mdcutone
Copy link
Member

This issue is being fixed next release. We have an EyeLink 1000 here to test with, I'll close the issue once I confirm everything is working with the plugin.

@mdcutone mdcutone self-assigned this Feb 15, 2024
@mdcutone mdcutone added the 🔧 hardware/iohub Issue with hardware interfacing or calibration. label Feb 15, 2024
@adicantor
Copy link

I guess I've figured it out myself:

pip install git+https://github.com/oesteban/psychopy-eyetracker-eyelink.git

Happy to send it back to psychopy org if you want.

hey :)
I have a similar issue, I'm using psychopy on macOS and cannot seem to find an eyelink plugin, so i want to pip install it as well. how can i modify your pip install to the macOS?

thanks for the help in advance,
A

@oesteban
Copy link
Author

oesteban commented Mar 3, 2024

@Malen2 I was wondering if Oesteban was able to make his eyelink work completely?

Yes, it did.

@adicantor macOS and cannot seem to find an eyelink plugin

Psychopy for Mac offers a pip interface. I never managed to make it work though. I only managed to have it working on Linux.

@krishnaraj-sr
Copy link

Any way to solve DEPRECATION The Gazepoint eyetracker requires package 'psychopy-eyetracker-gazepoint' to be installed. Please install this package and restart the session to enable support.

Already installed

@peircej
Copy link
Member

peircej commented Apr 10, 2024

For most of the eyetrackers (eyelink, tobii, pupillabs) this should be all fixed in 2024.1.1 so you should be able to install the plugin from the plugin manager )you maye need to go and delete your previously installed plugins by deleting your %appdata%/psychopy3/packages folder first

@krishnaraj-sr for gazepoint I can see a further issue that remains (because we don't have a device to test on). Can you open psychopy/iohub/devices/eyetracker/hw/gazepoint/__init__.py and
change the line
from psychopy_eyetracker_gazepoint import gp3
to
from psychopy_eyetracker_gazepoint.gazepoint import gp3

let us know if that works and we'll include that into 2024.1.2 👍

@krishna-raj-sr
Copy link

krishna-raj-sr commented Apr 15, 2024

Changes made to make Gazepoint Eye tracker work : Tested on Windows . Note that GazepointSampleEvent was added to the init.py

psychopy/iohub/devices/eyetracker/hw/gazepoint/__init__.py

import psychopy.logging as logging

try:
    from psychopy_eyetracker_gazepoint.gazepoint.gp3 import (
        __file__,
        EyeTracker, 
        MonocularEyeSampleEvent,
        BinocularEyeSampleEvent, 
        FixationStartEvent,
        FixationEndEvent, 
        SaccadeStartEvent,
        SaccadeEndEvent, 
        BlinkStartEvent,
        BlinkEndEvent,
        GazepointSampleEvent
    )
except (ModuleNotFoundError, ImportError, NameError):
    logging.error(
        "The Gazepoint eyetracker requires package " 
        "'psychopy-eyetracker-gazepoint' to be installed. Please install this "
        "package and restart the session to enable support.")

if __name__ == "__main__":
    pass

psychopy/iohub/devices/eyetracker/hw/gazepoint/caliberation.py


try:
    from psychopy_eyetracker_gazepoint.gazepoint.gp3.calibration import (
        GazepointCalibrationProcedure)
except (ModuleNotFoundError, ImportError, NameError):
    logging.error(
        "The Gazepoint eyetracker requires package " 
        "'psychopy-eyetracker-gazepoint' to be installed. Please install this "
        "package and restart the session to enable support.")

if __name__ == "__main__":
    pass

psychopy/iohub/devices/eyetracker/hw/gazepoint/eyetracker.py


try:
   from psychopy_eyetracker_gazepoint.gazepoint.gp3.eyetracker import (
       ET_UNDEFINED, 
       EyeTracker,
       to_numeric,
       getTime)
except (ModuleNotFoundError, ImportError, NameError):
   logging.error(
       "The Gazepoint eyetracker requires package" 
       "'psychopy-eyetracker-gazepoint' to be installed. Please install this "
       "package and restart the session to enable support.")

if __name__ == "__main__":
   pass

@mdcutone
Copy link
Member

mdcutone commented Apr 30, 2024

@krishna-raj-sr For the calibration.py and eyetracker.py files, they don't seem to differ from what is in the release branch in the gp3 submodule. Do I need to create them? I applied your changes to the __init__.py file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Issue describes a bug (crash or error) or undefined behavior. 🔧 hardware/iohub Issue with hardware interfacing or calibration.
Projects
None yet
Development

No branches or pull requests

7 participants