Hello,
I made cutom camera driver from nv_imx185.c.
and my camera is connected to mipi csi cphy with 3 lanes.
I tried to stream by v4l2-ctl but it is failed.
which part would be checked?
l45 version : 35.5.0
v4l2-ctl
$ v4l2-ctl -d /dev/video0 --set-fmt-video=width=3840,height=2160,pixelformat=RG10 \
> --set-ctrl bypass_mode=0 --stream-mmap --stream-count=3 --stream-to=test.raw --verbose
VIDIOC_QUERYCAP: ok
VIDIOC_S_EXT_CTRLS: ok
VIDIOC_G_FMT: ok
VIDIOC_S_FMT: ok
Format Video Capture:
Width/Height : 3840/2160
Pixel Format : 'RG10' (10-bit Bayer RGRG/GBGB)
Field : None
Bytes per Line : 7680
Size Image : 16588800
Colorspace : sRGB
Transfer Function : Default (maps to sRGB)
YCbCr/HSV Encoding: Default (maps to ITU-R 601)
Quantization : Default (maps to Full Range)
Flags :
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: 16588800 ts: 0.000000 (error, ts-monotonic, ts-src-eof)
cap dqbuf: 0 seq: 0 bytesused: 16588800 ts: 0.000000 (error, ts-monotonic, ts-src-eof)
cap dqbuf: 1 seq: 1 bytesused: 16588800 ts: 0.000000 (error, ts-monotonic, ts-src-eof)
cap dqbuf: 2 seq: 2 bytesused: 16588800 ts: 0.000000 (error, ts-monotonic, ts-src-eof)
cap dqbuf: 3 seq: 3 bytesused: 16588800 ts: 0.000000 (error, ts-monotonic, ts-src-eof)
cap dqbuf: 0 seq: 0 bytesused: 16588800 ts: 0.000000 (error, ts-monotonic, ts-src-eof)
cap dqbuf: 0 seq: 0 bytesused: 16588800 ts: 0.000000 (error, ts-monotonic, ts-src-eof)
cap dqbuf: 1 seq: 1 bytesused: 16588800 ts: 0.000000 (error, ts-monotonic, ts-src-eof)
cap dqbuf: 2 seq: 2 bytesused: 16588800 ts: 0.000000 (error, ts-monotonic, ts-src-eof)
cap dqbuf: 3 seq: 3 bytesused: 16588800 ts: 0.000000 (error, ts-monotonic, ts-src-eof)
kernel log
[ 281.519842] imx858 2-001a: imx858_power_on: power on
[ 281.550621] bwmgr API not supported
[ 281.561165] imx858 2-001a: imx858_set_mode mode: 0
[ 281.564790] imx858 2-001a: line_length_inck 716
[ 281.564792] imx858 2-001a: ivtpxck_period 64
[ 281.647164] imx858 2-001a: i2c write table, 0x0136 = 18
[ 281.647178] imx858 2-001a: imx858_start_streaming
[ 281.727827] imx858 2-001a: i2c write table, 0x0136 = 18
[ 281.968987] imx858 2-001a: i2c write table, 0x0100 = 01
[ 281.969200] imx858 2-001a: i2c read, 0x0005 = 07
[ 281.969203] imx858 2-001a: i2c read, 0x0100 = 01
[ 284.306137] tegra-camrtc-capture-vi tegra-capture-vi: uncorr_err: request timed out after 2500 ms
[ 284.315293] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: attempting to reset the capture channel
[ 284.324879] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 284.332648] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_close: Error in closing stream_id=0, csi_port=0
[ 284.343370] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 284.351419] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: successfully reset the capture channel
[ 286.862150] tegra-camrtc-capture-vi tegra-capture-vi: uncorr_err: request timed out after 2500 ms
[ 286.871311] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: attempting to reset the capture channel
[ 286.880978] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 286.888740] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_close: Error in closing stream_id=0, csi_port=0
[ 286.899440] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 287.922135] tegra194-vi5 13e40000.host1x:vi0@15c00000: capture control message timed out
[ 287.930537] tegra194-vi5 13e40000.host1x:vi0@15c00000: vi_capture_control_send_message: failed to send IVC control message
[ 288.974178] tegra194-vi5 13e40000.host1x:vi0@15c00000: capture control message timed out
[ 288.982610] tegra-camrtc-capture-vi tegra-capture-vi: vi capture setup failed
[ 288.989989] tegra-camrtc-capture-vi tegra-capture-vi: fatal: error recovery failed
trace log
# tracer: nop
#
# entries-in-buffer/entries-written: 23/23 #P:12
#
# _-----=> irqs-off
# / _----=> need-resched
# | / _---=> hardirq/softirq
# || / _--=> preempt-depth
# ||| / delay
# TASK-PID CPU# |||| TIMESTAMP FUNCTION
# | | | |||| | |
kworker/8:2-165 [008] .... 162.646345: rtcpu_string: tstamp:5963914735 id:0x04010000 str:"VM0 deactivating."
v4l2-ctl-3654 [005] .... 281.499616: tegra_channel_open: vi-output, imx858 2-001a
v4l2-ctl-3654 [005] .... 281.519819: tegra_channel_set_power: imx858 2-001a : 0x1
v4l2-ctl-3654 [005] .... 281.519832: camera_common_s_power: status : 0x1
v4l2-ctl-3654 [000] .... 281.537951: tegra_channel_set_power: 13e40000.host1x:nvcsi@15a00000- : 0x1
v4l2-ctl-3654 [000] .... 281.537956: csi_s_power: enable : 0x1
v4l2-ctl-3654 [000] .... 281.538611: tegra_channel_capture_setup: vnc_id 0 W 3840 H 2160 fmt c4
v4l2-ctl-3654 [002] .... 281.547116: tegra_channel_set_stream: enable : 0x1
v4l2-ctl-3654 [003] .... 281.560704: tegra_channel_set_stream: 13e40000.host1x:nvcsi@15a00000- : 0x1
v4l2-ctl-3654 [003] .... 281.560708: csi_s_stream: enable : 0x1
v4l2-ctl-3654 [003] .... 281.561145: tegra_channel_set_stream: imx858 2-001a : 0x1
kworker/8:2-165 [008] .... 281.578139: rtcpu_string: tstamp:9679397988 id:0x04010000 str:"VM0 activating."
kworker/8:2-165 [008] .... 281.578143: rtcpu_vinotify_event: tstamp:9679917019 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:309747000576 data:0x359d580010000000
kworker/8:2-165 [008] .... 281.578143: rtcpu_vinotify_event: tstamp:9679917193 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:309747007040 data:0x0000000031000001
kworker/8:2-165 [008] .... 281.578143: rtcpu_vinotify_event: tstamp:9679917388 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:309747052864 data:0x359d550010000000
kworker/8:2-165 [008] .... 281.578144: rtcpu_vinotify_event: tstamp:9679917556 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:309747059424 data:0x0000000031000002
vi-output, imx8-3656 [000] .... 284.351271: tegra_channel_capture_setup: vnc_id 0 W 3840 H 2160 fmt c4
kworker/8:2-165 [008] .... 284.398150: rtcpu_vinotify_event: tstamp:9767483054 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:312551408960 data:0x359d580010000000
kworker/8:2-165 [008] .... 284.398153: rtcpu_vinotify_event: tstamp:9767483189 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:312551434560 data:0x0000000031000001
kworker/8:2-165 [008] .... 284.398153: rtcpu_vinotify_event: tstamp:9767483342 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:312551445088 data:0x359d550010000000
kworker/8:2-165 [008] .... 284.398153: rtcpu_vinotify_event: tstamp:9767483474 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:312551481344 data:0x0000000031000002
vi-output, imx8-3656 [000] .... 287.942554: tegra_channel_capture_setup: vnc_id 0 W 3840 H 2160 fmt c4
kworker/8:2-165 [008] .... 295.222147: rtcpu_string: tstamp:10105636302 id:0x04010000 str:"VM0 deactivating."
device tree setting
/ {
overlay-name = "Jetson Camera IMX858";
jetson-header-name = "Jetson AGX CSI Connector";
compatible = "nvidia,p3737-0000+p3701-0000" , "nvidia,p3737-0000+p3701-0004", "nvidia,p3737-0000+p3701-0005", "nvidia,p3737-0000+p3701-0008";
fragment@0 {
target-path = "/";
__overlay__ {
tegra-capture-vi {
num-channels = <1>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
status = "okay";
liimx858_vi_in0: endpoint {
status = "okay";
port-index = <0>;
bus-width = <3>;
remote-endpoint = <&liimx858_csi_out0>;
};
};
};
};
host1x@13e00000 {
nvcsi@15a00000 {
num-channels = <1>;
#address-cells = <1>;
#size-cells = <0>;
channel@0 {
status = "okay";
reg = <0>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
status = "okay";
reg = <0>;
liimx858_csi_in0: endpoint@0 {
status = "okay";
port-index = <0>;
bus-width = <3>;
remote-endpoint = <&liimx858_imx858_out0>;
};
};
port@1 {
status = "okay";
reg = <1>;
liimx858_csi_out0: endpoint@1 {
status = "okay";
remote-endpoint = <&liimx858_vi_in0>;
};
};
};
};
};
};
i2c@3180000 {
imx858_a@1a {
status = "okay";
compatible = "nvidia,imx858";
reg = <0x1a>;
#address-cells = <1>;
#size-cells = <0>;
avdd-reg = "vana";
vana-supply = <&p3737_avdd_cam_2v8>;
clocks = <&bpmp_clks TEGRA234_CLK_EXTPERIPH1>,
<&bpmp_clks TEGRA234_CLK_EXTPERIPH1>;
clock-names = "extperiph1", "pllp_grtba";
mclk = "extperiph1";
reset-gpios = <&tegra_main_gpio CAM0_RST_L GPIO_ACTIVE_HIGH>;
devnode = "video0";
/* Physical dimensions of sensor */
physical_w = "15.0";
physical_h = "12.5";
sensor_model ="imx858";
post_crop_frame_drop = "0";
/* Convert Gain to unit of dB (decibel) befor passing to kernel driver */
use_decibel_gain = "true";
/* if true, delay gain setting by one frame to be in sync with exposure */
delayed_gain = "true";
/* enable CID_SENSOR_MODE_ID for sensor modes selection */
use_sensor_mode_id = "true";
mode0 { /*mode IMX858_MODE_3840X2160_10BIT_30FPS*/
mclk_khz = "24000";
num_lanes = "3";
tegra_sinterface = "serial_a";
phy_mode = "CPHY";
discontinuous_clk = "no";
dpcm_enable = "false";
cil_settletime = "0";
dynamic_pixel_bit_depth = "10";
csi_pixel_bit_depth = "10";
mode_type = "bayer";
pixel_phase = "rggb";
active_w = "3840";
active_h = "2160";
readout_orientation = "0";
line_length = "4536"; /* pixel clock*/
inherent_gain = "1";
pix_clk_hz = "608228571"; /* pixel rate */
line_length_inck = "716";
ivtpxck_period ="64"; /*155.2MHz ivtpxck period, unit 0.1 nsec */
gain_factor = "10";
min_gain_val = "31"; /* 3.1 dB */
max_gain_val = "300"; /* 30 dB */
step_gain_val = "1"; /* 0.1 */
default_gain = "31";
min_hdr_ratio = "1";
max_hdr_ratio = "1";
framerate_factor = "1000000";
min_framerate = "1500000"; /* 1.5 */
max_framerate = "60000000"; /* 30 */
step_framerate = "1";
default_framerate= "30000000";
exposure_factor = "1000000";
min_exp_time = "30"; /* us */
max_exp_time = "660000"; /* us */
step_exp_time = "1";
default_exp_time = "33334";/* us */
embedded_metadata_height = "2";
};
mode1 { /*mode IMX858_MODE_4032X3024_10BIT_30FPS*/
mclk_khz = "24000";
num_lanes = "3";
tegra_sinterface = "serial_a";
phy_mode = "CPHY";
discontinuous_clk = "no";
dpcm_enable = "false";
cil_settletime = "0";
dynamic_pixel_bit_depth = "10";
csi_pixel_bit_depth = "10";
mode_type = "bayer";
pixel_phase = "rggb";
active_w = "4032";
active_h = "3024";
readout_orientation = "0";
line_length = "5783"; /* pixel clock*/
inherent_gain = "1";
pix_clk_hz = "548571429"; /* pixel rate */
line_length_inck = "1012";
ivtpxck_period ="45"; /*219.6MHz ivtpxck period, unit 0.1 nsec */
gain_factor = "10";
min_gain_val = "31"; /* 3.1 dB */
max_gain_val = "300"; /* 30 dB */
step_gain_val = "2"; /* 0.1 */
default_gain = "31";
min_hdr_ratio = "1";
max_hdr_ratio = "1";
framerate_factor = "1000000";
min_framerate = "1500000"; /* 1.5 */
max_framerate = "30000000"; /* 30 */
step_framerate = "1";
default_framerate= "30000000";
exposure_factor = "1000000";
min_exp_time = "30"; /* us */
max_exp_time = "660000"; /* us */
step_exp_time = "1";
default_exp_time = "33334";/* us */
embedded_metadata_height = "2";
};
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
liimx858_imx858_out0: endpoint {
port-index = <0>;
bus-width = <3>;
remote-endpoint = <&liimx858_csi_in0>;
};
};
};
};
};
tegra-camera-platform {
compatible = "nvidia, tegra-camera-platform";
num_csi_lanes = <3>;
max_lane_speed = <2400000>;
min_bits_per_pixel = <10>;
vi_peak_byte_per_pixel = <2>;
vi_bw_margin_pct = <25>;
isp_peak_byte_per_pixel = <5>;
isp_bw_margin_pct = <25>;
modules {
module0 {
status = "okay";
badge = "imx858_bottom_liimx858";
position = "bottom";
orientation = "0";
drivernode0 {
status = "okay";
pcl_id = "v4l2_sensor";
devname = "imx858 2-001a";
proc-device-tree = "/proc/device-tree/i2c@3180000/imx858_a@1a";
};
drivernode1 {
status = "okay";
pcl_id = "v4l2_lens";
};
};
};
};//tegra-camera-platform
}; //__overlay__
};
};