Hi everyone,
I use Oirn module the BSP version is 3.5.1, I cannot capture the first frame of the sensor output image. How to fix this issue? Thanks.
How do you know can’t capture the first frame?
I added log code in tegra_i2c_xfer() funciton(kernel/kernel-5.10/drivers/i2c/busses/i2c-tegra.c). When i2c transfed one message in output current time, and I added log code in vi5_capture_dequeue() funciton(kernel/nvidia/drivers/media/platform/tegra/camera/vi/vi5_fops.c). When captured one frame output start of frame time and end of frame time and current time, the code is as follows:
// tegra_i2c_xfer() funciton
if (!pm_runtime_enabled(i2c_dev->dev))
tegra_i2c_runtime_suspend(i2c_dev->dev);
else
pm_runtime_put(i2c_dev->dev);
dev_info(i2c_dev->dev, "i2c send msg, t = %llu\n", ktime_get_real());
return ret ?: i;
// vi5_capture_dequeue() funciton
dev_info(&chan->video->dev, "sof = %llu, eof = %llu, time= %lld\n",
descr->status.sof_timestamp, descr->status.eof_timestamp, ktime_get_real());
/* Read EOF from capture descriptor */
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0)
ts = ns_to_timespec((s64)descr->status.eof_timestamp);
#else
ts = ns_to_timespec64((s64)descr->status.eof_timestamp);
#endif
#if KERNEL_VERSION(5, 4, 0) > LINUX_VERSION_CODE
trace_tegra_channel_capture_frame("eof", ts);
#else
trace_tegra_channel_capture_frame("eof", &ts);
#endif
When I started capturing images, I used logical analysis to capture I2C and MIPI signals.
T1 is timetick of Oin write register of stream on to sensor via I2C.
T2 is the end timetick of the 1st image output from sensor via MIPI.
T3 is the end timetick of the 2nd image output from sensor via MIPI.
T2-T1=52.7ms, T3-T1=88.4ms.
And kernel output log is as below:
[ 80.073881] tegra-i2c 3180000.i2c: send msg, t = 1714004503554843136
[ 80.162537] video4linux video0: sof = 103265755264, eof = 103282957376, time= 1714004503643490240
[ 80.198100] video4linux video0: sof = 103301451808, eof = 103318653920, time= 1714004503679057344
The timetick is 80.073881s when Orin wrote register of stream on to sensor via I2C.
The timetick is 80.162537s when Orin captured the 1st image.
The start timetick of image is 103265755264ns, the end timetick of image is 103282957376ns.
The time difference between capturing the first frame and writing the register is:
80.162537s-80.073881s=88.656ms, it longger than 52.7ms(T2-T1).
So Orin can not capture the 1st frame by sensor.
Is this still an issue to support? Any result can be shared?
Yes, I need to support.
Could you check the frame ID from the trace log.
Thanks
How to enable trace log?
Enable by below command.
sudo su
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
cat /sys/kernel/debug/tracing/trace
Is this still an issue to support? Any result can be shared?
Hi kay,
Please refer to the attachment.
CSI1_JP5.0.2.dbg.log (20.6 KB)
Should have more information like FS/SOF/FE/EOF/… information and include the frame count like below.(frame:49)
kworker/0:5-22342 [000] .... 409743.690661: rtcpu_vinotify_event: tstamp:12805376058889 cch:0 vi:0 tag:VIFALC_ACTIONLST channel:0x23 frame:49 vi_tstamp:409772017039936 data:0x0000000002020031
kworker/0:5-22342 [000] .... 409743.690664: rtcpu_vinotify_event: tstamp:12805376059062 cch:0 vi:0 tag:VIFALC_ACTIONLST channel:0x23 frame:49 vi_tstamp:409772017056672 data:0x0000000000020031
kworker/0:5-22342 [000] .... 409743.690665: rtcpu_vinotify_event: tstamp:12805376059234 cch:0 vi:0 tag:FS channel:0x00 frame:50 vi_tstamp:409772017546880 data:0x0000000000000010
kworker/0:5-22342 [000] .... 409743.690666: rtcpu_vinotify_event: tstamp:12805376059389 cch:0 vi:0 tag:ATOMP_FS channel:0x00 frame:50 vi_tstamp:409772017546944 data:0x0000000800000000
kworker/0:5-22342 [000] .... 409743.690666: rtcpu_vinotify_event: tstamp:12805376059561 cch:0 vi:0 tag:CHANSEL_EMBED_SOF channel:0x23 frame:50 vi_tstamp:409772017547616 data:0x0000000000000004
kworker/0:5-22342 [000] .... 409743.690667: rtcpu_vinotify_event: tstamp:12805376059710 cch:0 vi:0 tag:CHANSEL_EMBED_EOF channel:0x23 frame:50 vi_tstamp:409772017584096 data:0x0000000000010008
kworker/0:5-22342 [000] .... 409743.690668: rtcpu_vinotify_event: tstamp:12805376059880 cch:0 vi:0 tag:ATOMP_EMB_DATA_DONE channel:0x23 frame:50 vi_tstamp:409772017584928 data:0x0000000000000000
kworker/0:5-22342 [000] .... 409743.690668: rtcpu_vinotify_event: tstamp:12805376060041 cch:0 vi:0 tag:VIFALC_ACTIONLST channel:0x23 frame:50 vi_tstamp:409772017608736 data:0x0000000003020032
kworker/0:5-22342 [000] .... 409743.690669: rtcpu_vinotify_event: tstamp:12805376060209 cch:0 vi:0 tag:CHANSEL_PXL_SOF channel:0x23 frame:50 vi_tstamp:409772017602848 data:0x0000000000000001
kworker/0:5-22342 [000] .... 409743.690670: rtcpu_vinotify_event: tstamp:12805376060359 cch:0 vi:0 tag:VIFALC_ACTIONLST channel:0x23 frame:50 vi_tstamp:409772017632224 data:0x0000000008020032
kworker/0:5-22342 [000] .... 409743.690670: rtcpu_vinotify_event: tstamp:12805376060531 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:409772017906208 data:0xcd9ce50010000000
kworker/0:5-22342 [000] .... 409743.690671: rtcpu_vinotify_event: tstamp:12805376060679 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:409772017949696 data:0x0000000031000033
kworker/0:5-22342 [000] .... 409743.690675: rtcpu_vinotify_event: tstamp:12805377013698 cch:0 vi:0 tag:CHANSEL_PXL_EOF channel:0x23 frame:50 vi_tstamp:409772064179424 data:0x00000000099f0002
kworker/0:5-22342 [000] .... 409743.690676: rtcpu_vinotify_event: tstamp:12805377013851 cch:0 vi:0 tag:FE channel:0x00 frame:50 vi_tstamp:409772064179936 data:0x0000000000000020
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.