Support for multiple high resolution USB 3.0 cameras?

I cannot open multiple 5 megapixel e-con DENEBOLA (See3CAM_CX3RDK) cameras with my TX1. They open fine at 1080 with v4l2src and nvgstcapture (which is limited to 1920x1080 capture?) but display lots of shudder and visual glitches when opened at 5Mpx 15fps. Also worth noting they work fine on x86 PCs.

Does anyone else have similar experience? Does the TX1 support these high resolution cameras? It seems like there are bugs in the TX1’s v4l2 implementation?

Hi Hammer,

We checked two denebola kits (as well as other USB 3.0 cameras) on the TX1. A single camera works fine at Full HD streaming. But when we try to stream two or more cameras at resolutions higher than 1080p, the frames appear to be corrupt. The frames are flagged as bad from the UVC driver itself.

The same kernel driver is used on an x86 pc. So the issue cant be due to the driver. We suspect the issue to be due to USB bandwidth capabilities of the TX1 usb controller. Similar issues were noted when testing USB cameras on TK1 as well.

You could also try the jetson_clocks_max.sh script provided by Nvidia in the latest 24.1 release package. This seems to increase the performance of the cameras a bit further. ie. less corruption in high resolutions.

Thanks for the feedback dilipkumar25,
This problem is annoying because these data rates are well within the USB3.0 spec. Have you filed a bug report with NVIDIA?

Please check if below post could help to improve your issue.

[url]https://devtalk.nvidia.com/default/topic/937487/currupted-frames-from-ar1820-usb-camera/#4887598[/url]

Unfortunately this patch didn’t fix my corruption problem. Any other suggestions?

hammer00,

Please check if below new xusb fw can help your issue,
[url]https://devtalk.nvidia.com/default/topic/919354/jetson-tx1/usb-3-transfer-failures/post/4899105/#4899105[/url]

conan,

Is the firmware compatible with the TK1 as well? If not, is there a similar firmware available for the TK1 ? We faced similar issues at high resolutions in the TK1 as well.

dilipkumar25,

The firmware can’t be used on TK1. Could you please give more details on the issue you mentioned? such as, which release, what kind of camera and its output resolution? the symptom?

Hi dilipkumar25,

Here is the TK1 firmware for similar issue.
You can replace the USB firmware file by unzipping and copying the unzipped file to your /lib/firmware/ directory.

Please help to check if it can help to resolve your case.

Thanks
xusb_sil_rel_fw-45xx-20895338.zip (72.9 KB)

Hi kaycc,

Thanks for the updated firmware for the tk1. We tested it on a Jetson Tk1 running l4t-r21.4. After unzipping the file, the xusb firmware timestamp has changed. So im sure that the new firmware is loaded fine. The issues with the usb cameras still persist. There is no significant difference in performance. The frames still appear corrupt at high resolutions.

Hi nVConan,

This is the issue I am referring to.

The camera is a USB 3.0 See3CAM_CX3RDK camera. The output format is YUYV. Some frames appear corrupt towards the bottom half when streaming at 5MP resolution (2592x1944) at 15fps.

Hi dilipkumar25,

Please help to have a try with below patch.

diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index 8820871b..0322430 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -1238,7 +1238,7 @@ union xhci_trb {
  * since the command ring is 64-byte aligned.
  * It must also be greater than 16.
  */
-#define TRBS_PER_SEGMENT       64
+#define TRBS_PER_SEGMENT       256
/* Allow two commands + a link TRB, along with any reserved command TRBs */
#define MAX_RSVD_CMD_TRBS      (TRBS_PER_SEGMENT - 3)
#define TRB_SEGMENT_SIZE       (TRBS_PER_SEGMENT*16)

This patch is expected remove the message ‘tegra-xhci tegra-xhci: WARN Event TRB for slot 4 ep 2 with no TDs queued?’. But I’m not sure whether it can help more.
It’s better to estimate the USB 3.0 bandwidth with the device you are using first.

Furthermore, please make sure set CPU to max freq to prevent event ring full problem.

Thanks

Hey. I ran into the same problem described in the topic https://devtalk.nvidia.com/default/topic/953775/jetson-usb-camera-hang/?offset=1. I use 3 cameras OEM Global Shutter Camera Module. This camera is connected for the first time. The second time it does not connect. The third time it is connected again. To connect to the camera, I use the command:

gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw, format=YUY2, width=640, height=480 ! videoconvert ! video/x-raw, format=RGB ! videoconvert ! xvimagesink

I upgraded the kernel version to 4.4.38-tegra using JetPack-L4T-3.1-linux-x64.
I applied all the patches described in this topic, and this GitHub - jetsonhacks/installLibrealsenseTX1: Install lbrealsense for Intel RealSense cameras on Jetson TX1 Development Kit and GitHub - jetsonhacks/installLibrealsense: Install librealsense for Intel Realsense cameras on Jetson development kits
Nothing helped.

dmesg command output:

[   10.926394] hid-generic 0003:1BCF:0005.0004: input,hidraw3: USB HID v1.10 Mouse [USB Optical Mouse] on usb-70090000.xusb-3.4.4/input0
[   11.103603] tegradc tegradc.1: nominal-pclk:148500000 parent:148500000 div:1.0 pclk:148500000 147015000~161865000
[   11.104592] tegradc tegradc.1: hdmi: pclk:148500K, set prod-setting:prod_c_hdmi_75m_150m
[   12.498588] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   12.583502] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   13.817711] xhci-tegra 70090000.xusb: tegra_xhci_mbox_work mailbox command 17
[   13.825311] xhci-tegra 70090000.xusb: tegra_xhci_mbox_work mailbox command 18
[   15.206084] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   16.444017] Setting pll_a = 45158400 Hz clk_out = 11289600 Hz
[   16.491724] Setting pll_a = 45158400 Hz clk_out = 11289600 Hz
[   16.518075] Setting pll_a = 45158400 Hz clk_out = 11289600 Hz
[   16.549534] Setting pll_a = 45158400 Hz clk_out = 11289600 Hz
[   16.551405] Setting pll_a = 45158400 Hz clk_out = 11289600 Hz
[   16.552754] Setting pll_a = 45158400 Hz clk_out = 11289600 Hz
[   16.573846] Setting pll_a = 45158400 Hz clk_out = 11289600 Hz
[   16.576168] Setting pll_a = 45158400 Hz clk_out = 11289600 Hz
[   16.587189] Setting pll_a = 45158400 Hz clk_out = 11289600 Hz
[   16.624023] Setting pll_a = 45158400 Hz clk_out = 11289600 Hz
[   16.695242] tegradc tegradc.1: nominal-pclk:148500000 parent:148500000 div:1.0 pclk:148500000 147015000~161865000
[   16.696560] tegradc tegradc.1: hdmi: pclk:148500K, set prod-setting:prod_c_hdmi_75m_150m
[   18.396585] EXT4-fs (sda1): recovery complete
[   18.401753] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
[  131.380574] usb 1-3.3: USB disconnect, device number 5
[  205.389968] usb 1-3.3: new high-speed USB device number 11 using xhci-tegra
[  205.419634] usb 1-3.3: New USB device found, idVendor=054c, idProduct=06b0
[  205.427525] usb 1-3.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  205.436219] usb 1-3.3: Product: Storage Media
[  205.440695] usb 1-3.3: Manufacturer: Sony
[  205.445265] usb 1-3.3: SerialNumber: 4C5211608104400263
[  205.451928] usb 1-3.3: ep 0x81 - rounding interval to 128 microframes, ep desc says 255 microframes
[  205.461717] usb 1-3.3: ep 0x2 - rounding interval to 128 microframes, ep desc says 255 microframes
[  205.471648] usb-storage 1-3.3:1.0: USB Mass Storage device detected
[  205.478512] scsi host3: usb-storage 1-3.3:1.0
[  206.719706] scsi 3:0:0:0: Direct-Access     Sony     Storage Media    0100 PQ: 0 ANSI: 4
[  206.728766] sd 3:0:0:0: [sda] 63406080 512-byte logical blocks: (32.5 GB/30.2 GiB)
[  206.736997] sd 3:0:0:0: [sda] Write Protect is off
[  206.742959] sd 3:0:0:0: [sda] Mode Sense: 43 00 00 00
[  206.748648] sd 3:0:0:0: [sda] No Caching mode page found
[  206.754910] sd 3:0:0:0: [sda] Assuming drive cache: write through
[  206.766952]  sda: sda1
[  206.771565] sd 3:0:0:0: [sda] Attached SCSI removable disk
[  243.335271] usb 1-3.3: USB disconnect, device number 11
[  253.742824] xhci-tegra 70090000.xusb: tegra_xhci_mbox_work mailbox command 17
[  253.751195] xhci-tegra 70090000.xusb: tegra_xhci_mbox_work mailbox command 18
[  254.162899] xhci-tegra 70090000.xusb: tegra_xhci_mbox_work mailbox command 17
[  254.170968] xhci-tegra 70090000.xusb: tegra_xhci_mbox_work mailbox command 18
[  268.810003] xhci-tegra 70090000.xusb: tegra_xhci_mbox_work mailbox command 17
[  268.817276] xhci-tegra 70090000.xusb: tegra_xhci_mbox_work mailbox command 18
[  274.609603] xhci-tegra 70090000.xusb: tegra_xhci_mbox_work mailbox command 17
[  274.617680] xhci-tegra 70090000.xusb: tegra_xhci_mbox_work mailbox command 18
[  321.364336] compiz[1729]: unhandled level 2 translation fault (11) at 0x7f8305de00, esr 0x92000006
[  321.380602] pgd = ffffffc0f4bdb000
[  321.386294] [7f8305de00] *pgd=00000000c0db3003, *pud=00000000c0db3003, *pmd=0000000000000000

