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.

H264 encoder process hangs on DM8127

Hi,

The HW is DM8127.
After some particular operation, h264 encoder will hang while calling "ividenc.process()".
I was trying to dump h264 debug message by enabling parameter "debugTraceLevel". 
And the debug data was written to a file.
The problem is that this file is not a readable format, please refer to the attached file.

Is there any way or tool to analyze this data?
Please help. 

Thank you.

3146.tracefile.txt

  • Hi,

    We will get back on this by early next week.

    regards

    Yashwant

  • Hi Ashton,

    The debugTrace binary file generated needs to be parsed using DebugTracer utility. I have attached the parsed file in readable format.

    We will analyse this log to find out the reason for hang.

    Can you please share the configuration used to encode this stream?

    8228.3146.tracefile.txt_parsed.txt

    Ram

  • Hi, Ram

    I am sorry that I am not sure if the attached trace data file contains the frame which made the encoder hanged.

    So I made another trace file that should contain the frame which made enc hanged.
    Please refer to the attachment.

    The operation is like the following :

    1. I have 2 channel obj, channel 1 is JPEG and channel 2 is H264.

    2. I want to change the codec of channel 1 to H264, so I delete the previous encode object and create a new h264 encode object.

    3. Then I need to generate H264 frame header. So I set 

    algObj.u.h264AlgIfObj.dynamicParams.videnc2DynamicParams.generateHeader = XDM_GENERATE_HEADER;
    error = handle->fxns->ividenc.control((IVIDENC2_Handle) handle, XDM_SETPARAMS, (IVIDENC2_DynamicParams *) &pChObj->algObj.u.h264AlgIfObj.dynamicParams, (IVIDENC2_Status *) &pChObj->algObj.u.h264AlgIfObj.status); 
    ....
    ....
    error = handle->fxns->ividenc.process((IVIDENC2_Handle) handle, inputBufDesc, outputBufDesc, (IVIDENC2_InArgs *) inArgs, (IVIDENC2_OutArgs *) outArgs);
     
    This works fine. I got the H264 header for channel 1.

    4. And then, the frame of channel 2 is going to be processed. It's a normal frame.
         But it hanged while calling  "ividenc.process()"

    I print so debug message on the console

    (Encode loop)
     [m3video] channel = 1, set to generate header.
    [m3video] channel = 1. before calling process()
     ividenc.process()
     [m3video] channel = 1, after calling process()
    [m3video]
    [m3video] channel = 2, before calling process()
    ividenc.process() --> hangs here when calling this
    ...

    My conclusion is that if one trying to create a new H264 enc obj and set to generate header , the next frame will make encoder hang.

    If any configuration you need, please let me know.

    Thank you.

    Regards,

    0068.tracefile.txt

  • Hi Aston,

    Please find the parsed trace file for the binary file you shared. Since the encoder is hanging, trace file doesn't have log for hanging frame. You may have to manually copy it from DDR memory to a binary file.

     

     

     

  • The sequence you followed to encode looks fine. Not sure why there is hang.

    We will try to reporduce the same sequence and let you know.

    Ram

    5466.0068.tracefile.txt_parsed.txt

  • Hi, Ram.

    Thanks for the info.
    I try to dump this trace data directly from DDR memory address after encoder hanged.

    Please help to parse this trace file.

    Thank you.

    4861.trace.txt

  • Hi Aston,

    Please find the parsed Trace file. Frame 1123 is hanging.

    Release IVAHD                             : NOT_STARTED
    Encode Process                            : NOT_FINISHED

    But no clue what has gone wrong.

    Ram

    3704.4861.trace.txt_parsed.txt

  • Hi Ram,

    Thank you very much for your help and information.

    Is there any way to produce further debug data, like tracing encoding process steps or status?
    Seems like the memory somewhere of the next frame is overwritten after creating new enc obj and generate a header frame.
    If the next frame is skipped, encoder will not hang. 

    If there is any way I can try, please tell me.

    Thank you.
    Best Regards, 

     

  • Hi Aston,

    Can you please provide me these info?

    1) Is the hang observed only if you set first channel for generate header? If you don't set it for generate header, is second channel process going fine?

    2)Can you please make sure that handle, input and output buffers passed to both the channels are different?

    3)If possible, please hsare the source code of your testApplication with the sequence you mentioned.

    Ram

  • Hi Ram,

    1) Yes, only if set first channel for generate header.

    2) I checked each handle,  input and output buffer address, They are different for both channel.

    3) Sorry, I can't but the steps are simple as the following. Using DVRRDK_01.06.00.11

    i) Set two channel for H.264, and keep them encoding frames.
    ii) Delete the H.264 algIf obj of 1st channel and create a new H.264 algIf obj and set to generate header for the 1st channel.
    iii) After the header is generated for the 1st channel. The encoder will hang while encoding the next frame which is for the 2nd channel.

    If any luck, please let me know.

    Thank you very much for your help.
    Best Regards,