Adv7282am dubole image

Hi, everyone.

I’m useing adv7282am(Pal convert into CSI signal) on Nvidia TX2,
Platform:# R32 (release), REVISION: 1.0, GCID: 14531094, BOARD: t186ref, EABI: aarch64, DATE: Wed Mar 13 07:41:08 UTC 2019
CSI port: serial_c

When i applyed this patch: TX2-4GB NVCSI/VI error with JetPack 4.3
i can captured video stream from adv7282am with I2P(de-interlaced function), and get double image, like the below:


dmesg:
[ 100.405417] adv7180 2-0020: camera_common_try_fmt: size 720 x 576
[ 100.409752] tegra-ivc-vi-notify ivc-b000000.rtcpu:vinotify@12c0: vi_notify_channel_enable_reports: ch:0
[ 100.409785] tegra-vi4 15700000.vi: Create Surface with imgW=720, imgH=576, memFmt=203
[ 100.411268] nvcsi 150c0000.nvcsi: csi4_start_streaming port_idx=0, lanes=1
[ 100.411273] nvcsi 150c0000.nvcsi: csi4_stream_init csi_port = 2
[ 100.411283] nvcsi 150c0000.nvcsi: csi4_stream_config
[ 100.411292] nvcsi 150c0000.nvcsi: csi4_stream_config (2) read VC0_DPCM_CTRL = 00000000
[ 100.411295] nvcsi 150c0000.nvcsi: settle time reading from props
[ 100.411297] nvcsi 150c0000.nvcsi: settle time reading from props
[ 100.411299] nvcsi 150c0000.nvcsi: csi4_phy_config
[ 100.411304] nvcsi 150c0000.nvcsi: NVCSI_CIL_CONFIG = 00000000
[ 100.411310] nvcsi 150c0000.nvcsi: cil core clock: 204, csi clock: 89
[ 100.411312] nvcsi 150c0000.nvcsi: cil_settingtime was autocalculated
[ 100.411315] nvcsi 150c0000.nvcsi: csi settle time: 33, cil settle time: 27
[ 100.411327] adv7180 2-0020: v4l2sd_stream++ enable 1
[ 100.411331] adv7180 2-0020: adv7180_set_mode
[ 100.411337] adv7180 2-0020: adv7180_start_streaming
[ 100.417360] tegra-ivc-vi-notify ivc-b000000.rtcpu:vinotify@12c0: vi_notify_get_capture_status: ch: 0 sof_ts:100173254354 eof_ts:0 idx:1
[ 100.417367] video4linux video0: vi_notify_wait: vi4 got SOF syncpt buf[ffffffc1e0cd3800]
[ 100.437336] tegra-ivc-vi-notify ivc-b000000.rtcpu:vinotify@12c0: vi_notify_get_capture_status: ch: 0 sof_ts:100193246546 eof_ts:0 idx:2
[ 100.437344] video4linux video0: vi_notify_wait: vi4 got SOF syncpt buf[ffffffc1e0cd3000]
[ 100.457305] tegra-ivc-vi-notify ivc-b000000.rtcpu:vinotify@12c0: vi_notify_get_capture_status: ch: 0 sof_ts:100213238642 eof_ts:0 idx:3
[ 100.457313] video4linux video0: vi_notify_wait: vi4 got SOF syncpt buf[ffffffc1bb238000]
[ 100.457321] video4linux video0: free_ring_buffers: capture init latency is 49 ms
[ 100.477317] tegra-ivc-vi-notify ivc-b000000.rtcpu:vinotify@12c0: vi_notify_get_capture_status: ch: 0 sof_ts:100233230770 eof_ts:0 idx:4
[ 100.477325] video4linux video0: vi_notify_wait: vi4 got SOF syncpt buf[ffffffc1e342f400]
[ 100.517303] tegra-ivc-vi-notify ivc-b000000.rtcpu:vinotify@12c0: vi_notify_get_capture_status: ch: 0 sof_ts:100273215090 eof_ts:0 idx:5
[ 100.517310] video4linux video0: vi_notify_wait: vi4 got SOF syncpt buf[ffffffc1e0cd3800]
[ 100.537294] tegra-ivc-vi-notify ivc-b000000.rtcpu:vinotify@12c0: vi_notify_get_capture_status: ch: 0 sof_ts:100293207250 eof_ts:0 idx:6
[ 100.537301] video4linux video0: vi_notify_wait: vi4 got SOF syncpt buf[ffffffc1e0cd3000]
[ 100.557291] tegra-ivc-vi-notify ivc-b000000.rtcpu:vinotify@12c0: vi_notify_get_capture_status: ch: 0 sof_ts:100313199346 eof_ts:0 idx:7
[ 100.557298] video4linux video0: vi_notify_wait: vi4 got SOF syncpt buf[ffffffc1bb238000]
[ 100.577272] tegra-ivc-vi-notify ivc-b000000.rtcpu:vinotify@12c0: vi_notify_get_capture_status: ch: 0 sof_ts:100333191506 eof_ts:0 idx:8
[ 100.577280] video4linux video0: vi_notify_wait: vi4 got SOF syncpt buf[ffffffc1e342f400]

