-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Librealsense needs sudo on macOS Monterey and Ventura #11815
Comments
Hi @jackjansen Whilst I do not have advice that I can offer on this subject, let's keep the case open for a couple of weeks to give other Mac users the opportunity to comment. You could also post a message at #9916 inviting the Mac users in that discussion to comment with advice here. |
I have been searching through the libusb issues, and a few seem promising as they discuss a problem similar to ours (unable to open USB devices on Monterey or later). Also: these issues are often with "camera-like" devices (which the Realsense also is: it shows up in Apple applications like Photo Booth). The central issue in the libusb repo seems to be libusb/libusb#1014 A potential workaround seems to be in libusb/libusb#972 (comment) That references Apple documentation https://developer.apple.com/documentation/coremediaio/overriding_the_default_usb_video_class_extension?language=objc
This could be the smoking gun: if Apple has handed the Realsense camera (or one of its sensors) off to its own driver then |
Searching a bit further has finally led me to a libusb FAQ entry that seems to indicate the issue is unsolvable: I have tried unloading the KEXT that handles USB video cameras, by doing
but it fails with
|
As I understand it, Apple started requiring elevated authority to draw more power than "normal." Out of curiosity, I asked ChatGPT if it knew of any work arounds. I wonder if the powered USB hub would have any result.
|
@jackjansen I just started looking into this issue again and I would agree with you. RealSense cameras are shown as UVC cameras, which means they are already accessed by the kext ( Otherwise, if it would be possible to disable UVC in the FW, macOS would maybe not attach the device. |
Thanks for opening this fresh new issue @jackjansen - the spam from the previous one was getting annoying. While I don't have any insights on how to fix the root issue I noticed you mentioned that you weren't able to access the camera from Unity. In case you haven't tried it already if you open the Unity editor with root privileges from the command line then camera access is possible. Thanks also for all the digging so far to try get to the bottom of this issue! |
Thanks very much @timprepscius @jen-co and @cansik for your advice on this issue! |
Thank you @timprepscius for that note on USB power draw. My feeling is that this is a completely different issue from the UVC issue. Also: it seems this power-draw issue cannot be worked around by running with I've been doing a couple of experiments with a D415 on two machines running Ventura 13.3 or Ventura 13.4: Mac mini M1 and an Intel MacBook Pro 2019. The Mac mini M1 does worst: nothing works. I always get
Tried with and without I have not been able to find the Energy Saver settings that ChatGPT came up with, so it must have hallucinated those (at least for Ventura). The Intel MacBook does a bit better, but in a very weird way:
My current theory is that there is something with the USB port on the computer (maybe having PD enabled?) that makes a difference. If other people could experiment and report that would be helpful. (I have checked with |
Hi @jackjansen Do you have an update about this case that you can provide, please? Thanks! |
Hi @jackjansen Do you require further assistance with this case, please? Thanks! |
Thank you everyone for the support on this issue. I am a little confused, however. The depth camera can still be opened and used, but it requires an annoying sudo everytime, is this the problem or the camera simply doesn't work on Mac Ventura? I just bought a D435f and a D435if online but I have only a M2 macbook, i'm hoping to help solve this issue before my cameras arrive. |
Has any Mac user tried to use parallel windows to open the camera? I hope someone can test try this method since my cameras haven't arrived. |
@MMYoloCoding I have run librealsense successfully, below is my system environment:
Refer to my repo: https://github.com/yugasun/pyrealsense2-mac |
@yugasun It would be more interesting to hear more about how you solved it, instead of just posting a link to your repository? And what does solve mean? Does it run without sudo, without any problems? Looking at your repository, it seems that you translated the powershell script to bash. Are there changes fixing the libusb kext problem? |
@cansik Just run sucessfully with |
@cansik Do you have any idea why your pyrealsense2-mac fixes the issue? (Unfortunately I cannot try it myself at the moment) |
@jackjansen My build script uses the most recent libusb version, which allowed it to support M1 chips. But other than that the main reason for the repository was to create macOS releases, because Intel is not publishing wheels for macOS on pypi. |
@cansik I have no success with your https://github.com/yugasun/pyrealsense2-mac repository. I finally got it to build But I had to make various changes to your build script before it built
|
@jackjansen Ok, I guess there is a misunderstanding and this is exactly what I was worried about: The confusion between @yugasun's fork and the one I was working on for over two years (https://github.com/cansik/pyrealsense2-macosx/). But regarding your question: Yes, the @yugasun Could you please explain the purpose behind launching your own version instead of contributing to the existing project through a pull request? Now we have |
@cansik Sorry for casing confusing for you, because I can not run successful by using |
@yugasun
|
Update: I figured out the issue in the last message I sent I am running into new error when using |
Hi @AkshajGupta Were you able to resolve your problem, please? Thanks! |
My Solution in TouchDesigner: |
Thanks so much @sidekicktec for sharing the M1 installation solution that worked for you! |
Case closed due to no further comments received. |
Hi everyone, The current latest 2.56.1 version of the librealsense SDK contains a fix for SDK compilation on MacOS Apple Silicon 'M' processors and also an update for MacOS 14 (Sonoma). These changes are confirmed in 2.56.1's release notes. 2.56.1 is currently an 'interim beta' release of the SDK which can only be installed by source code compilation. https://github.com/IntelRealSense/librealsense/releases/tag/v2.56.1 |
I am opening this issue because #9916 has become unwieldy and has an awful lot of information that is beside the point.
Maintainers: feel free to close-as-duplicate if you think this is a bad idea.
My hope is that there are some people out there who have an idea which MacOS change is the cause of this issue, then we should be able to come up with a fix or workaround.
I presume the root cause is the continuous effort by Apple to harden MacOS against malware, that started with MacOS 10.8 with signed applications, System Integrity Protection, and all that. But I have no idea which specific feature has caused this behaviour.
Issue Description
Since MacOS Monterey any program that uses librealsense needs
sudo
rights. The error differs depending on the program, but it will often say something like "failed to set power state" or "failed to claim usb interface" or both:Requiring superuser rights is always inconvenient, but sometimes impossible (for example when trying to use librealsense from within
Unity
).The text was updated successfully, but these errors were encountered: