Two USB 3.0 IDS cameras with Jetson TK1

Hello All,

I am trying connect multiple USB 3.0 IDS cameras (3240 LE series)to Jetson TK1 using USB hub and i am capturing and displaying both the videos.

I can see flicker and both videos multiplexed into one window…

My concern is can we connect two USB cameras to TK1 using USB hub and display both the videos separately or is there any other way to interface two USB cameras to TK1 ?

Any help is highly appreciated…

Two separate cameras on two separate USB connections (even if via a HUB) should be two separate streams of data. Running two separate programs or a single program capable of displaying video streams separately is itself a software-only issue (describe what you want to do with the two cameras and someone will probably offer an example of software to do this). Performance may be a different story, e.g., flicker.

Several things might cause flicker. First, the USB port on a JTK1 is by default set to USB2…an edit in a kernel parameter would set this to USB3 (thus boosting data throughput from 480Mbit/s to 5000Mbit/s). Running “lsusb -t” while the cameras connected should indicate “5000M” in their tree for speed, while USB2 would show “480M”. If using the u-boot boot loader (default in R21.x, but differs in R19.x), you can simply edit the extlinux.conf file in “/boot”; you would just edit “usb_port_owner_info=0” to become “usb_port_owner_info=2”, and reboot.

One thing to note is that video cameras should run in USB “isochronous” mode. This mode is for real time data streaming. Some USB video cameras run in “block” mode; block mode is intended for starting/stopping with large chunks of data, typically a hard drive (hard drives don’t lose data by momentary stops, and buffering in the hard drive mitigates the pitfalls of start/stop). Block mode for video will have interrupted data no matter what; some frame drops are mandatory for this (the camera itself would need a hard drive to record to to avoid dropped frames, but then USB would be talking to a hard drive and not the camera…even if a hard drive avoided dropped frames, video itself would not run smoothly in real time). You can use lsusb verbose mode to see more about which mode your camera runs in.

All other things being correct, your cameras have different data rate requirements depending on which mode they are in. If they both stream 640x480 grayscale, you probably won’t have issues with flicker or dropped frames even under the worst of conditions. If a single camera runs ultra-hidef full color 60fps, then everything starts becoming critical even for a single camera. So what mode do your cameras work in?

I am using IDS Camera 3240 USB 3.0 camera… and i have connected two cameras using USB hub…

Currently i just want to check that i am able to grab frame from both the camera on Jetson TK1 and display it…

I am not using any hard drive(As you mentioned) to record video so i think my camera is working in isochronous mode only…

Isochronous mode is unrelated to whether you use a hard drive. Isochronous versus block mode depends on your camera’s USB design. If the camera states it wants to use block mode, then it behaves similar to a hard drive with stop/start.

If you run “lsusb -t”, you will see some lines end with one of these: “1.5M”, “12M”, “480M”, or “5000M”. Those are speeds devices are running at in units of Mbit/sec. At least in the case of one root HUB, you should see “5000M”…if not you probably didn’t update the kernel parameter to allow it to operate at 5000Mbit/sec. Any device plugged into that HUB would also be limited by root HUB speed, and if it doesn’t run at 5000M, the next speed lower is 480M. This is the basic USB setting for its speed.

A device has its own speed and operating mode. If you simply run “lsusb”, with no options, you should see an entry which is your camera. There is an “ID” listed for that particular device which can be used to select just that device under lsusb. The “-d” parameter of lsusb accepts that ID to pick just that device. For example, I have a mouse which shows up as ID “1b1c:1b05”, so I could list just the mouse as:

lsusb -d '1b1c:1b05'

The reason for using the ID is because you wouldn’t want to use verbose lsusb output of all devices at once. Assuming your ID is edited to something other than my mouse, you could list all USB attributes in verbose mode via:

lsusb -d '1b1c:1b05' -v
# or...for paging...
lsusb -d '1b1c:1b05' -v | less
# or...for logging to a file...
lsusb -d '1b1c:1b05' -v | tee usb_log.txt

Typically you would search that verbose lsusb for “Transfer Type” and see either “Isochronous” or “Bulk” on your camera (keep in mind there are multiple components to a USB device…not all have to be in the same mode, but at least the camera must be isochronous to be guaranteed no stop/start behavior).

Does your camera show isochronous mode or bulk mode? Does your lsusb -t show 5000M for your camera?