Our hardware is based on an FPGA device that takes SDI input and outputs CSI data.
The device is self-driven, so there is no I²C interface required for configuration.
We are developing a driver on the AGX Orin platform to support it.
In the driver, the I²C part is ignored, and we are able to successfully create the /dev/video0 node.
Required modifications in the Device Tree have also been completed.
Now, we are trying to receive CSI-2 data without I2C from an FPGA on AGX Orian (36.4.3). the device is still unable to capture frames. Although /dev/video0 appears successfully. need help to debug these issues
We are using v4l2-ctl to try to capture the data.
#v4l2-ctl -d /dev/video0 --stream-mmap --stream-count=5 --verbose
VIDIOC_QUERYCAP: ok
VIDIOC_REQBUFS returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_STREAMON returned 0 (Success)
cap dqbuf: 0 seq: 0 bytesused: 4147200 ts: 0.000000 (error, ts-monotonic, ts-src-eof)
cap dqbuf: 0 seq: 0 bytesused: 4147200 ts: 0.000000 (error, ts-monotonic, ts-src-eof)
cap dqbuf: 1 seq: 1 bytesused: 4147200 ts: 0.000000 (error, ts-monotonic, ts-src-eof)
cap dqbuf: 2 seq: 2 bytesused: 4147200 ts: 0.000000 (error, ts-monotonic, ts-src-eof)
cap dqbuf: 3 seq: 3 bytesused: 4147200 ts: 0.000000 (error, ts-monotonic, ts-src-eof)
cap dqbuf: 0 seq: 0 bytesused: 4147200 ts: 0.000000 (error, ts-monotonic, ts-src-eof)
cap dqbuf: 0 seq: 0 bytesused: 4147200 ts: 0.000000 (error, ts-monotonic, ts-src-eof)
cap dqbuf: 1 seq: 1 bytesused: 4147200 ts: 0.000000 (error, ts-monotonic, ts-src-eof)
cap dqbuf: 2 seq: 2 bytesused: 4147200 ts: 0.000000 (error, ts-monotonic, ts-src-eof)
cap dqbuf: 3 seq: 3 bytesused: 4147200 ts: 0.000000 (error, ts-monotonic, ts-src-eof)
#dmesg log-
fpga_dev_open
[75462.407171] fpga-media 2-0036: fpga_dev_open:
[75542.177243] power_on
[75542.188172] _set_mode
[75542.188178] fpga_dev_start_streaming
[75542.188179] fpga_dev_start_streaming -done
[75544.849309] tegra-camrtc-capture-vi tegra-capture-vi: uncorr_err: request timed out after 2500 ms
[75544.849333] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: attempting to reset the capture channel
[75544.850583] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: successfully reset the capture channel
[75547.409428] tegra-camrtc-capture-vi tegra-capture-vi: uncorr_err: request timed out after 2500 ms
[75547.409448] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: attempting to reset the capture channel
[75547.410694] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: successfully reset the capture channel
[75549.937575] tegra-camrtc-capture-vi tegra-capture-vi: uncorr_err: request timed out after 2500 ms
[75549.937591] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: attempting to reset the capture channel
[75549.938819] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: successfully reset the capture channel
#media-ctl -p
Media controller API version 5.15.148
Media device information
driver tegra-camrtc-ca
model NVIDIA Tegra Video Input Device
serial
bus info
hw revision 0x3
driver version 5.15.148
Device topology
-
entity 1: 13e00000.host1x:nvcsi@15a00000- (2 pads, 2 links)
type V4L2 subdev subtype Unknown flags 0
device node name /dev/v4l-subdev0
pad0: Sink
← “fpga-media 2-0036”:0 [ENABLED]
pad1: Source
→ “vi-output, fpga-media 2-0036”:0 [ENABLED] -
entity 4: fpga-media 2-0036 (1 pad, 1 link)
type V4L2 subdev subtype Sensor flags 0
device node name /dev/v4l-subdev1
pad0: Source
[fmt:UYVY8_1X16/1920x1080@1/60 field:none colorspace:srgb]
→ “13e00000.host1x:nvcsi@15a00000-”:0 [ENABLED] -
entity 6: vi-output, fpga-media 2-0036 (1 pad, 1 link)
type Node subtype V4L flags 0
device node name /dev/video0
pad0: Sink
← “13e00000.host1x:nvcsi@15a00000-”:1 [ENABLED]
We are using following way to trace log to see NVCSI/VI activity but not receive any frame
echo 1 > /sys/kernel/debug/tracing/events/camera_common/enable
cat /sys/kernel/debug/tracing/trace_pipe
<…>-5274 [003] … 79509.386783: tegra_channel_open: vi-output, fpga-media 2-0036
v4l2-ctl-5274 [003] … 79509.414745: tegra_channel_set_power: fpga-media 2-0036 : 0x1
v4l2-ctl-5274 [003] … 79509.414761: camera_common_s_power: status : 0x1
v4l2-ctl-5274 [003] … 79509.414776: tegra_channel_set_power: 13e00000.host1x:nvcsi@15a00000- : 0x1
v4l2-ctl-5274 [003] … 79509.414778: csi_s_power: enable : 0x1
v4l2-ctl-5274 [003] … 79509.415531: tegra_channel_capture_setup: vnc_id 0 W 1920 H 1080 fmt 13
<…>-5275 [007] … 79509.425123: vi_task_submit: class_id:48 ch:0 syncpt_id:11 syncpt_thresh:0 pid:5275 tid:5275
vi-output, fpga-5275 [007] … 79509.425142: vi_task_submit: class_id:48 ch:0 syncpt_id:11 syncpt_thresh:0 pid:5275 tid:5275
vi-output, fpga-5275 [007] … 79509.425147: vi_task_submit: class_id:48 ch:0 syncpt_id:11 syncpt_thresh:0 pid:5275 tid:5275
vi-output, fpga-5275 [007] … 79509.425149: vi_task_submit: class_id:48 ch:0 syncpt_id:11 syncpt_thresh:0 pid:5275 tid:5275
v4l2-ctl-5274 [000] … 79509.425313: tegra_channel_set_stream: enable : 0x1
v4l2-ctl-5274 [000] … 79509.425914: tegra_channel_set_stream: 13e00000.host1x:nvcsi@15a00000- : 0x1
v4l2-ctl-5274 [000] … 79509.425917: csi_s_stream: enable : 0x1
v4l2-ctl-5274 [000] … 79509.426224: tegra_channel_set_stream: fpga-media 2-0036 : 0x1
vi-output, fpga-5276 [002] … 79512.162137: tegra_channel_capture_setup: vnc_id 0 W 1920 H 1080 fmt 13
vi-output, fpga-5275 [007] … 79512.162504: vi_task_submit: class_id:48 ch:0 syncpt_id:11 syncpt_thresh:0 pid:5275 tid:5275
vi-output, fpga-5275 [007] … 79512.162520: vi_task_submit: class_id:48 ch:0 syncpt_id:11 syncpt_thresh:0 pid:5275 tid:5275
vi-output, fpga-5275 [007] … 79512.162521: vi_task_submit: class_id:48 ch:0 syncpt_id:11 syncpt_thresh:0 pid:5275 tid:5275
vi-output, fpga-5275 [007] … 79512.162523: vi_task_submit: class_id:48 ch:0 syncpt_id:11 syncpt_thresh:0 pid:5275 tid:5275
vi-output, fpga-5276 [002] … 79514.722351: tegra_channel_capture_setup: vnc_id 0 W 1920 H 1080 fmt 13
vi-output, fpga-5275 [000] … 79514.722565: vi_task_submit: class_id:48 ch:0 syncpt_id:11 syncpt_thresh:0 pid:5275 tid:5275
vi-output, fpga-5275 [000] … 79514.722599: vi_task_submit: class_id:48 ch:0 syncpt_id:11 syncpt_thresh:0 pid:5275 tid:5275
vi-output, fpga-5275 [000] … 79514.722609: vi_task_submit: class_id:48 ch:0 syncpt_id:11 syncpt_thresh:0 pid:5275 tid:5275
vi-output, fpga-5275 [000] … 79514.722611: vi_task_submit: class_id:48 ch:0 syncpt_id:11 syncpt_thresh:0 pid:5275 tid:5275
Sharing dts mode0 value define for FPGA device
mode0 {
mclk_khz = “24000”; //as a dummy
status = “okay”;
num_lanes = “4”;
tegra_sinterface = “serial_a”; //CSI2 port A
phy_mode = “DPHY”;
discontinuous_clk = “no”;
//discontinuous_clk = “yes”;
dpcm_enable = “false”;
csi_pixel_bit_depth = “16”;
mode_type = “yuv”;
pixel_phase = “uyvy”;
cil_settletime = “0”;
active_w = “1920”;
active_h = “1080”;
line_length = “3840”;
inherent_gain = “1”;
mclk_multiplier = “6.67”;
pix_clk_hz = “124416000”; //
//pix_clk_hz = “148500000”; //
gain_factor = “10”;
min_gain_val = “10”;
max_gain_val = “160”;
step_gain_val = “1”;
default_gain = “10”;
min_hdr_ratio = “1”;
max_hdr_ratio = “1”;
framerate_factor = “1000000”;
min_framerate = “1816577”;
max_framerate = “30000000”;
step_framerate = “1”;
default_framerate = “30000000”;
exposure_factor = “1000000”;
min_exp_time = “34”;
max_exp_time = “550385”;
step_exp_time = “1”;
default_exp_time = “33334”;
// embedded_metadata_height = “0”;
//test_pattern_en = “1”;
};