[  321.396568] CPU: 1 PID: 1729 Comm: compiz Not tainted 4.4.38-tegra #1
[  321.403472] Hardware name: jetson_tx1 (DT)
[  321.407821] task: ffffffc07aafcb00 ti: ffffffc0f1f9c000 task.ti: ffffffc0f1f9c000
[  321.415618] PC is at 0x7f8000c604
[  321.419414] LR is at 0x7f8000d328
[  321.424896] pc : [<0000007f8000c604>] lr : [<0000007f8000d328>] pstate: 80000000
[  321.432583] sp : 0000007fc5d9cc50
[  321.436218] x29: 0000007fc5d9cc50 x28: 0000000004b369e0 
[  321.450183] x27: 0000007f800df9f8 x26: 0000007f800df9a0 
[  321.489408] x25: fffffffffffffffa x24: 0000007f800df0d0 
[  321.507991] x23: 0000007f800df9a8 x22: 0000000000000030 
[  321.519511] x21: 0000000002f7e400 x20: 0000007f8305ddf8 
[  321.530726] x19: 0000007f800df9f8 x18: 0000000000000000 
[  321.544935] x17: 0000007f80010988 x16: 0000007f7ff61280 
[  321.554940] x15: 0000000000000000 x14: 2432001100000000 
[  321.565306] x13: 0000000000000000 x12: 0000000000000000 
[  321.590780] x11: 00a0000e000001a0 x10: 2432001100000000 
[  321.596596] x9 : 0000000000000000 x8 : 00000000004dd6b0 
[  321.602483] x7 : 0000000000000000 x6 : 0000007fc5d9ccdc 
[  321.608100] x5 : 0000000000000000 x4 : 0000000004ca5e20 
[  321.613808] x3 : 0000000000000001 x2 : 0000000000000000 
[  321.619636] x1 : 0000000000000091 x0 : 0000000002f7e400 

