-
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
[Windows] [Multi-Camera] D415 unresponsive after multiple sensor open and closes. #6397
Comments
If you cannot reset a specific device because it cannot be enumerated, an alternative solution may be to reset the entire USB port. It should then not be dependent on detection of whatever camera is currently plugged into it. Googling for 'windows c++ reset usb port' can provide some research leads about how to accomplish this. A popular suggestion is a Microsoft tool called DevCon. https://docs.microsoft.com/en-us/windows-hardware/drivers/devtest/devcon |
Thank you for a fast response. I forgot to mention, but I have already tried resetting the hub both from device manager and devcon :( |
Are you using multiple pipelines, please? If so, poll_for_frames should be more suitable to a multicam setup than try_wait_for_frames so you are not missing frames from one queue whilst waiting on another. The link below has an explanation of the differences between try_wait_for_frames, poll_for_frames, etc. If all 20 cameras are attached to the same device with 5 hubs, how many cameras at a time are actively streaming, please? The most RealSense cameras that I have seen in simultaneous use on the same computing device is 6. Twenty cameras streaming simultaneously would require a very powerful computer system to provide sufficient processing resources (an i7 processor is recommendable for just 4 simultaneously streaming cameras). The USB hub system would also have some inefficiencies if the hub does not have a dedicated USB controller for each of its ports and is instead handling more than 1 port on the hub. |
Ok, I will try to use poll_for_frames and see the effects later. I understand what you are trying to say. As the application I am developing requires rapid almost simultaneous capturing for a short amount of time, streams for all twenty cameras are opened and then closed quickly. Staggering captures from each device simply won’t work because stream.open(), stream.start() stream.stop(), stream.close() takes too much time. Framerate is lowered to 6 fps as anything above that will crash the program. I used to use the typical rs::pipeline for streaming, but it proved to be too inefficient for the application, so I switched to using rs::syncer and it seems to be working 99% fine (with lots of automatic retry routines) (receiving 4x2 depth and color frame from all cameras in just 800ms) There are currently 1 usb controllers for every 2 devices. I was wondering if there was any way we could brute force a hardware reset using cfgmgr32 or some windows usb library to enumerate through the unresponsive devices and transfer the HWRST command (if possible). |
Rather than rapidly open and close the streams, an alternative may be to put the whole CPU to sleep until you need to wake it up for a capture. poll_for_frames is very suited to this, since you have to control the sleep state for it carefully anyway. It also seems like an application that would be suited to multicam hardware sync, where you link the 20 cameras together with sync cabling (or transmit a wireless pulse from a signal generator) and 19 of those cameras are set as "slave" cameras that follow the capture timing of 1 "master" camera, or 20 cameras sync as slaves to the wireless pulse. In regard to a reset alternative, the link below leads to a multicam version of hardware_reset() |
Thank you for your advices. They were very useful. First, I have tried putting some threads created by librealsense to sleep, by intercepting #6281 really gave me hints in implementing this. Thank you. Second, even though I knew about the hardware sync feature, I didn't want to risk investing time and money into hardware (as some cameras are way more than 3 meters apart) that I couldn`t prove would work with 20 devices on 6fps. The white paper only shows up to 6 devices on 30 fps. Third, the symptoms in #3829 and the one I am experiencing is very similar. The issuer there is using Ubuntu which I think some machines has a USB hub power cut capability (ex https://github.com/mvp/uhubctl), which would fix this problem for sure, but a Windows machine usually does not have this capability. |
I'm glad that the links provided were helpful. :) The link below has a method in Microsoft's documentation for power-cycling a USB port or hub on Windows. |
Do you require further assistance please, or can this case be closed? Thanks! |
Not for now! Thanks! |
Thanks so much for the update! |
Just a comment. |
Issue Description
I am currently developing a device consisting of 20 D415 devices.
They are each connected to 5 pcie usb-hubs with 4 usb3.0-connectors.
At least one device will become unresponsive, meaning stop being enumerated into
rs2::context().query_devices();
, after around 200~1000 loops of running a code like below.The current method to making them responsive requires either unplugging & replugging the device from their corresponding USB hubs, or shutting down and manually booting the PC (Restarts don't work)(You have to cut power to the device).
I have tried uninstalling all drivers, disabling USB selective suspend, but none of them worked.
Since enumeration is impossible, device.hardware_reset() cannot be executed.
I think there should be an alternative method of restarting the camera in a software manner. (or at least recover when on system restart (not shutdown & power up))
Whenever this occurs, the USB Tree View displays the following. (SET_ADDRESS_FAILURE)

Here is a quick sample for reproduction.
It will take long until a device becomes unresponsive.
The text was updated successfully, but these errors were encountered: