prapor
October 18, 2022, 11:18am
1
Hello,
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,
thanks
prapor
October 19, 2022, 6:44am
4
/usr/src/jetson_multimedia_api/samples/10_camera_recording
+++ 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->setBufferType(BUFFER_TYPE_EGL_IMAGE);
+ 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.
hi all,
for the r32.5 release
you are able to fetch start-of-frame and end-of-frame timing via TSC HW timestamp.
it returns the VI HW (SoF/EoF) timestamp based-on tegra wide timestamp system counter (TSC), it’s the timestamp for the sensor (unit in nanoseconds).
here’s code snippet by modify Argus sample code (i.e. userAutoExposure) to use the interface to get TSC HW timestamp.
for example,
+++ b/public/samples/userAutoExposure/main.cpp
@@ -32,6 +32,7 @@
#include <stdlib.h>
#include <Arg…
prapor
October 23, 2022, 2:48pm
6
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()
prapor
October 24, 2022, 5:24pm
9
Thank you. I already doing it, just wanted to try something new :)
prapor
October 24, 2022, 5:27pm
10
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.