My development environment:system : jetpack 6.0
Blockquote
wake_up_interruptible(&chan->start_wait);
/* Read SOF from capture descriptor */
ts = ns_to_timespec64((s64)descr->status.sof_timestamp);
trace_tegra_channel_capture_frame(“sof”, &ts);
vb->vb2_buf.timestamp = descr->status.sof_timestamp;
As far as I understand, descr->status.sof_timestamp is the time of RCE. Is there a reliable equation to convert this time to system time (TSC) time?
hello Denisss,
since you’re now working with l4r-r32.4.4. please note that there’ll be timestamp modification for next public release.
please refer to the statement in Topic 78821 , recap as below…
we had some changes for Xavier to plumbed up the hardware timestamps into camera software stack.
there’ll be start-of-frame and end-of-frame sensor timestamps include in metadata from TSC hardware, by using new interfaces for TSC HW timestamp; you may expect those changes will be include to next p…
Is this topic applicable to jetpack6?
hello MushroomHunter,
please refer to developer guide,
it’s Argus::Ext::ISensorTimestampTsc::getSensorSofTimestampTsc to return the VI HW (SOF) timestamp based on TSC.
you may see-also Argus::ICaptureMetadata::getSensorTimestamp of the timestamp for the sensor.
for comparison,
please try adding some code snippets to Argus sample application, such as yuvJpeg
for instance,
+++ b/public/samples/yuvJpeg/main.cpp
@@ -32,6 +32,7 @@
#include "Thread.h"
#include <Argus/Argus.h>
+#include <Argus/Ext/SensorTimestampTsc.h>
#include <EGLStream/EGLStream.h>
@@ -98,6 +99,8 @@ bool ConsumerThread::threadExecute()
{
IEGLOutputStream *iStream = interface_cast<IEGLOutputStream>(m_stream);
IFrameConsumer *iFrameConsumer = interface_cast<IFrameConsumer>(m_consumer);
+ Ext::ISensorTimestampTsc *iSensorTimestampTsc = NULL;
+ unsigned long long tscTimeStamp = 0;
// Wait until the producer has connected to the stream.
CONSUMER_PRINT("Waiting until producer is connected...\n");
@@ -132,6 +135,13 @@ bool ConsumerThread::threadExecute()
static_cast<unsigned long long>(iMetadata->getSensorTimestamp()),
iMetadata->getSceneLux());
+ iSensorTimestampTsc = interface_cast<Ext::ISensorTimestampTsc>(metadata);
+ if (!iSensorTimestampTsc)
+ ORIGINATE_ERROR("failed to get iSensorTimestampTsc inteface");
+ tscTimeStamp = iSensorTimestampTsc->getSensorSofTimestampTsc();
+ CONSUMER_PRINT("FrameNum= %lu, TSC timestamps (us)= %llu\n",
+ iFrame->getNumber(), tscTimeStamp/1000);
+
here’re the results for demonstration.
CONSUMER: Acquired Frame: 138, time 9292694120000
CONSUMER: Sensor Timestamp: 9292648434000, LUX: 1751.220947
CONSUMER: FrameNum= 138, TSC timestamps (us)= 9317942798
hi JerryChang
Our current camera is a yuv image,Can we use this method?I have tried this method before, but it always fails. I don’t know if there is any other configuration required?
There is another question, if this method is used, is the camera timestamp the conversion of tsc and rce timestamps, or does rtcpu directly use tsc timestamp as camera timestamp.
@JerryChang
The image data we currently output is in YUV format and has not passed through ISP. So can I still use this interface?
hello MushroomHunter,
unfortunately not, Argus sample application works with bayer sensors only.
hello MushroomHunter,
you may refer to below to obtain sof_timestamp from VI driver,
please also note that, TSC is 31.25MHz ~= 32 ns, this sof_timestamp
is timestamp processed by RCE.
for instance,
diff --git a/drivers/media/platform/tegra/camera/vi/vi5_fops.c
@@ -582,6 +582,8 @@ static void vi5_capture_dequeue(struct tegra_channel *chan,
trace_tegra_channel_capture_frame("sof", &ts);
vb->vb2_buf.timestamp = descr->status.sof_timestamp;
+ pr_info("JC: %s: frame_id= %d sof_timestamp= %llu\n", __func__, descr->status.frame_id, descr->status.sof_timestamp);
My expectation is to put the camera and the system in the same time domain. And the results of my current test are that the timestamp of RCE is much faster than the system timestamp.
You can refer to my postRCE timestamp vs system UTC timestamp
hello MushroomHunter,
TSC timestamp is a counter, the period is 32 ns (due to 31.25MHz). you may multiply by 32 to convert TSC to nanoseconds.
RCE timestamp is calculated from TSC to obtain the SOF/EOF timestamps.
let’s following up Topic 313528 for your further request.
system
Closed
December 18, 2024, 3:38am
13
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.