USB 3.0 Bandwidth is Low

I’m trying to stream raw video from 2 USB 3.0 cameras (econ systems See3CAM_CU38) using gstreamer on the Nano Devkit. By trying various combinations of resolution, frame rate, and number of cameras, it seems that there is a consistent bandwidth limit of about 600 mbit/s on the USB bus. At low resolutions and frame rates everything works fine, but at data rates above this limit frames are dropped. I can see dropped frames by watching the video output, and by color changes in the camera status LED.

My gstreamer pipeline is

gst-launch-1.0 v4l2src device=/dev/video0 ! "video/x-raw,format=UYVY,framerate=$FPS/1,width=$WIDTH,height=$HEIGHT" ! fakesink

Others seem to have posted similar problems:

“Jetson Nano USB 3.0 Bandwidth Issue”
https://devtalk.nvidia.com/default/topic/1063102/jetson-nano/jetson-nano-usb-3-0-bandwidth-issue/

Based on this thread, I added “usbcore.autosuspend=-1 usb_port_owner_info=2 usbcore.usbfs_memory_mb=1024” to /boot/extlinux/extlinux.conf, without any improvement. I also tried setting clk_parent to pll_re_out in /sys/kernel/debug/clk/xusb_falcon_src, which has a higher clock rate of 336000000, also without any improvement.

“Realsense camera unstable”
https://devtalk.nvidia.com/default/topic/1048804/jetson-agx-xavier/realsense-camera-unstable/2

This thread is for Xavier, and has a fix that involves updating the usb firmware, checking proper ELPG operation, and increasing the xusb_falcon clock rate. My usb firmware version is 50.22. ELPG seems to work, and Nano doesn’t accept a 408000000 rate (changed between 152 and 266 seconds in log), according to dmesg:

[    4.286075] tegra-xudc-new 700d0000.xudc: exiting ELPG
[    4.287828] tegra-xudc-new 700d0000.xudc: exiting ELPG done
[    4.287846] tegra-xudc-new 700d0000.xudc: ep 0 (type: 0, dir: out) enabled
[    4.288484] tegra-xudc-new 700d0000.xudc: entering ELPG
[    4.288718] tegra-xudc-new 700d0000.xudc: entering ELPG done
[    4.316254] l4tbr0: port 1(rndis0) entered blocking state
[    4.316259] l4tbr0: port 1(rndis0) entered disabled state
[    4.368649] l4tbr0: port 2(usb0) entered blocking state
[    4.368654] l4tbr0: port 2(usb0) entered disabled state
[    4.369054] device usb0 entered promiscuous mode
[    5.739178] tegra-xusb 70090000.xusb: Upgrade port 0 to USB3.0
[    5.739185] tegra-xusb 70090000.xusb: Upgrade port 1 to USB3.0
[    6.067044] usb 2-1: new SuperSpeed USB device number 2 using tegra-xusb
[    6.102744] usb 2-1: New USB device found, idVendor=0bda, idProduct=0411
[    6.102749] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    6.102751] usb 2-1: Product: 4-Port USB 3.1 Hub
[    6.102754] usb 2-1: Manufacturer: Generic
[    6.107526] hub 2-1:1.0: USB hub found
[    6.110209] hub 2-1:1.0: 4 ports detected
[    6.279122] usb 2-1: usb_suspend_both: status 0
[    6.279353] usb usb2: usb_suspend_both: status 0
[    6.756016] usb usb2: usb_suspend_both: status -16
[    6.773912] usb usb2: usb_suspend_both: status 0
[    7.006389] usb 2-1.2: new SuperSpeed USB device number 3 using tegra-xusb
[    7.026964] usb 2-1.2: LPM exit latency is zeroed, disabling LPM.
[    7.027974] usb 2-1.2: New USB device found, idVendor=2560, idProduct=c133
[    7.027985] usb 2-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    7.027993] usb 2-1.2: Product: See3CAM_CU38
[    7.028000] usb 2-1.2: Manufacturer: e-con systems
[    7.028006] usb 2-1.2: SerialNumber: 1C27C705
[    7.032385] hid-generic 0003:2560:C133.0001: hidraw0: USB HID v1.11 Device [e-con systems See3CAM_CU38] on usb-70090000.xusb-1.2/input2
[    7.146605] usb 2-1.4: new SuperSpeed USB device number 4 using tegra-xusb
[    7.171216] usb 2-1.4: LPM exit latency is zeroed, disabling LPM.
[    7.172511] usb 2-1.4: New USB device found, idVendor=2560, idProduct=c133
[    7.172527] usb 2-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    7.172538] usb 2-1.4: Product: See3CAM_CU38
[    7.172549] usb 2-1.4: Manufacturer: e-con systems
[    7.172558] usb 2-1.4: SerialNumber: 0817C605
[    7.177628] hid-generic 0003:2560:C133.0002: hidraw1: USB HID v1.11 Device [e-con systems See3CAM_CU38] on usb-70090000.xusb-1.4/input2
[    7.282351] uvcvideo: Found UVC 1.00 device See3CAM_CU38 (2560:c133)
[    7.309404] uvcvideo 2-1.2:1.0: Entity type for entity Extension 3 was not initialized!
[    7.317459] uvcvideo 2-1.2:1.0: Entity type for entity Processing 2 was not initialized!
[    7.325689] uvcvideo 2-1.2:1.0: Entity type for entity Camera 1 was not initialized!
[    7.333728] input: See3CAM_CU38 as /devices/70090000.xusb/usb2/2-1/2-1.2/2-1.2:1.0/input/input2
[    7.333941] uvcvideo: Found UVC 1.00 device See3CAM_CU38 (2560:c133)
[    7.360478] uvcvideo 2-1.4:1.0: Entity type for entity Extension 3 was not initialized!
[    7.368615] uvcvideo 2-1.4:1.0: Entity type for entity Processing 2 was not initialized!
[    7.376792] uvcvideo 2-1.4:1.0: Entity type for entity Camera 1 was not initialized!
[    7.384923] input: See3CAM_CU38 as /devices/70090000.xusb/usb2/2-1/2-1.4/2-1.4:1.0/input/input3
[    7.385082] usbcore: registered new interface driver uvcvideo
[    7.385084] USB Video Class driver (1.1.1)
[   10.122470] usb 2-1.2: usb_suspend_both: status 0
[   10.954546] usb 2-1.4: usb_suspend_both: status 0
[   11.010528] usb 2-1: usb_suspend_both: status 0
[   11.011431] usb usb2: usb_suspend_both: status 0
[   11.011530] tegra-xusb 70090000.xusb: entering ELPG
[   11.013409] tegra-pmc: PMC tegra_pmc_utmi_phy_enable_sleepwalk : port 1, speed 3
[   11.013957] tegra-pmc: PMC tegra_pmc_utmi_phy_enable_sleepwalk : port 2, speed 0
[   11.017354] tegra-xusb 70090000.xusb: entering ELPG done
[  128.910800] tegra-xusb 70090000.xusb: exiting ELPG
[  128.914506] tegra-xusb 70090000.xusb: Firmware timestamp: 2019-05-08 09:42:10 UTC, Version: 50.22 release
[  128.914775] tegra-pmc: PMC tegra_pmc_utmi_phy_disable_sleepwalk : port 0
[  128.914797] tegra-pmc: PMC tegra_pmc_utmi_phy_disable_sleepwalk : port 1
[  128.914818] tegra-pmc: PMC tegra_pmc_utmi_phy_disable_sleepwalk : port 2
[  128.915847] tegra-xusb 70090000.xusb: exiting ELPG done
[  152.202359] usb 2-1.4: usb_suspend_both: status 0
[  152.202510] usb 2-1.2: usb_suspend_both: status 0
[  152.254312] usb 2-1: usb_suspend_both: status 0
[  152.255233] usb usb2: usb_suspend_both: status 0
[  152.255332] tegra-xusb 70090000.xusb: entering ELPG
[  152.256975] tegra-pmc: PMC tegra_pmc_utmi_phy_enable_sleepwalk : port 1, speed 3
[  152.257561] tegra-pmc: PMC tegra_pmc_utmi_phy_enable_sleepwalk : port 2, speed 0
[  152.261215] tegra-xusb 70090000.xusb: entering ELPG done
[  266.007710] tegra-xusb 70090000.xusb: exiting ELPG
[  266.007762] tegra-dvfs: rate 408000000 too high for dvfs on xusb_falcon_src
[  266.019288] tegra-xusb 70090000.xusb: failed to enable xhci clocks -22
[  266.025842] tegra-xusb 70090000.xusb: exiting ELPG failed

