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.

Running dm6446_h264enc_02_02_00_02_production example application on a C6748 failed in _DMAN3_initImpl()

Other Parts Discussed in Thread: TMS320C6748, OMAPL138

Hello!

I am developping an application for the C6748 and I need to add H.264 encoding to it. Up to now, all my attemps to make it run on the C6748 failed. Here is an overview of all the steps I went through:

Test #1:

- I installed the H.264 encoder "dm6446_h264enc_02_02_00_02_production.exe" on my old XP computer with CCSv3.3 SR 12.1, bios_5_31_02, C6000 Code Generation Tools 6.1.19, framework_components_2_20_01.

- I copied the app folder (dm6446_h264enc_02_02_00_02_production\packages\ti\sdo\codecs\h264enc\app) to my working directory (W:\app).

- I opened the project in CCSv3.3 (W:\app\Client\Build\TestAppEncoder.pjt), made some minor fixes to project properties and paths, then rebuilt all. Build Completed with 0 Errors, 0 Warnings, 0 Remarks.

- I connected a XDS510USB+ to a DM6437 board we designed a few years ago and the application executed successfully! Note that reading a frame to encode from the input file took almost 2 minutes.

Test #2:

- I changed (simplified) the folder structure of the project.

- The example is still building without errors, warnings and remarks.

- The example is still running well!

Test #3:

- On my new Win7 computer with CCSv5.3, I installed bios_5_31_09, c6000_6.1.23, framework_components_2_26_00_01 and "dm6446_h264enc_02_02_00_02_production.exe" in order to have a working environment similar to the one on my old computer.

- I copied the example application from test #2 to my working directory.

- I imported the legacy CCSV3.3 project to CCSv5.3 and made some adjustments to device variant, device connection, linker file, compiler include search path and linker file search path.

- The example application builds and runs successfully on the DM6437 :-)

Test #4:

- I updated the project to use bios_5_42_00_07.

- Building the application generates no error and no warning.

- Again, the application is running fine!

[C64XP_0]
*******************************************
Read Configuration Set 1
*******************************************
Running in Compliance Mode
Creating Algorithm Instance...
Algorithm Instance Creation Done...

 Encoded Frame # 0
 Encoded Frame # 1
 Encoded Frame # 2
 Encoded Frame # 3
 Encoded Frame # 4
 Specified number of Frames Encoded...
 Encoder compliance test passed
 --------------  SUMMARY --------------------
  Total number of Frames          = 5
  Bit Rate at 7500 frames/Sec       = 111053 Kbps
  Width and Height                = 1280, 720
 --------------    END   --------------------

 End of execution

Test #5:

- I changed the device variant for the TMS320C6748.

- I changed the cmd file for the C6748 command file I use for other C6748 projects.

- I changed the target configuration file accordingly.

- The application built with no error and no warning.

- Running the application fails when adding algorithm's dma ressources (DMAN3_grantDmaChannels).

[C64XP_0]
*******************************************
Read Configuration Set 1
*******************************************
Running in Compliance Mode
Creating Algorithm Instance...
Algorithm Instance Creation Done...

Problem adding algorithm's dma resources... Exiting for this configuration...

 End of execution

The Problem:

From what I can see, the problem comes from initializeDMAN3 (dman3_initImpl.c:418)
where chipTccs = 32 instead of 64 as for the DM6437.
Here is the DMAN3 trace i would get:

_DMAN3_initImpl> DMAN3 tccAllocationMaskH configures tcc 63, that is more than available on hardware 32

Does anyone have an idea of what is wrong with my C6748 project?
Have I missed something in the transition from DM6437 to C6748?

