D435 intermittantly fails to appear on lsusb after boot and reboot
| Required Info | |
|---|---|
| Camera Model | D435 |
| Firmware Version | 5.9.9.2 |
| Operating System & Version | Linux (Ubuntu 16.04) |
| Kernel Version (Linux Only) | 4.8 |
| Platform | Intel NUC 7i3BNH |
| SDK Version | 2.10.3 |
Issue Description
When trying to use 2x D435 with a 7th gen i3 NUC, I found that sometimes the devices failed to show up after a reboot cycle.
I automated both a reboot test:
- reboot on a cron job with logging on a service that launched and monitored the D435 ROS node output
- powered the NUC using a relay that cycled 15 seconds off, 5 minutes on (same service+logging)
The service used the ROS pipeline with only depth enabled. One pipeline per camera. The only modificiation to the current release branch is this reset the camera whenever the driver launches: https://github.com/ethz-asl/realsense/commit/148eaf93b4ad9f7d795ddce42f6bfae4e7e52533
I have experienced three issues:
- The device fails to show up (1 or 2 devices missing from
lsusb) This is the primary issue that I am concerned about. - The ros node can't talk to the camera without a reset after a 'bad' shutdown (resolved by the above patch). This issue can also be manually "fixed" by issuing the reset in the realsense-viewer each time it happens.
- The pipeline launches but crashes or otherwise does not emit data shortly after launch. It sometimes emits data for a second or two. (I haven't investigated this one much).
After finding a workable solution for problem 2, I set out to profile problems 1 and 3.
- Problem 1 can be "resolved" by rebooting or power cycling the machine. This is not desirable.
- Problem 3 can be handled by adding a watchdog that resets the entire affected pipeline (kills the process tree and relaunches the launchfile). My guess is that this is a problem in either librealsense2 stability or the ros node stability.
I profiled this a lot to try to understand the problem and work around it:
| hardware | kernel | firmware | usb config | test # | issue 1# | issue 3# | conclusion |
|---|---|---|---|---|---|---|---|
| NUC7i3BNH | 4.8.0.36 | 5.9.2.0 | usb c, usb a | 211 | 29 | 13 | only usb a camera experiences reset issue, maybe usb c port is immune |
| NUC7i3BNH | 4.13.0.58 | 5.9.2.0 | usb c, usb a | 104 | 28 | 6 | kernel 4.8 and 4.13 both experience this problem |
| NUC7i3BNH | 4.8.0.36 | 5.9.2.0 | both usb c, Kensington CH1000 hub | 242 | 0 | 23 | USB c hub can resolve issue 1 |
| NUC7i3BNH | 4.8.0.36 | 5.9.2.0 | both usb c, Ankler hub | 149 | 1 | 64 | usb c hub does not always resolve issue |
| NUC7i3BNH | 4.8.0.36 | 5.9.9.2 | both usb c, Oricos hub | 1 | 47 | 0 | some hubs really don't work |
| AsRock IMB-195 i7-6700TE | 4.8.0.36 | 5.9.9.2 | both USB A | 1466 | 733 | 1737 | The D435s are very unreliable with this computer. |
In that last case, there is a fairly reliable pattern.
- 20 reset cycles: Cameras worked on two consecutive boots
- 1466 reset cycles: Cameras alternated, first working, then on the next reboot did not work
@josephduchesne thanks for all the details. I have seen issue 1 occur consistently with a 5i7 NUC and not at all on a fairly new 7i7 NUC. After updating the BIOS I have not seen issue 1 occur since. Can you confirm that you have the latest BIOS? Regards, Ted Tsuchiya, Intel RealSense Support
@tedtman I made note of the current BIOS and also downloaded the newest BIOS. I can confirm that this still occurs. I plugged 2x D435 using firmware 5.9.9.2 into the rear USB A ports. On the second boot, lsusb showed:
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 8087:0a2b Intel Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
0/2 devices show up on Bus 002. On the next boot cycle, both appeared.
I received the following errors that seem related in syslog:
Apr 27 10:25:26 cameras kernel: [ 2.143302] usb 2-3: device not accepting address 2, error -71
Apr 27 10:25:26 cameras kernel: [ 2.715293] usb 2-3: device not accepting address 3, error -71
Apr 27 10:25:26 cameras kernel: [ 3.539492] usb 2-3: device not accepting address 4, error -71
Apr 27 10:25:26 cameras kernel: [ 4.103459] usb 2-3: device not accepting address 5, error -71
Apr 27 10:25:26 cameras kernel: [ 4.695489] usb 2-4: device not accepting address 6, error -71
Apr 27 10:25:26 cameras kernel: [ 5.259491] usb 2-4: device not accepting address 7, error -71
Apr 27 10:25:26 cameras kernel: [ 5.823487] usb 2-4: device not accepting address 8, error -71
Apr 27 10:25:26 cameras kernel: [ 6.387491] usb 2-4: device not accepting address 9, error -71
Firmware in previous tests: BNKBL357.86A.0050.2017.0816.2002 Firmware in this test: BNKBL357.86A.0063.2018.0413.1542
I left the test running for a while. The computer reboots on a cron (5 min), and after boot if there are no D435s showing up.
2018-04-27 11:07:57 lsusb shows 0 D435, no address error: 8, rebooting 2018-04-27 11:08:33 lsusb shows 2 D435, starting 2018-04-27 11:10:31 lsusb shows 0 D435, no address error: 8, rebooting 2018-04-27 11:11:06 lsusb shows 2 D435, starting 2018-04-27 11:15:31 lsusb shows 0 D435, no address error: 8, rebooting 2018-04-27 11:16:07 lsusb shows 2 D435, starting 2018-04-27 11:20:34 lsusb shows 0 D435, no address error: 8, rebooting 2018-04-27 11:21:09 lsusb shows 2 D435, starting 2018-04-27 11:25:32 lsusb shows 0 D435, no address error: 8, rebooting 2018-04-27 11:26:06 lsusb shows 2 D435, starting 2018-04-27 11:30:30 lsusb shows 0 D435, no address error: 8, rebooting 2018-04-27 11:31:03 lsusb shows 2 D435, starting 2018-04-27 11:35:32 lsusb shows 0 D435, no address error: 8, rebooting 2018-04-27 11:36:08 lsusb shows 2 D435, starting 2018-04-27 11:40:31 lsusb shows 0 D435, no address error: 8, rebooting 2018-04-27 11:41:06 lsusb shows 2 D435, starting 2018-04-27 11:45:31 lsusb shows 0 D435, no address error: 8, rebooting 2018-04-27 11:46:07 lsusb shows 2 D435, starting 2018-04-27 11:50:30 lsusb shows 0 D435, no address error: 8, rebooting 2018-04-27 11:51:06 lsusb shows 2 D435, starting 2018-04-27 11:55:31 lsusb shows 0 D435, no address error: 8, rebooting 2018-04-27 11:56:05 lsusb shows 2 D435, starting 2018-04-27 12:00:32 lsusb shows 0 D435, no address error: 8, rebooting 2018-04-27 12:01:07 lsusb shows 2 D435, starting 2018-04-27 12:05:31 lsusb shows 0 D435, no address error: 8, rebooting 2018-04-27 12:06:05 lsusb shows 2 D435, starting 2018-04-27 12:10:31 lsusb shows 0 D435, no address error: 8, rebooting 2018-04-27 12:11:06 lsusb shows 2 D435, starting 2018-04-27 12:15:31 lsusb shows 0 D435, no address error: 8, rebooting 2018-04-27 12:16:06 lsusb shows 2 D435, starting 2018-04-27 12:20:31 lsusb shows 0 D435, no address error: 8, rebooting 2018-04-27 12:21:06 lsusb shows 2 D435, starting 2018-04-27 12:25:31 lsusb shows 0 D435, no address error: 8, rebooting 2018-04-27 12:26:08 lsusb shows 2 D435, starting 2018-04-27 12:30:31 lsusb shows 0 D435, no address error: 8, rebooting 2018-04-27 12:31:07 lsusb shows 2 D435, starting 2018-04-27 12:35:34 lsusb shows 0 D435, no address error: 8, rebooting 2018-04-27 12:36:10 lsusb shows 2 D435, starting 2018-04-27 12:40:31 lsusb shows 0 D435, no address error: 8, rebooting 2018-04-27 12:41:07 lsusb shows 2 D435, starting 2018-04-27 12:45:32 lsusb shows 0 D435, no address error: 8, rebooting 2018-04-27 12:46:08 lsusb shows 2 D435, starting 2018-04-27 12:50:32 lsusb shows 0 D435, no address error: 8, rebooting 2018-04-27 12:51:07 lsusb shows 2 D435, starting 2018-04-27 12:55:31 lsusb shows 0 D435, no address error: 8, rebooting 2018-04-27 12:56:06 lsusb shows 2 D435, starting 2018-04-27 13:00:32 lsusb shows 0 D435, no address error: 8, rebooting 2018-04-27 13:01:07 lsusb shows 2 D435, starting 2018-04-27 13:05:32 lsusb shows 0 D435, no address error: 8, rebooting 2018-04-27 13:06:06 lsusb shows 2 D435, starting 2018-04-27 13:10:33 lsusb shows 0 D435, no address error: 8, rebooting 2018-04-27 13:11:07 lsusb shows 2 D435, starting 2018-04-27 13:15:31 lsusb shows 0 D435, no address error: 8, rebooting 2018-04-27 13:16:04 lsusb shows 2 D435, starting
This seems suspiciously regular.
Leaving this running all weekend, it got less regular:
2018-04-30 08:50:32 lsusb shows 0 D435, no address error: 8, rebooting
2018-04-30 08:51:08 lsusb shows 2 D435, starting
2018-04-30 08:55:27 lsusb shows 2 D435, starting
2018-04-30 09:00:27 lsusb shows 2 D435, starting
2018-04-30 09:05:28 lsusb shows 2 D435, starting
2018-04-30 09:10:32 lsusb shows 0 D435, no address error: 8, rebooting
2018-04-30 09:11:08 lsusb shows 2 D435, starting
2018-04-30 09:15:32 lsusb shows 0 D435, no address error: 8, rebooting
2018-04-30 09:16:07 lsusb shows 2 D435, starting
2018-04-30 09:20:33 lsusb shows 0 D435, no address error: 8, rebooting
2018-04-30 09:21:09 lsusb shows 2 D435, starting
2018-04-30 09:25:28 lsusb shows 2 D435, starting
2018-04-30 09:30:27 lsusb shows 2 D435, starting
2018-04-30 09:35:28 lsusb shows 2 D435, starting
2018-04-30 09:40:33 lsusb shows 0 D435, no address error: 8, rebooting
2018-04-30 09:41:08 lsusb shows 2 D435, starting
2018-04-30 09:45:31 lsusb shows 0 D435, no address error: 8, rebooting
2018-04-30 09:46:08 lsusb shows 2 D435, starting
2018-04-30 09:50:33 lsusb shows 0 D435, no address error: 8, rebooting
2018-04-30 09:51:09 lsusb shows 2 D435, starting
2018-04-30 09:55:32 lsusb shows 0 D435, no address error: 8, rebooting
2018-04-30 09:56:07 lsusb shows 2 D435, starting
2018-04-30 10:00:32 lsusb shows 0 D435, no address error: 8, rebooting
2018-04-30 10:01:17 lsusb shows 2 D435, starting
2018-04-30 10:05:28 lsusb shows 2 D435, starting
2018-04-30 10:10:27 lsusb shows 2 D435, starting
2018-04-30 10:15:28 lsusb shows 2 D435, starting
2018-04-30 10:20:32 lsusb shows 0 D435, no address error: 8, rebooting
2018-04-30 10:21:07 lsusb shows 2 D435, starting
2018-04-30 10:25:27 lsusb shows 2 D435, starting
2018-04-30 10:30:27 lsusb shows 2 D435, starting
2018-04-30 10:35:33 lsusb shows 0 D435, no address error: 8, rebooting
2018-04-30 10:36:08 lsusb shows 2 D435, starting
2018-04-30 10:40:32 lsusb shows 0 D435, no address error: 8, rebooting
2018-04-30 10:41:07 lsusb shows 2 D435, starting
2018-04-30 10:45:35 lsusb shows 0 D435, no address error: 8, rebooting
2018-04-30 10:46:10 lsusb shows 2 D435, starting
2018-04-30 10:50:32 lsusb shows 0 D435, no address error: 8, rebooting
2018-04-30 10:51:07 lsusb shows 2 D435, starting
Sorry @josephduchesne but can you confirm my understanding of your test?
- start camera and stream depth
- warm reboot?
- repeat
- every five minutes remove power from the NUC and restart after 15 seconds Thanks, Ted.
In this particular case it's the following loop:
- warm reboot
- if lsusb shows both cameras
- log "lsusb shows 2 D435, starting"
- start camera and stream depth for 5 minutes
- if lsusb shows 0 or 1 cameras
- log "lsusb shows N $D435_COUNT, no address error: $NO_ADDRESS, rebooting"
- if lsusb shows both cameras
I also tested an alternate configuration where every 5 minutes there was a 15 second power off cycle but the results looked similar.
The two variables D435_COUNT and NO_ADDRESS are:
D435_COUNT=$(lsusb | grep '8086:0b07' | wc -l)
NO_ADDRESS=$(journalctl -b | grep 'device not accepting address' | wc -l)
Are the cameras streaming when reboot is initiated? Is "power off cycle" a physical power off or shutdown?
They cameras may be streaming when the reboot is initiated.
Reboot is 'sudo reboot' in this case.
The cameras are running under a systemd service, but I'm not sure how the ros nodelet manager handles the signal to stop when the shutdown happens.
It is possible it's not being shut down 'properly', but since our use case involves a machine with a physical key that could turn power off without warning, this is a case that we will have to handle as gracefully as possible.
Thanks, your case is understood and I just want to help provide the specifics for debugging.
If lsusb is successful, does your test know if the cameras are actually streaming? (The DSO you noted fixed 5.8.15 that succeeded with lsusb but failed to be seen by the driver on cold boot; validation for this was also performed on slightly different h/w, type-B USB boards)
If lsusb is successful, I have a wrapper around the roslaunch which watches the ROS output topic, and resets the entire pipeline (roslaunch file and all nodes) if there has been no output for 10 seconds. This also logs failures. By calling reset on the cameras on initialisation (using this modification to the ROS nodelet), the camera will come up with a small number of attempts (0-3, typically 0).
This process is also logged in my logfile.
An example section of this logfile:
2018-04-30 15:55:32 lsusb shows 0 D435, no address error: 8, rebooting
2018-04-30 15:56:08 lsusb shows 2 D435, starting
2018-04-30 15:56:09 START /left_launch_monitor watching /camera_left/depth/points
2018-04-30 15:56:09 /left_launch_monitor launched /opt/ros/kinetic/bin/roslaunch /opt/ros/kinetic/share/avidbots_camera_launch/launch/single_d435.launch ns:=camera_left tf_prefix:=rs_left_ PID 1266
2018-04-30 15:56:09 START /right_launch_monitor watching /camera_right/depth/points
2018-04-30 15:56:09 /right_launch_monitor launched /opt/ros/kinetic/bin/roslaunch /opt/ros/kinetic/share/avidbots_camera_launch/launch/single_d435.launch ns:=camera_right tf_prefix:=rs_right_ PID 1267
2018-04-30 15:56:19 RESET /left_launch_monitor no message on /camera_left/depth/points in 10.02 seconds
2018-04-30 15:56:20 /left_launch_monitor launched /opt/ros/kinetic/bin/roslaunch /opt/ros/kinetic/share/avidbots_camera_launch/launch/single_d435.launch ns:=camera_left tf_prefix:=rs_left_ PID 1461
2018-04-30 15:56:27 RESET /right_launch_monitor no message on /camera_right/depth/points in 10.05 seconds
2018-04-30 15:56:27 /right_launch_monitor launched /opt/ros/kinetic/bin/roslaunch /opt/ros/kinetic/share/avidbots_camera_launch/launch/single_d435.launch ns:=camera_right tf_prefix:=rs_right_ PID 1537
2018-04-30 15:56:30 RESET /left_launch_monitor no message on /camera_left/depth/points in 10.00 seconds
2018-04-30 15:56:45 /left_launch_monitor launched /opt/ros/kinetic/bin/roslaunch /opt/ros/kinetic/share/avidbots_camera_launch/launch/single_d435.launch ns:=camera_left tf_prefix:=rs_left_ PID 1657
2018-04-30 15:57:02 RESET /left_launch_monitor no message on /camera_left/depth/points in 10.07 seconds
2018-04-30 15:57:03 /left_launch_monitor launched /opt/ros/kinetic/bin/roslaunch /opt/ros/kinetic/share/avidbots_camera_launch/launch/single_d435.launch ns:=camera_left tf_prefix:=rs_left_ PID 1792
2018-04-30 16:00:31 lsusb shows 0 D435, no address error: 8, rebooting
2018-04-30 16:01:08 lsusb shows 2 D435, starting
The sequence of events in plain english:
- 0:32: Computer boots, but finds 0 cameras, so it reboots (Issue 1)
- 1:08: Computer boots, finds 2 cameras and starts left/right camera managers
- 1:19: Left camera times out, resets (Issue 2 or 3)
- 1:27: Right camera times out, resets (after working at least partially for ~8 seconds before failing) (Issue 3)
- 1:30: Left camera times out again (immediately after restarting, never works) (Issue 2 or 3)
- 2:02: Left camera times out a third time (after working for ~22 seconds) (Issue 3)
- Both cameras then happily work until 5:00 when the computer reboots on its cronjob
- 5:31: Computer boots, but finds 0 cameras, so it reboots (Issue 1)
- 6:08: Computer boots, finds 2 cameras and starts left/right camera managers... the cycle repeats
The clarify, the launch monitor process exists to work around DSO-8665 in conjunction with the ROS node modification that resets the camera on node start.
Also, yes the fact that the launch monitor did not reset a camera after 10 seconds indicates that the camera is streaming depth data.
I have independently validated this using rostopic / rviz several times.
[Realsense Customer Engineering Team Comment] @josephduchesne, can you change the BIOS setting for devices/USB to uncheck USB legacy and set xHCI mode to "Enabled" and see if this makes a difference?
The earlier tests were with USB legacy enabled, but after updating the firmware I tested first with it enabled, then with it disabled (latest tests). I didn't see a difference.
I'll check if xHCI is configured tomorrow and test whichever mode is opposite the current setting.
I can't find xHCI configuration options on the NUC7i3BNH
Sorry, I forgot that you have a 7th gen NUC; xHCI has no optional settings. I have been working with a 4th gen i3 that has an auto / enabled mode option for xHCI.
When lsusb fails, what do you see on dmesg before reboot?
For completeness I've attached the entire dmesg file, but the relevant section appears to be:
[ 3.113989] usb 1-2: new low-speed USB device number 3 using xhci_hcd
[ 3.260348] usb 1-2: New USB device found, idVendor=045e, idProduct=076c
[ 3.260350] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 3.260351] usb 1-2: Product: Microsoft® Comfort Mouse 4500
[ 3.260352] usb 1-2: Manufacturer: Microsoft
[ 3.273944] fbcon: inteldrmfb (fb0) is primary device
[ 3.369764] Console: switching to colour frame buffer device 160x50
[ 3.377679] usb 2-3: Device not responding to setup address.
[ 3.388299] i915 0000:00:02.0: fb0: inteldrmfb frame buffer device
[ 3.585676] usb 2-3: Device not responding to setup address.
[ 3.790016] usb 2-3: device not accepting address 4, error -71
[ 3.842309] [drm] RC6 on
[ 3.937865] usb 1-8: new full-speed USB device number 4 using xhci_hcd
[ 4.079871] usb 1-8: New USB device found, idVendor=8087, idProduct=0a2b
[ 4.079873] usb 1-8: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 4.097433] usbcore: registered new interface driver usbhid
[ 4.097434] usbhid: USB HID core driver
[ 4.099091] input: Microsoft Microsoft® Comfort Mouse 4500 as /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/0003:045E:076C.0003/input/input4
[ 4.099304] input: Microsoft Wired Keyboard 600 as /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0/0003:045E:07F8.0001/input/input5
[ 4.158355] microsoft 0003:045E:076C.0003: input,hidraw0: USB HID v1.11 Mouse [Microsoft Microsoft® Comfort Mouse 4500] on usb-0000:00:14.0-2/input0
[ 4.201706] usb 2-3: Device not responding to setup address.
[ 4.218110] hid-generic 0003:045E:07F8.0001: input,hidraw1: USB HID v1.11 Keyboard [Microsoft Wired Keyboard 600] on usb-0000:00:14.0-1/input0
[ 4.219136] input: Microsoft Wired Keyboard 600 as /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.1/0003:045E:07F8.0002/input/input6
[ 4.278113] hid-generic 0003:045E:07F8.0002: input,hidraw2: USB HID v1.11 Device [Microsoft Wired Keyboard 600] on usb-0000:00:14.0-1/input1
[ 4.409679] usb 2-3: Device not responding to setup address.
[ 4.614008] usb 2-3: device not accepting address 5, error -71
[ 4.642035] usb usb2-port3: unable to enumerate USB device
[ 4.793679] usb 2-4: Device not responding to setup address.
[ 5.001684] usb 2-4: Device not responding to setup address.
[ 5.205982] usb 2-4: device not accepting address 6, error -71
[ 5.357685] usb 2-4: Device not responding to setup address.
[ 5.565707] usb 2-4: Device not responding to setup address.
[ 5.770013] usb 2-4: device not accepting address 7, error -71
[ 5.921678] usb 2-4: Device not responding to setup address.
[ 6.129677] usb 2-4: Device not responding to setup address.
[ 6.334007] usb 2-4: device not accepting address 8, error -71
[ 6.485683] usb 2-4: Device not responding to setup address.
[ 6.693686] usb 2-4: Device not responding to setup address.
[ 6.898008] usb 2-4: device not accepting address 9, error -71
The Bus enumeration on the NUC7i3 is:
- 1: Front+Back USB 2.0 host controller
- 2: Front+Back USB 3.0 host controller
- 3: USB C port 2.0 host controller
- 4: USB C port 3.0 host controller
It appears that bluetooth is provided on this machine via the USB 2.0 host controller on Bus 1 as an internal USB device.
(The keyboard+mouse were not present during the tests but were plugged in for BIOS configuration)
lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 8087:0a2b Intel Corp.
Bus 001 Device 003: ID 045e:076c Microsoft Corp. Comfort Mouse 4500
Bus 001 Device 002: ID 045e:07f8 Microsoft Corp. Wired Keyboard 600 (model 1576)
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
An additional piece of debugging information:
I tried a Rosewill RC-509 PCI-E (PCI Express) to USB 3.1 (Type A +Type C) Expansion Card in the AsRock IMB-195 i7-6700TE platform listed above in the table I provided.
It does not experience issue 1. The devices always initialise correctly.
[Realsense Customer Engineering Team Comment] hi @josephduchesne,
sorry for late, i am another engineer now take care this ticket, i got 2 D435 and gen7 Nuc for this issue now, but would like to confirm if latest FW5.9.13 still have same issue? and from your last comment, using different HW seems no issue 1 now, but other issue still happen on your AsRock platform? thanks.
[Realsense Customer Engineering Team Comment] per my test for 10 reboot with latest FW v5.9.13,connect both D435 to USB port in the back, seems so far so good.
[Realsense Customer Engineering Team Comment] hi @josephduchesne would like to know if you last test is with latest FW5.9.13? and if the new FW still fail on your Nuc? thanks.