This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Using nTimeStamp and nTickCount in ezsdk_dm814x-evm_5_05_01_04

Hello TI,


We have DM8148 based custom board and we are using ezsdk_dm814x-evm_5_05_01_04. We have an application based on capture_encode demo. I have few question regarding the fields nTickCount and nTimeStamp:

  1. What is the purpose of nTickCount field and why it is currently not used?
  2. Is the value of nTimeStamp depends on ARM CPU usage?

Can anyone please let me know the usage of these fields?

Thanks in advance.

Krunal

  • Hello,

    Krunal Patel_11 said:
    What is the purpose of nTickCount field and why it is currently not used?

    I should check.

    Krunal Patel_11 said:
    Is the value of nTimeStamp depends on ARM CPU usag

    nTimestamp gives the value as provided by the capture driver.

    Check also :

    BR

    Margarita

  • Hello,

        OMX_U32 nTickCount;         /**< Optional entry that the component and
                                         application can update with a tick count
                                         when they access the component.  This
                                         value should be in microseconds.  Since
                                         this is a value relative to an arbitrary
                                         starting point, this value cannot be used
                                         to determine absolute time.  This is an
                                         optional entry and not all components
                                         will update it.*/

    Check component-sources/omx_05_02_00_46/include, file OMX_Core.h

    BR

    Margarita

  • Hello Margarita,

    I have already checked the definition of nTickCount in OMX_Core.h.

    But my question is:

    1. In capture_encode demo why 'nTickCount' is '0'?
    2. Also when I checked the value of nTimeStamp its value increases either by 16 or by 24 even if the frame rate is 60 fps. Can you please let me know the reason for this? Will this field be updated after every frame?

    Thanks,

    Krunal

  • Hello Margarita,

    Any updates on the above queries? Kindly find the table for the different nTimeStamp values and the difference between them. Ideally the difference should be 16 or 17. But sometimes it is 24.

    FrameCounter nTimeStamp Difference between Present and previous frame
    0 16029
    1 16053 24
    2 16069 16
    3 16085 16
    4 16101 16
    5 16117 16
    6 16133 16
    7 16149 16
    8 16165 16
    9 16181 16
    10 16197 16
    11 16213 16
    12 16237 24
    13 16253 16
    14 16269 16
    15 16285 16
    16 16301 16
    17 16317 16
    18 16333 16
    19 16349 16
    20 16365 16
    21 16381 16
    22 16397 16
    23 16413 16
    24 16437 24
    25 16453 16
    26 16469 16
    27 16485 16
    28 16501 16
    29 16517 16
    30 16533 16
    31 16549 16
    32 16565 16
    33 16581 16
    34 16597 16
    35 16613 16
    36 16637 24
    37 16653 16
    38 16669 16
    39 16685 16
    40 16701 16
    41 16717 16
    42 16733 16
    43 16749 16
    44 16765 16
    45 16781 16
    46 16797 16
    47 16821 24
    48 16837 16
    49 16853 16
    50 16869 16
    51 16885 16
    52 16901 16
    53 16917 16
    54 16933 16
    55 16949 16
    56 16965 16
    57 16981 16
    58 16997 16
    59 17021 24
    60 17037 16
    61 17053 16
    62 17069 16
    63 17085 16
    64 17101 16
    65 17117 16
    66 17133 16
    67 17149 16
    68 17165 16
    69 17181 16
    70 17197 16
    71 17221 24
    72 17237 16
    73 17253 16
    74 17269 16
    75 17285 16
    76 17301 16
    77 17317 16
    78 17333 16
    79 17349 16
    80 17365 16
    81 17381 16
    82 17397 16
    83 17421 24
    84 17437 16
    85 17453 16
    86 17469 16
    87 17485 16
    88 17501 16
    89 17517 16
    90 17533 16
    91 17549 16
    92 17565 16
    93 17581 16
    94 17605 24
    95 17621 16
    96 17637 16
    97 17653 16
    98 17669 16

    Please let me know if you need more details.


    Thanks,

    Krunal

  • Hello,

    For the first it should be 24ms and for the rest 16ms.

    BR
    Margarita
  • Can you please elaborate? What I noticed is after every 10 or 11 frames the difference is 24 and for all other it is 16.

    Thanks,
    Krunal
  • Hi Margarita,

    Can you please explain "For the first it should be 24ms and for the rest 16ms" in more detail?

    Thanks,
    Krunal
  • Hello,

    It seems that the queued  buffer to the capture driver will dequeued after a callback from the capture driver. It gives a callback after 8ms.

    BR

    Margarita

  • Thanks for the responses.

    Krunal
  • Hi Margarita,

    I have few more questions regarding the timestamps and buffers.

    1. Can you give us a link to the driver code handling captured buffers from VFCC?
    2. Can you give us an explanation of VFCC firmware and driver interaction?
      1. How driver is notified about the new buffer is ready?
      2. How driver is aware of buffers timestamp?
    3. Why nTimeStamp resolution is 8 ms?

    Thanks,

    Krunal

  • Hello,

    The VFCC code is in the overlay package which is under NDA and can not be discussed in the public forum. Contact your local FAE or TI representative for information how can be obtain it.

    BR
    Margarita

  • Margarita,

    Can you please share your email address so that we can discuss it over email?

    Thanks,
    Krunal
  • Hello Margarita,

    Can you please email me the responses on "krunal.patel@einfochips.com"?

    Thanks,
    Krunal
  • Hello Margarita,

    Can you please let me know how and where are the buffers filled with data containing video frame, timestamp, etc.?

    Thanks,
    Krunal
  • Hello Krunal,

    Krunal Patel_11 said:
    Can you please let me know how and where are the buffers filled with data containing video frame, timestamp, etc.?

    Are you mean in the code?

    BR

    Margarita

  • Yes. If it cannot be discussed here on public forum you can email me the details on my email id "krunal.patel@einfochips.com"

    Thanks,
    Krunal
  • Hello,

    Do you have the overlay package?

    BR
    Margarita
  • Yes, currently we are using ezsdk_dm814x-evm_5_05_01_04_overlay_setuplinux.

    Thanks,
    Krunal
  • Hello,

    You could check omx_vfcc_drvif.c in the vfcc component folder and in the component-sources/hdvpss_xx_xx_xx_xx/packages/ti/psp/vps/drivers/capture folder (vps_capture.h: IOCTL_VPS_CAPT_CFG_TIME_STAMPING_FRAMES).

    BR
    Margarita

  • Hi Margarita,

    Thanks for the information. 

    In addition to the above information I have some queries:

    1. Can we add a new field along with the video timestamp which can be used to mark the frame number(i.e. sequence number)?
    2. Can you please confirm that the timestamp values will be accurate in case of CPU spikes?
    3. Can there be cases when the frames can be lost between driver to user space during CPU spikes(high CPU usage)?

    Thanks,

    Krunal

  • Hello,

    I haven't try this but you could try.
    The CPU load could increase since for every captured frame an interrupt would be generated.

    BR
    Margarita

  • Hello Margarita,

    We have observed at our end that during high CPU usage the difference between timestamp of two consecutive frames is large. Due to this we suspect that there may be frame drop in between.

    So can you please confirm that whether is it possible to validate are there any frame drops or not?

    Please let me know if there are any queries regarding our requirement.

    Thanks,
    Krunal
  • Hi Margarita,

    Any updates or findings on this issue?

    Thanks,
    Krunal
  • Hello,

    I can not set up your use case.

    You could check for frame drop by using loggerSMDump.
    You could also try the capture driver stand alone is the a frame drop or not. Also you could check the timestamps.
    This example you could find in the hdvpss folder in the overlay package. You need CCS to execute this exmaple.

    BR
    Margarita
  • Hello,

    Could you check this on EVM first?

    BR
    Margarita
  • Hi Margarita,

    From your previous response "It seems that the queued  buffer to the capture driver will dequeued after a callback from the capture driver. It gives a callback after 8ms."

    Can you please let us know if there is any way by which we can reduce the callback time of 8ms?

    Thanks,
    Krunal

  • Hello,

    Check my previous post before this one which you posted:"For the first it should be 24ms and for the rest 16ms."

    Have you tried the capture example in the HDVPSS folder on the EVM with CCS?
    Could you print the timestamps?

    BR
    Margarita
  • Hi Margarita,

    I didn't got a chance to try the capture example on the EVM with CCS.
    But I did print the timestamps in the VPSS capture firmware and got the print-outs on the A8 core using the remote_debug_client.out utility.
    What I noticed is: Every 6th frame takes 40ms in capture completion, while other frames takes 32ms. I even checked the time taken by the callback function. It is same in the 6th frame capture case as in other frame capture case.

    Can you please explain me the reason for this behavior?

    Thanks,
    Krunal
  • Hi Margarita,

    We tried with the capture_encode demo on EVM and we got the same results.
    Any updates on this behavior?

    Thanks,
    Krunal
  • Hello,

    The driver team response is:

    "It is happening because, the fractional part of 0.667 accumated over 12 frames.
    12x0.667 = 8 and this is resulting is 24(16+8)"

    BR
    Margarita

  • Hi Margarita,

    What is fractional part? Why is it accumulated after exactly 12 frames?

    BR
    Krunal
  • Sharing some more information from our side regarding the debugging.

    When we print timeStamp values in HDVPSS firmware we get a difference of 8ms after every 5th or 6th frame, while in application it is after 10th or 11th frame. We have put the debug prints in function "Vps_CaptTskPutCaptFrm" of file vpsdrv_captureList.c of capture driver. Please find the below code snippet for your reference:

    if ((NULL != pChObj->pPrevFrame) &&
        (TRUE == pChObj->evenFieldCaptured) &&
         (pChObj->pPrevFrame->channelNum !=
            VPS_CAPT_DROP_FRAME_CH_ID))
    {
        frameCaptured = TRUE;
        Vps_printf("Debug : nTimeStamp = %d\n",Clock_getTicks());
        VpsUtils_quePut(
            &pObj->fullQue[Vps_captGetStreamId(parseDescInfo->lChannel)],
            pChObj->pPrevFrame,
            BIOS_WAIT_FOREVER);
        pChObj->pPrevFrame = NULL;
    }


    Also we have observed the above behavior when input is NTSC.

    BR

    Krunal