Hi Mods,
For context I am porting e-con AR0230 cameras from AGX Orin development kit to a custom carrier board. Previous thread here, resolved most of the device tree issues.
Gstreamer command to launch camera:
gst-launch-1.0 -v v4l2src device="/dev/video0" ! video/x-raw,framerate=60/1,width=640,height=480,format=UYVY ! xvimagesink
Right now I’m trying to open the cameras and retrieve the video stream but I am face with this error in dmesg
:
[ 183.948740] Index = 0x0000 , format = 0x59565955, width = 640, height = 480, frate num = 60
[ 183.952423] Skipping Previous mode set ...
[ 184.159980] Index = 0x0000 , format = 0x59565955, width = 640, height = 480, frate num = 60
[ 184.159989] Skipping Previous mode set ...
[ 184.225705] bwmgr API not supported
[ 186.872605] tegra-camrtc-capture-vi tegra-capture-vi: uncorr_err: request timed out after 2500 ms
[ 186.885608] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: attempting to reset the capture channel
[ 186.896447] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 186.904308] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_close: Error in closing stream_id=0, csi_port=0
[ 186.915123] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 186.922988] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_open: VI channel not found for stream- 0 vc- 0
[ 186.934081] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: successfully reset the capture channel
[ 189.464551] tegra-camrtc-capture-vi tegra-capture-vi: uncorr_err: request timed out after 2500 ms
[ 189.473859] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: attempting to reset the capture channel
[ 189.484453] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 189.492268] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_close: Error in closing stream_id=0, csi_port=0
[ 189.503058] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 189.510871] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_open: VI channel not found for stream- 0 vc- 0
[ 189.521904] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: successfully reset the capture channel
[ 189.533705] mcu_cam_stream_off 269 CAM Get CMD Stream off Success !!
[ 189.533724] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 189.541601] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_close: Error in closing stream_id=0, csi_port=0
I tried following some of the threads which talks about debugging cameras through /sys/kernel/debug/tracing/trace
. Below are the commands I ran:
echo 1 > /sys/kernel/debug/bpmp/debug/clk/vi/mrq_rate_locked
echo 1 > /sys/kernel/debug/bpmp/debug/clk/isp/mrq_rate_locked
echo 1 > /sys/kernel/debug/bpmp/debug/clk/nvcsi/mrq_rate_locked
echo 1 > /sys/kernel/debug/bpmp/debug/clk/emc/mrq_rate_locked
###
cat /sys/kernel/debug/bpmp/debug/clk/vi/max_rate |tee /sys/kernel/debug/bpmp/debug/clk/vi/rate
832000000
cat /sys/kernel/debug/bpmp/debug/clk/isp/max_rate | tee /sys/kernel/debug/bpmp/debug/clk/isp/rate
1011200000
cat /sys/kernel/debug/bpmp/debug/clk/nvcsi/max_rate | tee /sys/kernel/debug/bpmp/debug/clk/nvcsi/rate
642900000
cat /sys/kernel/debug/bpmp/debug/clk/emc/max_rate | tee /sys/kernel/debug/bpmp/debug/clk/emc/rate
3199000000
###
echo 1 > /sys/kernel/debug/tracing/tracing_on
echo 30720 > /sys/kernel/debug/tracing/buffer_size_kb
echo 1 > /sys/kernel/debug/tracing/events/tegra_rtcpu/enable
echo 1 > /sys/kernel/debug/tracing/events/freertos/enable
echo 2 > /sys/kernel/debug/camrtc/log-level
echo 1 > /sys/kernel/debug/tracing/events/camera_common/enable
echo > /sys/kernel/debug/tracing/trace
cat /sys/kernel/debug/tracing/trace
returns below log after trying to launch gstreamer which has the error:
rtcpu_vinotify_event: tstamp:6526856137 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:208848999168 data:0x379d580010000000
.
root@miivii-tegra:/home/nvidia# cat /sys/kernel/debug/tracing/trace
# tracer: nop
#
# entries-in-buffer/entries-written: 35/35 #P:8
#
# _-----=> irqs-off
# / _----=> need-resched
# | / _---=> hardirq/softirq
# || / _--=> preempt-depth
# ||| / delay
# TASK-PID CPU# |||| TIMESTAMP FUNCTION
# | | | |||| | |
kworker/2:4-669 [002] .... 176.192580: rtcpu_string: tstamp:6275481431 id:0x04010000 str:"VM0 deactivating."
gst-launch-1.0-7245 [006] .... 183.675355: tegra_channel_open: vi-output, ar0230 2-0043
gst-launch-1.0-7245 [006] .... 183.675424: tegra_channel_close: vi-output, ar0230 2-0043
gst-launch-1.0-7245 [006] .... 183.675432: tegra_channel_open: vi-output, ar0230 2-0044
gst-launch-1.0-7245 [006] .... 183.675442: tegra_channel_close: vi-output, ar0230 2-0044
gst-launch-1.0-7245 [006] .... 183.681383: tegra_channel_open: vi-output, ar0230 2-0043
v4l2src0:src-7247 [003] .... 184.215702: tegra_channel_set_power: ar0230 2-0043 : 0x1
v4l2src0:src-7247 [003] .... 184.215722: camera_common_s_power: status : 0x1
v4l2src0:src-7247 [003] .... 184.216239: tegra_channel_set_power: 13e40000.host1x:nvcsi@15a00000- : 0x1
v4l2src0:src-7247 [003] .... 184.216244: csi_s_power: enable : 0x1
v4l2src0:src-7247 [003] .... 184.216392: tegra_channel_capture_setup: vnc_id 0 W 640 H 480 fmt 13
v4l2src0:src-7247 [003] .... 184.223210: tegra_channel_set_stream: enable : 0x1
v4l2src0:src-7247 [003] .... 184.226133: tegra_channel_set_stream: 13e40000.host1x:nvcsi@15a00000- : 0x1
v4l2src0:src-7247 [003] .... 184.226136: csi_s_stream: enable : 0x1
v4l2src0:src-7247 [003] .... 184.226467: tegra_channel_set_stream: ar0230 2-0043 : 0x1
kworker/2:4-669 [002] .... 184.248519: rtcpu_string: tstamp:6526388682 id:0x04010000 str:"VM0 activating."
kworker/2:4-669 [002] .... 184.248523: rtcpu_vinotify_event: tstamp:6526856137 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:208848999168 data:0x379d580010000000
kworker/2:4-669 [002] .... 184.248524: rtcpu_vinotify_event: tstamp:6526856384 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:208849005696 data:0x0000000031000001
kworker/2:4-669 [002] .... 184.248524: rtcpu_vinotify_event: tstamp:6526856632 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:208849061888 data:0x379d550010000000
kworker/2:4-669 [002] .... 184.248524: rtcpu_vinotify_event: tstamp:6526856838 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:208849068480 data:0x0000000031000002
vi-output, ar02-7261 [005] .... 186.933923: tegra_channel_capture_setup: vnc_id 0 W 640 H 480 fmt 13
kworker/2:4-669 [002] .... 186.980514: rtcpu_vinotify_event: tstamp:6611461763 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:211559909536 data:0x379d580010000000
kworker/2:4-669 [002] .... 186.980518: rtcpu_vinotify_event: tstamp:6611461974 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:211559916032 data:0x0000000031000001
kworker/2:4-669 [002] .... 186.980519: rtcpu_vinotify_event: tstamp:6611462226 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:211564003552 data:0x379d550010000000
kworker/2:4-669 [002] .... 186.980520: rtcpu_vinotify_event: tstamp:6611462432 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:211564010144 data:0x0000000031000002
vi-output, ar02-7261 [002] .... 189.521744: tegra_channel_capture_setup: vnc_id 0 W 640 H 480 fmt 13
gst-launch-1.0-7245 [001] .... 189.532400: tegra_channel_set_stream: enable : 0x0
gst-launch-1.0-7245 [001] .... 189.532402: tegra_channel_set_stream: ar0230 2-0043 : 0x0
gst-launch-1.0-7245 [002] .... 189.533712: tegra_channel_set_stream: 13e40000.host1x:nvcsi@15a00000- : 0x0
gst-launch-1.0-7245 [002] .... 189.533717: csi_s_stream: enable : 0x0
gst-launch-1.0-7245 [002] .... 189.554469: tegra_channel_set_power: ar0230 2-0043 : 0x0
gst-launch-1.0-7245 [002] .... 189.554486: camera_common_s_power: status : 0x0
gst-launch-1.0-7245 [002] .... 189.555009: tegra_channel_set_power: 13e40000.host1x:nvcsi@15a00000- : 0x0
gst-launch-1.0-7245 [002] .... 189.555013: csi_s_power: enable : 0x0
gst-launch-1.0-7245 [002] .... 189.557756: tegra_channel_close: vi-output, ar0230 2-0043
Output of v4l2-ctl -d /dev/video1 --list-formats-ext
Type: Video Capture
[0]: 'UYVY' (UYVY 4:2:2)
Size: Discrete 640x480
Interval: Discrete 0.017s (60.000 fps)
Interval: Discrete 0.022s (45.000 fps)
Size: Discrete 960x540
Interval: Discrete 0.017s (58.000 fps)
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 1280x720
Interval: Discrete 0.022s (45.000 fps)
Size: Discrete 1280x960
Interval: Discrete 0.029s (34.000 fps)
Size: Discrete 1920x1080
Interval: Discrete 0.033s (30.000 fps)
[1]: 'NV16' (Y/CbCr 4:2:2)
Size: Discrete 640x480
Interval: Discrete 0.017s (60.000 fps)
Interval: Discrete 0.022s (45.000 fps)
Size: Discrete 960x540
Interval: Discrete 0.017s (58.000 fps)
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 1280x720
Interval: Discrete 0.022s (45.000 fps)
Size: Discrete 1280x960
Interval: Discrete 0.029s (34.000 fps)
Size: Discrete 1920x1080
Interval: Discrete 0.033s (30.000 fps)
Unsure how I should enable rtcpu debug (tegra-rtcpu-trace
) on dmesg to get further debug logs, since I am on a custom board and the .img
file going around are for the development kit. Any advice would be appreciated.
.dtsi
file and the video modes are attached for reference, hopefully they are helpful.
tegra234-camera-max9296-a-nilecam.dtsi.txt (9.0 KB)
miivii-nilecam20_cuxvr_mode.dtsi.txt (7.6 KB)