I’m getting a reliable “Memory fault” error trying to set up the keyboard input for PsychoPy. I’ve narrowed the issue down to the PsychHID KbQueueStart call.
Question: Is there a way to turn up the verbosity of psychtoolbox via Python to maybe get more debug info?
Using the following script:
#!/usr/bin/env python import time from psychtoolbox import PsychHID print("DEBUG: KbQueueCreate") PsychHID('KbQueueCreate', 4) print("DEBUG: wait #1") time.sleep(5) print("DEBUG: KbQueueStart") PsychHID('KbQueueStart', 4) print("DEBUG: wait #2") time.sleep(5) print("DEBUG: done")
>python test.py DEBUG: KbQueueCreate PsychHID-INFO: libX11 library not yet set up for thread-safe operation by host application, as required. PsychHID-INFO: Now calling XInitThreads() myself, to fix this problem in a likely safe way. DEBUG: wait #1 DEBUG: KbQueueStart DEBUG: wait #2 Memory fault
I suspect that this issue is specific to my system (though I haven’t tried it on any other) - some details:
>cat /etc/centos-release CentOS Linux release 7.7.1908 (Core) >python -V Python 3.6.8 >psychopy -v PsychoPy3, version 2020.1.2 (c)Jonathan Peirce 2018, GNU GPL license >pip list | egrep psych psychtoolbox 3.0.16
- I added time.sleep() calls to the test script because … threads. This confirms that the Memory fault is caused by PsychHID KbQueueStart, and not something earlier.
- The note about XInitThreads() is puzzling, not sure if it’s related to this issue.
- The device number used in the test script (4) is not relevant, all valid device numbers return the same results.