I have a Jetson Xavier NX, L4T version we are using is 32.5.
We are using radar ‘iwr6843isk’ to capture raw data and pass it to Jetson. I would like to get time stamps from the driver we use for each frames.
I went through some of the related topisc
If your problem is don’t know how to get the timestamp.
You can reference to the v4l2-ctl tools source code is public.
Current the timestamp is Monotonic mode if you want to change it you have to modify the vi4_fops.c
nvidia@nvidia-desktop:~$ v4l2-ctl --stream-mmap --stream-count=3 -d /dev/video0 --verbose
vb2_buffer is defined in videobuf2-core.h which is only available in the kernel source. Trying to include it in user space causes a whole host of issues.
When that failed I spent some time trying to cherry pick out the struct definitions (vb2_buffer, vb2_queue, vb2_plane, etc) but that quickly got down to some includes only available in the kernel source.
I don’t think that using vb2_buffer (or vb2_v4l2_buffer) is an option in user space.
please refer to below to demonstrate how to check the timestamp.
offset_ns is used to calculate the capture timestamp from system time.
you might also check below example for offset_ns to compensate the capture timestamp.
root@tegra-ubuntu:~# cat /sys/devices/system/clocksource/clocksource0/offset_ns
to add debug prints to gather kernel time.
diff --git a/drivers/media/platform/tegra/camera/vi/vi5_fops.c b/drivers/media/platform/tegra/camera/vi/vi5_fops.c
Also I have tried printing the time stamp for start and end of frame from the vi driver. But I want to get the exact timestamping from the driver. How can this be achieved?
Try to trace the …/kernel/nvidia/drivers/media/platform/tegra/camera/vi/vi5_fops.c
to be more specific,
you should check VI-5 kernel driver, $public_sources/kernel_src/kernel/nvidia/drivers/media/platform/tegra/camera/vi/vi5_fops.c
please check below for start-of-frame timestamp, which sending to user-space.
static void vi5_capture_dequeue(struct tegra_channel *chan,
struct tegra_channel_buffer *buf)
vb->vb2_buf.timestamp = descr->status.sof_timestamp;
October 18, 2022, 12:02am
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.