[  321.626986] Library at 0x7f8000c604: 0x7f7ff9e000 /lib/aarch64-linux-gnu/libc-2.23.so
[  321.635284] Library at 0x7f8000d328: 0x7f7ff9e000 /lib/aarch64-linux-gnu/libc-2.23.so
[  321.643374] vdso base = 0x7f803b7000
[  323.309547] tegradc tegradc.1: nominal-pclk:148500000 parent:148500000 div:1.0 pclk:148500000 147015000~161865000
[  323.311052] tegradc tegradc.1: hdmi: pclk:148500K, set prod-setting:prod_c_hdmi_75m_150m
[  323.676417] tegradc tegradc.1: nominal-pclk:148500000 parent:148500000 div:1.0 pclk:148500000 147015000~161865000
[  323.677226] tegradc tegradc.1: hdmi: pclk:148500K, set prod-setting:prod_c_hdmi_75m_150m
[  326.213217] Setting pll_a = 45158400 Hz clk_out = 11289600 Hz
[  326.258833] Setting pll_a = 45158400 Hz clk_out = 11289600 Hz
[  327.172270] Setting pll_a = 45158400 Hz clk_out = 11289600 Hz
[  327.472312] Setting pll_a = 45158400 Hz clk_out = 11289600 Hz
[  327.479760] Setting pll_a = 45158400 Hz clk_out = 11289600 Hz
[  327.487737] Setting pll_a = 45158400 Hz clk_out = 11289600 Hz
[  327.516740] Setting pll_a = 45158400 Hz clk_out = 11289600 Hz
[  327.524246] Setting pll_a = 45158400 Hz clk_out = 11289600 Hz
[  327.541977] Setting pll_a = 45158400 Hz clk_out = 11289600 Hz
[  327.576210] Setting pll_a = 45158400 Hz clk_out = 11289600 Hz
[  330.122339] tegradc tegradc.1: nominal-pclk:148500000 parent:148500000 div:1.0 pclk:148500000 147015000~161865000
[  330.123142] tegradc tegradc.1: hdmi: pclk:148500K, set prod-setting:prod_c_hdmi_75m_150m
[  338.089724] Setting pll_a = 45158400 Hz clk_out = 11289600 Hz
[  338.134793] Setting pll_a = 45158400 Hz clk_out = 11289600 Hz
[  338.167109] Setting pll_a = 45158400 Hz clk_out = 11289600 Hz
[  338.199595] Setting pll_a = 45158400 Hz clk_out = 11289600 Hz
[  338.207130] Setting pll_a = 45158400 Hz clk_out = 11289600 Hz
[  338.215558] Setting pll_a = 45158400 Hz clk_out = 11289600 Hz
[  338.241913] Setting pll_a = 45158400 Hz clk_out = 11289600 Hz
[  338.249350] Setting pll_a = 45158400 Hz clk_out = 11289600 Hz
[  338.266430] Setting pll_a = 45158400 Hz clk_out = 11289600 Hz
[  338.301953] Setting pll_a = 45158400 Hz clk_out = 11289600 Hz
[  375.630081] usb 1-3.3: new high-speed USB device number 12 using xhci-tegra
[  375.659857] usb 1-3.3: New USB device found, idVendor=054c, idProduct=06b0
[  375.669183] usb 1-3.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  375.678992] usb 1-3.3: Product: Storage Media
[  375.684791] usb 1-3.3: Manufacturer: Sony
[  375.690361] usb 1-3.3: SerialNumber: 4C5211608104400263
[  375.698052] usb 1-3.3: ep 0x81 - rounding interval to 128 microframes, ep desc says 255 microframes
[  375.708548] usb 1-3.3: ep 0x2 - rounding interval to 128 microframes, ep desc says 255 microframes
[  375.720006] usb-storage 1-3.3:1.0: USB Mass Storage device detected
[  375.727549] scsi host4: usb-storage 1-3.3:1.0
[  376.972908] scsi 4:0:0:0: Direct-Access     Sony     Storage Media    0100 PQ: 0 ANSI: 4
[  376.989170] sd 4:0:0:0: [sda] 63406080 512-byte logical blocks: (32.5 GB/30.2 GiB)
[  376.998821] sd 4:0:0:0: [sda] Write Protect is off
[  377.004165] sd 4:0:0:0: [sda] Mode Sense: 43 00 00 00
[  377.011100] sd 4:0:0:0: [sda] No Caching mode page found
[  377.016899] sd 4:0:0:0: [sda] Assuming drive cache: write through
[  377.030907]  sda: sda1
[  377.035580] sd 4:0:0:0: [sda] Attached SCSI removable disk
[  377.392218] EXT4-fs (sda1): recovery complete
[  377.398202] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
[  378.068422] nf_conntrack: automatic helper assignment is deprecated and it will be removed soon. Use the iptables CT target to attach helpers instead.
[ 1373.638302] tegradc tegradc.1: nominal-pclk:148500000 parent:148500000 div:1.0 pclk:148500000 147015000~161865000
[ 1373.639145] tegradc tegradc.1: hdmi: pclk:148500K, set prod-setting:prod_c_hdmi_75m_150m
[ 1373.785165] tegradc tegradc.1: nominal-pclk:148500000 parent:148500000 div:1.0 pclk:148500000 147015000~161865000
[ 1373.785995] tegradc tegradc.1: hdmi: pclk:148500K, set prod-setting:prod_c_hdmi_75m_150m
[ 1585.608477] xhci-tegra 70090000.xusb: tegra_xhci_mbox_work mailbox command 17
[ 1585.616180] xhci-tegra 70090000.xusb: tegra_xhci_mbox_work mailbox command 18

Hi maxfashko, for clarification, you connect one USB camera or three USB cameras? Please run ‘ls /dev/video*’ to show all devices.

I connect three available usb cameras. In devices there are only three usb cameras. Built-in camera after piercing the JetPack 3.1 has disappeared. But the problem is not that, I do not need a built-in camera.
If I run two command instances for different devices:

gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw, format=YUY2, width=640, height=480 ! videoconvert ! video/x-raw, format=RGB ! videoconvert ! xvimagesink

