Hi,
We are working on stereo vision and would like to leverage on the Jetson GPU.
I would like to get the streaming video from 2 USB3 cameras connected to the Jetson tegra via a USB3 HUB. I tried with L4T R21.3 and L4T R21.4 and I found different issues but in both cases I’m not able to make it work correctly, can anyone help me?
The set up is the following:
This hub http://www.dlink.com/it/it/home-solutions/connect/usb/dub-1340-4-port-superspeed-usb-3-hub connected to the Jetson with 2 cameras connected to it and a keyboard and mouse.
The camera used is SeeCam from e-consystems USB 3.0 Cameras
Relevant part of the dmesg
[ 679.851586] tegra-xhci tegra-xhci: Firmware timestamp: 2014-09-16 02:10:07 UTC, Falcon state 0x20
[ 680.144799] usb 2-1: new SuperSpeed USB device number 10 using tegra-xhci
[ 680.393642] usb 2-1: Parent hub missing LPM exit latency info. Power management will be impacted.
[ 680.406977] usb 2-1: New USB device found, idVendor=2109, idProduct=8110
[ 680.413747] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 680.413847] usb 2-1: Product: USB3.0 Hub
[ 680.413922] usb 2-1: Manufacturer: VIA Labs, Inc.
[ 680.434746] hub 2-1:1.0: USB hub found
[ 680.447752] hub 2-1:1.0: 4 ports detected
[ 680.560138] usb 1-3: new high-speed USB device number 8 using tegra-xhci
[ 680.578810] usb 1-3: New USB device found, idVendor=2109, idProduct=2811
[ 680.578846] usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 680.578857] usb 1-3: Product: USB2.0 Hub
[ 680.578863] usb 1-3: Manufacturer: VIA Labs, Inc.
[ 680.583850] hub 1-3:1.0: USB hub found
[ 680.584505] hub 1-3:1.0: 4 ports detected
[ 680.822781] usb 2-1.1: new SuperSpeed USB device number 11 using tegra-xhci
[ 680.834316] usb 2-1.1: Parent hub missing LPM exit latency info. Power management will be impacted.
[ 680.835902] usb 2-1.1: New USB device found, idVendor=2560, idProduct=c151
[ 680.835922] usb 2-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 680.835937] usb 2-1.1: Product: See3CAMCU50
[ 680.835951] usb 2-1.1: Manufacturer: e-consystems
[ 680.838474] uvcvideo: Found UVC 1.00 device See3CAMCU50 (2560:c151)
[ 680.840995] input: See3CAMCU50 as /devices/platform/tegra-xhci/usb2/2-1/2-1.1/2-1.1:1.0/input/input10
[ 680.848311] hid-generic 0003:2560:C151.0009: hidraw0: USB HID v1.11 Device [e-consystems See3CAMCU50] on usb-tegra-xhci-1.1/input2
[ 680.914464] usb 2-1.2: new SuperSpeed USB device number 12 using tegra-xhci
[ 680.925859] usb 2-1.2: Parent hub missing LPM exit latency info. Power management will be impacted.
[ 680.927522] usb 2-1.2: New USB device found, idVendor=2560, idProduct=c151
[ 680.927533] usb 2-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 680.927542] usb 2-1.2: Product: See3CAMCU50
[ 680.927548] usb 2-1.2: Manufacturer: e-consystems
[ 680.930525] uvcvideo: Found UVC 1.00 device See3CAMCU50 (2560:c151)
[ 680.933258] input: See3CAMCU50 as /devices/platform/tegra-xhci/usb2/2-1/2-1.2/2-1.2:1.0/input/input11
[ 680.936655] hid-generic 0003:2560:C151.000A: hidraw1: USB HID v1.11 Device [e-consystems See3CAMCU50] on usb-tegra-xhci-1.2/input2
Output of lsusb -t
lsusb -t
/: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=tegra-ehci/1p, 480M
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=tegra-ehci/1p, 480M
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
|__ Port 1: Dev 13, If 0, Class=Video, Driver=uvcvideo, 480M
|__ Port 1: Dev 13, If 1, Class=Video, Driver=uvcvideo, 480M
|__ Port 1: Dev 13, If 2, Class=Human Interface Device, Driver=usbhid, 480M
|__ Port 2: Dev 11, If 0, Class=Video, Driver=uvcvideo, 480M
|__ Port 2: Dev 11, If 1, Class=Video, Driver=uvcvideo, 480M
|__ Port 2: Dev 11, If 2, Class=Human Interface Device, Driver=usbhid, 480M
|__ Port 3: Dev 3, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
|__ Port 4: Dev 4, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=tegra-ehci/1p, 480M
Output of lsusb -vv (relevant part, device description was shortened, if you need more info I can post the full version)
Bus 002 Device 012: ID 2560:c151
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 3.00
bDeviceClass 239 Miscellaneous Device
bDeviceSubClass 2 ?
bDeviceProtocol 1 Interface Association
bMaxPacketSize0 9
idVendor 0x2560
idProduct 0xc151
bcdDevice 0.00
iManufacturer 1 e-consystems
iProduct 2 See3CAMCU50
iSerial 0
bNumConfigurations 1
Binary Object Store Descriptor:
bLength 5
bDescriptorType 15
wTotalLength 22
bNumDeviceCaps 2
USB 2.0 Extension Device Capability:
bLength 7
bDescriptorType 16
bDevCapabilityType 2
bmAttributes 0x00000000
(Missing must-be-set LPM bit!)
SuperSpeed USB Device Capability:
bLength 10
bDescriptorType 16
bDevCapabilityType 3
bmAttributes 0x00
wSpeedsSupported 0x000e
Device can operate at Full Speed (12Mbps)
Device can operate at High Speed (480Mbps)
Device can operate at SuperSpeed (5Gbps)
bFunctionalitySupport 3
Lowest fully-functional device speed is SuperSpeed (5Gbps)
bU1DevExitLat 0 micro seconds
bU2DevExitLat 0 micro seconds
Device Status: 0x0000
(Bus Powered)
Using L4T R21.3
Aquiring frames from both cameras at the same time result in having one of the two video streaming blocked or not working. I used vlc, guvcview and cheese to test it.
I also made a small executable acquiring frames from the camera using v4l2 api and send them through the network to another pc to visualize. Acquisition in YUV format was done in a thread and convertion YUV->rgb + network send was done on a different thread.
The result were the following:
Using a single camera I was able to acquire frames at the declared framerate
-
Resolution --> declared rate / measured rate
- 640x480 --> 30fps / 30fps
- 1920x1080 --> 15fps / 15fps
- 1280x720 --> 30fps / 30fps
- 2592x1944 --> 8fps / 8fps
For the maximum resolution however I had to require a single buffer diring camera initialization, otherwise I got the folllowing error:
“Insufficient buffer memory on- /dev/video0 – VIDIOC_REQBUFS error 12, Cannot allocate memory”
When I try to use 2 cameras at the same time the result were similar, I was able to read from both cameras at the declared framerate execept for the highest. In that case the second camera doens’t start and it give me the same error as before.
Using a different camera http://shop.leopardimaging.com/product.sc?productId=213&categoryId=34, the result was similar, using one single camera I was able to read all different resolution at the declared framerate while using 2 cameras at the saame time for high resolution one works while the other is blocked.
Using L4T R21.4
I did the update and the situation is a bit worse.
Using one camera it works fine.
Using VLC with 2 cameras I get corrupted images full with horizontal green and pink lines. The image is not understandable at all. guvcview and cheese doesn’t start giving the following errors
ubuntu@tegra-ubuntu:~$ guvcview
guvcview 1.7.1
file guvcview_video.mkv has extension type 1
file guvcview_image.jpg has extension type 0
file guvcview_image.jpg has extension type 0
Video file suffix detected: 0
Image file suffix detected: 0
ALSA lib pcm_dsnoop.c:618:(snd_pcm_dsnoop_open) unable to open slave
ALSA lib pcm_dmix.c:1022:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
ALSA lib pcm_dmix.c:961:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
ALSA lib pcm_dmix.c:1022:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm_dmix.c:1022:(snd_pcm_dmix_open) unable to open slave
FATAL: cannot locate cpu MHz in /proc/cpuinfo
ubuntu@tegra-ubuntu:~$ cheese
JPEG parameter struct mismatch: library thinks size is 432, caller expects 488
NvEglHandle: Unfreed handle of upon egl deinit: type=1 refcnt=1
NvEglHandle: Unfreed handle of upon egl deinit: type=2 refcnt=1
NvEglHandle: Unfreed handle of upon egl deinit: type=2 refcnt=1
Probably this particular error is related to an incorrect installation, isn’t it? can you give some advice for this?
Using my code (Iuse memory mapping method) I see the select function on the video device file returning with timeout (1sec) and I’m not able to read.
The problem starts as soon as I start acquiring from the second camera. Both give timeout and I cannot read from them, regardless of the resolution.
So how can I have the 2 streaming video working correctly? Any help will be really appreciated.
Thanks,
Alberto