# Metadata indicates 7+ seconds image latency

**URL:** <https://forums.developer.nvidia.com/t/metadata-indicates-7-seconds-image-latency/291636>\
**Category:** DRIVE AGX Orin General\
**Tags:** driveos-nvmedia\
**Created:** [May 2, 2024, 12:41pm UTC](https://forums.developer.nvidia.com/t/metadata-indicates-7-seconds-image-latency/291636 "2024-05-02T12:41:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![manthey](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@manthey](https://forums.developer.nvidia.com/u/manthey)\
**Post date:** [May 2, 2024, 12:41pm UTC](https://forums.developer.nvidia.com/t/metadata-indicates-7-seconds-image-latency/291636/1 "2024-05-02T12:41:44Z")

</div>

Please provide the following info (tick the boxes after creating this topic):  
**Software Version**  
 DRIVE OS 6.0.8.1

**Target Operating System**  
 Linux

**Hardware Platform**  
 DRIVE AGX Orin Developer Kit (not sure its number)

I read current the TSC clock value in ticks as described [here](https://forums.developer.nvidia.com/t/tsc-timestamp-when-nvpps-is-disabled-or-ptp-is-not-synching/288284/5) and compare it with the image buffer metadata INvSIPLClient::ImageMetaData::frameCaptureStartTSC and INvSIPLClient::ImageMetaData::frameCaptureTSC values in the moment I receive the buffer.

This is what we see:

frameCaptureStartTSC: 3181374267758 ticks  
frameCaptureTSC: 3181375729268 ticks  
TSCnow: 3181610295295 ticks

The difference of frameCaptureStartTSC to frameCaptureTSC is 1,461,510 which converts 1461510 ticks \*32ns/tick = 46,768,320ns = 46ms which is little less than a frame period

The difference of tscnow to frameCaptureStartTSC yes is 236,027,537 ticks which is 7,552,881,184ns or 7.5 seconds!

In other words the SIPLCamera Latency according to the TSC timestamps is 7.5 seconds. That would be unusable for any self driving use case. Given the fact we just retrieve the RAW frame we are not using any ISP. How can we reduce the latency?

---

<div class="post-metadata">

**Author:** ![VickNV](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/vicknv/32/14043_2.png) [@VickNV](https://forums.developer.nvidia.com/u/VickNV)\
**Post date:** [May 2, 2024, 5:58pm UTC](https://forums.developer.nvidia.com/t/metadata-indicates-7-seconds-image-latency/291636/3 "2024-05-02T17:58:00Z")

</div>

Where are you obtaining the ‘TSCnow’ value? You might try correlating the TSC and the PTP in the RecordCaptureDoneEventTime() function found in /drive/drive-linux/samples/nvmedia/nvsipl/test/camera/CNvSIPLMasterNvSci.hpp using the NVPPS\_GETEVENT ioctl.

---

<div class="post-metadata">

**Author:** ![manthey](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@manthey](https://forums.developer.nvidia.com/u/manthey)\
**Post date:** [May 2, 2024, 6:46pm UTC](https://forums.developer.nvidia.com/t/metadata-indicates-7-seconds-image-latency/291636/4 "2024-05-02T18:46:22Z")

</div>

I read the physical memory address

> devmem2 0x0c6a0010 —\> A  
> devmem2 0x0c6a0014----\> B  
> Current TSC tick is A + (B \<\< 32)

I verified the values I am reading and it is definitely a clock at 31,25 Mhz (32ns period).  
We are not using PTP or PPS yet. PTP\_TSC offset is always 0.

We tested on another AGX drive and that showed even a 44 second offset. So it seems the TSC clock values are shifted by a random number. An uninitialised offset would explain the behavior.

 ![image](https://global.discourse-cdn.com/nvidia/original/4X/1/f/f/1ff6023f85e2d425b14d064dbdd9a96d6f0caa0c.png)

---

<div class="post-metadata">

**Author:** ![manthey](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@manthey](https://forums.developer.nvidia.com/u/manthey)\
**Post date:** [May 2, 2024, 7:49pm UTC](https://forums.developer.nvidia.com/t/metadata-indicates-7-seconds-image-latency/291636/5 "2024-05-02T19:49:58Z")

</div>

Ok, it is getting pretty obvious. This is the log of another system

frameCaptureStartTSC, frameCaptureTSC, TSCNow, TSCNow - frameCaptureTSC  
650782250, 652243753, 2040222771, **1387979018**  
652518862, 653980366, 2041959412, **1387979046**  
654255471, 655716975, 2043696053, **1387979078**  
655992084, 657453587, 2045432694, **1387979107**  
657728696, 659190200, 2047170289, **1387980089**

So the distance between TSCNow and frameCaptureTSC almost remains constant. What this strongly indicates is that all timestamps use in fact the same clock, while frameCaptureTSC frameCaptureStartTSC get adjusted by an uninitialised constant

---

<div class="post-metadata">

**Author:** ![VickNV](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/vicknv/32/14043_2.png) [@VickNV](https://forums.developer.nvidia.com/u/VickNV)\
**Post date:** [May 2, 2024, 8:32pm UTC](https://forums.developer.nvidia.com/t/metadata-indicates-7-seconds-image-latency/291636/6 "2024-05-02T20:32:46Z")

</div>

Please try calling [NvpGetTimeMark()](https://developer.nvidia.com/docs/drive/drive-os/6.0.8.1/public/drive-os-linux-sdk/common/topics/util_setup/benchmarking_library_functions.html#concept_xly_gcj_ytb__section_hrs_3cj_ytb) to get the TSCNow.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/system/32/68080_2.png) [@system](https://forums.developer.nvidia.com/u/system)\
**Post date:** [May 20, 2024, 6:04pm UTC](https://forums.developer.nvidia.com/t/metadata-indicates-7-seconds-image-latency/291636/9 "2024-05-20T18:04:55Z")

</div>

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