gst-launch-1.0 v4l2src device=/dev/video1 ! video/x-raw, format=YUY2, width=640, height=480 ! videoconvert ! video/x-raw, format=RGB ! videoconvert ! xvimagesink

After a while one of the cameras stops responding (the image freezes).
On the desktop version of the ubuntu with the kernel 4.10.0-32-generic there are no problems with these cameras.
And still the this cameras is connected for the first time. The second time it does not connect. The third time it is connected again

Hi,
Does it happen if you run

gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw, format=YUY2, width=640, height=480 ! fakesink
gst-launch-1.0 v4l2src device=/dev/video1 ! video/x-raw, format=YUY2, width=640, height=480 ! fakesink

Nothing good happened. Because it’s not about gsteramer. Capturing the image from the camera in the OpenCV behaves exactly the same. The same applies to the yavta.
The case is definitely in the USB drivers. Connection of three or two cameras is carried out through the USB hub. We thought it was in it, but by connecting one camera directly to the USB connector, we got the same thing.

Hi maxfashko,
I have tried to connect two Logitech c930e and run at 1080p for 30+ minutes on r28.1.

gst-launch-1.0 v4l2src device= /dev/video0 ! video/x-raw,format=I420,width=1920,height=1080 ! nvvidconv ! nvoverlaysink overlay-x=200 overlay-y=160 overlay-w=640 overlay-h=360
gst-launch-1.0 v4l2src device= /dev/video1 ! video/x-raw,format=I420,width=1920,height=1080 ! nvvidconv ! nvoverlaysink overlay-x=900 overlay-y=160 overlay-w=640 overlay-h=360 overlay=2

Do you have other usb cameras to give it a try?

Yes, other cameras work. We launched 2 logitech c270. But the logitech c270 does not have global shutter.

Here is what the official documentation from the camera manufacturer’s website says:
(See3CAMs on Jetson TK1 (ARM) over USB 3.0)

Enabling HID support

The default kernel zImage provided by NVIDIA for the Jetson TK1 does not support hidraw device support. Hidraw support is necessary for accessing the extra controls present in each See3CAM device. To enable hidraw in Jetson, the kernel binary needs to be rebuilt after configuring and enabling HID device support.

  1. Extracting and configuring the kernel

Extract the source code to any path on the host Linux PC.

tar -xjf <path_to>/kernel_src.tbz2
cd kernel/
ARCH=arm make tegra12_defconfig
ARCH=arm make menuconfig

Now enable hidraw support in the kernel by enabling the option given below.

“Device Drivers → HID support → /dev/hidraw raw HID device support”.

Now save and exit from the menu.

  1. Building and installing the kernel

Run the following commands in the host PC to build and install the kernel and drivers.

ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make zImage
ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make modules
sudo ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make modules_install INSTALL_MOD_PATH=$LDK_ROOTFS_DIR

sudo cp arch/arm/boot/zImage $LDK_ROOTFS_DIR/boot
sudo cp arch/arm/boot/zImage <path_to>/Linux_for_Tegra/kernel/zImage

NOTE: Alternatively, the Grinch kernel (>=19.3.1) can be used which has support for hidraw devices. Refer to the NVIDIA developer forums for more information.

Enabling USB 3.0 support

By default, the USB 3.0 port in the Jetson TK1 dev kit works only in USB 2.0 mode. So connecting any USB 3.0 device to that port is not sufficient to utilize the maximum performance that USB 3.0 offers. The following are the steps required to enable USB 3.0 in Jetson TK1 depending upon the version of L4T used.

For L4T 19.3

The default bootloader in this version of L4T is fastboot. For enabling USB 3.0 using this boot loader, the ODMDATA value needs to be changed in the file “jetson-tk1.conf” in Linux_for_Tegra directory and a re-flash is required.

 cd Linux_for_Tegra/

Open the file jetson-tk1.conf. Modify the value ODMDATA=0x6009C000 to ODMDATA=0x6209C000 and save the file. Now follow the steps for Flashing the Jetson TK1 (Section 7.1) to enable USB 3.0.

If U-boot is used as bootloader, the file extlinux.conf needs to be modified to get USB 3.0 working. For changing the bootloader to U-boot, refer to section 7.2. The following steps are not required otherwise.

After successfully booting the device, edit the file extlinux.conf in /boot and make the following changes on the Jetson device itself.

The second occurrence of usb_port_owner_info=0 should be changed to usb_port_owner_info=2.

The vmalloc parameter should be set to 512.

Hi maxfashko, I am a bit confused. Is the issue on TK1 or TX1?