Hi,
We are using a custom sensor which is similar to the OV5693 sensor.
On Jetpack 3.3 we could use the “Sensor Software Driver Programming Guide” in order to modify the OV5693 driver and the DTB.
Our modifications were:
- Updating “tegra186-quill-p3310-1000-a00-00-base.dts” file in order to unregister the Plugin Manager support and load the specific dtsi file <t18x-common-platforms/tegra186-quill-camera-e3326-a00.dtsi>.
- Updating the “ov5693.c” file in order to disable the ov5693_read_reg() and ov5693_write_reg() functions by returning 0 (our sensor doesn’t support the I2C read/write).
- Updating “tegra186-camera-e3326-a00.dtsi” file in order to change the bus-width from 2 to 4 lanes (our sensor supports 2 different modes - 2 lanes and 4 lanes)
After updating the driver we could work with our sensor on both 2 lanes and 4 lanes modes.
After upgrading to Jetpack 4.2 and applying the same modifications, we could work with our sensor on 2 lanes mode only. We couldn’t work on 4 lanes mode.
In order to work with 4 lanes mode on Jetpack 4.2, we tried to use a different approach:
We tried to modify a different sensor driver (IMX185) the same way we modified the OV5693 driver.
After applying the same modifications, we could see /dev/video0 and run the compliance test:
v4l2-compliance SHA : not available
Driver Info:
Driver name : tegra-video
Card type : vi-output, imx185 2-001a
Bus info : platform:15700000.vi:0
Driver version: 4.9.140
Capabilities : 0x84200001
Video Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04200001
Video Capture
Streaming
Extended Pix Format
Compliance test for device /dev/video0 (not using libv4l2):
Required ioctls:
test VIDIOC_QUERYCAP: OK
Allow for multiple opens:
test second video open: OK
test VIDIOC_QUERYCAP: OK
test VIDIOC_G/S_PRIORITY: OK
test for unlimited opens: OK
Debug ioctls:
test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
test VIDIOC_LOG_STATUS: OK
Input ioctls:
test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
test VIDIOC_ENUMAUDIO: OK (Not Supported)
test VIDIOC_G/S/ENUMINPUT: OK
test VIDIOC_G/S_AUDIO: OK (Not Supported)
Inputs: 1 Audio Inputs: 0 Tuners: 0
Output ioctls:
test VIDIOC_G/S_MODULATOR: OK (Not Supported)
test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
test VIDIOC_ENUMAUDOUT: OK (Not Supported)
test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
test VIDIOC_G/S_AUDOUT: OK (Not Supported)
Outputs: 0 Audio Outputs: 0 Modulators: 0
Input/Output configuration ioctls:
test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
test VIDIOC_G/S_EDID: OK (Not Supported)
Test input 0:
Control ioctls:
test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK
test VIDIOC_QUERYCTRL: OK
test VIDIOC_G/S_CTRL: OK
test VIDIOC_G/S/TRY_EXT_CTRLS: OK
test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK
test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
Standard Controls: 1 Private Controls: 18
Format ioctls:
test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
fail: v4l2-test-formats.cpp(1184): ret && node->has_frmintervals
test VIDIOC_G/S_PARM: FAIL
test VIDIOC_G_FBUF: OK (Not Supported)
test VIDIOC_G_FMT: OK
test VIDIOC_TRY_FMT: OK
test VIDIOC_S_FMT: OK
test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
test Cropping: OK (Not Supported)
test Composing: OK (Not Supported)
fail: v4l2-test-formats.cpp(1630): node->can_scale && node->frmsizes_count[v4l_format_g_pixelformat(&cur)]
test Scaling: OK
Codec ioctls:
test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
test VIDIOC_G_ENC_INDEX: OK (Not Supported)
test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)
Buffer ioctls:
test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
test VIDIOC_EXPBUF: OK
Test input 0:
Total: 43, Succeeded: 42, Failed: 1, Warnings: 0
When trying to use the v4l2-ctl util we get the following results:
$ v4l2-ctl --set-fmt-video=width=8192,height=384,pixelformat=RG12 --stream-mmap --stream-count=10 -d /dev/video0 --stream-to=test.raw --verbose
VIDIOC_QUERYCAP: ok
VIDIOC_G_FMT: ok
VIDIOC_S_FMT: ok
Format Video Capture:
Width/Height : 8192/384
Pixel Format : ‘RG12’
Field : None
Bytes per Line : 16384
Size Image : 6291456
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: ok
VIDIOC_QUERYBUF: ok
VIDIOC_QBUF: ok
VIDIOC_QUERYBUF: ok
VIDIOC_QBUF: ok
VIDIOC_QUERYBUF: ok
VIDIOC_QBUF: ok
VIDIOC_QUERYBUF: ok
VIDIOC_QBUF: ok
VIDIOC_STREAMON: ok
here is the output from dmesg (after adding more debug traces):
[ 4003.080719] imx185 2-001a: [IMX185]: power on
[ 4003.082961] imx185 2-001a: v4l2sd_set_fmt
[ 4003.082972] imx185 2-001a: v4l2sd_set_fmt success
[ 4003.082981] imx185 2-001a: v4l2sd_set_fmt
[ 4003.082997] imx185 2-001a: v4l2sd_set_fmt success
[ 4003.093247] tegra-vi4 15700000.vi: tegra_channel_capture_frame_single_thread
[ 4003.094786] imx185 2-001a: v4l2sd_stream
[ 4003.094792] imx185 2-001a: [IMX185]: set mode
[ 4003.094797] imx185 2-001a: [IMX185]: imx185_write_table
[ 4003.094799] imx185 2-001a: [IMX185]: set mode success
[ 4003.094803] imx185 2-001a: [IMX185]: Start streaming
[ 4003.094806] imx185 2-001a: [IMX185]: imx185_write_table
[ 4003.094807] imx185 2-001a: [IMX185]: Start streaming sucess
[ 4003.094809] imx185 2-001a: v4l2sd_stream success
[ 4003.094819] tegra-vi4 15700000.vi: vi_notify_wait: valid_ports: 1
[ 4003.094823] tegra-vi4 15700000.vi: vi_notify_wait: thresh[0] = 17
[ 4003.296998] tegra-vi4 15700000.vi: PXL_SOF syncpt timeout! err = -11
[ 4003.303578] tegra-vi4 15700000.vi: tegra_channel_error_recovery: attempting to reset the capture channel
[ 4003.314040] nvcsi 150c0000.nvcsi: csi4_stream_check_status
[ 4003.314778] tegra-vi4 15700000.vi: tegra_channel_capture_frame_single_thread
[ 4003.314898] tegra-vi4 15700000.vi: vi_notify_wait: valid_ports: 1
[ 4003.314911] tegra-vi4 15700000.vi: vi_notify_wait: thresh[0] = 18
[ 4003.516999] tegra-vi4 15700000.vi: PXL_SOF syncpt timeout! err = -11
[ 4003.523585] tegra-vi4 15700000.vi: tegra_channel_error_recovery: attempting to reset the capture channel
[ 4003.533858] nvcsi 150c0000.nvcsi: csi4_stream_check_status
[ 4003.534522] tegra-vi4 15700000.vi: tegra_channel_capture_frame_single_thread
[ 4003.534581] tegra-vi4 15700000.vi: vi_notify_wait: valid_ports: 1
[ 4003.534591] tegra-vi4 15700000.vi: vi_notify_wait: thresh[0] = 19
[ 4003.737013] tegra-vi4 15700000.vi: PXL_SOF syncpt timeout! err = -11
[ 4003.743605] tegra-vi4 15700000.vi: tegra_channel_error_recovery: attempting to reset the capture channel
[ 4003.754820] nvcsi 150c0000.nvcsi: csi4_stream_check_status
[ 4003.755343] tegra-vi4 15700000.vi: tegra_channel_capture_frame_single_thread
[ 4003.755408] tegra-vi4 15700000.vi: vi_notify_wait: valid_ports: 1
[ 4003.755422] tegra-vi4 15700000.vi: vi_notify_wait: thresh[0] = 20
[ 4003.957195] tegra-vi4 15700000.vi: PXL_SOF syncpt timeout! err = -11
[ 4003.963725] tegra-vi4 15700000.vi: tegra_channel_error_recovery: attempting to reset the capture channel
[ 4003.974431] nvcsi 150c0000.nvcsi: csi4_stream_check_status
[ 4003.975221] tegra-vi4 15700000.vi: tegra_channel_capture_frame_single_thread
[ 4003.975300] tegra-vi4 15700000.vi: vi_notify_wait: valid_ports: 1
[ 4003.975313] tegra-vi4 15700000.vi: vi_notify_wait: thresh[0] = 21
[ 4004.176977] tegra-vi4 15700000.vi: PXL_SOF syncpt timeout! err = -11
[ 4004.183556] tegra-vi4 15700000.vi: tegra_channel_error_recovery: attempting to reset the capture channel
[ 4004.194186] nvcsi 150c0000.nvcsi: csi4_stream_check_status
[ 4004.194846] tegra-vi4 15700000.vi: tegra_channel_capture_frame_single_thread
[ 4004.194914] tegra-vi4 15700000.vi: vi_notify_wait: valid_ports: 1
[ 4004.194926] tegra-vi4 15700000.vi: vi_notify_wait: thresh[0] = 22
[ 4004.396963] tegra-vi4 15700000.vi: PXL_SOF syncpt timeout! err = -11
[ 4004.403528] tegra-vi4 15700000.vi: tegra_channel_error_recovery: attempting to reset the capture channel
[ 4004.416934] nvcsi 150c0000.nvcsi: csi4_stream_check_status
[ 4004.417672] imx185 2-001a: v4l2sd_stream
[ 4004.417683] imx185 2-001a: [IMX185]: Stop streaming
[ 4004.417689] imx185 2-001a: [IMX185]: imx185_write_table
[ 4004.417695] imx185 2-001a: [IMX185]: imx185_write_reg
[ 4004.417700] imx185 2-001a: [IMX185]: Stop streaming sucess
[ 4004.417706] imx185 2-001a: v4l2sd_stream success
[ 4004.417724] nvcsi 150c0000.nvcsi: csi4_stream_check_status
[ 4004.427947] imx185 2-001a: [IMX185]: imx185_power_off
We couldn’t understand why the same modifications works on Jetpack 3.3 but doesn’t work on Jetpack 4.2.
Did we miss any other modification?
Thanks,
Oren.
Here are more debug traces from /sys/kernel/debug/tracing/trace:
tracer: nop
entries-in-buffer/entries-written: 393/393 #P:4
_-----=> irqs-off
/ _----=> need-resched
| / _—=> hardirq/softirq
|| / _–=> preempt-depth
||| / delay
TASK-PID CPU# |||| TIMESTAMP FUNCTION
| | | |||| | |
kworker/4:1-7866 [004] .... 1033.021115: rtos_queue_peek_from_isr_failed: tstamp:32661301216 queue:0x0b4b4500
kworker/4:1-7866 [004] .... 1033.188968: rtos_queue_peek_from_isr_failed: tstamp:32666301148 queue:0x0b4b4500
kworker/4:1-7866 [004] .... 1033.356974: rtos_queue_peek_from_isr_failed: tstamp:32671301153 queue:0x0b4b4500
kworker/4:1-7866 [004] .... 1033.525025: rtos_queue_peek_from_isr_failed: tstamp:32676301265 queue:0x0b4b4500
kworker/4:1-7866 [004] .... 1033.693007: rtos_queue_peek_from_isr_failed: tstamp:32681301170 queue:0x0b4b4500
kworker/4:1-7866 [004] .... 1033.861119: rtos_queue_peek_from_isr_failed: tstamp:32686300962 queue:0x0b4b4500
kworker/4:1-7866 [004] .... 1034.028939: rtos_queue_peek_from_isr_failed: tstamp:32691301181 queue:0x0b4b4500
kworker/4:1-7866 [004] .... 1034.140862: rtos_queue_peek_from_isr_failed: tstamp:32696300991 queue:0x0b4b4500
kworker/4:1-7866 [004] .... 1034.309011: rtos_queue_peek_from_isr_failed: tstamp:32701301210 queue:0x0b4b4500
kworker/4:1-7866 [004] .... 1034.645052: rtos_queue_peek_from_isr_failed: tstamp:32711301437 queue:0x0b4b4500
kworker/4:1-7866 [004] .... 1034.812928: rtos_queue_peek_from_isr_failed: tstamp:32716301215 queue:0x0b4b4500
kworker/4:1-7866 [004] .... 1034.980950: rtos_queue_peek_from_isr_failed: tstamp:32721301222 queue:0x0b4b4500
kworker/4:1-7866 [004] .... 1035.149135: rtos_queue_peek_from_isr_failed: tstamp:32726301256 queue:0x0b4b4500
kworker/4:1-7866 [004] .... 1035.261040: rtos_queue_peek_from_isr_failed: tstamp:32731301242 queue:0x0b4b4500
kworker/4:1-7866 [004] .... 1035.428949: rtos_queue_peek_from_isr_failed: tstamp:32736301241 queue:0x0b4b4500
kworker/4:1-7866 [004] .... 1035.596974: rtos_queue_peek_from_isr_failed: tstamp:32741301252 queue:0x0b4b4500
kworker/4:1-7866 [004] .... 1035.764996: rtos_queue_peek_from_isr_failed: tstamp:32746301341 queue:0x0b4b4500
kworker/4:1-7866 [004] .... 1035.933166: rtos_queue_peek_from_isr_failed: tstamp:32751301282 queue:0x0b4b4500
kworker/4:1-7866 [004] .... 1036.101084: rtos_queue_peek_from_isr_failed: tstamp:32756301299 queue:0x0b4b4500
kworker/4:1-7866 [004] .... 1036.268905: rtos_queue_peek_from_isr_failed: tstamp:32761301067 queue:0x0b4b4500
kworker/4:1-7866 [004] .... 1036.380900: rtos_queue_peek_from_isr_failed: tstamp:32766301068 queue:0x0b4b4500
kworker/4:1-7866 [004] .... 1036.549278: rtos_queue_peek_from_isr_failed: tstamp:32771301296 queue:0x0b4b4500
kworker/4:1-7866 [004] .... 1036.716932: rtos_queue_peek_from_isr_failed: tstamp:32776301315 queue:0x0b4b4500
kworker/4:1-7866 [004] .... 1036.885033: rtos_queue_peek_from_isr_failed: tstamp:32781301310 queue:0x0b4b4500
kworker/4:1-7866 [004] .... 1037.052979: rtos_queue_peek_from_isr_failed: tstamp:32786301388 queue:0x0b4b4500
kworker/4:1-7866 [004] .... 1037.220961: rtos_queue_peek_from_isr_failed: tstamp:32791301319 queue:0x0b4b4500
kworker/4:1-7866 [004] .... 1037.388987: rtos_queue_peek_from_isr_failed: tstamp:32796301326 queue:0x0b4b4500
kworker/4:1-7866 [004] .... 1037.501088: rtos_queue_peek_from_isr_failed: tstamp:32801301424 queue:0x0b4b4500
kworker/4:1-7866 [004] .... 1037.668946: rtos_queue_peek_from_isr_failed: tstamp:32806301340 queue:0x0b4b4500
kworker/4:1-7866 [004] .... 1037.836906: rtos_queue_peek_from_isr_failed: tstamp:32811301346 queue:0x0b4b4500
kworker/4:1-7866 [004] .... 1038.004934: rtos_queue_peek_from_isr_failed: tstamp:32816301356 queue:0x0b4b4500
kworker/4:1-7866 [004] .... 1038.173005: rtos_queue_peek_from_isr_failed: tstamp:32821301190 queue:0x0b4b4500
kworker/4:1-7866 [004] .... 1038.173038: rtos_queue_peek_from_isr_failed: tstamp:32822224059 queue:0x0b4b4500
kworker/4:1-7866 [004] .n.. 1080.516913: rtos_queue_peek_from_isr_failed: tstamp:34144761279 queue:0x0b4b4500
kworker/4:1-7866 [004] .n.. 1080.516950: rtcpu_start: tstamp:34144762155
kworker/4:1-7866 [004] .n.. 1080.516984: rtos_queue_send_from_isr_failed: tstamp:34144824996 queue:0x0b4a7258
kworker/4:1-7866 [004] .... 1080.517016: rtos_queue_send_from_isr_failed: tstamp:34144825105 queue:0x0b4aad68
kworker/4:1-7866 [004] .... 1080.517082: rtos_queue_send_from_isr_failed: tstamp:34144825211 queue:0x0b4ac998
kworker/4:1-7866 [004] .... 1080.517082: rtos_queue_send_from_isr_failed: tstamp:34144825318 queue:0x0b4ae518
kworker/4:1-7866 [004] .... 1080.517084: rtos_queue_send_from_isr_failed: tstamp:34144825424 queue:0x0b4af2d8
kworker/4:1-7866 [004] .... 1080.517084: rtos_queue_send_from_isr_failed: tstamp:34144825528 queue:0x0b4b0098
kworker/4:1-7866 [004] .... 1080.517086: rtos_queue_send_from_isr_failed: tstamp:34144825631 queue:0x0b4b0e58
kworker/4:1-7866 [004] .... 1080.517086: rtos_queue_send_from_isr_failed: tstamp:34144825746 queue:0x0b4b1c18
kworker/4:1-7866 [004] .... 1080.517088: rtos_queue_send_failed: tstamp:34144826203 queue:0x0b4a7258
kworker/4:1-7866 [004] .... 1080.517089: rtos_queue_send_from_isr_failed: tstamp:34144828166 queue:0x0b4a7258
kworker/4:1-7866 [004] .... 1080.517090: rtos_queue_send_from_isr_failed: tstamp:34144828274 queue:0x0b4aad68
kworker/4:1-7866 [004] .... 1080.517090: rtos_queue_send_from_isr_failed: tstamp:34144828380 queue:0x0b4ac998
kworker/4:1-7866 [004] .n.. 1080.517091: rtos_queue_send_from_isr_failed: tstamp:34144828493 queue:0x0b4ae518
kworker/4:1-7866 [004] .... 1080.517123: rtos_queue_send_from_isr_failed: tstamp:34144828598 queue:0x0b4af2d8
kworker/4:1-7866 [004] .... 1080.517154: rtos_queue_send_from_isr_failed: tstamp:34144828702 queue:0x0b4b0098
kworker/4:1-7866 [004] .... 1080.517186: rtos_queue_send_from_isr_failed: tstamp:34144828807 queue:0x0b4b0e58
kworker/4:1-7866 [004] .... 1080.517187: rtos_queue_send_from_isr_failed: tstamp:34144828912 queue:0x0b4b1c18
kworker/4:1-7866 [004] .... 1080.517188: rtos_queue_send_failed: tstamp:34144829848 queue:0x0b4a7258
kworker/4:1-7866 [004] .... 1080.684938: rtos_queue_peek_from_isr_failed: tstamp:34149761710 queue:0x0b4b4500
kworker/4:1-7866 [004] .... 1080.740934: rtos_queue_send_from_isr_failed: tstamp:34151737150 queue:0x0b4a7258
kworker/4:1-7866 [004] .... 1080.740947: rtos_queue_send_from_isr_failed: tstamp:34151737433 queue:0x0b4aad68
kworker/4:1-7866 [004] .... 1080.740952: rtos_queue_send_from_isr_failed: tstamp:34151737703 queue:0x0b4ac998
kworker/4:1-7866 [004] .... 1080.740955: rtos_queue_send_from_isr_failed: tstamp:34151737970 queue:0x0b4ae518
kworker/4:1-7866 [004] .... 1080.740958: rtos_queue_send_from_isr_failed: tstamp:34151738240 queue:0x0b4af2d8
kworker/4:1-7866 [004] .... 1080.740961: rtos_queue_send_from_isr_failed: tstamp:34151738508 queue:0x0b4b0098
kworker/4:1-7866 [004] .... 1080.740965: rtos_queue_send_from_isr_failed: tstamp:34151738787 queue:0x0b4b0e58
kworker/4:1-7866 [004] .... 1080.740968: rtos_queue_send_from_isr_failed: tstamp:34151739055 queue:0x0b4b1c18
kworker/4:1-7866 [004] .... 1080.740973: rtos_queue_send_failed: tstamp:34151740459 queue:0x0b4a7258