[darwin_claim_interface] USBInterfaceOpen: another process has device opened for exclusive access
- Why GitHub?
- 1.5k
- Insights
MacOS Monterey 12.0, libuvc, libusb: info [darwin_claim_interface] USBInterfaceOpen: another process has device opened for exclusive access #972
Open hl0521 opened this issue on Aug 4 · 23 comments OpenMacOS Monterey 12.0, libuvc, libusb: info [darwin_claim_interface] USBInterfaceOpen: another process has device opened for exclusive access #972
hl0521 opened this issue on Aug 4 · 23 commentsComments
hl0521 commented on Aug 4 ?
When using the function "uvc_open" in libuvc on MacOS Monterey 12.0, the following exception will be thrown: libusb: info [darwin_claim_interface] USBInterfaceOpen: another process has device opened for exclusive access. Does anyone know how to solve this problem? The complete log is as follows:
|
mcuee commented on Aug 5
That is just a info message and not a problem. |
mcuee commented on Aug 5
Do you have real problem here other than the message? |
mcuee commented on Aug 5
Reference: we have downgraded the message from warning to info as it is normal. |
hl0521 commented on Aug 5
My program use the libuvc (https://github.com/libuvc/libuvc) to control the webcam. The program can work on macOS 10.x and macOS 11.x. It doesn't work on macOS 12.0 that is Apple's new system released recently. The cause is that the function "uvc_open" failed. Function "uvc_open" works as follows: uvc_open Maybe this problem is caused by some changes in Apple’s new system, i'm not sure. And I don't know how to solve this problem, so come here for help. |
mcuee commented on Aug 5
Can you try the latest libusb git? And post the debug log again. |
hl0521 commented on Aug 5
I updated the latest code from the libusb yesterday and got the above log. The log starts with [device.c:322] begin uvc_open |
mcuee commented on Aug 5
I see. Thanks. Maybe there is a change on the Apple side. Anyway, this is a beta release. You may want to try again when there is a formal release. Right now please post the debug log for macOS 11.x as well since you say it works. By comparing the logs, you may be able to identify the differences. It could be that there is a kernel driver in the 12.x beta which opens the device for exclusive access. One thing you can try is to see if you can use the latest addition to the macOS side, the kernel driver detaching function, but you need to have the right entitlement. I have not tried this myself. More details are in pull request #911 |
hl0521 commented on Aug 5 ?
On macOS 11.4, the log as follows:
|
mcuee commented on Aug 5 ?
Main difference:
macOS 12 beta: claiming interface failed. So there is a kernel driver (or maybe system application) which opened the device for exclusive access. You may have to contact Apple for help.
|
hjelmn commented on Aug 8
Think I know how I broke it. Fixing now.... |
hjelmn commented on Aug 8
Opps. Wrong bug :). |
mcuee commented on Aug 8
@hl0521 You may want to give latest git a try again (to run with sudo) under macOS 12 beta. Nathan just fixed an issue and it might help you under macOS 12 beta. Reference discussion: #911 |
hl0521 commented on Aug 8 ?
It works when running with sudo. Thanks. I also found another issue: when calling "uvc_close" in libuvc, the following line of code in function "libusb_free_transfer" oftern lead to program crash. |
mcuee commented on Aug 8
Thanks for the updates. Then there is no issue with libusb already. I will close this issue. The proper way (without using sudo) is for the developer to get the right entitlement as per the following discussion: #911
|
mcuee commented on Aug 8
You may want to report the issue to libuvc, looks like a bug in libuvc. But if you think it is an issue with libusb, please create a new issue and post the debug log. Thanks. |
scchn commented on Aug 12
Non-VM apps on the App Store have no way to get the 'com.apple.vm.device-access' or run as root by default. |
mcuee commented on Aug 12
Thanks for the updates. As for the first sentence, I am not so sure if it is correct or not. I think it is not correct to say "non-VM apps". |
scchn commented on Aug 12
Ha, me either. Quote from the mail:
|
mcuee commented on Aug 12
Do not worry too much about the vm in the name. https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_vm_device-access |
mcuee commented 28 days ago
https://github.com/libusb/libusb/wiki/FAQ#how-can-i-run-libusb-applications-under-mac-os-x-if-there-is-already-a-kernel-extension-installed-for-the-device-and-claim-exclusive-access Updates on Oct 2021: with the merging of pull request #911, support for detaching kernel drivers with authorization has been added. This will be included in the upcoming 1.0.25 release. Take note the underlying macOS capture APIs only work on the whole device and not on individual interfaces. So this will force all the kernel extensions (drivers) bound to all the interfaces of a USB Composite devices to be released (Issue #920). You will need to get the entitlement from Apple Developer support, create a provisioning profile with that entitlement, and build your app with that profile. Please take note that command line apps cannot use provisioning profiles and therefore cannot hold this entitlement. |
mcuee commented 18 days ago
Please refer to the following discussion as well for further info. Apple support seems to say that the 'com.apple.vm.device-access' is not the right entitlement for this purpose.
|
mcuee commented 15 days ago ?
Ref: libuvc/libuvc#188 If you are just testing, then you can use latest libusb git and sudo. The following is with my Mac Mini M1 running macOS 12.0.1.
|
mcuee commented 15 days ago
ANother libuvc issue is here: libuvc/libuvc#194 |
- ? 2021 GitHub, Inc.
- Terms
- Privacy
- Security
- Status
- Docs
- Contact GitHub
- Pricing
- API
- Training
- Blog
- About
- Team
- Enterprise
- Explore
- Marketplace
- Pricing
- 3.4k
- Code
- Issues 63
- Pull requests 14
- Actions
- Projects
- Wiki
- Security