tarce:

_-----=> irqs-off

/ _----=> need-resched

| / _—=> hardirq/softirq

|| / _–=> preempt-depth

||| / delay

TASK-PID CPU# |||| TIMESTAMP FUNCTION

| | | |||| | |

 kworker/0:2-2015  [000] ....    86.022122: rtos_queue_peek_from_isr_failed: tstamp:3074838469 queue:0x0b4b4500
 kworker/0:2-2015  [000] ....    86.022126: rtcpu_start: tstamp:3074839379
 kworker/0:2-2015  [000] ....    86.022128: rtos_queue_send_from_isr_failed: tstamp:3074847610 queue:0x0b4a7258
 kworker/0:2-2015  [000] ....    86.022129: rtos_queue_send_from_isr_failed: tstamp:3074847718 queue:0x0b4aad68
 kworker/0:2-2015  [000] ....    86.022130: rtos_queue_send_from_isr_failed: tstamp:3074847829 queue:0x0b4ac998
 kworker/0:2-2015  [000] ....    86.022131: rtos_queue_send_from_isr_failed: tstamp:3074847936 queue:0x0b4ae518
 kworker/0:2-2015  [000] ....    86.022131: rtos_queue_send_from_isr_failed: tstamp:3074848040 queue:0x0b4af2d8
 kworker/0:2-2015  [000] ....    86.022132: rtos_queue_send_from_isr_failed: tstamp:3074848146 queue:0x0b4b0098
 kworker/0:2-2015  [000] ....    86.022133: rtos_queue_send_from_isr_failed: tstamp:3074848251 queue:0x0b4b0e58
 kworker/0:2-2015  [000] ....    86.022133: rtos_queue_send_from_isr_failed: tstamp:3074848356 queue:0x0b4b1c18
 kworker/0:2-2015  [000] ....    86.022135: rtcpu_dbg_set_loglevel: tstamp:3074849597 old:0 new:2
 kworker/0:2-2015  [000] ....    86.022136: rtos_queue_send_from_isr_failed: tstamp:3074850667 queue:0x0b4a7258
 kworker/0:2-2015  [000] ....    86.022136: rtos_queue_send_from_isr_failed: tstamp:3074850773 queue:0x0b4aad68
 kworker/0:2-2015  [000] ....    86.022137: rtos_queue_send_from_isr_failed: tstamp:3074850881 queue:0x0b4ac998
 kworker/0:2-2015  [000] ....    86.022138: rtos_queue_send_from_isr_failed: tstamp:3074850999 queue:0x0b4ae518
 kworker/0:2-2015  [000] ....    86.022138: rtos_queue_send_from_isr_failed: tstamp:3074851105 queue:0x0b4af2d8
 kworker/0:2-2015  [000] ....    86.022139: rtos_queue_send_from_isr_failed: tstamp:3074851210 queue:0x0b4b0098
 kworker/0:2-2015  [000] ....    86.022139: rtos_queue_send_from_isr_failed: tstamp:3074851315 queue:0x0b4b0e58
 kworker/0:2-2015  [000] ....    86.022140: rtos_queue_send_from_isr_failed: tstamp:3074851420 queue:0x0b4b1c18
 kworker/0:2-2015  [000] ....    86.190151: rtos_queue_peek_from_isr_failed: tstamp:3079838794 queue:0x0b4b4500
 kworker/0:2-2015  [000] ....    86.358184: rtos_queue_peek_from_isr_failed: tstamp:3084838801 queue:0x0b4b4500
 kworker/0:4-5262  [000] ....    86.526847: rtos_queue_peek_from_isr_failed: tstamp:3089838820 queue:0x0b4b4500
 kworker/0:2-2015  [000] ....    86.694239: rtos_queue_peek_from_isr_failed: tstamp:3094838839 queue:0x0b4b4500
 kworker/0:2-2015  [000] ....    86.806276: rtos_queue_peek_from_isr_failed: tstamp:3099838840 queue:0x0b4b4500
 kworker/0:2-2015  [000] ....    86.974276: rtos_queue_peek_from_isr_failed: tstamp:3104838833 queue:0x0b4b4500
 kworker/0:2-2015  [000] ....    87.142347: rtos_queue_peek_from_isr_failed: tstamp:3109838840 queue:0x0b4b4500
 kworker/0:2-2015  [000] ....    87.314342: rtos_queue_peek_from_isr_failed: tstamp:3114838841 queue:0x0b4b4500
 kworker/0:2-2015  [000] ....    87.486423: rtos_queue_peek_from_isr_failed: tstamp:3119838851 queue:0x0b4b4500
 kworker/0:4-5262  [000] ....    87.658540: rtos_queue_peek_from_isr_failed: tstamp:3124838875 queue:0x0b4b4500
 kworker/0:2-2015  [000] ....    87.770442: rtos_queue_peek_from_isr_failed: tstamp:3129838863 queue:0x0b4b4500
 kworker/0:2-2015  [000] ....    87.938482: rtos_queue_peek_from_isr_failed: tstamp:3134838869 queue:0x0b4b4500
 kworker/0:2-2015  [000] ....    88.106504: rtos_queue_peek_from_isr_failed: tstamp:3139838876 queue:0x0b4b4500
 kworker/0:2-2015  [000] ....    88.274541: rtos_queue_peek_from_isr_failed: tstamp:3144838882 queue:0x0b4b4500
 kworker/0:2-2015  [000] ....    88.442568: rtos_queue_peek_from_isr_failed: tstamp:3149838896 queue:0x0b4b4500
 kworker/0:2-2015  [000] ....    88.610585: rtos_queue_peek_from_isr_failed: tstamp:3154838905 queue:0x0b4b4500
 kworker/0:2-2015  [000] ....    88.778752: rtos_queue_peek_from_isr_failed: tstamp:3159838911 queue:0x0b4b4500
 kworker/0:2-2015  [000] ....    88.890613: rtos_queue_peek_from_isr_failed: tstamp:3164838910 queue:0x0b4b4500
 kworker/0:2-2015  [000] ....    89.058632: rtos_queue_peek_from_isr_failed: tstamp:3169838934 queue:0x0b4b4500
 kworker/0:2-2015  [000] ....    89.226663: rtos_queue_peek_from_isr_failed: tstamp:3174838930 queue:0x0b4b4500
 kworker/0:2-2015  [000] ....    89.394691: rtos_queue_peek_from_isr_failed: tstamp:3179838933 queue:0x0b4b4500
 kworker/0:2-2015  [000] ....    89.562705: rtos_queue_peek_from_isr_failed: tstamp:3184838944 queue:0x0b4b4500
 kworker/0:2-2015  [000] ....    89.730736: rtos_queue_peek_from_isr_failed: tstamp:3189838944 queue:0x0b4b4500
 kworker/0:2-2015  [000] ....    89.898772: rtos_queue_peek_from_isr_failed: tstamp:3194838973 queue:0x0b4b4500
 kworker/0:2-2015  [000] ....    90.010794: rtos_queue_peek_from_isr_failed: tstamp:3199838964 queue:0x0b4b4500
 kworker/0:2-2015  [000] ....    90.178806: rtos_queue_peek_from_isr_failed: tstamp:3204838985 queue:0x0b4b4500
 kworker/0:2-2015  [000] ....    90.346839: rtos_queue_peek_from_isr_failed: tstamp:3209838974 queue:0x0b4b4500
 kworker/0:2-2015  [000] ....    90.514884: rtos_queue_peek_from_isr_failed: tstamp:3214838980 queue:0x0b4b4500
 kworker/0:2-2015  [000] ....    90.682880: rtos_queue_peek_from_isr_failed: tstamp:3219838991 queue:0x0b4b4500
 kworker/0:2-2015  [000] ....    90.850911: rtos_queue_peek_from_isr_failed: tstamp:3224838991 queue:0x0b4b4500
 kworker/0:2-2015  [000] ....    91.018933: rtos_queue_peek_from_isr_failed: tstamp:3229839020 queue:0x0b4b4500
 kworker/0:2-2015  [000] ....    91.130966: rtos_queue_peek_from_isr_failed: tstamp:3233827422 queue:0x0b4b4500

gst-launch-1.0-7677 [000] … 100.392807: tegra_channel_open: vi-output, adv7180 2-0020
gst-launch-1.0-7677 [000] … 100.393840: tegra_channel_set_power: adv7180 2-0020 : 0x1
gst-launch-1.0-7677 [000] … 100.393848: camera_common_s_power: status : 0x1
gst-launch-1.0-7677 [000] … 100.393906: tegra_channel_set_power: 150c0000.nvcsi–1 : 0x1
gst-launch-1.0-7677 [000] … 100.393908: csi_s_power: enable : 0x1
gst-launch-1.0-7677 [000] … 100.395348: tegra_channel_close: vi-output, adv7180 2-0020
gst-launch-1.0-7677 [000] … 100.395354: tegra_channel_set_power: adv7180 2-0020 : 0x0
gst-launch-1.0-7677 [000] … 100.395359: camera_common_s_power: status : 0x0
gst-launch-1.0-7677 [000] … 100.395405: tegra_channel_set_power: 150c0000.nvcsi–1 : 0x0
gst-launch-1.0-7677 [000] … 100.395407: csi_s_power: enable : 0x0
gst-launch-1.0-7677 [000] … 100.404523: tegra_channel_open: vi-output, adv7180 2-0020
gst-launch-1.0-7677 [000] … 100.404532: tegra_channel_set_power: adv7180 2-0020 : 0x1
gst-launch-1.0-7677 [000] … 100.404540: camera_common_s_power: status : 0x1
gst-launch-1.0-7677 [000] … 100.404591: tegra_channel_set_power: 150c0000.nvcsi–1 : 0x1
gst-launch-1.0-7677 [000] … 100.404593: csi_s_power: enable : 0x1
v4l2src0:src-7679 [000] … 100.409758: tegra_channel_capture_setup: vnc_id 0 W 720 H 576 fmt cb
vi-output, adv7-7681 [000] … 100.409871: tegra_channel_set_stream: enable : 0x1
vi-output, adv7-7681 [000] … 100.411260: tegra_channel_set_stream: 150c0000.nvcsi–1 : 0x1
vi-output, adv7-7681 [000] … 100.411263: csi_s_stream: enable : 0x1
vi-output, adv7-7681 [000] … 100.411320: tegra_channel_set_stream: adv7180 2-0020 : 0x1
vi-output, adv7-7681 [000] … 100.417376: tegra_channel_capture_frame: sof:100.173254354
vi-output, adv7-7681 [003] … 100.437352: tegra_channel_capture_frame: sof:100.193246546
kworker/0:2-2015 [000] … 100.456049: rtos_queue_peek_from_isr_failed: tstamp:3525023807 queue:0x0b4b4500
kworker/0:2-2015 [000] … 100.456053: rtcpu_start: tstamp:3525024916
kworker/0:2-2015 [000] … 100.456054: rtos_queue_send_from_isr_failed: tstamp:3525033701 queue:0x0b4a7258
kworker/0:2-2015 [000] … 100.456055: rtos_queue_send_from_isr_failed: tstamp:3525033807 queue:0x0b4aad68
kworker/0:2-2015 [000] … 100.456056: rtos_queue_send_from_isr_failed: tstamp:3525033916 queue:0x0b4ac998
kworker/0:2-2015 [000] … 100.456057: rtos_queue_send_from_isr_failed: tstamp:3525034024 queue:0x0b4ae518
kworker/0:2-2015 [000] … 100.456058: rtos_queue_send_from_isr_failed: tstamp:3525034127 queue:0x0b4af2d8
kworker/0:2-2015 [000] … 100.456058: rtos_queue_send_from_isr_failed: tstamp:3525034231 queue:0x0b4b0098
kworker/0:2-2015 [000] … 100.456059: rtos_queue_send_from_isr_failed: tstamp:3525034336 queue:0x0b4b0e58
kworker/0:2-2015 [000] … 100.456059: rtos_queue_send_from_isr_failed: tstamp:3525034449 queue:0x0b4b1c18
kworker/0:2-2015 [000] … 100.456061: rtos_queue_send_failed: tstamp:3525034905 queue:0x0b4a7258
kworker/0:2-2015 [000] … 100.456062: rtos_queue_send_from_isr_failed: tstamp:3525036756 queue:0x0b4a7258
kworker/0:2-2015 [000] … 100.456063: rtos_queue_send_from_isr_failed: tstamp:3525036871 queue:0x0b4aad68
kworker/0:2-2015 [000] … 100.456063: rtos_queue_send_from_isr_failed: tstamp:3525036976 queue:0x0b4ac998
kworker/0:2-2015 [000] … 100.456064: rtos_queue_send_from_isr_failed: tstamp:3525037081 queue:0x0b4ae518
kworker/0:2-2015 [000] … 100.456065: rtos_queue_send_from_isr_failed: tstamp:3525037189 queue:0x0b4af2d8
kworker/0:2-2015 [000] … 100.456065: rtos_queue_send_from_isr_failed: tstamp:3525037294 queue:0x0b4b0098
kworker/0:2-2015 [000] … 100.456066: rtos_queue_send_from_isr_failed: tstamp:3525037399 queue:0x0b4b0e58
kworker/0:2-2015 [000] … 100.456067: rtos_queue_send_from_isr_failed: tstamp:3525037503 queue:0x0b4b1c18
kworker/0:2-2015 [000] … 100.456067: rtos_queue_send_failed: tstamp:3525038443 queue:0x0b4a7258
kworker/0:2-2015 [000] … 100.456069: rtcpu_vinotify_event: tstamp:3525274837 tag:CHANSEL_PXL_SOF channel:0x00 frame:1 vi_tstamp:3525274319 data:0x00000001
kworker/0:2-2015 [000] … 100.456070: rtcpu_vinotify_event: tstamp:3525275010 tag:ATOMP_FS channel:0x00 frame:1 vi_tstamp:3525274350 data:0x00000000
kworker/0:2-2015 [000] … 100.456070: rtcpu_vinotify_event: tstamp:3525278690 tag:CHANSEL_LOAD_FRAMED channel:0x04 frame:1 vi_tstamp:3525278322 data:0x08000000
kworker/0:2-2015 [000] … 100.456071: rtcpu_vinotify_event: tstamp:3525850586 tag:CHANSEL_PXL_EOF channel:0x00 frame:1 vi_tstamp:3525849917 data:0x023f0002
kworker/0:2-2015 [000] … 100.456071: rtcpu_vinotify_event: tstamp:3525850704 tag:ATOMP_FE channel:0x00 frame:1 vi_tstamp:3525849965 data:0x00000000
kworker/0:2-2015 [000] … 100.456072: rtcpu_vinotify_event: tstamp:3525899577 tag:CHANSEL_PXL_SOF channel:0x00 frame:2 vi_tstamp:3525899075 data:0x00000001
kworker/0:2-2015 [000] … 100.456072: rtcpu_vinotify_event: tstamp:3525899744 tag:ATOMP_FS channel:0x00 frame:2 vi_tstamp:3525899105 data:0x00000000
kworker/0:2-2015 [000] … 100.456072: rtcpu_vinotify_event: tstamp:3525902959 tag:CHANSEL_LOAD_FRAMED channel:0x04 frame:2 vi_tstamp:3525902592 data:0x08000000
kworker/0:2-2015 [000] … 100.456073: rtcpu_vinotify_event: tstamp:3526475339 tag:CHANSEL_PXL_EOF channel:0x00 frame:2 vi_tstamp:3526474671 data:0x023f0002
kworker/0:2-2015 [000] … 100.456073: rtcpu_vinotify_event: tstamp:3526475456 tag:ATOMP_FE channel:0x00 frame:2 vi_tstamp:3526474720 data:0x00000000
vi-output, adv7-7681 [003] … 100.457334: tegra_channel_capture_frame: sof:100.213238642
vi-output, adv7-7681 [003] … 100.477334: tegra_channel_capture_frame: sof:100.233230770
kworker/0:2-2015 [000] … 100.512133: rtcpu_vinotify_event: tstamp:3526524332 tag:CHANSEL_PXL_SOF channel:0x00 frame:1 vi_tstamp:3526523828 data:0x00000001
kworker/0:2-2015 [000] … 100.512137: rtcpu_vinotify_event: tstamp:3526524492 tag:ATOMP_FS channel:0x00 frame:1 vi_tstamp:3526523858 data:0x00000000
kworker/0:2-2015 [000] … 100.512137: rtcpu_vinotify_event: tstamp:3526527344 tag:CHANSEL_LOAD_FRAMED channel:0x04 frame:1 vi_tstamp:3526526981 data:0x08000000
kworker/0:2-2015 [000] … 100.512138: rtcpu_vinotify_event: tstamp:3527100097 tag:CHANSEL_PXL_EOF channel:0x00 frame:1 vi_tstamp:3527099426 data:0x023f0002
kworker/0:2-2015 [000] … 100.512139: rtcpu_vinotify_event: tstamp:3527100219 tag:ATOMP_FE channel:0x00 frame:1 vi_tstamp:3527099475 data:0x00000000
kworker/0:2-2015 [000] … 100.512139: rtcpu_vinotify_event: tstamp:3527149085 tag:CHANSEL_PXL_SOF channel:0x00 frame:2 vi_tstamp:3527148582 data:0x00000001
kworker/0:2-2015 [000] … 100.512140: rtcpu_vinotify_event: tstamp:3527149258 tag:ATOMP_FS channel:0x00 frame:2 vi_tstamp:3527148613 data:0x00000000
kworker/0:2-2015 [000] … 100.512140: rtcpu_vinotify_event: tstamp:3527724840 tag:CHANSEL_PXL_EOF channel:0x00 frame:2 vi_tstamp:3527724180 data:0x023f0002
kworker/0:2-2015 [000] … 100.512141: rtcpu_vinotify_event: tstamp:3527724962 tag:ATOMP_FE channel:0x00 frame:2 vi_tstamp:3527724228 data:0x00000000
vi-output, adv7-7681 [003] … 100.517328: tegra_channel_capture_frame: sof:100.273215090
vi-output, adv7-7681 [003] … 100.537318: tegra_channel_capture_frame: sof:100.293207250
vi-output, adv7-7681 [003] … 100.557316: tegra_channel_capture_frame: sof:100.313199346
kworker/0:2-2015 [000] … 100.568058: rtcpu_vinotify_event: tstamp:3528398596 tag:CHANSEL_PXL_SOF channel:0x00 frame:2 vi_tstamp:3528398092 data:0x00000001
kworker/0:2-2015 [000] … 100.568061: rtcpu_vinotify_event: tstamp:3528398758 tag:ATOMP_FS channel:0x00 frame:2 vi_tstamp:3528398122 data:0x00000000
kworker/0:2-2015 [000] … 100.568061: rtcpu_vinotify_event: tstamp:3528405277 tag:CHANSEL_LOAD_FRAMED channel:0x04 frame:2 vi_tstamp:3528404903 data:0x08000000
kworker/0:2-2015 [000] … 100.568062: rtcpu_vinotify_event: tstamp:3528974355 tag:CHANSEL_PXL_EOF channel:0x00 frame:2 vi_tstamp:3528973689 data:0x023f0002
kworker/0:2-2015 [000] … 100.568062: rtcpu_vinotify_event: tstamp:3528974470 tag:ATOMP_FE channel:0x00 frame:2 vi_tstamp:3528973739 data:0x00000000
kworker/0:2-2015 [000] … 100.568063: rtcpu_vinotify_event: tstamp:3529023386 tag:CHANSEL_PXL_SOF channel:0x00 frame:1 vi_tstamp:3529022847 data:0x00000001
kworker/0:2-2015 [000] … 100.568063: rtcpu_vinotify_event: tstamp:3529023548 tag:ATOMP_FS channel:0x00 frame:1 vi_tstamp:3529022877 data:0x00000000
kworker/0:2-2015 [000] … 100.568064: rtcpu_vinotify_event: tstamp:3529029928 tag:CHANSEL_LOAD_FRAMED channel:0x04 frame:1 vi_tstamp:3529029565 data:0x08000000
kworker/0:2-2015 [000] … 100.568065: rtcpu_vinotify_event: tstamp:3529599110 tag:CHANSEL_PXL_EOF channel:0x00 frame:1 vi_tstamp:3529598445 data:0x023f0002
kworker/0:2-2015 [000] … 100.568066: rtcpu_vinotify_event: tstamp:3529599225 tag:ATOMP_FE channel:0x00 frame:1 vi_tstamp:3529598492 data:0x00000000
kworker/0:2-2015 [000] … 100.568066: rtcpu_vinotify_event: tstamp:3529648140 tag:CHANSEL_PXL_SOF channel:0x00 frame:2 vi_tstamp:3529647600 data:0x00000001
kworker/0:2-2015 [000] … 100.568066: rtcpu_vinotify_event: tstamp:3529648301 tag:ATOMP_FS channel:0x00 frame:2 vi_tstamp:3529647630 data:0x00000000
kworker/0:2-2015 [000] … 100.568067: rtcpu_vinotify_event: tstamp:3529654614 tag:CHANSEL_LOAD_FRAMED channel:0x04 frame:2 vi_tstamp:3529654248 data:0x08000000
vi-output, adv7-7681 [003] … 100.577293: tegra_channel_capture_frame: sof:100.333191506
vi-output, adv7-7681 [003] … 100.597281: tegra_channel_capture_frame: sof:100.353183666
vi-output, adv7-7681 [003] … 100.617276: tegra_channel_capture_frame: sof:100.373175794
kworker/0:2-2015 [000] … 100.624088: rtos_queue_peek_from_isr_failed: tstamp:3530024166 queue:0x0b4b4500
kworker/0:2-2015 [000] … 100.624092: rtcpu_vinotify_event: tstamp:3530223866 tag:CHANSEL_PXL_EOF channel:0x00 frame:2 vi_tstamp:3530223197 data:0x023f0002
kworker/0:2-2015 [000] … 100.624092: rtcpu_vinotify_event: tstamp:3530223983 tag:ATOMP_FE channel:0x00 frame:2 vi_tstamp:3530223247 data:0x00000000
kworker/0:2-2015 [000] … 100.624101: rtcpu_vinotify_event: tstamp:3530272861 tag:CHANSEL_PXL_SOF channel:0x00 frame:1 vi_tstamp:3530272355 data:0x00000001
kworker/0:2-2015 [000] … 100.624102: rtcpu_vinotify_event: tstamp:3530273058 tag:ATOMP_FS channel:0x00 frame:1 vi_tstamp:3530272385 data:0x00000000
kworker/0:2-2015 [000] … 100.624102: rtcpu_vinotify_event: tstamp:3530278780 tag:CHANSEL_LOAD_FRAMED channel:0x04 frame:1 vi_tstamp:3530278416 data:0x08000000
kworker/0:2-2015 [000] … 100.624103: rtcpu_vinotify_event: tstamp:3530848627 tag:CHANSEL_PXL_EOF channel:0x00 frame:1 vi_tstamp:3530847953 data:0x023f0002
kworker/0:2-2015 [000] … 100.624103: rtcpu_vinotify_event: tstamp:3530848748 tag:ATOMP_FE channel:0x00 frame:1 vi_tstamp:3530848002 data:0x00000000
kworker/0:2-2015 [000] … 100.624104: rtcpu_vinotify_event: tstamp:3530897611 tag:CHANSEL_PXL_SOF channel:0x00 frame:2 vi_tstamp:3530897110 data:0x00000001
kworker/0:2-2015 [000] … 100.624104: rtcpu_vinotify_event: tstamp:3530897771 tag:ATOMP_FS channel:0x00 frame:2 vi_tstamp:3530897140 data:0x00000000
kworker/0:2-2015 [000] … 100.624105: rtcpu_vinotify_event: tstamp:3530903383 tag:CHANSEL_LOAD_FRAMED channel:0x04 frame:2 vi_tstamp:3530903014 data:0x08000000
kworker/0:2-2015 [000] … 100.624105: rtcpu_vinotify_event: tstamp:3531473393 tag:CHANSEL_PXL_EOF channel:0x00 frame:2 vi_tstamp:3531472708 data:0x023f0002
kworker/0:2-2015 [000] … 100.624105: rtcpu_vinotify_event: tstamp:3531473513 tag:ATOMP_FE channel:0x00 frame:2 vi_tstamp:3531472756 data:0x00000000
kworker/0:2-2015 [000] … 100.624106: rtcpu_vinotify_event: tstamp:3531522364 tag:CHANSEL_PXL_SOF channel:0x00 frame:1 vi_tstamp:3531521864 data:0x00000001
kworker/0:2-2015 [000] … 100.624106: rtcpu_vinotify_event: tstamp:3531522525 tag:ATOMP_FS channel:0x00 frame:1 vi_tstamp:3531521894 data:0x00000000
kworker/0:2-2015 [000] … 100.624107: rtcpu_vinotify_event: tstamp:3531528400 tag:CHANSEL_LOAD_FRAMED channel:0x04 frame:1 vi_tstamp:3531528031 data:0x08000000
vi-output, adv7-7681 [003] … 100.637261: tegra_channel_capture_frame: sof:100.393167954
vi-output, adv7-7681 [003] … 100.657254: tegra_channel_capture_frame: sof:100.413160114
vi-output, adv7-7681 [004] … 100.677243: tegra_channel_capture_frame: sof:100.433152210

