-
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
"Failed to set power state" when multicam on NVIDIA Jetson TX2 #6395
Comments
There have been multicam problems reported recently with Jetson Xavier boards in regards to problems such as failure to set power state or cameras not being detected when more than one camera is attached. So this case with your TX2 may be related. An Xavier user recently offered details of a multicam workaround that he developed: |
Thank you for your quick reply ! I had a look to this workaround and it doesn't seems to work unfortunately. I am working at high resolution (1280x720 for depth, 1920x1080 for RGB). |
Is your hub a powered hub (drawing from the mains power socket) or an unpowered one (connected to the TX2's USB socket) please? Though I note the investigations you have already done that suggest it is not a hub-related issue. |
The hub is unpowered. It doesn't seems to be related to the hub because everything works fine (3 cameras with high resolutions) on a "regular" laptop. |
It is not unusual for a camera that works fine on a desktop or laptop to have problems on a single-board computer such as Jetson, which are typically "low power" devices because of their use in applications such as mobile robotics where power efficiency may be a priority. So that does not necessarily rule out the hub as a problem, since if it is an unpowered hub then it is drawing its power from the low-power board's USB port instead of having its own independent strong power supply like it would if it were powered by the mains socket. |
I'm aware of those power limitations, but still, after doing some power measurments and calculations, it seems that the USB port has enough power to power the 3 cameras. Still we'll try with a powered hub and keep you posted. |
Thanks very much, I look forward to your update. Good luck! |
In the meantime, do you have any idea of other things we might look at if the problem isn't the hub ? Because if we observe the power used by the hub (and the cameras) and the power of the USB port, we should have more than enough ! |
As well as the volume of power supplied, the stability of the power supplied to the USB port can be a factor. I once had a case where RealSense was used with an enterprise server with a 650W power supply and it still experienced disconnections. RealSense cameras are sensitive to the state of the port, and mains-powered hubs can help to provide a more reliable power supply to the port on the hub than a port on a computer or an unpowered hub can. I see that you have already tried starting with one just camera and then inserting the others into the hub one at a time. A couple of long-shots that you could try with the USB cable are:
Also, have you tried inserting each camera on its own with no other cameras connected, to check whether any of the individual cameras have a problem? You could also try swapping the USB cables around (e.g put the USB cable from camera 1 on camera 2, and the cable from camera 2 on camera 1). |
Hi, |
Thanks for trying everything. Did you build Librealsense for your TX2 from source code or with the debian packages, please? I was just thinking that if it was from source then you may be able to reduce the processing load on the TX2's CPU by building Librealsense with CUDA support to offload some of the CPU's processing work onto the GPU. If you installed Librealsense using the debian packages then they would already contain CUDA support. |
We've built Librealsense from source, but we already did it with CUDA support. This wasn't the issue. However, we managed to solve our problem by deactivating the USB auto-suspend in the usbcore parameters. It seemed to have some issues with the uvcvideo driver. By being careful in the order the cameras are plugged in the hub and by applying the workaround you mentioned earlier, everything works ! FYI, in our case, the cameras need to be plugged in the hub in decreasing order regarding the serial number (highest SN in port 1, lowest SN in port 3). Then the cameras can be activated in any order. If we change the plugging order or we don't apply the workaround, we still get the failed to set power state error. |
I'm very glad you found solutions for your problems! Thanks very much for posting your findings here so that others can benefit from them. |
You're welcome. Thank your for helping us through this. |
Hello, I encountered the same problem in similar scenes. Using USB-HUB to connect 3 cameras on TX2, USB-HUB has a separate power supply, an error occurs when using rs-multicam: ‘Failed to set power state’, SDK version is v2.32.1 (from the debian packages). However, keeping the other hardware unchanged, use another TX2, which contains SDK version v2.29 (from source code), using rs-multicam can open 3 cameras. The TX2 system is updated, I hope to use SDK v2.32.1 + (from the debian packages). Is there any suggestion? |
Hi @dongkaizhou The RealSense developers have created improvements to how multicam is handled that should be available in an upcoming SDK release. They may not fix a problem if it is related to a specific model of hub hardware but may help if the problem is related to rs2::pipeline. In the meantime, a RealSense user has suggested a workaround. |
It turns out that many users have this kind of problem, look forward to the new SDK to solve this problem. |
Hi @dongkaizhou Have you had an opportunity to try the new SDK version 2.35.0 yet please and find whether it solved the errors mentioned in this case? |
@dongkaizhou My understanding is that if the above instructions are used then the version installed should be whatever the latest Debian package version is. More information about DKMS package version numbers can be found in the link below. |
Thanks, I will pay attention to Debian package version, Where can I see the update time of all Debian package version? |
@dongkaizhou The link below explains that the DKMS packages are organised by Ubuntu distro instead of having a separate version for each individual SDK version. So there is a DKMS package for Bionic, another for Xenial, etc. So my understanding is that there is not a version history for the DKMS packages, and that earlier packages are overwritten with the newer version and so keep the same filename. The package for Xenial or for Bionic is installed by using the sudo add-apt-repository command provided in the installation instructions for Xenial (used with Ubuntu 16 LTS) or Bionic (used with Ubuntu 18 LTS). I am also not aware of a formal information source for when a DKMS package has been updated. You can upgrade only the librealsense2-dkms package specifically instead of upgrading all packages by using this instruction: sudo apt-get --only-upgrade install librealsense2-utils librealsense2-dkms Regarding multicam support, there are some known problems at the moment with camera detection in multicam setups on Jetson models. The RealSense developer team has created improved multicam support, and this was successfully merged into the development branch of the SDK on 1 June 2020. So it should be present in the next public SDK version. The new multicam developments should help with multicam problems related to rs2::pipeline, though may not correct problems related to specific models of powered USB hub hardware. In the meantime, a Jetson user has offered a workaround here: |
@dongkaizhou 2.32.1 does not contain the multicam improvements as it is an older SDK. The SDK is now up to version 2.35.0 at the time of writing this. The Debian packages may not be in sync with what the current SDK version is though. I am not on the Developer team (I am Support) and so cannot influence the timing of when the Debian packages are updated. The developer team are very aware of issues with multicam though, and the new improvements were created to try to resolve some of those problems. Until the multicam improvements are available for users to test, the workaround link posted above remains the best available solution for Jetson users to try |
OK, hoping that Debian packages will be updated soon and will continue to test this issue. |
|
IT looks as though at the time that David's message was written, it was suggesting to compile SDK version 2.33.1 from source. |
So if you can install SDK from source, it is the best choice? |
Ideally, if you are installing on Jetson Nano then I would recommend using JetsonHacks' most recent Nano guide, which uses Debian packages: https://www.jetsonhacks.com/2019/12/22/install-realsense-camera-in-5-minutes-jetson-nano/ If you need to install the SDK on Nano from source though then Intel's own Jetson installation documentation recommends using the "backend" method of installation. It requires an internet connection to perform the installation but is not dependent on Linux versions or kernel versions and does not require patching to be performed. https://github.com/IntelRealSense/librealsense/blob/master/doc/installation_jetson.md Regarding the above image saying to use the CMake flag -DFORCE_LIBUVC = TRUE - Intel introduced a new system a month after that guide was last updated that uses -DFORCE_RSUSB_BACKEND=true instead. So use -DFORCE_RSUSB_BACKEND=true (see the instructions link below). Instructions for installing the 2.35.0 SDK source with the backend method are in the link below. |
Seeing this, Intel and Nvidia both recommend Debian installation. |
On the powered hub that I have, there is a USB connector on the side of the hub that is separate from the hub's main ports. This port is for a USB lead that goes from the hub port to a USB port on my computer. If I unplug this lead from the computer's USB port then the USB devices that are plugged into the hub no longer work. If you have a similar cable on your powered USB hub, I wondered if you could make sure that it is plugged into a USB port on the Jetson TX2 that you are using, and not your other Jetson TX2, which you mention in this comment: I could see a possible situation where the cable connecting the hub to the computer might be plugged into the other TX2 board that is not powered up when you are using the TX2 that will not detect the computers. And so although the cameras are attached to the hub, the TX2 that returns the failed to set power state error does so because the hub's hub-to-computer USB cable is not plugged into it. I have assembled together a rough diagram to illustrate what I am describing above. :) |
@dongkaizhou SDK 2.35.2 has been published on the Releases page. https://github.com/IntelRealSense/librealsense/releases/tag/v2.35.2 https://github.com/IntelRealSense/librealsense/wiki/Release-Notes#release-2352 I am aware that you need a Debian version though, so I provide this information in case you want to see what is added in 2.35.2. |
Thank you very much for describing it with vivid pictures. I have tested this situation many times, and there are many attempts to connect the HUB to TX2. I have considered and tested the situation you described. The tested situation is as follows:
|
Looking at the log information generated when using the RealSense Viewer, there are two interesting things:
It may be a situation that improves in the new SDK 2.35.2 with the multicam improvements, if the fault is not with the particular model of USB hub. Do you get less errors in the Viewer if you only have the Depth streams activated? |
@dongkaizhou Could you try updating your camera firmware to 5.12.5 please? You can do this by going to the 'More' option at the top of the RealSense Viewer's options side-panel and selecting 'Update to recommended firmware' from its menu. |
Yes, update FW to 5.12.02, but the failed is exist. |
The newest firmware is 5.12.5. You mentioned above that you updated to 5.12.02. Can you confirm please that you have tried 5.12.5 |
Hi, the main problem is the SDK-V2.32.1 version of TX2. I look forward to the Debian version update. If there is an update, please inform me. I am busy with other things recently. |
Okay, thanks very much. |
@dongkaizhou A new ROS wrapper version 2.2.14 has now been released that supports librealsense SDK 2.35.2. https://github.com/IntelRealSense/realsense-ros/releases/tag/2.2.14 |
Case closed due to no further comments. @dongkaizhou please create a new GitHub issue if you still have problems when you return to RealSense work. Thanks! |
I had a similar problem on Raspberry Pi OS, using pyrealsense2 and the D435i I was opening two pipelines, one for the camera and one for the IMU. Starting the camera didn't give any problems, but when starting the IMU, right after, there was an error message "failed to set power state". After may software and hardware attempts, I solved it in a trivial way... I added 500ms pause between the two startings. You might do a similar thing if you have more than one device. Good luck! |
Issue Description
I am trying to connect 3 D435 cameras to an NVIDIA Jetson TX2 platform via a USB3 hub. If only 1 camera is connected, everything works fine, but when I connect the second one (and the third one) and try to launch the rs-multicam example (or some other code involving multiple cameras), I get a "Failed to set power state" error.
It doesn't seem to be related to the hub because it works fine on a Ubuntu 18.04 and 19.10 laptops. After lots of investigations, it also seems that this issue is not related to the hub nor the USB controller.
One easy way to reproduce is to connect 3 cameras and launch the
realsense_device_manager.py
script provided in the box dimensioner multicam python example.Also, in realsense-viewer, if I try to open all Depth+RGB streams for the 3 cameras, some streams don't recieve any frames. This does not happen when using a laptop.
Any help would be appreciated !
The text was updated successfully, but these errors were encountered: