psychopy.org | Reference | Downloads | Github

Iohub EyeLink unresponsive keyboard during calibration


#1

Hi everyone,

I’m running into an issue eye-tracking calibration: the keyboard freezes at the setup screen, and one of the new instances/processes crashes (probably the one associated with the keyboard). I have EyeLink 1000 Plus, running PsychoPy 1.82.01 from OS X 10.9 Mavericks. None of the keys are working (including Esc).

Note that I used a modified SRR_eyelink_std.yaml file to only have three values for screen_background_color – minus the alpha value – otherwise it crashes (“ValueError(‘Invalid parameter. Should be length 3 but got length 4’,)” in setColor).

The following error is produced when running ‘getting_started.py’:

########## Running: /Users/egor/Dropbox/Projects/mc/mc/mcbsf_iohub.py ##########
[CarbonScreen(x=0, y=0, width=1920, height=1080), CarbonScreen(x=-1680, y=0, width=1680, height=1050)]
2016-09-05 17:58:57.929 python[66707:507] PyObjCPointer created: at 0xa09a1438 of type {__CFBoolean=}
{…}
964 thread_policy_set failed: 4.
EL Modes: [‘250B’, ‘500B’, ‘1000B’, ‘2000’]
EL srate: -32768
EL rts: [250, 500, 1000]
ERROR: setEyesToTrack: Selected sample rate is not supported!
2016-09-05 17:59:06.458 python[66721:507] ApplePersistenceIgnoreState:
Existing state will not be touched. New state will be written to
/var/folders/6k/qxj7wz1n5kbff7v1rdlvbkkr0000gv/T/org.psychopy.PsychoPy2.savedState

The unresponsive keyboard issue seems to be similar to the following one: https://groups.google.com/forum/#!topic/psychopy-users/_mXv6gUlg4w

The proposed solution (replacing iohub with the version written by Sol to deal with this issue) only helped somewhat: it got rid of the unsupported sample rate, but not the keyboard issue.

Running: /Users/egor/Downloads/distribute/demos/coder/getting_started/getting_started.py
2016-09-05 17:29:46.829 python[66393:507] PyObjCPointer created: at 0xa09a1438 of type {__CFBoolean=}
{…}
964 thread_policy_set failed: 4.
2016-09-05 17:29:54.942 python[66406:507] ApplePersistenceIgnoreState:
Existing state will not be touched. New state will be written to
/var/folders/6k/qxj7wz1n5kbff7v1rdlvbkkr0000gv/T/org.psychopy.PsychoPy2.savedState

However, the solution also proposed to upgrade to 1.83.04. I tried upgrading but ran into the following issue instead, to which the only solution seems to be downgrading back to 1.82.01:
https://groups.google.com/forum/#!msg/psychopy-users/X0Q3NkZDXPc/_sqSrZzTAQAJ

I made a single modification in my psychopy installation: I renamed the directory

/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/iohub/devices/eyetracker/hw/sr_research/eyelink/win32/

into

/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/iohub/devices/eyetracker/hw/sr_research/eyelink/darwin/

Before that, PsychoPy gave the following message:

Could not add path:
/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/iohub/devices/eyetracker/hw/sr_research/eyelink/darwin/python27/
964 thread_policy_set failed: 4.
EL Modes: [‘250B’, ‘500B’, ‘1000B’, ‘2000’]
EL srate: -32768
EL rts: [250, 500, 1000]
ERROR: setEyesToTrack: Selected sample rate is not supported!
Could not add path:
/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/iohub/devices/eyetracker/hw/sr_research/eyelink/darwin/python27/

It still ran the calibration, but gave the same thread_policy_set error, as seen above.

I know that EyeLink 1000 Plus is not tested, but I am eager to resolve this issue, so please let me know if you need more information.

Best,
–Egor


Iohub EyeLink fails to import pylink properly
#2

Whether here or on github, I suspect the only person that can help you with this issue is @sol


#3

One thing though, did you turn on the accessibility access for this machine? For iohub to access the keyboard to any window (which is what it does) it needs psychopy app (or terminal if you run from there) to have accessibility features turned on in the OS.


#4

Hi Jon,

Thank you for your response.

I checked yesterday, and yes, PsychoPy is given accessibility access. Does it need to be reenabled after a PsychoPy reinstall? It still appears in the accessibility list though.

Best,
–Egor


#5

Just confirmed this:


#6

Turned out that the Accessibility permissions need to be reassigned every time PsychoPy is updated or its libraries altered in any way for iohub to be able to record the key presses.

This gets the calibration screen to react to Esc now. However, it is still unresponsive to all other keys, making this issue very similar to this one: https://groups.google.com/forum/#!topic/psychopy-users/_mXv6gUlg4w

However, the solution doesn’t work. I suspect that’s because the libraries have been updated from the 1.83.04 state. Rolling back to 1.82.01 also doesn’t work.

I wanted to keep track of all things that I’ve tried so far, in case it helps anyone not to lose weeks of (so far) futile debugging.

1.82.01: With updated Accessibility & Privacy, the calibration screen reacts to Esc but nothing else works.
1.83.04: Missing ‘packaging’ package https://groups.google.com/forum/#!msg/psychopy-users/X0Q3NkZDXPc/_sqSrZzTAQAJ.
1.84.0/1: missing pylink attributes (see below); replacing pylink library gets the calibration screen to run, but again, it will only react to Esc and nothing else.

The missing pylink attributes error looks like this:

