Open swishswish123 opened 7 months ago
It sounds as though the reset code attempted to reset the camera by disconnecting it and then re-connecting it but then was unable to find it when trying to re-connect after disconnection.
When the Viewer or your program is run after the computer is started up, does it always work the first time? There are some cases where a program will work the first time it is run but not the second time.
Yes that makes sense as when I run the viewer it takes a few times before it works, giving me the power state error. The number of times I have to run it before it works is unpredictable. Do you know why this happens?
It sounds more like a hardware issue than a program issue. It could be that the brand of USB controller chosen by your computer's manufacturer to control the USB ports may not get along well with your RealSense camera.
A way to test this would be to plug the camera into a USB hub instead of directly into the computer's USB port if you are not using a hub already. A hub uses its own brand of USB controller for its ports instead of the one used by the computer's ports.
You could also test whether reliability improves if you unplug the camera from the port, wait a couple of seconds and then re-insert it. Doing so would have the same effect as resetting the camera.
I can't seem to get it to work 🙁
I tried with a different USB hub than I was using (I was previously using the apple official one).
The unplugging the camera for a few seconds and plugging it back in seemed to work for the realsense-viewer for a bit but now it's gone back to being random...
https://github.com/IntelRealSense/librealsense/issues/11815 seems to be relevant to the issues that you are having regarding Monterey, the need for sudo and 'Failed to set power state' errors.
Hi @swishswish123 Was the information in https://github.com/IntelRealSense/librealsense/issues/11815 helpful to your problem, please? Thanks!
Thanks @MartyG-RealSense, sorry for taking so long to reply, I've not yet had the chance to test it out but I will try to do it this week and get back to you
It's no problem at all. I look forward to your next report. Good luck!
I have the same issue. I still can't get the viewer to work on my Mac running Sonoma 14.2.1 (i havent tried pyrealsense-macos)
I'm on v2.54.2 with the latest firmware version I flashed using a Windows desktop. I'm using the brew install.
I can launch the viewer normally without sudo, but as soon as I plug in the camera it crashes.
If I launch the viewer with: no sudo, usb-c to usb-c cable:
27/01 15:06:08,526 INFO [0x1d7075000] (context.cpp:336) Found 1 RealSense devices (mask 0xff)
27/01 15:06:08,542 ERROR [0x16b73f000] (handle-libusb.h:127) failed to claim usb interface: 0, error:
RS2_USB_STATUS_ACCESS
27/01 15:06:08,543 ERROR [0x16b59b000] (sensor.cpp:661) acquire_power failed: failed to set power state
27/01 15:06:08,544 WARNING [0x16b59b000] (rs.cpp:312) null pointer passed for argument "device"
27/01 15:06:08,544 WARNING [0x16b59b000] (rs.cpp:2700) Couldn't refresh devices - failed to set power state
27/01 15:06:08,589 INFO [0x1d7075000] (rs.cpp:2697) Framebuffer size changed to 2418 x 1562
27/01 15:06:08,589 INFO [0x1d7075000] (rs.cpp:2697) Scale Factor is now 1
Assertion failed: (list_empty(&darwin_cached_devices)), function darwin_init, file darwin_usb.c, line 605.
[1] 6273 abort realsense-viewer
If I launch the viewer with: sudo, usb-c to usb-c cable:
27/01 15:14:50,256 INFO [0x1d7075000] (context.cpp:336) Found 1 RealSense devices (mask 0xff)
27/01 15:14:50,304 INFO [0x1d7075000] (rs.cpp:2697) Framebuffer size changed to 2418 x 1562
27/01 15:14:50,304 INFO [0x1d7075000] (rs.cpp:2697) Scale Factor is now 1
[1] 6405 segmentation fault sudo realsense-viewer
If I launch the viewer with: no sudo, usb-a to usb-c cable w/converter:
27/01 15:17:43,386 INFO [0x1d7075000] (context.cpp:336) Found 1 RealSense devices (mask 0xff)
27/01 15:17:43,405 ERROR [0x16e3af000] (handle-libusb.h:127) failed to claim usb interface: 0, error: RS2_USB_STATUS_ACCESS
27/01 15:17:43,406 ERROR [0x16e20b000] (sensor.cpp:661) acquire_power failed: failed to set power state
27/01 15:17:43,406 WARNING [0x16e20b000] (rs.cpp:312) null pointer passed for argument "device"
27/01 15:17:43,407 WARNING [0x16e20b000] (rs.cpp:2700) Couldn't refresh devices - failed to set power state
27/01 15:17:43,451 INFO [0x1d7075000] (rs.cpp:2697) Framebuffer size changed to 2418 x 1562
27/01 15:17:43,451 INFO [0x1d7075000] (rs.cpp:2697) Scale Factor is now 1
Assertion failed: (list_empty(&darwin_cached_devices)), function darwin_init, file darwin_usb.c, line 605.
[1] 6450 abort realsense-viewer
If I launch the viewer with: sudo, usb-a to usb-c cable w/converter:
27/01 15:18:54,924 INFO [0x1d7075000] (context.cpp:336) Found 1 RealSense devices (mask 0xff)
27/01 15:18:54,970 INFO [0x1d7075000] (rs.cpp:2697) Framebuffer size changed to 2418 x 1562
27/01 15:18:54,970 INFO [0x1d7075000] (rs.cpp:2697) Scale Factor is now 1
[1] 6459 segmentation fault sudo realsense-viewer
You were discussing the cable, but it seems like it doesn't have an effect.
@HasanTheSyrian There was a similar problem at https://github.com/IntelRealSense/librealsense/issues/12307#issuecomment-1812688156 with realsense-viewer when using sudo.
One RealSense Mac user suggested dealing with the Failed to set power state error by using brew install libusb
first before doing brew install librealsense
Unfortunately did not work.
I tried what jackjansen said in #11815 of trying different ports and at the moment it seems like the port furthest from the screen, on the side of the power supply works. I am using USB-C to USB-A cable, then the apple USB-A to USB-C adaptor and connect that to my Mac.
When I say works, I mean my python script AND the realsense-viewer seem to be running properly 🥳
So @HasanTheSyrian maybe you can try that way? You should also try inserting the USB-C in both ways, as to me it seems to make a difference which way I plug in the apple adaptor. (For the realsense viewer this is of course after doing brew install libsub
then brew install librealsense
)
Let's hope this doesn't stop working like last time! Thanks so much @MartyG-RealSense for the help :)
I tried what jackjansen said in #11815 of trying different ports and at the moment it seems like the port furthest from the screen, on the side of the power supply works. I am using USB-C to USB-A cable, then the apple USB-A to USB-C adaptor and connect that to my Mac.
When I say works, I mean my python script AND the realsense-viewer seem to be running properly 🥳
So @HasanTheSyrian maybe you can try that way? You should also try inserting the USB-C in both ways, as to me it seems to make a difference which way I plug in the apple adaptor. (For the realsense viewer this is of course after doing
brew install libsub
thenbrew install librealsense
)Let's hope this doesn't stop working like last time! Thanks so much @MartyG-RealSense for the help :)
I ordered a UBS-C - USB-A adapter, I'll report back when it comes.
Thanks so much @swishswish123 for your advice to @HasanTheSyrian :)
I cannot recall a past case in which Ubuntu has been used with RealSense on a Mac. It was more usual for Windows to be used via MacOS' Boot Camp Assistant utility. Boot Camp does not work with Apple Silicon Macs though, but my understanding is that it is possible to install multiple OS on M1 / M2 Macs and access them via the Start-Up options by holding down the power button.
librealsense can be compiled on Ubuntu on Arm devices (such as Raspberry Pi, Nvidia Jetson and other brands of Arm-based single board computers). I do not have an example of its installation and use on Ubuntu on Mac though.
Looking at the details of Asahi, it seems like a very good match for M1 and M2 Macs. librealsense can be built from source code on non-Ubuntu flavors of Linux if compiled in RSUSB = true mode, as RSUSB is not dependent on Linux versions or kernel versions and does not need to have a patch applied to the kernel.
I cannot recall a past case in which Ubuntu has been used with RealSense on a Mac. It was more usual for Windows to be used via MacOS' Boot Camp Assistant utility. Boot Camp does not work with Apple Silicon Macs though, but my understanding is that it is possible to install multiple OS on M1 / M2 Macs and access them via the Start-Up options by holding down the power button.
librealsense can be compiled on Ubuntu on Arm devices (such as Raspberry Pi, Nvidia Jetson and other brands of Arm-based single board computers). I do not have an example of its installation and use on Ubuntu on Mac though.
Looking at the details of Asahi, it seems like a very good match for M1 and M2 Macs. librealsense can be built from source code on non-Ubuntu flavors of Linux if compiled in RSUSB = true mode, as RSUSB is not dependent on Linux versions or kernel versions and does not need to have a patch applied to the kernel.
The USB dongle didn't work... but I installed Asahi Linux and...
It works!!!
I obviously had to build it from scratch so it wasn't very straightforward (only missing packages) but IT WORKS! I still need to test out Pyrealsense, the SDK, examples, etc (which compiled successfully).
Also, you are right Asahi Linux is a good match. The amount of work they did is BONKERS. They reverse-engineered firmware for almost of Macs' hardware in a very very short amount of time.
Hi @HasanTheSyrian It's great to hear that you were successful with Asahi Linux! This should be a useful reference for other Mac M1 / M2 users.
Hi @HasanTheSyrian It's great to hear that you were successful with Asahi Linux! This should be a useful reference for other Mac M1 / M2 users.
I was thinking of adding the steps to the repository, but thought I probably can't because it's not officially supported(?)
RealSense users do still submit Mac-related updates as Pull Requests, although it is rare.
https://github.com/IntelRealSense/librealsense/pulls?q=is%3Apr+is%3Aopen+mac
RealSense users do still submit Mac-related updates as Pull Requests, although it is rare.
https://github.com/IntelRealSense/librealsense/pulls?q=is%3Apr+is%3Aopen+mac
Okay Ill add the installation steps to the documentation as a PR soon.
Hi @HasanTheSyrian Have you had the opportunity to submit a PR yet? Thanks!
@MartyG-RealSense I'm still experimenting with Asahi, I haven't forgotten. I'll make a draft within the next 1-3 weeks.
@HasanTheSyrian Thanks very much!
Hi @HasanTheSyrian Did you submit a PR about this case since your last comment on it in February 2024, please? Thanks!
@MartyG-RealSense Yes! Long time ago.
Thanks very much for the confirmation. I will add an Enhancement label to this case to affirm that it should be kept open whilst your PR is active. Thanks again!
Issue Description
I am generating a point cloud of an object with known dimensions and known distance from the camera. When I check the coordinates, the z distance seems correct, but the dimensions in the x and y directions is always smaller than it should be.
This is the method I use as part of a class to generate the point cloud from the images:
Would appreciate any help!
Thanks so much