Is it possible to develop USB drivers for third-party camera devices ?

Can anyone tell me whether it is possible to write a usb driver for a third party usb camera or will Apple only allow the hardware manufacturer to develop drivers ?


And if Apple are OK with that is there anything legal that might prevent one from doing so ?


And finally are the hardware interfaces proprietary or are they likely to be using standard interfacing hardware ?


I am currently trying to contact the manufacturers but that may take a while.

AFAIK, most just work and don't require a device-centric 'driver'.


Those that are for some reason proprietary are typically sold as MFi. MFi is a licensing program and I'd not expect manufs. in that program to just let you free ride on their investment, but yeah, legal, too.

Hello,

If the camera is fully USB UVC (video class) compliant then odds are good that it's automatically supported by the USB UVC class driver in macOS.

If the camera is USB UVC compliant but isn't recognized by macOS then you should file a Feedback Assistant report and provide as much detail as possible about the camera, such as its brand & model name. If possible, please run IORegistryExplorer with the camera attached, save the IORegistry to a file, and then attach the IORegistry file to the Feedback Assistant report. The IORegistry file will contain a lot of useful data about the camera, and potentially show why it wasn't supported by the Apple USB UVC driver.

If the camera is USB vendor specific then it should be possible to create a vendor specific USB DriverKit driver (dext) that matches and loads when the USB camera is attached, as well as receives a video stream from the camera. Supplying a video stream to macOS is outside the domain of DriverKit, so I recommend that you either post a "how do I supply a video stream to macOS" question to a forum related to AV topics, or that you submit a Technical Support Incident (TSI) to DTS.

Best regards,

C.
Thanks, I'll try that - however I suspect the device is not USB UVC compliant. It's a Nikon Z6 and I guess it will need a vendor specific driver much like the recently announced Cannon USB webcam utility. Nevertheless I'll run IORegistryExplorer as suggested above.

There is some third-party software that seems to work with the specific Z6 camera - how is it they are able to access the video stream from the camera via USB without using a vendor specific driver ? Is there some other way to access the device directly from within an application ?

Regards
Hi. You asked

There is some third-party software that seems to work with the specific Z6 camera - how is it they are able to access the video stream from the camera via USB without using a vendor specific driver ? Is there some other way to access the device directly from within an application ?  

You can use the user-space USB APIs to access any USB device (see IOKit/usb/IOUSBLib.h). Even class-compliant devices can be accessed if you write a codeless kext which outmatches the system's driver. Apparently code-less dexts are also possible, but I don't know if they will be matched at boot time, so you might have a hard time if you want to directly access a keyboard or a mouse.

The only downside to this approach is that the data from the camera would only be visible to your process, it isn't generally available to the system. To partially solve this, you can build a CoreMedia IO plugin, which is loaded into other processes. Your plugin knows how to communicate with your app, and uses some form of inter-process communication to get the frames from your camera-controlling app. CoreMedia IO plug-ins don't work in apps like Photo Booth which do not allow loading of third-party plug-ins.

Another way to make a vendor-specific camera widely available would be to write a kernel extension which changes the way it responds to Get Descriptor calls and they way it vends data, so that it appears to the system like a UVC device. It may be possible to do this with a dext.



Is it possible to develop USB drivers for third-party camera devices ?
 
 
Q