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
Having some HID issues #215
Comments
Not reproducible under either 64-Bit Octave or 64-Bit Matlab R2012a under OSX 10.9.5 under repeated runs of GratingDemo with or without 'clear all' and 'clear PsychHID' interspersed. I also don't remember any problems with PsychHID under 10.10 with R2014b on the MacMini test machine, despite running many different demos and tests in all kind of permutations. So i don't know. Also i spent a full awful week rewriting PsychHID to cope with all the breakage that Apple introduced with OSX 10.9 for all recent MacBook Air's, so i'm not at all motivated to spend any time soon on more fighting with Apples fragile HID implementation. Maybe you can downgrade the OS, downgrade PTB to 3.0.11 or just get the old PsychHID. Or even better, upgrade to Linux. |
Yes, I saw the exasperated commit messages on your PsychHID rewrite ;-) Will experiment with replacing PsychHID as a first attempt. I'm currently working in China (everyone uses Windows) so can't test on my other Macs. As an aside, have you ever installed Linux on an external disk, so you can boot a Mac to Linux without having to repartition its internal disk? Or are you forced to rewrite the Mac bootloader? |
I have an external USB drive for BIOS booting Linux on PC's. Since a few weeks i also have two USB sticks which can EFI-Boot whatever Apple machines you plug them into. It was a full 4 day fight, because of course Apples EFI is not EFI compliant but likes to think different. But in the end i managed. It's not a problem at all if you just want to dual-boot Linux from an external drive. That works with standard *buntu installer EFI-booted. The challenge was to create a stick that works on any Mac, not only on the machine where the stick was created. A good friend of mine just left for a year to MIT with her MacBookAir and a prepared Linux stick, so she has a survival kit of really well working equipment with her :). She's the only reason i even bothered to fix PsychHID for MacBookAir's, otherwise i would have closed the bug long ago as wontfix. My new host lab is a mostly Apple shop, and my first objective is to convert them as fast as possible into a Linux shop, as far as running data collection is concerned. |
Closing with "wontfix", as not reproducible on two other machines. |
I didn't ever seen this again after pulling some updates, and can't reproduce at all with the current PTB whatever I do, which is good! |
I'm unfortunately experiencing exactly the issue described above (MBP mid 2010, Yosemite, MATLAB R2014b, PTB 3.0.12 rev. 5797)... So far, no amount of updating, removing/reinstalling PTB seems to make a difference. @iandol, you mentioned you're no longer experiencing it? Do you remember anything specific about what changed? Thanks! |
Finally managed to fix this after debugging libHID_Utilities.a. If anyone else runs into this issue, in my case the problem occurred due to the call to IOHIDManagerOpen on line 135 of PsychSourceGL/Cohorts/HID_Utilities_64Bit/HID_Utilities.c returning kIOReturnExclusiveAccess. Apparently this means one of the HID devices has been "exclusively" seized by something on the system and can't be opened. On a hunch inspired here I scanned through the output of "ioreg" and noticed a kernel extension I'd installed long ago but wasn't actively using (Soundflower). I uninstalled it and rebooted and now PsychHID works again. |
Thanks for that helpful debug info! I didn't need to uninstall any 3rd party kexts, PTB updates seemed to fix it for me without any intervention. |
As an aside @dhr , how did you debug HID_Utilities.c? |
@iandol, to debug I cloned the Psychtoolbox repo and opened the Xcode project under "PsychSourceGL/Cohorts/HID_Utilities_64Bit", then built "libHID_Utilities64.a" from the project (this required tweaking a few settings to make it build in the right place and have the right name... Xcode 6 has strong opinions about putting build output in inaccessible places). From within MATLAB, I navigated to "PsychSourceGL/Source" and ran |
I am experiencing the same issue trying to use psychtoolbox3 with an oculus rift on max os Yosemite and running Matlab R2014b. I have not tried dhr's debugging procedure above as I expect this won't work - the error arises only when the rift is plugged in. The program quits when I try to receive keyboard and mouse input. Does anyone have any insights? |
I also have the same issue, Mac Version 10.9.5, 64-bit, Matlab R2012a, and i am trying to plug in powermate |
Post the actual output of PTB, system log, etc. Just saying "me too" doesn't provide any useful info. If it would die for the same reason mentioned by dhr, then i'd assume some other device driver has claimed your device. Maybe you installed some powermate software which is interfering? I seem to remember somebody already had the Powermate working with PTB, although i don't remember on which OS. Or jennybosten installed some device driver from Occulus? PsychHID on OSX tries to get its hands on all USB-HID devices, so maybe it fails whenever any of them is already claimed by some other special driver? If you'd unplug your device, then run some PsychHID command like PsychHID('Devices'), then plug it in. Apple docs don't provide any info for possible failure modes of IOHIDDeviceManagerOpen(), why they would happen, or what to do if they happen. But if that would fail if at least one device is claimed by some other driver for exclusive access, this would be a problem for us. |
For reference wrt. Powermate: |
Power mate is working at a Mac 10.8.3 - 32 bit - on MatLab R2010a, by following the instructions of your link. But now i tried to make plug it in the Mac Version 10.9.5, 64-bit, Matlab R2012a, and when i run d=PsychHID('Devices'); i get this error: PsychHID-ERROR: Could not enumerate HID devices (HIDBuildDeviceList() failed)! There can be various reasons, Any suggestions? |
32-Bit PsychHID for 32-Bit Matlab on OSX used a different version of Apples HID utilities, which dealt a bit better with such problems. Those old HID utilities were broken by Apple during the 64-Bit transition, so i was forced to rewrite bits and pieces and upgrade to the more recent HID utilities which apparently handle this situation much less graceful. Did you install a special driver or software for the Powermate? If so, i'd uninstall that. |
Ok, i added some workarounds for Apples deficient OS to PsychHID for OSX. Can you UpdatePsychtoolbox to the latest beta release and check if stuff works better now? |
Thank you very very much Mario, it works!!!
|
Can you post PsychHID's output, so i can see how far it has to go wrt. Hacks to make the PowerMate working? @jennybosten Does this also resolve your Oculus problems? What is your PsychHID output in this case? |
When i run d=PsychHID('Devices'); PsychHID-ERROR: Could not enumerate and attach to all HID devices (HIDBuildDeviceList(0,0) failed)! |
Ok, good, that's the minimally invasive hack for the problem. |
Confirmed that this also fixes the PsychHID failure if an Oculus Rift is connected and the Oculus runtime installed and active. So we are all good again. |
This is on a mid-2012 retina MBP, running 3.0.12 (actually Mario's master) Matlab 2014b & Yosemite 10.10. Trying GratingDemo a second time causes a full matlab crash. I haven't had HID problems on this machine before... This was changed recently: #197
The text was updated successfully, but these errors were encountered: