Hello,
I am attempting to get the Sony EV9500M camera working over the Orin NX module + Orin Nano carrier. The driver code and dtsi are based on one existing driver of this camera for Xavier NX board. I modified them using imx219 driver and dtsi files as a reference.
The camera is connected to CAM1 (J21) connector using 4 MIPI lanes and supplied externally. It doesn’t have I2C.
The OS was built from SDK Manager using JetPack 5.1.2 and L4T 35.4.1
cat /etc/nv_tegra_release
# R35 (release), REVISION: 4.1, GCID: 33958178, BOARD: t186ref, EABI: aarch64, DATE: Tue Aug 1 19:57:35 UTC 2023
uname -a
Linux orinnx-desktop 5.10.120-tegra #10 SMP PREEMPT Thu Nov 23 13:57:00 CET 2023 aarch64 aarch64 aarch64 GNU/Linux
The device node is created and NVCSI bound.
media-ctl -p -d /dev/media0
Media controller API version 5.10.120
Media device information
------------------------
driver tegra-camrtc-ca
model NVIDIA Tegra Video Input Device
serial
bus info
hw revision 0x3
driver version 5.10.120
Device topology
- entity 1: 13e40000.host1x:nvcsi@15a00000- (2 pads, 2 links)
type V4L2 subdev subtype Unknown flags 0
device node name /dev/v4l-subdev0
pad0: Sink
<- "ev9500m 2-0010":0 [ENABLED]
pad1: Source
-> "vi-output, ev9500m 2-0010":0 [ENABLED]
- entity 4: ev9500m 2-0010 (1 pad, 1 link)
type V4L2 subdev subtype Sensor flags 0
device node name /dev/v4l-subdev1
pad0: Source
[fmt:UYVY8_1X16/1920x1080 field:none colorspace:srgb]
-> "13e40000.host1x:nvcsi@15a00000-":0 [ENABLED]
- entity 6: vi-output, ev9500m 2-0010 (1 pad, 1 link)
type Node subtype V4L flags 0
device node name /dev/video0
pad0: Sink
<- "13e40000.host1x:nvcsi@15a00000-":1 [ENABLED]
v4l2-ctl -d /dev/video0 --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
Type: Video Capture
[0]: 'UYVY' (UYVY 4:2:2)
Size: Discrete 1920x1080
Interval: Discrete 0.017s (60.000 fps)
[1]: 'NV16' (Y/CbCr 4:2:2)
Size: Discrete 1920x1080
Interval: Discrete 0.017s (60.000 fps)
[2]: 'UYVY' (UYVY 4:2:2)
Size: Discrete 1920x1080
Interval: Discrete 0.017s (60.000 fps)
The v4l2-compliance returns some failures that I don’t know how to solve.
v4l2-compliance -v -d /dev/media0
v4l2-compliance SHA: not available, 64 bits
Compliance test for tegra-camrtc-ca device /dev/media0:
Media Driver Info:
Driver name : tegra-camrtc-ca
Model : NVIDIA Tegra Video Input Device
Serial :
Bus info :
Media version : 5.10.120
Hardware revision: 0x00000003 (3)
Driver version : 5.10.120
Required ioctls:
warn: v4l2-test-media.cpp(51): empty bus_info
test MEDIA_IOC_DEVICE_INFO: OK
Allow for multiple opens:
test second /dev/media0 open: OK
warn: v4l2-test-media.cpp(51): empty bus_info
test MEDIA_IOC_DEVICE_INFO: OK
test for unlimited opens: OK
Media Controller ioctls:
Entity: 0x00000001 (Name: '13e40000.host1x:nvcsi@15a00000-', Function: Unknown sub-device (0002000a))
fail: v4l2-test-media.cpp(110): (function & MEDIA_ENT_TYPE_MASK) == MEDIA_ENT_F_OLD_SUBDEV_BASE && function > MEDIA_ENT_F_TUNER
fail: v4l2-test-media.cpp(202): checkFunction(ent.function, true)
test MEDIA_IOC_G_TOPOLOGY: FAIL
Entity: 0x00000001 (Name: '13e40000.host1x:nvcsi@15a00000-', Type: Unknown V4L2 Sub-Device, DevPath: /dev/v4l-subdev0)
Entity: 0x00000004 (Name: 'ev9500m 2-0010', Type: Camera Sensor, DevPath: /dev/v4l-subdev1)
Entity: 0x00000006 (Name: 'vi-output, ev9500m 2-0010', Type: V4L2 I/O, DevPath: /dev/video0)
fail: v4l2-test-media.cpp(389): num_data_links != num_links
test MEDIA_IOC_ENUM_ENTITIES/LINKS: FAIL
test MEDIA_IOC_SETUP_LINK: OK
Total for tegra-camrtc-ca device /dev/media0: 7, Succeeded: 5, Failed: 2, Warnings: 2
For testing purposes, I boost clocks and enable trace logs:
sudo nvpmodel -m 0
sudo jetson_clocks
sudo su
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 3 > /sys/kernel/debug/camrtc/log-level
echo 1 > /sys/kernel/debug/tracing/events/camera_common/enable
echo > /sys/kernel/debug/tracing/trace
But when I trigger my capture command I see the following in dmesg :
[ 496.314693] tegra-camrtc-capture-vi tegra-capture-vi: uncorr_err: request timed out after 2500 ms
[ 496.327460] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: attempting to reset the capture channel
[ 496.337641] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 496.345357] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_close: Error in closing stream_id=2, csi_port=2
[ 496.356012] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 496.363732] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_open: VI channel not found for stream- 2 vc- 0
[ 496.374623] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: successfully reset the capture channel
And this is in the trace:
tracer: nop
#
# entries-in-buffer/entries-written: 59/59 #P:8
#
# _-----=> irqs-off
# / _----=> need-resched
# | / _---=> hardirq/softirq
# || / _--=> preempt-depth
# ||| / delay
# TASK-PID CPU# |||| TIMESTAMP FUNCTION
# | | | |||| | |
kworker/1:4-404 [001] .... 106.431484: rtcpu_string: tstamp:3931035642 id:0x04010000 str:"VM0 deactivating."
gst-plugin-scan-3462 [004] .... 413.551859: tegra_channel_open: vi-output, ev9500m 2-0010
gst-plugin-scan-3462 [004] .... 413.551879: tegra_channel_close: vi-output, ev9500m 2-0010
v4l2-ctl-3499 [006] .... 438.469087: tegra_channel_open: vi-output, ev9500m 2-0010
v4l2-ctl-3499 [006] .... 438.469398: tegra_channel_close: vi-output, ev9500m 2-0010
gst-plugin-scan-3512 [001] .... 493.460248: tegra_channel_open: vi-output, ev9500m 2-0010
gst-plugin-scan-3512 [001] .... 493.460266: tegra_channel_close: vi-output, ev9500m 2-0010
gst-launch-1.0-3511 [002] .... 493.524824: tegra_channel_open: vi-output, ev9500m 2-0010
gst-launch-1.0-3511 [002] .... 493.524843: tegra_channel_close: vi-output, ev9500m 2-0010
gst-launch-1.0-3511 [002] .... 493.570891: tegra_channel_open: vi-output, ev9500m 2-0010
v4l2src0:src-3515 [000] .... 493.577559: tegra_channel_set_power: ev9500m 2-0010 : 0x1
v4l2src0:src-3515 [000] .... 493.577570: camera_common_s_power: status : 0x1
v4l2src0:src-3515 [000] .... 493.582423: tegra_channel_set_power: 13e40000.host1x:nvcsi@15a00000- : 0x1
v4l2src0:src-3515 [000] .... 493.582427: csi_s_power: enable : 0x1
v4l2src0:src-3515 [000] .... 493.583501: tegra_channel_capture_setup: vnc_id 0 W 1920 H 1080 fmt 13
v4l2src0:src-3515 [000] .... 493.591136: tegra_channel_set_stream: enable : 0x1
v4l2src0:src-3515 [000] .... 493.592625: tegra_channel_set_stream: 13e40000.host1x:nvcsi@15a00000- : 0x1
v4l2src0:src-3515 [000] .... 493.592628: csi_s_stream: enable : 0x1
v4l2src0:src-3515 [000] .... 493.592954: tegra_channel_set_stream: ev9500m 2-0010 : 0x1
kworker/1:4-404 [001] .... 493.610502: rtcpu_string: tstamp:16030604309 id:0x04010000 str:"VM0 activating."
kworker/1:4-404 [001] .... 493.610506: rtcpu_vinotify_event: tstamp:16031097037 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:512984809536 data:0x759e300010000000
kworker/1:4-404 [001] .... 493.610507: rtcpu_vinotify_event: tstamp:16031097211 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:512984816032 data:0x0000000031000001
kworker/1:4-404 [001] .... 493.610507: rtcpu_vinotify_event: tstamp:16031097408 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:512984861760 data:0x759e2d0010000000
kworker/1:4-404 [001] .... 493.610507: rtcpu_vinotify_event: tstamp:16031097577 cch:0 vi:1 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:512984868352 data:0x0000000031000002
vi-output, ev95-3518 [003] .... 496.374480: tegra_channel_capture_setup: vnc_id 0 W 1920 H 1080 fmt 13
I can’t see any frame, just a green picture. I probed the MIPI lanes and seems to be correct.
Any idea of what the problem might be or which way to go?
You can find attached the driver code, dtsi, system dts, dmesg logs and trace logs:
files.tar.gz (80.8 KB)
Thank you!