Hi,
On JetPack-4.2, I got empty timestamps from V4l2 buffers while capturing from a camera sensor.
Checking vi4_fops.c and channel.c Kernel files, I found that the timestamp of the buffers is not updated in “tegra_channel_capture_frame method” for “single_thread” only for “multi_thread”.
I fixed this, with the following patch:
From: eramirez392 <enrique.ramirez@ridgerun.com>
Date: Fri, 12 Jul 2019 11:36:45 -0600
Subject: [PATCH] Update buffer's timestamp for single thread capture
---
kernel/nvidia/drivers/media/platform/tegra/camera/vi/channel.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/kernel/nvidia/drivers/media/platform/tegra/camera/vi/channel.c b/kernel/nvidia/drivers/media/platform/tegra/camera/vi/channel.c
index c53f779..c82dcb9 100644
--- a/kernel/nvidia/drivers/media/platform/tegra/camera/vi/channel.c
+++ b/kernel/nvidia/drivers/media/platform/tegra/camera/vi/channel.c
@@ -513,6 +513,8 @@ void tegra_channel_ring_buffer(struct tegra_channel *chan,
#else
/* TODO: granular time code information */
vb->timecode.seconds = ts->tv_sec;
+ /* update time stamp of the buffer */
+ vb->vb2_buf.timestamp = timespec_to_ns(ts);
#endif
}
--
2.7.4
Regards,
-Enrique