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.

DM365 hanged at DMA_TI_Wait

Hi all,

  I must implement a library to manipulate encoder and decoder. I refered the dvsdk_2_10_01_18\dm365_codecs_01_00_06\packages\ti\sdo\codecs.
  My encoder class can run well by itself. The pseudo code is in below
   

    codec_init();
    encoder_open(&g_enc, &g_param);
    for( i = 0 ; i < 30; ++i )
    {
        encoder_encode(&g_enc, capturedFrame_yuv420sp, encodedFrame_output, &output_len);
    }
    encoder_close(&g_enc);
    codec_exit();


  Unfortunately, it will be hanged in DMA_TI_Wait, if I added my decoder class and run together.
  I am sure that the first frame was encoded and decoded successfully. The program will stop while to encode the second frame.
 What may I missed if I want to put encoder and decoder together? The pseudo code is in below

    /* codec_init:
       do CMEM_init, RMAN_init,
       RMAN_register IRESMAN_EDMA3CHAN, IRESMAN_VICP2, IRESMAN_HDVICP, IRESMAN_ADDRSPACE
       NEW CODE: do BUFFMGR_Init(H264_DPB_SIZE_PROFILE_3_1)
    */
    codec_init();

    encoder_open(&g_enc, &g_param);

    /*
     NEW CODE: H264VDEC_create, RMAN_assignResources H264VDEC_TI_IRES,
        H264VDEC_control to get XDM_GETBUFINFO...
    */
    decoder_open(&g_dec, &g_param);

    for( i = 0 ; i < 30; ++i )
    {
        encoder_encode(&g_enc, capturedFrame_yuv420sp, encodedFrame_output, &output_len);
        decoder_decode(&g_dec, encodedFrame_output, output_len, decodedFrame_output, &output_len);
    }
    decoder_close(&g_dec);
    encoder_close(&g_enc);

    /* codec_exit:
       RMAN_unregister IRESMAN_EDMA3CHAN, IRESMAN_VICP2, IRESMAN_HDVICP, IRESMAN_ADDRSPACE
       NEW CODE: do BUFFMGR_DeInit
    */
    codec_exit();

 
    [dump disassembly code]  
    80095E30          FUNC32, DMA_TI_Wait:
    80095E30 E3520000 CMP           R2, #0x0
    80095E34 E24DD004 SUB           R13, R13, #0x4
    80095E38 128DD004 ADDNE         R13, R13, #0x4
    80095E3C 112FFF1E BXNE          R14
    80095E40 E080C101 ADD           R12, R0, R1, LSL #2
    80095E44 E59CC0B0 LDR           R12, [R12, #0xB0]
    80095E48 E58DC000 STR           R12, [R13]
    80095E4C E59DC000 LDR           R12, [R13]
    80095E50 E35C0020 CMP           R12, #0x20
    80095E54 E5900838 LDR           R0, [R0, #0x838]
    80095E58 3A000010 BCC           0x80095EA0
    80095E5C E59DC000 LDR           R12, [R13]
    80095E60 E24CC020 SUB           R12, R12, #0x20
    80095E64 E3A0306C MOV           R3, #0x6C
    80095E68 E58DC000 STR           R12, [R13]
    80095E6C E3A0C001 MOV           R12, #0x1
    80095E70 E2832A01 ADD           R2, R3, #0x1000
    80095E74 E59D1000 LDR           R1, [R13]
    80095E78 E7922000 LDR           R2, [R2, R0]
    80095E7C E112011C TST           R2, R12, LSL R1
    80095E80 0AFFFFFA BEQ           0x80095E70
    80095E84 E59D1000 LDR           R1, [R13]
    80095E88 E1A0C11C MOV           R12, R12, LSL R1
    80095E8C E3A01074 MOV           R1, #0x74
    80095E90 E2811A01 ADD           R1, R1, #0x1000
    80095E94 E781C000 STR           R12, [R1, R0]
    80095E98 E28DD004 ADD           R13, R13, #0x4
    80095E9C E12FFF1E BX            R14
    80095EA0 E3A02068 MOV           R2, #0x68              ;; 0x80095EA0
    80095EA4 E59D1000 LDR           R1, [R13]
    80095EA8 E3A0C001 MOV           R12, #0x1
    80095EAC E2822A01 ADD           R2, R2, #0x1000
    80095EB0 E7922000 LDR           R2, [R2, R0]
    80095EB4 E112011C TST           R2, R12, LSL R1
    80095EB8 0AFFFFF8 BEQ           0x80095EA0             ;; infinite-loop go back address 0x80095EA0

  • By the way, because of some conditions, I must use H264VDEC_create, H264VDEC_control, H264VDEC_decode, H264VDEC_delete, are provided by dm365_codecs_01_00_06\packages\ti\sdo\codecs\h264dec\apps\client\test\src\h264vdec.c, to write my library.

    I known that they are different from codec APIs like as Vdec2_create, Vdec2_process, Vdec2_delete are provided dmai_1_21_00_10/packages/ti/sdo/dmai/ce/Vdec2.c.

    Anyway, I don't have any idea to solve this issue even I know that.[:(]

  • Hi All,

    I found another phenomenon.

    It will be ok if don't encode and decode in frame interleaved manner.

    In other words, Iet the program flow encodes several frames, and then decodes all of encoded frames.

    This use case always run successfully.