Dear forum,
Recently, I have been trying to get the Omnivision OV2740 to work with the Jetson Xavier NX through the nvarguscamerasrc for ISP demosaicing. It is in RAW10, grbg format.
I manage to get a frame of working image using this:
v4l2-ctl --stream-mmap --stream-skip=100 --stream-count=1 -d /dev/video0 --stream-to=new-6.raw
However, attempting to use the nvarguscamerasrc for ISP demosaicing is where it fails. Running the following command does not seem to get any response from the camera, giving the following error:
bbd-desktop:~$ gst-launch-1.0 nvarguscamerasrc num-buffers=20 ! fakesink -e -v
[ 96.522203] ov2740 10-0036: ov2740_open:
[ 96.524043] ov2740 10-0036: ov2740_power_on: power on
[ 96.525774] ov2740 10-0036: ov2740_power_off: power off
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/GstNvArgusCameraSrc:nvarguscamerasrc0.GstPad:src: caps = video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)NV12, framerate=(fraction)30/1
/GstPipeline:pipeline0/GstFakeSink:fakesink0.GstPad:sink: caps = video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)NV12, framerate=(fraction)30/1
[ 97.165467] ov2740 10-0036: ov2740_power_on: power on
[ 97.165899] ov2740 10-0036: ov2740_power_off: power off
[ 97.169739] ov2740 10-0036: ov2740_power_on: power on
[ 97.171207] ov2740 10-0036: ov2740_power_off: power off
[ 97.205490] ov2740 10-0036: ov2740_power_on: power on
[ 97.205787] ov2740 10-0036: ov2740_power_off: power off
[ 97.207882] ov2740 10-0036: ov2740_power_on: power on
[ 97.208163] ov2740 10-0036: ov2740_power_off: power off
[ 97.209516] ov2740 10-0036: ov2740_power_on: power on
[ 97.209929] ov2740 10-0036: ov2740_power_off: power off
[ 97.211196] ov2740 10-0036: ov2740_power_on: power on
[ 97.211541] ov2740 10-0036: ov2740_power_off: power off
GST_ARGUS: Creating output stream
CONSUMER: Waiting until producer is connected...
GST_ARGUS: Available Sensor modes :
GST_ARGUS: 1920 x 1080 FR = 59.999999 fps Duration = 16666667 ; Analog Gain range min 0.000000, max 48.000000; Exposure Range min 1000, max 430000000;
GST_ARGUS: Running with following settings:
Camera index = 0
Camera mode = 0
Output Stream W = 1920 H = 1080
seconds to Run = 0
Frame Rate = 59.999999
GST_ARGUS: Setup Complete, Starting captures for 0 seconds
GST_ARGUS: Starting repeat capture requests.
CONSUMER: Producer has connected; continuing.
[ 97.607277] ov2740 10-0036: ov2740_power_on: power on
[ 97.616327] ov2740 10-0036: ov2740_set_gain: gain reg: 160
[ 97.863132] ov2740 10-0036: ov2740_set_gain: gain reg: 160
[ 97.863905] ov2740 10-0036: Stream Beginning in Function ov2740_start_streaming
[ 99.382081] tegra194-vi5 15c10000.vi: no reply from camera processor
[ 99.382275] tegra194-vi5 15c10000.vi: vi capture get status failed
[ 102.454035] tegra194-vi5 15c10000.vi: no reply from camera processor
[ 102.454212] tegra194-vi5 15c10000.vi: vi capture get status failed
[ 105.462074] tegra194-vi5 15c10000.vi: no reply from camera processor
[ 105.462241] tegra194-vi5 15c10000.vi: vi capture get status failed
[ 106.966078] tegra194-vi5 15c10000.vi: no reply from camera processor
[ 106.966253] tegra194-vi5 15c10000.vi: vi capture get status failed
^Chandling interrupt.
Interrupt: Stopping pipeline ...
EOS on shutdown enabled -- Forcing EOS on the pipeline
Here is my dts file (9.9 KB) for the camera that works with v4l2-ctl capture, but not with nvarguscamerasrc.
vi@15c10000 {
num-channels = <2>;
ports {
#address-cells = <1>;
#size-cells = <0>;
vi_port1: port@1 {
reg = <1>;
ov2740_vi_in1: endpoint {
port-index = <2>;
bus-width = <2>;
remote-endpoint = <&ov2740_csi_out1>;
};
};
};
};
nvcsi@15a00000 {
num-channels = <2>;
#address-cells = <1>;
#size-cells = <0>;
csi_chan1: channel@1 {
reg = <1>;
ports {
#address-cells = <1>;
#size-cells = <0>;
csi_chan1_port0: port@0 {
reg = <0>;
ov2740_csi_in1: endpoint@2 {
port-index = <2>;
bus-width = <2>;
remote-endpoint = <&ov2740_out1>;
};
};
csi_chan1_port1: port@1 {
reg = <1>;
ov2740_csi_out1: endpoint@3 {
remote-endpoint = <&ov2740_vi_in1>;
};
};
};
};
};
cam_i2cmux {
i2c_1: i2c@1 {
ov2740_cam1: ov2740@36 {
...
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
ov2740_out1: endpoint {
status = "okay";
port-index = <2>;
bus-width = <2>;
remote-endpoint = <&ov2740_csi_in1>;
};
};
};
};
};
};
};
I ran media_ctl and got this as a response:
bbd@bbd-desktop:~$ media-ctl -p
Media controller API version 0.1.0
Media device information
------------------------
driver tegra194-vi5
model NVIDIA Tegra Video Input Device
serial
bus info
hw revision 0x3
driver version 0.0.0
Device topology
- entity 1: 15a00000.nvcsi--2 (2 pads, 0 link)
type V4L2 subdev subtype Unknown flags 0
device node name /dev/v4l-subdev0
pad0: Sink
pad1: Source
- entity 4: 15a00000.nvcsi--1 (2 pads, 2 links)
type V4L2 subdev subtype Unknown flags 0
device node name /dev/v4l-subdev1
pad0: Sink
<- "ov2740 10-0036":0 [ENABLED]
pad1: Source
-> "vi-output, ov2740 10-0036":0 [ENABLED]
- entity 7: ov2740 10-0036 (1 pad, 1 link)
type V4L2 subdev subtype Sensor flags 0
device node name /dev/v4l-subdev2
pad0: Source
[ 40.165799] ov2740 10-0036: ov2740_open:
[fmt:SGRBG10_1X10/1920x1080 field:none colorspace:srgb]
-> "15a00000.nvcsi--1":0 [ENABLED]
- entity 9: vi-output, ov2740 10-0036 (1 pad, 1 link)
type Node subtype V4L flags 0
device node name /dev/video0
pad0: Sink
<- "15a00000.nvcsi--1":1 [ENABLED]
Currently, this camera is connected to J9 of the Jetson NX development board - listed as CSI 2 in Figure 2.8 of the Camera Module Hardware Design Guide. This CSI is denoted as CSI-C on the Port Index.
I have updated my dts file (5.4 KB) so that the camera points from CSI-C to Port 2 of CSI to Stream 2 of VI (within this diagram) with the following dts and the same error persists (and now although probe works, /dev/video0 does not show up anymore):
vi@15c10000 {
num-channels = <2>;
ports {
#address-cells = <1>;
#size-cells = <0>;
vi_port_2: port@2 {
reg = <2>;
vi_stream_2: endpoint {
port-index = <2>;
bus-width = <2>;
remote-endpoint = <&csi_C_out>;
};
};
};
};
nvcsi@15a00000 {
num-channels = <2>;
#address-cells = <1>;
#size-cells = <0>;
csi_C_channel: channel@2 {
reg = <2>; // Port 2(CSI) is connected to CSI-C
ports {
#address-cells = <1>;
#size-cells = <0>;
csi_C_channel_port0: port@0 {
reg = <0>;
csi_C_in: endpoint@4 {
port-index = <2>;
bus-width = <2>;
remote-endpoint = <&ov2740_out1>;
};
};
csi_C_channel_port1: port@1 {
reg = <1>;
csi_C_out: endpoint@5 {
remote-endpoint = <&vi_stream_2>;
};
};
};
};
};
cam_i2cmux {
i2c_1: i2c@1 {
ov2740_cam1: ov2740@36 {
...
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
ov2740_out1: endpoint {
status = "okay";
port-index = <2>;
bus-width = <2>;
remote-endpoint = <&csi_C_in>;
};
};
};
};
};
};
I might have misunderstood a couple parameter, especially the endpoint indexing. Is there any obvious mistake I am making?