Did anyone give some advice?

Thanks.

hello tek.xing,

this seems like stride alignment issue, could you please dump the value of byte-per-line for checking,
BTW, R32.1 was quite old, would you have plan to upgrade the software release?
thanks

Please tell me how to check the byte-per-line?step by step。
I have no plan to upgrade at present, i can try later.
Thanks.

hello tek.xing,

you’re able to check the image details for byte-per-line,
or, you may add debug message in below sources to check chan->format.bytesperline
$l4t-sources/public_sources/kernel/nvidia/drivers/media/platform/tegra/camera/vi/channel.c

[ 4.749559] tek.xing tegra_channel_update_format, bytesperline = 3840, preferred_stride = 0, bytesperline = 3840
[ 4.749894] tek.xing tegra_channel_update_format, bytesperline = 1440, preferred_stride = 0, bytesperline = 1440
[ 4.749897] tek.xing tegra_channel_update_format, bytesperline = 1440, preferred_stride = 0, bytesperline = 1440
[ 4.749924] tek.xing tegra_channel_update_format, bytesperline = 1440, preferred_stride = 0, bytesperline = 1440

Tx2 capture size is 720x576.
is it ok?

by the way, i want to know that the D-PHY could cause this issue?

hello tek.xing,

please have a try to apply this kernel change to add function for setting bytes-per-line.
thanks

diff --git a/drivers/media/platform/tegra/camera/vi/channel.c b/drivers/media/platform/tegra/camera/vi/channel.c
index 9f9a5dc..940b6ba 100644
--- a/drivers/media/platform/tegra/camera/vi/channel.c
+++ b/drivers/media/platform/tegra/camera/vi/channel.c
@@ -148,6 +148,25 @@ static u32 get_aligned_buffer_size(struct tegra_channel *chan,
        return size;
 }

+static void tegra_channel_set_bytesperline(struct tegra_channel *chan,
+                               const struct tegra_video_format *vfmt,
+                               struct v4l2_pix_format *pix)
+{
+       unsigned int bpl;
+       unsigned int numerator, denominator;
+       unsigned int align, fmt_align;
+       const struct tegra_frac *bpp = &vfmt->bpp;
+
+       denominator = (!bpp->denominator) ? 1 : bpp->denominator;
+       numerator = (!bpp->numerator) ? 1 : bpp->numerator;
+       fmt_align = (denominator == 1) ? numerator : 1;
+       align = lcm(chan->width_align, fmt_align);
+
+       bpl = (pix->width * numerator) / denominator;
+       pix->bytesperline = tegra_core_bytes_per_line(
+               pix->width, align, vfmt);
+}
+
 static void tegra_channel_fmt_align(struct tegra_channel *chan,
                                const struct tegra_video_format *vfmt,
                                u32 *width, u32 *height, u32 *bytesperline)
