ISensorTimestampTsc null


when I try to use ISensorTimestampTsc it’s always NULL.
Nano dev board B01, IMX477, JetPack 4.6.1

to test, add follow lines to “10_camera_recording” example starting from 273:

                IBuffer* iBuff = interface_cast<IBuffer>(buffer);
                auto *p2 = interface_cast<const Ext::ISensorTimestampTsc>( iBuff->getMetadata() );
                printf("p2: %p", p2);

What I’m doing wrong? How to get ISensorTimestampTsc?

hello prapor,

what exactly is this… auto *p2?
please share your code snippets completely for reference,


+++ main.cpp	2022-10-19 01:37:01.933494199 -0500
@@ -31,6 +31,7 @@
 #include "nvmmapi/NvNativeBuffer.h"
 #include <Argus/Argus.h>
+#include <Argus/Ext/SensorTimestampTsc.h>
 #include <NvVideoEncoder.h>
 #include <NvApplicationProfiler.h>
@@ -268,6 +269,14 @@
         v4l2_buf.index = bufferIndex;
         Buffer* buffer = stream->acquireBuffer();
+	{
+		IBuffer* iBuff = interface_cast<IBuffer>(buffer);
+		const Ext::ISensorTimestampTsc *p2 = interface_cast<const Ext::ISensorTimestampTsc>( iBuff->getMetadata() );
+		if (p2 == NULL)
+			printf("ISensorTimestampTsc is NULL\n");
+	}
         /* Convert Argus::Buffer to DmaBuffer and queue into v4l2 encoder */
         DmaBuffer *dmabuf = DmaBuffer::fromArgusBuffer(buffer);
         CHECK_ERROR(m_VideoEncoder->output_plane.qBuffer(v4l2_buf, dmabuf));
@@ -522,6 +531,7 @@
     /* Configure the OutputStream to use the EGLImage BufferType */
+    iStreamSettings->setMetadataEnable(true);
     /* Create the OutputStream */
     UniqueObj<OutputStream> outputStream(iCaptureSession->createOutputStream(streamSettings.get()));

hello prapor,

the timestamps include in metadata from TSC hardware.
please refer to below thread as see-also.

Example from the post you point to, also return NULL (doesn’t print sof/eof time).
Does ISensorTimestampTsc available for Jetson Nano 4GB (or Jetson Nano 2GB), please?

hello prapor,

ahh… Nano series don’t support saving TSC HW timestamp into metadata.
may I know what’s the actual use-case? thanks

BTW, you may use below to fetch timestamps.
uint64_t CaptureMetadataImpl::getSensorTimestamp()

Thank you. I already doing it, just wanted to try something new :)

use case: synchronization of many sensors.
They already synchronized in HW and 90% of time ( CaptureMetadataImpl::getSensorTimestamp() ) shows the same value, but the rest 10% of time it’s (+/- 1000).
I thought maybe Ext::ISensorTimestampTsc will be always the same.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.