Thanks for your help,
Julie

  • For anyone of you trying to run the H.264 encoder example on a C6748...

    Add these lines at line 300 of TestAppEncoder.c just before the call to DMAN3_init()

    #ifdef c6748
        /* This configures the DMAN3 module for the C6748 */
        DMAN3_PARAMS.tccAllocationMaskH = 0x00000000;
        DMAN3_PARAMS.tccAllocationMaskL = 0xFFFFFFFF;
        DMAN3_PARAMS.maxTCs = 2;
    #endif

    Now the example should work properly!

    Julie

  • Hello Julie,


    I'm also trying to make h.264 work on my C6748 device.

    After I changed the following:

    #define QDMA_BASE  (0x01C00000 + 0x4000)

    and added the mask setting:

        DMAN3_PARAMS.tccAllocationMaskH = 0x00000000
        DMAN3_PARAMS.tccAllocationMaskL = 0xFFFFFFFF
        DMAN3_PARAMS.maxTCs = 2;


    the example can run but compliance test failed:

    [C674X_0]
    *******************************************
    Read Configuration Set 1
    *******************************************
    Running in Compliance Mode
    Creating Algorithm Instance...
    Algorithm Instance Creation Done...

    Encoded Frame # 0
    Encoder compliance test failed for this frame.
    -------------- SUMMARY --------------------
    Total number of Frames = 1
    Bit Rate at 7500 frames/Sec = 0 Kbps
    Width and Height = 1280, 720
    -------------- END --------------------

    End of execution

    Do you have any idea? Thank you! 

    Luke

  • Hi Luke,

    I did not had to change the definition of QDMA_BASE address as it is there for KAILASH. Ensure you have both "C6000" and "c6748" defined in your project properties and that KAILASH is not.

    Please let me know if that solved your problem.

    Julie

  • Hi Julie,

    I undefine KAILASH and still get the same result.

    Now I'm using the encoder source located in : C:\my_working_path\dvsdk_4_03_00_06_omapl138\codecs-omapl138_4_02_00_00\packages\ti\sdo\codecs\h264enc

    It seems you are using newer version of H.264 encoder: 02_02_00_02

    So could you tell me where to download it? I can only find dm6446_h264enc_2_00_01_00_production.exe @ http://www.ti.com/tool/dm644xcodecs

    My working environment:

    framework components 2.20

    DSP/BIOS 5.32.04

    C6000 Code Generation Tools 6.1.2

    .cmd file :

    -stack 0x3000
    -heap  0x2F00000
    -c                  /* Use C linking conventions: auto-init vars at runtime */
    -l rts64plus.lib

    MEMORY
    {
        DSPL2ROM     o = 0x00700000  l = 0x00100000   /* 1MB L2 Internal ROM */
        DSPL2RAM     o = 0x00800000  l = 0x00040000   /* 256kB L2 Internal RAM */
        DSPL1PRAM    o = 0x00E00000  l = 0x00008000   /* 32kB L1 Internal Program RAM */
        DSPL1DRAM    o = 0x00F00000  l = 0x00008000   /* 32kB L1 Internal Data RAM */
        //SHDSPL2ROM   o = 0x11700000  l = 0x00100000   /* 1MB L2 Shared Internal ROM */
        //SHDSPL2RAM   o = 0x11800000  l = 0x00040000   /* 256kB L2 Shared Internal RAM */
        IROM         o = 0x11700000  l = 0x00100000
        IRAM         o = 0x11800000  l = 0x00040000
        SHDSPL1PRAM  o = 0x11E00000  l = 0x00008000   /* 32kB L1 Shared Internal Program RAM */
        SHDSPL1DRAM  o = 0x11F00000  l = 0x00008000   /* 32kB L1 Shared Internal Data RAM */
        EMIFACS0     o = 0x40000000  l = 0x20000000   /* 512MB SDRAM Data (CS0) */
        EMIFACS2     o = 0x60000000  l = 0x02000000   /* 32MB Async Data (CS2) */
        EMIFACS3     o = 0x62000000  l = 0x02000000   /* 32MB Async Data (CS3) */
        EMIFACS4     o = 0x64000000  l = 0x02000000   /* 32MB Async Data (CS4) */
        EMIFACS5     o = 0x66000000  l = 0x02000000   /* 32MB Async Data (CS5) */
        //SHRAM        o = 0x80000000  l = 0x00020000   /* 128kB Shared RAM */
        L3_CBA_RAM   o = 0x80000000  l = 0x00020000
        DDR2         o = 0xC3000000  l = 0x08000000
    }               
    SECTIONS{

      /*--------------------------------------------------------------------*/
      /* algorithm code section: Has to be aligned at 64 Kbytes             */
      /*--------------------------------------------------------------------*/
      .text:H264VENC_TI_cSect1  > DDR2, align = 0x10000

      /*--------------------------------------------------------------------*/
      /* algorithm initialized-const data section: aligned at 8 Bytes       */
      /*--------------------------------------------------------------------*/
      .const:H264VENC_TI_dSect1 > DDR2, align = 8
     
      /*--------------------------------------------------------------------*/  
      /* algorithm uninitialized data section: Has to be aligned at 8 Bytes */
      /*--------------------------------------------------------------------*/
      .far:H264VENC_TI_uSect1   > DDR2, align = 8
     
      /*--------------------------------------------------------------------*/
      /* Internal Data memory section: non-BIOS mechanism, Form a array and */
      /* redirect it to required memory section                             */
      /*--------------------------------------------------------------------*/
      .intDataMem               > DSPL2RAM


      .input_buffer  : align(0x100) > DDR2
      .output_buffer : align(0x100) > DDR2
      .ref_buffer    : align(0x100) > DDR2

      .pinit    :  > DDR2
      .vecs     :  > DDR2
      .sysmem   :  > DDR2
      .far      :  > DDR2
      .text     :  > DDR2
      .bios     :  > DDR2
      .const    :  > DDR2
      .cinit    :  > DDR2
      .bss      :  > DDR2
      .cio      :  > DDR2
      .switch   :  > DDR2
      .data     :  > DDR2
      .args     :  > DDR2
      .stack    :  > DDR2
      .reset    :  > DDR2
      .csl_vect :  > DDR2
    }

    Please kindly see if anything I go wrong....thanks a lot!!

    Luke

  • Hi Luke,

    I downloaded the H.264 Encoder, Version 2.02.00.02 from this page:
    http://software-dl.ti.com/dsps/dsps_public_sw/codecs/C64XPlus_Video/index_FDS.html

    My project is working with CCSv5.3, c6000_6.1.23 or c6000_7.4.1, bios_5_42_00_07 and framework_components_2_26_00_01.

    ".intDataMem" should be placed in IRAM to work properly not DSPL2RAM as it is actually in your command file. Also verify your DDR2 memory definition. Mine looks like this:
    DDR2 : origin = 0xc0000000,  len = 0x8000000

    Kind regards,

    Julie

  • Hi Julie,

    It works now! My DDR2 starting address was wrong but only I changed ,initDataMen > IRAM then the encoder can encode without error! Thank you very much!

    But when I running output mode, the process seems too long? It took me about 38 minutes to finish the encode process. I know it may be cause of the JTAG read/write PC, but in your case, is it that slow too?

    Another question is, what decoder should I install in my windows?

    It seems VLC can not play the output .264 file (also the reference .264 file). Any idea?

    Thanks again!

    Luke

  • Hi Luke,

    I am glad to hear it is working now. Yes, running the example in output mode takes time, a lot of time.

    You can play the encoded stream in VLC. However you have to change the file extension from .264 to .h264 so VLC will be able to chosse the right decoder.

    Julie

  • Hi Julie,

    My VLC version is 2.0.8 and still can't play the output(or reference) file, all black window.

    But I found a decoder that can play the h.264 stream well => http://www.fastvdo.com/H.264.html

    Just for your reference!

    Thanks!

    Luke

  • Hello,

    I am also trying to get the dm6446_h264enc_02_02_00_02_production H.264 encoder example "TestAppEncoder" working on a C6748 as well.  I've found this thread quite helpful in getting me started, but my code execution gets stuck in the 

    ividEncfxns->process((IVIDENC1_Handle)handle,
    (IVIDEO1_BufDescIn *)&inputBufDesc,
    (XDM_BufDesc *)&outputBufDesc,
    (IVIDENC1_InArgs *)&inArgs,
    (IVIDENC1_OutArgs *)&outArgs);

    process call.  As far as I can tell, the process call is stuck inside "H264VENC_TI_QDMA_wait".

    I'm using CCS v5.5, bios_5_42_00_07, c6000_7.4.4, and framework_components_2_26_00_01.  I'm currently not using anything from xdctools/xdais.

    Judging from the browsing I've done, my problem is almost certainly improper configuration of DMAN3, even though the initialization call (DMAN3_init()) works OK. Also, the inputs to the process call look reasonable.

    Any thoughts?  Was there some additional DMAN3 configuration not discussed above that I may be missing?

    I appreciate any help!  I can post the memory section allocation from my .cmd or any code if necessary.

    Thanks!

    -Aaron 

  • Hi Aaron,

    To have the H.264 example running on the C6748, I didn't had to change anything else other than the device variant, the cmd file, the ccxml file and the DMAN3 configurations mentioned above. My first thought is to:

    1. Check predefined symbols in project properties. I have: --define="C6000" --define="_RTS_MODE" --define="c6748"
    2. Check the linker command file and ensure the .intDataMem section is located in IRAM.

    Did you modified the example code (except for DMAN3 config) or are you trying to run the code as is?

    Regards,

    Julie