I’m using Jetson TX2 SoM with L4T 32.4.3, JetPack 4.4 and two OV9782 cameras connected via
2x DS90UB953-Q1 and DS90UB954-Q1 FPD-Link III deserializer to the CSI-A/CSI-B ports, using
4 data lanes and one clock lane. This requires using CSI2 virtual channels, so I’m using a configuration
with virtual channels VC0 and VC1.
The OV9782 camera driver was developed by Nvidia partner D3 Engineering and works without issues,
I can stream from both cameras simultaneously either as raw images with v4l2-ctl tool or in ISP mode
(using Argus/GStreamer). Below some more info about the cameras/interfaces:
$ media-ctl -p
Media controller API version 0.1.0
Media device information
------------------------
driver tegra-vi4
model NVIDIA Tegra Video Input Device
serial
bus info
hw revision 0x3
driver version 0.0.0
Device topology
- entity 1: 150c0000.nvcsi--6 (2 pads, 2 links)
type V4L2 subdev subtype Unknown flags 0
device node name /dev/v4l-subdev0
pad0: Sink
<- "ov9782d3 9-0060":0 [ENABLED]
pad1: Source
-> "vi-output, ov9782d3 9-0060":0 [ENABLED]
- entity 4: 150c0000.nvcsi--5 (2 pads, 2 links)
type V4L2 subdev subtype Unknown flags 0
device node name /dev/v4l-subdev1
pad0: Sink
<- "ov9782d3 10-0060":0 [ENABLED]
pad1: Source
-> "vi-output, ov9782d3 10-0060":0 [ENABLED]
- entity 7: ov9782d3 10-0060 (1 pad, 1 link)
type V4L2 subdev subtype Sensor flags 0
device node name /dev/v4l-subdev2
pad0: Source
[fmt:SBGGR10_1X10/1280x800 field:none colorspace:srgb]
-> "150c0000.nvcsi--5":0 [ENABLED]
- entity 9: vi-output, ov9782d3 10-0060 (1 pad, 1 link)
type Node subtype V4L flags 0
device node name /dev/video0
pad0: Sink
<- "150c0000.nvcsi--5":1 [ENABLED]
- entity 23: ov9782d3 9-0060 (1 pad, 1 link)
type V4L2 subdev subtype Sensor flags 0
device node name /dev/v4l-subdev3
pad0: Source
[fmt:SBGGR10_1X10/1280x800 field:none colorspace:srgb]
-> "150c0000.nvcsi--6":0 [ENABLED]
- entity 25: vi-output, ov9782d3 9-0060 (1 pad, 1 link)
type Node subtype V4L flags 0
device node name /dev/video1
pad0: Sink
<- "150c0000.nvcsi--6":1 [ENABLED]
$ argus_oneshot -l
Executing Argus Sample: argus_oneshot
2 Available CameraDevices:
==== CameraDevice 0: =========================================
UUID: adca2c00,0f01,11e5,0000,00,00,00,00,00,00
MaxAeRegions: 64
MaxAwbRegions: 64
FocusPositionRange: [0, 0]
LensApertureRange: [2.970000, 2.970000]
IspDigitalGainRange: [1.000000, 256.000000]
ExposureCompensationRange: [-2.000000, 2.000000]
NumSensorModes: 2
SensorMode 0:
Resolution: 1280x800
ExposureTimeRange: [9000, 10000000]
FrameDurationRange: [50000000, 1000001024]
(1.00 to 20.00 fps)
AnalogGainRange: [1.000000, 15.937500]
InputBitDepth: 10
OutputBitDepth: 10
SensorModeType: SENSOR_MODE_TYPE_BAYER
IS WDR Mode: No
SensorMode 1:
Resolution: 1280x800
ExposureTimeRange: [68000, 20000000]
FrameDurationRange: [20000000, 1000001024]
(1.00 to 50.00 fps)
AnalogGainRange: [1.000000, 255.000000]
InputBitDepth: 10
OutputBitDepth: 10
SensorModeType: SENSOR_MODE_TYPE_BAYER
IS WDR Mode: No
==== CameraDevice 1: =========================================
UUID: adca2c00,0f01,11e5,0001,00,00,00,00,00,00
MaxAeRegions: 64
MaxAwbRegions: 64
FocusPositionRange: [0, 0]
LensApertureRange: [2.970000, 2.970000]
IspDigitalGainRange: [1.000000, 256.000000]
ExposureCompensationRange: [-2.000000, 2.000000]
NumSensorModes: 2
SensorMode 0:
Resolution: 1280x800
ExposureTimeRange: [9000, 10000000]
FrameDurationRange: [50000000, 1000001024]
(1.00 to 20.00 fps)
AnalogGainRange: [1.000000, 15.937500]
InputBitDepth: 10
OutputBitDepth: 10
SensorModeType: SENSOR_MODE_TYPE_BAYER
IS WDR Mode: No
SensorMode 1:
Resolution: 1280x800
ExposureTimeRange: [68000, 20000000]
FrameDurationRange: [20000000, 1000001024]
(1.00 to 50.00 fps)
AnalogGainRange: [1.000000, 255.000000]
InputBitDepth: 10
OutputBitDepth: 10
SensorModeType: SENSOR_MODE_TYPE_BAYER
IS WDR Mode: No
Two simultaneous streams in VI mode work as expected, i.e.:
$ v4l2-ctl -d /dev/video0 -c bypass_mode=0 --stream-mmap --stream-count=1000
<<<<<<<<<<<<<<<<<<<<<< 20.19 fps
<<<<<<<<<<<<<<<<<<<< 20.19 fps
<<<<<<<<<<<<<<<<<<<< 20.13 fps
<<<<<<<<<<<<<<<<<<<< 20.14 fps
...
$ v4l2-ctl -d /dev/video1 -c bypass_mode=0 --stream-mmap --stream-count=1000
<<<<<<<<<<<<<<<<<<<<<< 20.19 fps
<<<<<<<<<<<<<<<<<<<< 20.19 fps
<<<<<<<<<<<<<<<<<<<< 20.13 fps
<<<<<<<<<<<<<<<<<<<< 20.14 fps
...
I can also stop and restart one stream (VC0 or VC1) while another stream (VC1 or VC0) is active.
Two simultaneous streams in ISP mode also work as expected, i.e.:
$ gst-launch-1.0 nvarguscamerasrc sensor-id=0 sensor-mode=0 ! "video/x-raw(memory:NVMM),width=1280,height=800,format=NV12,framerate=20/1" ! nvv4l2h264enc ! h264parse ! rtph264pay mtu=1400 ! udpsink host=192.168.10.30 port=5000
Setting pipeline to PAUSED ...
Opening in BLOCKING MODE
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Redistribute latency...
NvMMLiteOpen : Block : BlockType = 4
===== NVMEDIA: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 4
GST_ARGUS: Creating output stream
CONSUMER: Waiting until producer is connected...
GST_ARGUS: Available Sensor modes :
GST_ARGUS: 1280 x 800 FR = 20,000000 fps Duration = 50000000 ; Analog Gain range min 1,000000, max 15,937500; Exposure Range min 9000, max 10000000;
GST_ARGUS: 1280 x 800 FR = 50,000000 fps Duration = 20000000 ; Analog Gain range min 1,000000, max 255,000000; Exposure Range min 68000, max 20000000;
GST_ARGUS: Running with following settings:
Camera index = 0
Camera mode = 0
Output Stream W = 1280 H = 800
seconds to Run = 0
Frame Rate = 20,000000
GST_ARGUS: Setup Complete, Starting captures for 0 seconds
GST_ARGUS: Starting repeat capture requests.
CONSUMER: Producer has connected; continuing.
H264: Profile = 66, Level = 0
...
$ gst-launch-1.0 nvarguscamerasrc sensor-id=1 sensor-mode=0 ! "video/x-raw(memory:NVMM),width=1280,height=800,format=NV12,framerate=20/1" ! nvv4l2h264enc ! h264parse ! rtph264pay mtu=1400 ! udpsink host=192.168.10.30 port=5001
Setting pipeline to PAUSED ...
Opening in BLOCKING MODE
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Redistribute latency...
NvMMLiteOpen : Block : BlockType = 4
===== NVMEDIA: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 4
GST_ARGUS: Creating output stream
CONSUMER: Waiting until producer is connected...
GST_ARGUS: Available Sensor modes :
GST_ARGUS: 1280 x 800 FR = 20,000000 fps Duration = 50000000 ; Analog Gain range min 1,000000, max 15,937500; Exposure Range min 9000, max 10000000;
GST_ARGUS: 1280 x 800 FR = 50,000000 fps Duration = 20000000 ; Analog Gain range min 1,000000, max 255,000000; Exposure Range min 68000, max 20000000;
GST_ARGUS: Running with following settings:
Camera index = 1
Camera mode = 0
Output Stream W = 1280 H = 800
seconds to Run = 0
Frame Rate = 20,000000
GST_ARGUS: Setup Complete, Starting captures for 0 seconds
GST_ARGUS: Starting repeat capture requests.
CONSUMER: Producer has connected; continuing.
H264: Profile = 66, Level = 0
...
In ISP mode I can also stop and restart one stream (VC0 or VC1) while another stream (VC1 or VC0) is active.
But the customer requirement is to use one virtual channel (VC0 or VC1) in VI mode and another virtual channel (VC1 or VC0) in ISP mode. And I observed various critical bugs with this usage scenario.
First problem is that the running ISP stream (VC0) stops if I start another stream (VC1) with v4l2-ctl.
How to reproduce:
First, start the VC0 stream by:
$ gst-launch-1.0 nvarguscamerasrc sensor-id=0 sensor-mode=0 ! "video/x-raw(memory:NVMM),width=1280,height=800,format=NV12,framerate=20/1" ! nvv4l2h264enc ! h264parse ! rtph264pay mtu=1400 ! udpsink host=192.168.10.30 port=5000
and while it is running, start the VC1 stream in VI mode:
v4l2-ctl -d /dev/video0 -c bypass_mode=0 --stream-mmap --stream-count=1000
<<<<<<<<<<<<<<<<<<<<<< 20.19 fps
<<<<<<<<<<<<<<<<<<<< 20.19 fps
...
This results in the broken ISP stream, camera data for VC0 is not recieved any more.
Below are the log files from dmesg, trace buffer and nvargus-daemon (journalctl -u):
dmesg-isp-stream-0-interrupted-by-v4l2-ctl-0.txt (76.6 KB)
trace-isp-stream-0-interrupted-by-v4l2-ctl-0.txt (184.6 KB)
nvargus-daemon-isp-stream-0-interrupted-by-v4l2-ctl-0.txt (159.6 KB)
Similar problem appears if I first start the VC1 stream (in VI mode), then start the VC0 stream (in ISP mode). Now both streams are running as expected, but if I now interrupt the VC1 stream, the ISP stream stops and nvargus-daemon reports errors.
Commands to reproduce:
First start VC1 stream:
$ v4l2-ctl -d /dev/video0 -c bypass_mode=0 --stream-mmap --stream-count=1000
<<<<<<<<<<<<<<<<<<<<<< 20.19 fps
<<<<<<<<<<<<<<<<<<<< 20.19 fps
...
While this is running, start the VC0 stream:
$ gst-launch-1.0 nvarguscamerasrc sensor-id=0 sensor-mode=0 ! "video/x-raw(memory:NVMM),width=1280,height=800,format=NV12,framerate=20/1" ! nvv4l2h264enc ! h264parse ! rtph264pay mtu=1400 ! udpsink host=192.168.10.30 port=5000
Now interrupt the VC1 stream with CTRL-C, and the ISP stream stops immediately.
Below are the log files from the latter case:
dmesg-isp-stream-0-interrupted-by-v4l2-ctl-stop.txt (122.3 KB)
trace-isp-stream-0-interrupted-by-v4l2-ctl-stop.txt (323.0 KB)
nvargus-daemon-isp-stream-0-interrupted-by-v4l2-ctl-stop.txt (769.3 KB)
Similar problem was already reported before here:
https://forums.developer.nvidia.com/t/missing-argus-support-for-low-frame-resolution-cameras/178537/18
I think Nvidia can reproduce these bugs on Jetson TX2 with GMSL + IMX390 cameras.