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.

Getting debug messages from TI h264 encoder on DM368

I have an encoding application where I receive raw YUV data and encode it into H264 .

This application is run on DM368 using the TI H264 encoder.

This application gets stalled sometimes and on debugging it was found that it gets stuck inside the encoder(It never returns from the "H264VENC_encode()" api).

To find out the reason why the encoder gets stalled, I am trying to enable debugging messages from the encoder.

I tried CE_DEBUG but debugging messages did not come.I also tried to link my application with debug library "h264venc_ti_arm926_debug.a" but nothing happened.

Can anyone suggest me how to enable debugging messages from the encoder to get to the root cause of the problem.

Also what could be the reason for the encoder to get stalled inside this api?

Regards,

Kusha

  • Hi Kusha,

    Can you please tell me

    1. Which version of codec are you using? if not latest plz dowload and use the latest version "H.264 Encoder, Version 2.30.00.06"  you can find the latest codec in below link
    http://software-dl.ti.com/dsps/dsps_public_sw/codecs/DM36x/index_FDS.html

    let me know if you still observe the same issue with latest version.


    2. Please share all the parameters you are using.

  • Hi Prashanth,

    1.The encoder version I am using is 02.30.00.04.

    I will try migrating to latest encoder version but I am afraid I wont be use it in my application as it has already gone under regression testing.So if you can please let me know how to get the debug messages from the encoder, it will help me find out where the encoder is getting stuck.

    2. The parameters I am using are:

    ##########################################################################################
    # Parameters
    ##########################################################################################
    ImageWidth              = 960      

    ImageHeight             = 540     
    FrameRate               = 30000      
    #FrameRate               = 25000     
    #BitRate                 = 10000000    
    BitRate                 = 6000    
    ChromaFormat            = 9         
    InterlacedVideo         = 0         
    EnableVUIParam          = 1         
    EnableBufSEI            = 0        
    ME_Type                 = 1          
    RC_PRESET               = 2        
    #RC_PRESET               = 5       
    ENC_PRESET              = 2       

    ##########################################################################################
    # Encoder Control
    ##########################################################################################
    ProfileIDC              = 100        
    LevelIDC                = 31         
    #LevelIDC                = 40         
    Log2MaxFrameNumMinus4   = 0          
    ConstraintFlag          = 0          
    IntraPeriod             = 60        
    IDRFramePeriod          = 60         
    LongTermRefreshInterval = 0         
    EnableLongTermFrame     = 0         
    FramesToEncode          = 40      
    SliceSize               = 0          
    RateControl             = 1          
    MaxDelay                = 2000       
    QPInit                  = 30         
                                                                                                             

    Regards,

    Kusha

  • Hi Kusha,

    Please try using the latest codec verison once to check weather the issue is reproduced or not. I can send you the debug library later. 

    And for what purpose you are using the codec with this param settings?

    RateControl  will be get used only if RC_PRESET = 5(USER DEFINED) else it will be OFF!

  • Hi Prashanth,

    I could get the debugging prints using the debug library "h264venc_ti_arm926_debug.a" but  they are too many prints.

    The problem(encoder getting stalled) is not easily reproducible if I get too many prints.

    Can you please suggest some way to reduce the prints from the debug library?

    Also is it possible to get the prints from a particular function of the library as I know the function where the encoder is actually getting stuck?

    Regards,

    Kusha

  • Hi Kusha,

    you have said you tired  CE_DEBUG but did not get messages. What values you set for  CE_DEBUG??

    Plz try with   CE_DEBUG=3.

  • Hi Prashanth,

    I tried with CE_DEBUG = 3 but no success.

    Just to confirm the steps were:

    # export CE_DEBUG=3

    #./application.out

    I have compiled the application with normal library and not with debug library.

    Regards,

    Kusha

  • Hi Prashanth,

    I tried with the latest encoder as told by you.But I got CMEM error saying "Unable to allocate pool of size 783360" .I tried adjusting the pools accordingly but I am still getting the similar errors for different pool sizes.

    Below mentioned is the snippet from loadmodules.sh showing the pool sizes:

    pools=2x640,2x896,2x1828,2x2048,4x5288,2x8064,2x18304,2x20480,2x49152,2x52512,2x52984,2x67200,2x131072,2x262144,2x1966080,5x4632,2x12672,2x59392,2x518400,2x783360,2x460800,9x460800 phys_start=0x86E00000 phys_end=0x88000000  allowOverlap=1 phys_start_1=0x00001000 phys_end_1=0x00008000 pools_1=1x28672

    The memory available for CMEM is 18MB.

    Please help with this.

    Regards,

    Kusha

  • Hi, 

    There is no memtab/CMEM related change happens between 02.30.00.04 to 02.30.00.06. You should not get error. Its advised to heap based allocation for CMEM instead of pool based. With heap based allocation you will not see any pool related error.

    For heap based allocation you need add below lines in your CFG file. or refer demos present in DVSDK.

    var ALG_MEM = xdc.useModule('ti.sdo.ce.alg.Settings'); 
    ALG_MEM.useHeap = true;
    ALG_MEM.useCache = true;


  • Hi Veeranna,

    I tried what you suggested but I am still getting the similar error(Unable to find a pool size of 5288).

    Can you please share a sample config file for this?

    Following is the loadmodules.sh I am using

    insmod cmemk.ko pools=5x4632,2x59392,2x12672,2x518400,1x13305600,1x783360,1x783360,1x460800,1x126720,3x353280,1x1044480 phys_start=0x86E00000 phys_end=0x88000000  allowOverlap=1 phys_start_1=0x00001000 phys_end_1=0x00008000 pools_1=1x28672

    Regards,

    Kusha

  • Hi,

    I was using "High speed" mode of the encoder in my application.

    On reverting the mode back to "Default mode" the problem of encoder getting stalled got solved.The encoder is working fine now.

    Can any one tell what problem did "High speed" cause?

    Regards,

    Kusha

  • Hi Kusha,

    High speed should work, we tested it and many customers using it. When you say stalled means is it hanging or its giving cmem pool error?. More details and/or logs will be helpful

    regarding pool size error, you just copy those 3 lines in cfg and in loadmodule.sh you need not mention any pools, just start and end address should be enough.

    Thanks,

    Veeranna

  • Hi Veeranna,

    Thanks for your reply.

    The encoder is hanging.It doesn't give any error.I tried taking logs by using CE_DEBUG but its not working.So I cant share any logs with you.

    Regarding the pool size error, I tried excatly the same thing what you are telling but it is still giving me the same error("Unable to allocate the pool size of 5288").FYI, I am using a 18MB for cmem.

    Regards,

    Kusha