Skip to content
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 fails to claim USB interface on MacOS Monterey #9916

Open
dominiccarrano opened this issue Nov 3, 2021 · 130 comments
Open

librealsense fails to claim USB interface on MacOS Monterey #9916

dominiccarrano opened this issue Nov 3, 2021 · 130 comments

Comments

@dominiccarrano
Copy link


Required Info
Camera Model D415
Firmware Version N/A
Operating System & Version MacOS Monterey (12.0.1)
SDK Version 2.49
Language python

Issue Description

After upgrading my machine from macOS Catalina (10.15.6) to Monterey (12.0.1), all RealSense applications I have and pyrealsense2 code I’ve written -- which all previously ran without issue -- are broken. They all give me the same error message: failed to claim usb interface: 0, error: RS2_USB_STATUS_ACCESS. I’ve verified both physically and via System Preferences that the D415 is connected to the machine with a USB 3 connection using the same cable that the D415 was shipped with.

When I run rs-enumerate-devices, I get:

> rs-enumerate-devices
Could not create device - failed to set power state . Check SDK logs for details
 02/11 16:49:13,578 ERROR [0x70000cff3000] (handle-libusb.h:95) failed to claim usb interface: 0, error: RS2_USB_STATUS_ACCESS

When I run realsense-viewer, I get:

> realsense-viewer
 02/11 16:52:08,669 ERROR [0x70000c115000] (handle-libusb.h:95) failed to claim usb interface: 0, error: RS2_USB_STATUS_ACCESS
 02/11 16:52:08,669 ERROR [0x70000bf8c000] (sensor.cpp:537) acquire_power failed: failed to set power state
 02/11 16:52:08,673 WARNING [0x70000bf8c000] (rs.cpp:308) null pointer passed for argument “device”
 02/11 16:52:08,673 WARNING [0x70000bf8c000] (rs.cpp:2621) Couldn’t refresh devices - failed to set power state

I wondered if something was wrong with the device firmware and tried updating it, which gives me:

> rs-fw-update -l
connected devices:
 03/11 14:56:46,495 ERROR [0x70000b0b1000] (handle-libusb.h:95) failed to claim usb interface: 0, error: RS2_USB_STATUS_ACCESS
RealSense error calling rs2_create_device(info_list:0x600003554e70, index:0):
    failed to set power state
 03/11 14:56:46,497 ERROR [0x119b34600] (sensor.cpp:537) acquire_power failed: failed to set power state

I uninstalled and then rebuilt librealsense from scratch for Monterey using the newest version of Xcode that’s Monterey compatible, but these issues still persist even after that. The librealsense homebrew page indicates that Monterey is supported. I’d greatly appreciate any guidance on fixing the failed to claim usb interface: 0, error: RS2_USB_STATUS_ACCESS problem for Monterey, thank you!

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Nov 3, 2021

Hi @dominiccarrano May I first confirm please whether you are using an Intel-based Mac computer or a newer Apple Silicon M1 model.

If you do have an Intel based Mac, have you attempted to build librealsense from a binary with brew using brew install librealsense

If you have chosen not to install librealsense with a brew binary because you require pyrealsense2 to be installed too, a RealSense Mac user recently shared a method in #9687 that they developed to install a pre-built pyrealsense2 on Mac using pip install.

@dominiccarrano
Copy link
Author

Hi @MartyG-RealSense, thanks for the quick response! I'm on an Intel-based Mac.

I've separately tried:

  • brew install librealsense
  • The steps described in this link
  • The method you've linked (although the author says it's only supported on Catalina and Big Sur, not Monterey)

and all produce this same RS2_USB_STATUS_ACCESS error.

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Nov 4, 2021

As you were earlier able to successfully use the camera on the same Mac with Catalina, that would make it unlikely that hardware problems with the camera or with the Mac computer are the cause of this problem. It could be an OS software issue with Monterey.

Is your camera plugged into a hub? There have been reports of USB detection issues recently from Mac users who have upgraded to Monterey, particularly with hubs. An example discussion from the past week is in the link below.

https://www.macrumors.com/2021/10/29/monterey-usb-hub-issues-reported/

@dominiccarrano
Copy link
Author

Thank you for the link, I wasn't aware of this. The camera was plugged into a hub, which had no issues on Catalina. But even after plugging it into the machine with a direct USB3 connection, I get the same error.

My understanding from perusing previous issues on this GitHub is that RS2_USB_STATUS_ACCESS typically means that libusb had trouble reading from a USB due to something permissions related. Is there any guidance from Intel on troubleshooting this for Mac (Monterey in particular)? I haven't been able to find anything online about how to debug this that wasn't specific to Linux.

@MartyG-RealSense
Copy link
Collaborator

I researched the Monterey USB problem further. In the majority of cases, waiting for Apple to release a fix in a patch seemed to be the most common advice.

There was one case where a Mac user restored access to their webcam in Monterey by resetting the Mac permissions with the command tccutil reset All in the terminal.

@jeredhdean
Copy link

I have the same error as @dominiccarrano and have walked through the same troubleshooting with the exact same results. Also an Intel Mac with Monterey that used to be a happy RealSense user with Big Sur.

First tried: tccutil reset Camera
Then tried: tccutil reset All

Still getting the RS2_USB_STATUS_ACCESS errors. If anyone finds a fix I'd love to know about it.

@MartyG-RealSense
Copy link
Collaborator

@jeredhdean Thanks very much for your report!

@dominiccarrano Have you found any solutions since your last report, please?

@dominiccarrano
Copy link
Author

I got the same result as @jeredhdean: still have RS2_USB_STATUS_ACCESS after each of those tccutil reset commands.

@MartyG-RealSense
Copy link
Collaborator

Reports about the Monterey USB issues strongly indicate that Thunderbolt ports are not affected. Thunderbolt ports accept USB-C connections. So conceivably, a camera might work if attached to a Thunderbolt port via a USB-A to USB-C adapter or a USB cable with USB-C micro sized connectors on both ends of the cable.

Point number 3 of a guide to the Monterey USB issue in the link below suggests trying resetting the System Management Controller (SMC).

https://cleanmymac.com/blog/usb-devices-disconnecting-monterey

@dominiccarrano
Copy link
Author

Thanks for the additional info on this, @MartyG-RealSense. Unfortunately, using a Thunderbolt connection instead didn't fix the issue, nor did an SMC reset. I should mention that this is on a late 2014 Mac mini with no Thunderbolt 3 (i.e., USB-C) ports, so I was using Thunderbolt 2 during that attempt.

However, when I booted up the Mac in Safe Mode the camera did work. In Safe Mode, rs-enumerate-devices and rs-fw-update -l behaved just as expected without any RS2_USB_STATUS_ACCESS error, and I was able to use pyrealsense2 to stream RGB-D frames within a Python shell. I couldn't use realsense-viewer in Safe Mode due to some component of glfw3 being blocked or failing. After rebooting the Mac again normally (i.e., not in Safe Mode), I got the same set of errors as before. I then tried all the suggestions under "If the issue doesn't continue in safe mode" (https://support.apple.com/en-us/HT201262), but still no luck.

@MartyG-RealSense
Copy link
Collaborator

Thanks very much @dominiccarrano for the information about being able to access the camera in Safe Mode! It seems likely though that a resolution for this issue will have to come from Apple's side via an update for Monterey.

@sam598
Copy link

sam598 commented Nov 14, 2021

I am getting the same error in MacOS Monterey, but I don't think it is the same as the Monterey USB hub issue.

This code:

import pyrealsense2.pyrealsense2 as rs

ctx = rs.context()
print(len(ctx.devices))

Will print "1" when a RealSense camera is connected, so the python wrapper can tell that a device is connected.

But if I try to read and print the camera's serial number:

for i in range(len(ctx.devices)):
    sn = ctx.devices[i].get_info(rs.camera_info.serial_number)
    print(sn)

it will fail with RuntimeError: failed to set power state

None of the built example or realsense-viewer will be able to access the device properly.

Under system report MacOS can clearly see that a realsense device is connected under Hardware > USB

Intel(R) RealSense(TM) Depth Camera 455 :

  Product ID:	0x0b5c
  Vendor ID:	0x8086  (Intel Corporation)
  Version:	50.d0
  Serial Number:	110223061847
  Speed:	Up to 5 Gb/s
  Manufacturer:	Intel(R) RealSense(TM) Depth Camera 455 
  Location ID:	0x01210000 / 3
  Current Available (mA):	900
  Current Required (mA):	720
  Extra Operating Current (mA):	0

The device is also visible under Hardware > Camera

Intel(R) RealSense(TM) Depth Camera 455 :

  Model ID:	UVC Camera VendorID_32902 ProductID_2908
  Unique ID:	0x121000080860b5c

Interestingly if I open Apple's Photobooth App Intel(R) RealSense(TM) Depth Camera 455 is available as an option along with FaceTime HD Camera. When selected it will show the RGB-Infrared stream and the IR projector is on at full power.

To me it seems that MacOS is able to power and access the RealSense camera without issue. There is something that Apple has changed that is causing the RealSense SDK to not work properly. This will likely require a change to the SDK that someone from Intel will need to investigate.

@MartyG-RealSense
Copy link
Collaborator

Thanks very much everyone for your reports. I will highlight the issue to Intel.

@Nikhil-Kasukurthi
Copy link

I'm facing the same issue as well, with L515.

@aagaard
Copy link

aagaard commented Nov 15, 2021

I also have the same issue with D415 and D435

@sam598
Copy link

sam598 commented Nov 15, 2021

Confirmed the same behavior on both a late 2019 Intel MacBook Pro as well as a late 2021 M1 Pro MacBook Pro.

MacOS Monterey Version 12.0.1
RealSense SDK Version 2.50.0 and FW 5.13.0.50

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Nov 16, 2021

I discussed this case with my Intel RealSense colleagues. We will wait for Apple to release a fix for Monterey first. Then we can see if RealSense related problems are still present after that.

@sam598
Copy link

sam598 commented Nov 16, 2021

How does that make sense? If the issue was USB then you would not be able to access the camera at all. It appears the issue is with the SDK.

@dominiccarrano
Copy link
Author

Ran a few more experiments (all with the system booted up normally, i.e. not in Safe Mode):

  • I can use the D415 in Photo Booth to take photos and videos, so macOS itself doesn't seem to have an issue with accessing the camera.
  • From digging through the librealsense source code, I found that RS2_USB_STATUS_ACCESS is an alias for LIBUSB_ERROR_ACCESS, which typically indicates a permissions error. I gave rs-enumerate-devices full permissions by going into System Preferences > Security & Privacy > Full Disk Access and adding the application, and then re-ran it. I still got the same bug, but the error message was slightly more verbose:
> rs-enumerate-devices # without full disk access
Could not create device - failed to set power state . Check SDK logs for details
 16/11 10:03:06,047 ERROR [0x70000c0c7000] (handle-libusb.h:95) failed to claim usb interface: 0, error: RS2_USB_STATUS_ACCESS

> rs-enumerate-devices # with full disk access
 16/11 10:01:42,062 ERROR [0x70000f7f3000] (handle-libusb.h:95) failed to claim usb interface: 0, error: RS2_USB_STATUS_ACCESS
Could not create device - failed to set power state . Check SDK logs for details
 16/11 10:01:42,063 ERROR [0x10edef600] (sensor.cpp:537) acquire_power failed: failed to set power state

@sam598
Copy link

sam598 commented Nov 16, 2021

@dominiccarrano if it were a camera permissions issue Full Disk Access would not make a difference, it would need to be Camera. Unfortunately you cannot pre enable an application for camera access, the application has to request it.

Interestingly opencv-python is also able to access and display an infrared feed from an attached RealSense camera similar to how photobooth is (once terminal or whatever application is running python is given camera permission).

@MartyG-RealSense it really seems like the onus is on Intel to investigate and fix this.

@Vangos
Copy link

Vangos commented Nov 17, 2021

I have been facing the same issue since I updated to macOS Monterey.

The camera appears in the USB list and I can properly use it as a webcam.

@MartyG-RealSense May I first confirm please whether you are using an Intel-based Mac computer or a newer Apple Silicon M1 model.

To avoid spending time on testing different architectures, the chipset is irrelevant to this issue. I have compiled RealSense for Intel (x86_64), Apple Silicon (arm64), and Universal (x86_64 + arm64) and I've used it without any problems in Big Sur.

Here's the test: I created a universal RealSense build on my M1 machine (Monterey). Obviously, it did not work on Monterey. However, when I used that exact same build on an Intel machine (Big Sur), it worked fine.

Same for x86 and ARM builds: they work on Big Sur, but not on Monterey.

Also, I recompiled libusb (latest version) and linked that to RealSense. No luck.

It seems this issue is related to Monterey and power delivery over USB.

@sam598 If the issue was USB then you would not be able to access the camera at all. It appears the issue is with the SDK.

The RealSense SDK uses the sensor in full power. I guess that's why it requires a dedicated USB-3/C. All other apps (like FaceTime or Photobooth) use RealSense as a webcam, limiting it to 30 FPS.

There are numerous user reports here. So, for now, I tend to agree with @MartyG-RealSense that it's something Apple should work on. However, I'm keeping the thread alive to ensure Intel engineers will take care of that for version 2.50.

@MartyG-RealSense
Copy link
Collaborator

As a side-note on the subject of Monterey, it is worth highlighting that the simple installation procedure brew install librealsense now supports Monterey.

https://formulae.brew.sh/formula/librealsense

@rowungiles
Copy link

rowungiles commented Nov 29, 2021

On macOS Big Sur 11.6.1, I am also seeing this issue using an M1 Mac mini.

This install of Big Sur is absolutely fresh (a downgrade from macOS 12.0), I have only installed Xcode and the brew installs outlined on the Intel Dev site. The install was a downgrade from Monterrey specifically to get librealsense working.

I have the following output from
Starting Xcode
Running realsense-viewer
Initial fail and then
Unplugging and re-plugging the camera in several times:

2021-11-29 12:52:33.855654+0000 realsense-viewer[18210:105475] Metal API Validation Enabled
2021-11-29 12:52:33.880607+0000 realsense-viewer[18210:105475] fopen failed for data file: errno = 2 (No such file or directory)
2021-11-29 12:52:33.880635+0000 realsense-viewer[18210:105475] Errors found! Invalidating cache...
2021-11-29 12:52:33.927411+0000 realsense-viewer[18210:105475] +[MTLIOAccelDevice registerDevices]: Zero Metal services found
 29/11 12:52:34,132 ERROR [0x17062f000] (handle-libusb.h:61) failed to set kernel driver auto detach: 0, error: RS2_USB_STATUS_NOT_SUPPORTED
 29/11 12:52:34,133 ERROR [0x17048b000] (sensor.cpp:572) acquire_power failed: failed to set power state
 29/11 12:52:34,134 WARNING [0x17048b000] (rs.cpp:310) null pointer passed for argument "device"
 29/11 12:52:34,134 WARNING [0x17048b000] (rs.cpp:2691) Couldn't refresh devices - failed to set power state
 29/11 12:53:38,472 ERROR [0x1706bb000] (handle-libusb.h:61) failed to set kernel driver auto detach: 0, error: RS2_USB_STATUS_NOT_SUPPORTED
 29/11 12:53:38,472 ERROR [0x101fefd40] (sensor.cpp:572) acquire_power failed: failed to set power state
 29/11 12:53:38,473 WARNING [0x101fefd40] (rs.cpp:310) null pointer passed for argument "device"
 29/11 12:53:38,473 WARNING [0x101fefd40] (rs.cpp:2691) Couldn't refresh devices - failed to set power state
 29/11 12:53:54,563 ERROR [0x1706bb000] (handle-libusb.h:61) failed to set kernel driver auto detach: 0, error: RS2_USB_STATUS_NOT_SUPPORTED
 29/11 12:53:54,563 ERROR [0x101fefd40] (sensor.cpp:572) acquire_power failed: failed to set power state
 29/11 12:53:54,564 WARNING [0x101fefd40] (rs.cpp:310) null pointer passed for argument "device"
 29/11 12:53:54,564 WARNING [0x101fefd40] (rs.cpp:2691) Couldn't refresh devices - failed to set power state
 29/11 12:54:45,116 ERROR [0x1706bb000] (handle-libusb.h:61) failed to set kernel driver auto detach: 0, error: RS2_USB_STATUS_NOT_SUPPORTED
 29/11 12:54:45,116 ERROR [0x101fefd40] (sensor.cpp:572) acquire_power failed: failed to set power state
 29/11 12:54:45,118 WARNING [0x101fefd40] (rs.cpp:310) null pointer passed for argument "device"
 29/11 12:54:45,118 WARNING [0x101fefd40] (rs.cpp:2691) Couldn't refresh devices - failed to set power state

I built the latest using master which I downloaded as a zip today.

I followed the build instructions from the Intel Dev site. Except for using the cmake command from #9999

Code is sitting in and running from my ~/Downloads folder

@Vangos
Copy link

Vangos commented Dec 1, 2021

As a side-note on the subject of Monterey, it is worth highlighting that the simple installation procedure brew install librealsense now supports Monterey.

Note: Supports Monterey on Intel Macs only. M1 is still not supported by the standard installation procedure.

@rowungiles
Copy link

rowungiles commented Dec 6, 2021

We've just tried the SDK on an Intel mac with Monterrey and can confirm RS2_USB_STATUS_NOT_SUPPORTED. Tried an install both from brew and building it ourselves with this repo's code.

@Joe-Palmer
Copy link

I have just tried installing with brew install librealsense on this Intel Mac:
image
However, I'm getting the same USB not supported error:

joes-imac:~ joe$ realsense-viewer 
 06/12 10:42:22,506 ERROR [0x700009caf000] (handle-libusb.h:95) failed to claim usb interface: 0, error: RS2_USB_STATUS_ACCESS
 06/12 10:42:22,507 ERROR [0x700009b26000] (sensor.cpp:537) acquire_power failed: failed to set power state
 06/12 10:42:22,508 WARNING [0x700009b26000] (rs.cpp:308) null pointer passed for argument "device"
 06/12 10:42:22,508 WARNING [0x700009b26000] (rs.cpp:2621) Couldn't refresh devices - failed to set power state

As a side-note on the subject of Monterey, it is worth highlighting that the simple installation procedure brew install librealsense now supports Monterey.

Note: Supports Monterey on Intel Macs only. M1 is still not supported by the standard installation procedure.

@Vangos how did you get it to work on an Intel Mac?

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Aug 24, 2022

Hi @cansik and @animaonline There is the option of continuing to use SDK version 2.50.0 for those who are concerned about the removal of official support for MacOS from 2.51.1 onwards.

Official MacOS updates for the RealSense SDK ceased after MacOS High Sierra (10.13) and the SDK continued to work with newer MacOS versions such as Catalina and Big Sur. Whilst there were issues with Apple Silicon M1 and with MacOS Monterey, Mac users in the RealSense community developed solutions for these.

As the SDK is open source, there is the possibility for RealSense Mac community members to create a custom GitHub 'fork' version of the SDK and add user-created updates if future MacOS versions cannot work with the SDK.

@timprepscius
Copy link

timprepscius commented Aug 24, 2022 via email

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Aug 24, 2022

Hi @timprepscius The RealSense SDK is open source but firmware drivers are not.

Since SDK 2.34.0 it has been possible though to override the firmware URL to allow on-site mirroring. You can also write your own firmware checking and updating script. #7093 and #6098 have details about this.

@timprepscius
Copy link

timprepscius commented Aug 25, 2022 via email

@MartyG-RealSense
Copy link
Collaborator

@timprepscius RealSense 400 Series cameras and the RealSense SDK are continuing. The support change relates to Android and MacOS specifically. Support for PC and Arm computing devices is unaffected. I do genuinely understand and appreciate your concern.

RealSense firmware drivers remain closed-source unfortunately.

The SDK does offer a Low Level Device API for communicating directly with the sensor hardware.

https://dev.intelrealsense.com/docs/api-architecture#low-level-device-api

A C++ example program that uses the low level API is rs-data-collect

https://github.com/IntelRealSense/librealsense/tree/master/tools/data-collect

@fpelegri
Copy link

fpelegri commented Oct 3, 2022

First python build for version 3.6, 3.7, 3.8, 3.9, 3.10 is done. You can download the pre-built wheel packages here: https://github.com/cansik/pyrealsense2-macosx/releases/tag/macosx-v2.50.0

I can only test it on my own M1 Macbook, so would be great if someone could give it a try. Please be aware to run your python script with sudo, otherwise RealSense tells you that no device is connected.

I had an issue running the Intel realSense D435i camera when I updated my MacBook Pro Intel chip based with BigSur OS version to Monterrey version. Running python script or any command related to camera functions with sudo solved my problem. Thanks for remarking that! 🙂

@MJKingsbury
Copy link

After HOURS of digging I found this rather useful thread, and thanks for the info @Vangos, however now while following your personal tutorial on an M1 MacBook Pro running Ventura 13.0.1 I have an issue...

I receive the following error trying to run the 'Git Checkout' command after cloning the repo:

Screenshot 2023-02-14 at 13 20 27

Any advice would be greatly appreciated, thanks!

@Vangos
Copy link

Vangos commented Feb 14, 2023

I receive the following error trying to run the 'Git Checkout' command after cloning the repo:

Hi! Seems like it's a Git issue. I would try git fetch before the checkout command. Also, ensure you are in the librealsense directory.

@Vangos
Copy link

Vangos commented Feb 14, 2023

You need to replace the existing libusb header location with the custom-built one. Refer to this screenshot:

image

@mora200217
Copy link

mora200217 commented Apr 15, 2023

Any update on this ? Still only working with sudo. I'm trying to use it with ROS noetic but it still not working.

When running rs-enumerate-devices

 15/04 13:17:09,000 ERROR [0x70000ef08000] (handle-libusb.h:125) failed to claim usb interface: 0, error: RS2_USB_STATUS_ACCESS
 15/04 13:17:09,000 ERROR [0x11cdb6600] (sensor.cpp:664) acquire_power failed: failed to set power state

Env specs

  • macOS Monterey 12.6.2
  • libusb 1.0.26 (brew install)
  • librealsense 2.53.1  (conda forge)

@jackjansen
Copy link

Because this issue has become large and unwieldy (with various unrelated issues thrown in) I have created #11815 in the hope of starting a fresh discussion on what the root cause is that librealsense needs root privileges on macOS Monterey and later. If you have any insights on the specific issue of requiring root privilege please share them in #11815.

@AkshajGupta
Copy link

I am getting a Killed: 9 error when I run 'sudo rs-enumerate-devices' on Ventura. How can I fix the problem?

@MartyG-RealSense
Copy link
Collaborator

Hi @AkshajGupta There have been reports of problems such as a non-detected camera with Ventura. An example of this is at #9687 (comment)

#11815 is the central place on this support forum where I am directing Ventura users who are having problems so that they can discuss it amongst themselves, and you will therefore be notified automatically of any solutions that the RealSense Mac community comes up with for getting librealsense working on Ventura if you have left a comment there.

@spindlewhorls
Copy link

@rowungiles did you have any luck with this? I have this usb problem on Ventura and I was considering downgrading to Big Sur to solve it until I saw your case

On macOS Big Sur 11.6.1, I am also seeing this issue using an M1 Mac mini.

This install of Big Sur is absolutely fresh (a downgrade from macOS 12.0), I have only installed Xcode and the brew installs outlined on the Intel Dev site. The install was a downgrade from Monterrey specifically to get librealsense working.

I have the following output from Starting Xcode Running realsense-viewer Initial fail and then Unplugging and re-plugging the camera in several times:

2021-11-29 12:52:33.855654+0000 realsense-viewer[18210:105475] Metal API Validation Enabled
2021-11-29 12:52:33.880607+0000 realsense-viewer[18210:105475] fopen failed for data file: errno = 2 (No such file or directory)
2021-11-29 12:52:33.880635+0000 realsense-viewer[18210:105475] Errors found! Invalidating cache...
2021-11-29 12:52:33.927411+0000 realsense-viewer[18210:105475] +[MTLIOAccelDevice registerDevices]: Zero Metal services found
 29/11 12:52:34,132 ERROR [0x17062f000] (handle-libusb.h:61) failed to set kernel driver auto detach: 0, error: RS2_USB_STATUS_NOT_SUPPORTED
 29/11 12:52:34,133 ERROR [0x17048b000] (sensor.cpp:572) acquire_power failed: failed to set power state
 29/11 12:52:34,134 WARNING [0x17048b000] (rs.cpp:310) null pointer passed for argument "device"
 29/11 12:52:34,134 WARNING [0x17048b000] (rs.cpp:2691) Couldn't refresh devices - failed to set power state
 29/11 12:53:38,472 ERROR [0x1706bb000] (handle-libusb.h:61) failed to set kernel driver auto detach: 0, error: RS2_USB_STATUS_NOT_SUPPORTED
 29/11 12:53:38,472 ERROR [0x101fefd40] (sensor.cpp:572) acquire_power failed: failed to set power state
 29/11 12:53:38,473 WARNING [0x101fefd40] (rs.cpp:310) null pointer passed for argument "device"
 29/11 12:53:38,473 WARNING [0x101fefd40] (rs.cpp:2691) Couldn't refresh devices - failed to set power state
 29/11 12:53:54,563 ERROR [0x1706bb000] (handle-libusb.h:61) failed to set kernel driver auto detach: 0, error: RS2_USB_STATUS_NOT_SUPPORTED
 29/11 12:53:54,563 ERROR [0x101fefd40] (sensor.cpp:572) acquire_power failed: failed to set power state
 29/11 12:53:54,564 WARNING [0x101fefd40] (rs.cpp:310) null pointer passed for argument "device"
 29/11 12:53:54,564 WARNING [0x101fefd40] (rs.cpp:2691) Couldn't refresh devices - failed to set power state
 29/11 12:54:45,116 ERROR [0x1706bb000] (handle-libusb.h:61) failed to set kernel driver auto detach: 0, error: RS2_USB_STATUS_NOT_SUPPORTED
 29/11 12:54:45,116 ERROR [0x101fefd40] (sensor.cpp:572) acquire_power failed: failed to set power state
 29/11 12:54:45,118 WARNING [0x101fefd40] (rs.cpp:310) null pointer passed for argument "device"
 29/11 12:54:45,118 WARNING [0x101fefd40] (rs.cpp:2691) Couldn't refresh devices - failed to set power state

I built the latest using master which I downloaded as a zip today.

I followed the build instructions from the Intel Dev site. Except for using the cmake command from #9999

Code is sitting in and running from my ~/Downloads folder

@huyyxy
Copy link

huyyxy commented May 8, 2024

in MacBook Pro, 16-inch, 2019, 2.6 GHz 六核Intel Core i7, Ventura 13.4 (22F66):

realsense-viewer
GLFW Driver Error: Cocoa: Regular windows do not have icons on macOS
 08/05 17:33:12,435 INFO [0x7ff84ab58640] (context.cpp:116) ... 1-2.1-2
 08/05 17:33:12,435 INFO [0x7ff84ab58640] (context.cpp:129) Found 1 RealSense devices (0xff requested & 0xff from device-mask in settings)
zsh: segmentation fault  realsense-viewer
sudo ./realsense-viewer
Password:
GLFW Driver Error: Cocoa: Regular windows do not have icons on macOS
 08/05 17:39:31,016 INFO [0x7ff84ab58640] (context.cpp:116) ... 1-2.1-2
 08/05 17:39:31,016 INFO [0x7ff84ab58640] (context.cpp:129) Found 1 RealSense devices (0xff requested & 0xff from device-mask in settings)
zsh: segmentation fault  sudo ./realsense-viewer

who can help me?

@huyyxy
Copy link

huyyxy commented May 8, 2024

in MacBook Pro, 16-inch, 2019, 2.6 GHz 六核Intel Core i7, Ventura 13.4 (22F66):在 MacBook Pro,16 英寸,2019 年,2.6 GHz 六核Intel Core i7,Ventura 13.4 (22F66) 中:

realsense-viewer
GLFW Driver Error: Cocoa: Regular windows do not have icons on macOS
 08/05 17:33:12,435 INFO [0x7ff84ab58640] (context.cpp:116) ... 1-2.1-2
 08/05 17:33:12,435 INFO [0x7ff84ab58640] (context.cpp:129) Found 1 RealSense devices (0xff requested & 0xff from device-mask in settings)
zsh: segmentation fault  realsense-viewer
sudo ./realsense-viewer
Password:
GLFW Driver Error: Cocoa: Regular windows do not have icons on macOS
 08/05 17:39:31,016 INFO [0x7ff84ab58640] (context.cpp:116) ... 1-2.1-2
 08/05 17:39:31,016 INFO [0x7ff84ab58640] (context.cpp:129) Found 1 RealSense devices (0xff requested & 0xff from device-mask in settings)
zsh: segmentation fault  sudo ./realsense-viewer

who can help me?谁能帮助我?

./rs-fw-update

Nothing to do, run again with -h for help

Connected devices:
 08/05 17:32:07,361 ERROR [0x70000bba7000] (handle-libusb.h:127) failed to claim usb interface: 0, error: RS2_USB_STATUS_ACCESS
 08/05 17:32:07,361 ERROR [0x7ff84ab58640] (uvc-sensor.cpp:412) acquire_power failed: failed to set power state
 08/05 17:32:07,365 ERROR [0x7ff84ab58640] (rs.cpp:237) [rs2_create_device( info_list:0x600003bf8000, index:0 ) UNKNOWN] failed to set power state
 08/05 17:32:07,366 ERROR [0x7ff84ab58640] (rs.cpp:237) [rs2_delete_device( device:nullptr ) UNKNOWN] null pointer passed for argument "device"
 08/05 17:32:07,366 WARNING [0x7ff84ab58640] (rs.cpp:373) null pointer passed for argument "device"
 08/05 17:32:09,296 ERROR [0x70000b99b000] (context-libusb.cpp:16) libusb_init failed
zsh: segmentation fault  ./rs-fw-update

@MartyG-RealSense
Copy link
Collaborator

Hi @huyyxy I have just responded to a case of the MacOS icon problem at #12890 (comment)

@MartyG-RealSense
Copy link
Collaborator

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.

image

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

@cansik
Copy link

cansik commented Sep 3, 2024

@MartyG-RealSense Thanks for this update. If you are interested to try it out in python, I have already prebuilt the wheels of the beta: https://github.com/cansik/pyrealsense2-macosx/releases/tag/macosx-v2.56.1-beta

However, the PR does not fix all the issue we are having with MacOS. It seems that the issue regarding power-settings is gone (at least here in my machine / camera) 🎉. But we still need sudo to start the device because of the os kext ( #11815 (comment)). Now sudo is also needed to just list the device count.

@MartyG-RealSense
Copy link
Collaborator

Thanks so much @cansik - I have passed on your feedback to my Intel RealSense developer colleague who worked on PR #12972. They welcome Mac customers developing solutions for issues and sharing them. It helps Intel and the customers to work together on Mac support.

My colleague added that a segfault is still thrown when querying devices and that according to users, Apple changed the USB policy and LibUSB is no longer working on Mac.

@OxO-7
Copy link

OxO-7 commented Sep 3, 2024

@cansik @MartyG-RealSense It's already solved a big problem!!Thanks!!

@jackjansen
Copy link

This is very good news!

@MartyG-RealSense as to helping out: I would really really love to, but I simply don't have the time at the moment:-(

But: if you could pass on my comment in the other bug, #11815 (comment), I still have the feeling that Intel (the company), as the owner of the USB VID of the Realsense cameras, should be able to tell Apple (the company) not to use the standard CoreMedia driver for this specific VID/PID combination, and then the Realsense camera will just be sitting there driverless and libusb can open it without sudo. I hope.

I vaguely remember that at some point in the past I have read that this is possible, there is a way that companies (or actually official owners of the VID as per the USB consortium or whatever) can communicate that to Apple, but I am not able to find a reference at the moment, sorry.

@MartyG-RealSense
Copy link
Collaborator

@jackjansen I will certainly pass on your feedback. Thanks very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests