hid_device_info->interface_number zero on macOS 13.3 #531
Labels
No labels
3rdparty
Android
API
Author does not respond
bsd
bug
build system/CI
ci-virtual-device
CMake
Contributions Welcome
Core
dependencies
device-specific
documentation
don't_merge
duplicate
enhancement
Example
Haiku
hidraw
hotplug
info required
invalid
libusb
macOS
Misc
Not an issue
question
Release
Test
Test GUI
Windows
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-libusb/hidapi#531
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Discussed in https://github.com/libusb/hidapi/discussions/527
Originally posted by dingsijie-nreal April 11, 2023
I've noticed comment here: https://github.com/libusb/hidapi/blob/master/mac/hid.c#L543
The interesting thing is: macOS Monterey(12.6.3) works perfectly with my usb gadget, I got expected interface numbers.
the output of
test.cis shown below:But, after upgrading to macOS 13.3 the result changes to flowing:
My mission it to discriminate 3 different components on my USB gadget, and the interface number was the key that I rely on.
But with 0 interfaces numbers, I don't know how to do my job.
Any one get any ideas? Thanks a lot.
I think this is a real issue.
Last time I can get proper interface number on my Mac Mini M1.
https://github.com/libusb/hidapi/issues/249#issuecomment-905417116
With the latest macOS Ventura 13.3.1 on my Mac Mini M1, interface number becomes 0 for the Logitech USB receiver (046d:c52b).
From @dingsijie-nreal
@Youw @dingsijie-nreal @pengxianheng-nreal
Somehow libusb is able to print the interface number.
PR #530 is a workaround and it seems to work. However, I believe there is a better solution.
Just a quick test using my mod hidapi-libusb under macOS.
https://github.com/libusb/hidapi/issues/319#issuecomment-894732993
@Youw
I am thinking that libusb codes may be of some reference to sort out the issue here.[
https://github.com/libusb/libusb/blob/master/libusb/os/darwin_usb.c#L1342-L1377
Yeah, libusb and HIDAPI using different API/subsystems to get the information about USB device.
libusb gets it directly from USB subsystem, which would be broken all at once if the interface number wasn't availale.
HIDAPI uses HidManager macOS API which is either changed or broken in the latest macOS 13.3.1.
BTW: I'm still using 12.6 so I'm unable to debug/fix it localy as of yet...
Yeah, I've noticed that libusb is able to fetch the correct interface number, but as @Youw has pointed out, hidapi doesn't use libusb on mac. Our app code currently uses hidapi API because it is easier and nicer to use than libusb. Maybe it is a real bug on macOS 13.3?
Now what I'm thinking more about is that shouldn't apple already received reports about this issue? Is @mcuee 's logitech USB receiver working fine on macOS 13.3? Or, maybe a usb device with none zero interface number itself is a less common design?
The USB receiver works fine (together with the mouse and keyboard). In fact yesterday I tried hidpp macOS fork and it works fine.
It is probably just the paticual macOS API is broken. Sometimes Apple will fix it in the future updates. Sometimes it may take time. Let's see if you will get some reply here. Better way is to submit a bug report to Apple.
Ref: https://developer.apple.com/forums/thread/728001
@dingsijie-nreal
It will be good to file a feedback to Apple.
https://developer.apple.com/bug-reporting/
You can see from the following libusb issue that Apple fixed the issue pretty fast in the paticular case. But sometimes it takes time.
Ref: https://github.com/libusb/libusb/issues/1156
feedback posted. https://feedbackassistant.apple.com/feedback/12125162
Is there some kind of visibility configuration for the feedback? I'm unable to open/see it.
Same here. Probably it is not visible for unconfirmed issue.
Only apple can see it according to:
https://developer.apple.com/forums/thread/700518
Also, I didn't notice any visibility setting when I was posting the feedback.
After digging deeper into the problem in the context of #534 - I'm starting to think that this is not a bug in macOS.
It looks like HIDAPI used an undocumented property of the
IOHIDDeviceregistry entry, and Apple finally cleaned (some?/all?) undocumented properties from the IOHIDDevice registry.But it is still a clear statement that
IOHIDDeviceentry in the registry is one of the child entries of theIOUSBHostInterfaceentry for USB HID devices, which definitely has the InterfaceNumber property (otherwise at least libusb would break completely).@dingsijie-nreal see if you (or you colleague?) could check the #534 fix.
PR #534 works fine for me.