How can I further troubleshoot this issue? 600 Mbit/s is only 12% of the nominal 5 Gbit/s bandwidth, and not adequate for my application (1280x960, 30 fps, 2 cameras, UYVY -> 1180 Mbit/s)

Hi Dylano,

We’re using below pipeline to run with two See3CAM CU135 usb camera with JetPack-4.2.2, after 5 mins, the frame rate keep at 30fps.

$ gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,format=UYVY,width=1920,height=1080,framerate=30/1 ! nvvidconv ! 'video/x-raw(memory:NVMM),format=NV12' ! nvvidconv ! fpsdisplaysink video-sink=nveglglessink text-overlay=false -v
$ gst-launch-1.0 v4l2src device=/dev/video1 ! video/x-raw,format=UYVY,width=1920,height=1080,framerate=30/1 ! nvvidconv ! 'video/x-raw(memory:NVMM),format=NV12' ! nvvidconv ! fpsdisplaysink video-sink=nveglglessink text-overlay=false -v

Frame rate:

[Video0]
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 9060, dropped: 3, current: 29.96, average: 30.00
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 9076, dropped: 3, current: 30.05, average: 30.00
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 9092, dropped: 3, current: 30.02, average: 30.00
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 9108, dropped: 3, current: 30.01, average: 30.00
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 9123, dropped: 3, current: 30.00, average: 30.00
[Video1]
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 9149, dropped: 1, current: 30.03, average: 30.00
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 9164, dropped: 1, current: 30.00, average: 30.00
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 9180, dropped: 1, current: 30.01, average: 30.00
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 9196, dropped: 1, current: 30.00, average: 30.00
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 9212, dropped: 1, current: 30.00, average: 30.00

The pipeline above does work without dropped frames. The key seems to be that nvvidconv and nveglglessink use the video/x-raw(memory:NVMM) caps, which means that memory copies are done by DMA. Is this correct?

Could you explain the logic behind the pipeline provided? I’m confused by 2 instances of nvvidconv, wouldn’t

$ gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,format=UYVY,width=1920,height=1080,framerate=30/1 ! nvvidconv ! 'video/x-raw(memory:NVMM),format=NV12' ! fpsdisplaysink video-sink=nveglglessink text-overlay=false -v

work equally well?

Hi,
Yes. Below pipeline is to convert UYVY CPU buffers to NV12 NVMM(DMA) buffers. Hardware components are with optimal performance in handling/passing NVMM buffers.

video/x-raw,format=UYVY,width=1920,height=1080,framerate=30/1 ! nvvidconv ! 'video/x-raw(memory:NVMM),format=NV12'