USB interface iterator broken @ USB device match notification in 10.14

When opening the USB device in response to the first match notification, the USB interface iterator (since 10.14) does not return a USB interface anymore.

However, if the USB device is already connected at the time calling IOServiceAddMatchingNotification(), and therefor it is iterated with its resulting iterator (without match notification) then the interfaces are found and from then on the USB interface iterator works.


Once the interface iterator has successfully returned a USB interface, it now also works as a reaction to USB match notification. (Therefore a reboot is necessary to reproduce the problem once the iterator found an USB interface).


Interestingly, it doesn't seem to be a simple timing problem, because a delay doesn't help, but a BP does...


Any suggestion is highly recommend.

Thanks!

  • Thanks, for giving me the chance to soliloquy. The issue persists in Bug Sur, we have worked around this by requesting a USBDeviceReEnumerate(); This continues to work on M1 for some USB devices, while for others the interface iterator is still empty and is not getting filled by any magic we tried.

    In this case the USB device is pretty simple it has a single configuration with 2 interfaces.

    What is the cause for this and can this be fixed/worked around?

Add a Comment