AttributeError("‘module’ object has no attribute ‘EyeLink’",)
etc.

In the above case, the dir(pylink) output is as follows:

[‘GSMLink’, ‘LOGGER’, ‘SerialLink’, ‘TCPLink’, ‘UDPLink’, ‘VERSION’, ‘builtins’, ‘doc’, ‘file’, ‘name’, ‘package’, ‘path’, ‘version’, ‘active_logger’, ‘compat’, ‘link’, ‘link_from_url’, ‘logger’]

To get pylink to work, I had to replace the PsychoPy pylink library with the one provided by SR Research. However, I’m almost certain that this messes with iohub functionality.

The output when the factory-state pylink library is loaded is:

[‘ABORT_EXPT’, ‘BLINK_EVENTS’, ‘BREAKPARSE’, ‘BUTTONEVENT’, ‘BUTTON_EVENTS’, ‘BX_AVERAGE’, ‘BX_DARKEN’, ‘BX_GRAYSCALE’, ‘BX_LIGHTEN’, ‘BX_MAXCONTRAST’, ‘BX_NODITHER’, ‘ButtonEvent’, ‘CALIBRATION_AREA_WARNING’, ‘CAL_ERR_BEEP’, ‘CAL_GOOD_BEEP’, ‘CAL_TARG_BEEP’, ‘COMMAND_FULL_WARN’, ‘CR_HAIR_COLOR’, ‘CR_LEFT_WARNING’, ‘CR_LOST_LEFT_WARNING’, ‘CR_LOST_RIGHT_WARNING’, ‘CR_LOST_WARNING’, … … …]

I’m really at my wit’s end here; I’ve no idea what else I could possibly do. Is there any way to contact Sol directly? His last (and only) activity here was more than a month ago… Thanks in advance for any help.


#7

Update: I also finally managed to run psychopy through command line (with Canopy 32-bit python), but the same error occurs:

➜  mc git:(master) ✗ python mcbsf_iohub.py

[CarbonScreen(x=0, y=0, width=1920, height=1080), CarbonScreen(x=-1680, y=0, width=1680, height=1050)]
975 thread_policy_set failed: 4.
…/data/mcbsf_p1_s1_2016-09-09_1440
…/data/mcbsf_p1_s1_2016-09-09_1440/mcbsf_p1_s1_2016-09-09_1440.edf
cond-files/cond-mcbsf.csv
** WARNING: Mouse Tap Disabled due to timeout. Re-enabling…: 4294967294
1
Key pressed. Continuing to the experiment.
===new=trial===
trial#1


#8

Hi, I am having the same issue: no key press works on the calibration screen, so I cannot even exit the calibration and continue my task script. But I am on Windows 7 instead of OS. Do you happen to know how to solve this? Thank you!


#9

Nope, haven’t found a solution… The only sure way I know of of communicating with EyeLink is using the old standalone PsychoPy, e.g., version 1.85.3 & using iohub instead of pylink.

That said, I haven’t checked on pylink since my utter failure to get it to work two years ago. @sol (who, to quote @jon, is “the only person that can help”) is nowhere to be seen (or found) for years, so I don’t respect it will ever get resolved.

The hopelessly broken iohub / pylink demos keep getting churned out studiously with every new version of PsychoPy, with iohub functions that got wiped out years ago.

Good luck to us all!


#10

I’m sorry for your frustration and that I am not able to actively work on or always support iohub. The source code is free and open. I actively developed iohub for several years and did my best to try and contribute something that I thought had meaning.

I hope you can understand that someone cannot always do volunteer work when they are already working 100% of the time to try to make ends meet. I have not disappeared; I’m just having to focus on different work that will hopefully end up also paying my families bills. :wink:

Good luck to us all!

Yes, and Happy Holidays.

Sincerely,

Sol


#11

I’m actually using 1.83.04 & iohub. Do you know if that works?
The calibration screen shows up for me and the whole process works fine. But I cannot exit it and let my experiment computer accept the results due to keyboard not working.


#12

Hi @sol, thank you for your response & for understanding the frustration. I also have to understand your situation, and the fact that PsychoPy is built by volunteers like you, who are extremely generous with their time.


#13

We could remove the demos that are broken (although they also might provide someone the incentive to work on the code and fix it!)

It’s not clear to me what degree of the functionality is gone, and I’m currently focussed on making the online studies work smoothly but, as always, we’re open to contributions that improve the project for everyone!


#14

Hi,

I am using pylink without ioHub, ioHub was just not working. I am currently running PsychoPy V. 1.85 on Windows XP.

I am currently having a similar (if not the same issue). I can run the calibration at the beginning of the experiment. However, I cannot draw targets to the screen to re-calibrate mid-experiment. I end up with a frozen screen. Any suggestions?

** To clarify, it is showing up on the eyelink PC, just not the host pc.

Shira


#15

I do not think this is the same issue, as calibration runs fine for you at the start of the experiment.

I think what is happening is that the eyelink calibration screen is actually being hidden by the psychopy screen that was open during your experiment.

To test this, can you try to minimize or (to test only) close the psychopy window before trying to start calibration again during an experiment?


#16

I think you are right. If that is the case, how do I circumvent the problem?


#17

HI Shira,

I think the code suggested by Jon here should work. Basically, try minimizing the psychopy window before doing calibration and maximizing it after:

win.winHandle.minimize()
eyetracker.runSetupProcedure()
win.winHandle.activate()
win.winHandle.maximize()

Thank you.


#18

Thanks