-
Notifications
You must be signed in to change notification settings - Fork 10
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
Potential Mac M1 (Arm Silicone) issue? #9
Comments
Once I get time. I'll get logs here just to make it obvious what I'm seeing on my end and maybe make it obvious what the issue at hand might be. |
Hi @Alexander-Leon - that sounds strange indeed. FWIW, I use an M1 MBP as my daily driver and I have a couple of small projects to the side that use Could you describe in a little more detail the calls you're making into package |
wireshark_usbhid_results.pcapng.zip Attached is Zipped Wireshark readings. Code to invoke it.
|
I suspect what you're running into are differences in the underlying USB implementation. Assuming this is a USB 2.0 HID device, your report length will not exceed 64 bytes. What could be happening is a buffer overflow somewhere either in the bowels of HIDAPI or IOKit. Backing up a little bit, have you verified the report length for your device? This will be shared as a part of the report descriptor. If you're hardcoding this value, then you'll want to make sure this matches exactly what your device expects. I also would not recommend treating a buffer as a string in your log function. I've found For example: t.Log(hex.Dump(buffer)) |
Hm odd, it is USB 2.0 so I think there's probably something for me to nibble at there Unless I'm misunderstanding something about the following it should be 512
|
Very interesting. Do you have access to a Linux environment? The output of |
It's been quite a while since I've read through the HID spec, but I had forgotten that it is permissible for reports to exceed wMaxPacketSize, so long as they are terminated with a shortened packet. |
Unfortunately not. Everything I work on linux related is generally containerized |
Gotcha. I wonder if as a next step if it would be worth writing the same test program you have in C and use HIDAPI directly to see if you get different behavior. I can't think of anything in the bindings that could cause the behavior you are seeing. It could be something macOS-specific being triggered by the device you have. |
That's sorta what I was thinking too. I just figured it'd be worth a shot reaching out to see if you had experienced anything when working on the initial bindings. I was avoiding that route, but at this point seems like the only proper course of action to dig deeper. [For context I know there's a way to properly interface with it because of openOCD working correctly, I'll just have to dig deeper. Thanks for your feed back though as well as the bindings, they've been useful. ] |
My pleasure and best of luck. I'll close the issue for now, but if you find anything that looks like a smoking gun I'd love to hear back - my curiosity is definitely piqued at this point! |
I ask this kinda vaguely because I'm not entirely sure if this is a platform issue or an issue with libusb under the hood, but I seem to have an issue specifically on the MAC M1 which I can get the platform to return the structure and provide me all the meta data, but when I stream to/from it. The exchange works once before breaking. Upon inspection of the processed packets being sent out. They're getting malformed as well as no always registering as HID packets. The buffers being passed are seemingly changing as well which leads to be believe it might be an issue with the underlying memory management, but there's so many layers I can't really say for sure.
I'm just not sure if I should be attempting to fix this in the lower levels or if I'm missing something for this to work properly with the wrapper or if this is M1 compatibility issues.
Note: The same project works perfectly on windows and was originally developed on windows, but was meant to be cross-platform.
The text was updated successfully, but these errors were encountered: