librealsense icon indicating copy to clipboard operation
librealsense copied to clipboard

Crashes in Mac M3 Pro Sonoma when connected to camera

Open philchao opened this issue 4 months ago • 14 comments

librealsense 2.54.2 RELEASE
OS Mac OS

Please provide a description of the problem

I am able to start the Intel RealSense Viewer v2.54.2 without the camera connected. But once I connect the camera the application automatically shuts down:

Process: realsense-viewer [6158] Path: /opt/homebrew/*/realsense-viewer Identifier: realsense-viewer Version: ??? Code Type: ARM-64 (Native) Parent Process: launchd [1] User ID: 501

Date/Time: 2024-03-05 14:34:00.6287 +1300 OS Version: macOS 14.2.1 (23C71) Report Version: 12 Anonymous UUID: 9E225096-2F73-84E7-D358-A6214E7D6214

Time Awake Since Boot: 11000 seconds

System Integrity Protection: enabled

Crashed Thread: 1

Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000028 Exception Codes: 0x0000000000000001, 0x0000000000000028

Termination Reason: Namespace SIGNAL, Code 11 Segmentation fault: 11 Terminating Process: exc handler [6158]

VM Region Info: 0x28 is not in any region. Bytes before following region: 68719476696 REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL UNUSED SPACE AT START --->
commpage (reserved) 1000000000-7000000000 [384.0G] ---/--- SM=NUL ...(unallocated)

Thread 0:: Dispatch queue: com.apple.main-thread

philchao avatar Mar 05 '24 01:03 philchao

05/03 14:53:54,186 ERROR [0x1709cb000] (handle-libusb.h:127) failed to claim usb interface: 0, error: RS2_USB_STATUS_ACCESS 05/03 14:53:54,187 ERROR [0x1de44d000] (sensor.cpp:661) acquire_power failed: failed to set power state 05/03 14:53:54,188 WARNING [0x1de44d000] (rs.cpp:312) null pointer passed for argument "device" 05/03 14:53:54,188 WARNING [0x1de44d000] (rs.cpp:2700) Couldn't refresh devices - failed to set power state 05/03 14:53:56,178 ERROR [0x16f3c7000] (context-libusb.cpp:16) libusb_init failed zsh: segmentation fault /opt/homebrew/Cellar/librealsense/2.54.2/bin/realsense-viewer

philchao avatar Mar 05 '24 01:03 philchao

Hi @philchao Intel has not provided official support for use of RealSense on Mac computers since 2017's MacOS High Sierra. Whilst the RealSense SDK has been able to work on Macs in subsequent years despite not being officially supported, problems have occurred more frequently since MacOS Monterey onwards and the introduction of the Apple Silicon Mac models (M1-M3). The community of RealSense Mac users is therefore usually the provider of solutions for issues by sharing knowledge with each other.

The discussion at https://github.com/IntelRealSense/librealsense/issues/12307 is likely to be relevant to your particular issue with Failed to set power state errors, especially the final comment in that discussion at https://github.com/IntelRealSense/librealsense/issues/12307#issuecomment-1812688156

MartyG-RealSense avatar Mar 05 '24 07:03 MartyG-RealSense

@MartyG-RealSense Thank you for your prompt feedback. I am just wondering if is there some other way to change the output-input of the RealSense camera? For instance, I tried to connect this Apple USB-C Digital AV Multiport Adapter (https://www.apple.com/nz/shop/product/MUF82ZA/A/usb-c-digital-av-multiport-adapter) to the camera and provided charge for the camera through the adapter's USB-C charge input and output from the adapter's HDMI to the computer but it does not seem to register the device. Is it possible to output the RealSense camera to HDMI whilst providing it with power through a USB-C? Thanks

philchao avatar Mar 06 '24 22:03 philchao

I have never seen a case where RealSense has been made to work with HDMI, unfortunately.

There have been a couple of past cases where a camera was able to be detected when attached to an adaptor cable on a Mac, but in most cases it is not successful.

MartyG-RealSense avatar Mar 07 '24 10:03 MartyG-RealSense

Hi @philchao Bearing in mind the advice in the comment above, do you require further assistance with this case please? Thanks!

MartyG-RealSense avatar Mar 13 '24 11:03 MartyG-RealSense

Thanks @MartyG-RealSense. Unfortunately, I still was not able to get RealSense Viewer to work with my M3 Mac on Sonoma. Not sure if @cansik has been able to with his pyrealsense2

philchao avatar Mar 13 '24 20:03 philchao

Hi @cansik Do you have any advice that you can offer @philchao regarding the above comment, please? Thanks so much for your continued support for RealSense on Mac!

MartyG-RealSense avatar Mar 21 '24 08:03 MartyG-RealSense

@MartyG-RealSense @philchao Not really, it's a matter of trial and error. The second attempt to start the relasense-viewer (installed with brew) worked for me. The camera was already connected. However, only the depth camera produced an image, not the RGB camera.

image

In my opinion, RealSense is no longer usable in production for MacOS users (which is a great pity). Today I would recommend the cameras from Luxonis, as they have an API that is supported on all major platforms.

cansik avatar Mar 21 '24 09:03 cansik

Hi @philchao Do you require further assistance with this case, please? Thanks!

MartyG-RealSense avatar Mar 27 '24 09:03 MartyG-RealSense

Hi @MartyG-RealSense, yes, I would like the Intel Real Sense Viewer to work with Mac Sonoma, but it does not seem possible at this stage.

philchao avatar Mar 28 '24 00:03 philchao

One Mac user took the approach of using the camera with the Asahi Linux OS on their Apple Silicon machine instead of MacOS and wrote an installation guide.

https://github.com/HasanTheSyrian/librealsense-hasan/blob/master/doc/installation_asahi.md

MartyG-RealSense avatar Mar 28 '24 12:03 MartyG-RealSense

Hi @philchao Is the Asahi Linux solution suggested in the comment above of use to you or do you still require a MacOS Sonoma solution, please?

MartyG-RealSense avatar Apr 03 '24 16:04 MartyG-RealSense

Hi, I'm facing the same issue. My mac M2 (MacOS sonoma) is able to detect the camera but when I open the realsense-viewer its crashing and it's not able to open. Is there any solution I could get for this issue.

Niranjini-Kathiravan avatar Apr 20 '24 20:04 Niranjini-Kathiravan

Hi, I'm getting the same issue on Mac M3.

I also tried to use Parallels to run realsense-viewer on ARM windows. In Device Manager, I could see the depth camera. But the viewer isn't able to detect it completely. Only 2D works, and it seems not actually found a RealSens Camera.

ARM_win_DeviceManager ARM_win_realsense-viewer

Jialus avatar Apr 25 '24 19:04 Jialus