Ticket #33 (closed enhancement: invalid)

Opened 4 years ago

Last modified 3 years ago

Mac OS X libusb 1.0 native HID backend

Reported by: xiaofan Owned by:
Milestone: Component: libusb-1.0
Keywords: Mac OS X, libusb, HID Cc:
Blocked By: Blocks:


I do not have a Mac. However, I think it may be a good idea to
have an HID backend for libusb 1.0 on Mac OS X as well.

Linux has the easier kernel driver detaching function. Windows
now has a native HID backend. For FreeBSD 8+, there is a
ugen driver associated with each HID interface as well. So for
them you do not need to do much to use libusb 1.0 for the
HID device now.

But for Mac OS X, you still need to use the ugly codeless
kext for the HID device if you want to use libusb. The native
Mac OS X HID API seems to be as capable as the Windows
one, so I think this is certainly possible.

I think this will benefit libhid as well if they move to libusb 1.0.

Change History

comment:1 Changed 4 years ago by Shirk

If there's no active work done on this ticket I'd like to have a look into this.
I'm a native Mac and Linux user and I'm using libusb on both platforms.

comment:2 Changed 4 years ago by hjelmn

Before we start messing with the HID framework I want to first determine whether it is possible to detach a kernel driver. If we can unload the driver then there is no need to mess with HID.

comment:3 Changed 4 years ago by xiaofan

As far as I know, the only way is to write a codeless kext to prevent the kernel from using the HID driver. This is ugly IMHO.

comment:4 in reply to: ↑ description Changed 3 years ago by northcob

Replying to xiaofan:

I do not have a Mac. However, I think it may be a good idea to
have an HID backend for libusb 1.0 on Mac OS X as well.

The ugly codeless kext does not seem to work anymore. If a HID or composite device with a HID identity is connected it gets the user space HID driver regardless of the kernel space kext. IMO one would need to put code into the shield kext to prevent the device revealing its HID character.

The effect is that libusb and the software that depends on it is broken on Darwin/Mac? OS X.

OTOH it is perfectly possible to talk to such devices via the HID driver.

So I think there is an urgent need for this HID backend.

comment:5 Changed 3 years ago by hjelmn

I do not think libusb should have native hid support for any platform (windows included). This functionality belongs in another library (such as libhid). I am willing to help add OS X support to libhid but, at this time, not libusb. If someone can provide a use case where libusb would be more suitable than libhid please let me know and I may reconsider.

I am going to mark this ticket invalid.

comment:6 Changed 3 years ago by hjelmn

  • Resolution set to invalid
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.