Unable to Control Optical Zoom via USB (UVC) in Custom Swift App, While Prebuilt App Works

I’m currently working on a macOS application to control a USB camera’s optical zoom via a direct USB connection.

My situation: I am using a USB camera that supports optical zoom. I downloaded an open-source project, CameraController. The prebuilt binary provided on GitHub works perfectly, and I can successfully control the camera’s optical zoom. However, when I build and run the same project from source in Xcode, the zoom control UI appears disabled (grayed out). The project compiles without errors. Additionally, I attempted to implement zoom control myself using the UVC protocol in Swift . However, it seems that the zoom control commands are not successfully sent or recognized by the camera.

Questions: Why would the prebuilt app work, but the same source code built locally results in disabled zoom controls? Are there known limitations on sending zoom control requests via USB on macOS? Is there a recommended modern approach for controlling optical zoom programmatically via Swift?

Any insights, debugging suggestions, or references would be greatly appreciated. Thanks in advance!

I suggest you get in touch with the maintainer of the project you cite. I tried building it, but it went off into the weeds when trying to parse the USB descriptor of three different UVC cameras.

Have you found the code which enables/disables the zoom control? That should give you some clue.

You said "tt seems that the zoom control commands are not successfully sent or recognized by the camera" - which is it - sent, or recognized? Does your code send the command? How? (show code). Does the camera or the USB stack return an error, and if so, which error?

You're not giving us much to go on here.

Unable to Control Optical Zoom via USB (UVC) in Custom Swift App, While Prebuilt App Works
 
 
Q