@@ -1836,6 +1855,7 @@ __tegra_channel_try_format(struct tegra_channel *chan,

        v4l2_fill_pix_format(pix, &fmt.format);

+       tegra_channel_set_bytesperline(chan, vfmt, pix);
        tegra_channel_fmt_align(chan, vfmt,
                                &pix->width, &pix->height, &pix->bytesperline);

No change,Same as before.

adv7282am output format and size is yuv422 8bit 720x576.

I use below command to capture video stream:
gst-launch-1.0 v4l2src device=/dev/video0 ! ‘video/x-raw, format=(string)UYVY, width=(int)720, height=(int)576, framerate=(fraction)30/1’ ! xvimagesink -ev

[ 36.825421] tek.xing tegra_channel_set_bytesperline, bytesperline = 1440
[ 36.825436] tek.xing tegra_channel_update_format, bytesperline = 1440, preferred_stride = 1440, bytesperline = 1440

hello tek.xing,

could you please dump the yuv capture with v4l2 standard controls, and please attach it for us checking.
for example,
$ v4l2-ctl -d /dev/video0 --set-fmt-video=width=720,height=576,pixelformat=UYVY --set-ctrl bypass_mode=0 --stream-mmap --stream-count=5 --stream-to=test.raw

test.raw.log (2.4 MB)

i use your command captured and use pYUV decode it as below:

test.raw file can’t be upload, you can download it and rename it to test.raw.

please have a try to apply this patch to add interlace support.
vi4-add-interlace-support.patch.txt (11.3 KB)

adv7282am is progressive video output, because i enable I2P function,
adv7282am converts the interlaced video input into a progressive video(576P) output.

And, when i applyed this patch, the issue is still exist.

hello tek.xing,

could you please hack bytes-per-line values in the kernel driver to check we’re in the right direction…
thanks

i don’t understand your mean cleayly. adv7282am 's byter-per-line is 1440, and i print it in kernel is also 1440.

[ 5082.558561] tek.xing tegra_channel_set_bytesperline, bytesperline = 1440
[ 5082.558591] tek.xing tegra_channel_update_format, bytesperline = 1440, preferred_stride = 1440, bytesperline = 1440

so far,i don’t know the root cause of this iusse.

hello tek.xing,

may I know what’s your result by converting to NV12 formats.
i.e. $ gst-launch-1.0 v4l2src ! 'video/x-raw,width=720, height=576,format=(string)UYVY' ! nvvidconv ! 'video/x-raw(memory:NVMM),format=(string)NV12' ! nvoverlaysink

hello tek.xing,

there’s VI requirements that must be atom (64-Byte) aligned; bytesperline=1440 did not following this.
could you please adjust the output format as 736x576 for testing? the idea is let the bytesperline changes to 1472.
thanks

The manufacturer hasn’t replied to me so far,but,i think, It is not feasible.

adv7282am can output below size:

Except for 720x576, none of the others can be captured by TX2.

please have a quick testing with hard code the bytesperline values in kernel driver as 1472.

The manufacturer replyed:ADV7282am does not (process up scaling and down scaling) have the capability to convert from one video resolution to other.