DM365 Audio Codecs Integration with DVSDK 2.10.01.18 Demos
From Texas Instruments Embedded Processors Wiki
The latest DM365 audio codec releases are available here.
This section outlines the steps needed to integrate the audio codecs into the DVSDK DEMOS environment. Assumption: You have downloaded and installed the DM365 DVSDK (GA version - DVSDK 2.10.01.18).
1. Copy the codecs packages into a temporary directory: ~\temp_audio and extract them
2. Copy the ittiam folder for the codec you want to run (<codecs_package>\<codec_name>_x_x_xx_production_dm365_mvl\packages-production\ittiam) to the following location: dvsdk_2_10_01_18\dm365_codecs_01_00_06\packages
3. Delete the dvsdk_2_10_01_18\dm365_codecs_01_00_06\packages\ittiam\app folder. It will not be needed.
4. Make the following configuration file changes:
- Add the following lines in the encode.cfg/decode.cfg file to set the cache enabling feature of CE for ARM-side algorithms
algSettings = xdc.useModule('ti.sdo.ce.alg.Settings'); algSettings.useCache = true;
- Add the audio codec of choice to the .cfg file (encode.cfg/decode.cfg)In the example below we are modifying encode.cfg to add the AAC encoder:
var AACENC = xdc.useModule('ittiam.codecs.aaclc_enc.ce.AACLC_ENC'); var myEngine = Engine.create("encode", [ {name: "mpeg4enc", mod: MPEG4ENC, local: true, groupId: 1}, {name: "h264enc", mod: H264ENC, local: true, groupId: 1}, {name: "g711enc", mod: G711ENC, local: true}, {name: "aacenc", mod: AACENC, local: true}, ]);
Similar changes can be made for WMA, MP3.
5. The following changes need to be made to DMAI:
- In dmai_1_21_00_10/packages/ti/sdo/dmai/package.xs, add the extensions audio1,speech1 interfaces as below
var codecInterfaces = [ "ti.sdo.ce.speech", "ti.sdo.ce.speech1", "ti.sdo.ce.audio", "ti.sdo.ce.audio1" "ittiam.extensions.audio1", /*For AAC,MP3 and WMA */ "ittiam.extensions.speech1", /* For G711 */ "ittiam.extensions.common", /* For AEC */ "ti.sdo.ce.video", "ti.sdo.ce.video1", "ti.sdo.ce.video2", "ti.sdo.ce.image", "ti.sdo.ce.image1", ];
- In dmai_1_21_00_10/packages/ti/sdo/dmai/ce/Aenc1.c the following line has to be added in Aenc1_process() function just before return Dmai_EOK. This is required for WMA encoder operation:
Buffer_setNumBytesUsed(hInBuf, outArgs.numInSamples * hAe->numChannels * hAe->bytesPerSample);
- In dmai_1_21_00_10/packages/ti/sdo/dmai/ce/Adec1.c, in the Adec1_process() function line no: 127
Buffer_setNumBytesUsed(hInBuf, outArgs.bytesConsumed);
6. Replace file main.c in encode demo folder with the one provided in File:Dvsdk 2 10 01 18 demos update.tar.gz
7. Update codecs.c in encode demo folder as follows:
- Add your file extension, .aac in this example.
/* File extensions for AAC */ static Char *aacExtensions[] = { ".aac", NULL };
- Add list of audio encoders.
/* NULL terminated list of speech encoders in the engine to use in the demo */ static Codec audioEncoders[] = { { "aacenc", /* String name of codec for CE to locate it */ "AACLC Encoder", /* The string to show on the UI for this codec */ aacExtensions, /* NULL terminated list of file extensions */ NULL, /* Use default params */ NULL /* Use default dynamic params */ }, { NULL } };
- Update the encodeEngine variable
/* Declaration of the production engine and encoders shipped with the DVSDK */ static Engine encodeEngine = { "encode", /* Engine string name used by CE to find the engine */ NULL, /* NULL terminated list of speech decoders in engine */ NULL, /* NULL terminated list of audio decoders in engine */ NULL, /* NULL terminated list of video decoders in engine */ speechEncoders, /* NULL terminated list of speech encoders in engine */ audioEncoders, /* Audio encoders in engine */ videoEncoders /* NULL terminated list of video encoders in engine */ };
8. Replace file main.c in decode demo folder with the one provided in the File:Dvsdk 2 10 01 18 demos update.tar.gz .
9. Update codecs.c in decode demo folder in the same way as for the encode demo in Step 7
9. Add the audio.c and audio.h to encode demo (provided in File:Dvsdk 2 10 01 18 demos update.tar.gz)
10.Add the audio.c and audio.h to decode demo (provided in File:Dvsdk 2 10 01 18 demos update.tar.gz)
11.There is a change in loadmodules.sh as below to run the video + audio together
insmod cmemk.ko phys_start=0x85000000 phys_end=0x88000000 pools=6x4096,2x8192,1x11908,2x13184,1x2697152,6x4096,1x30720,3x81920,1x3185664,64x56,1x320,1x640,1x81920,1x6650880,2x608,1x296,1x28,2x24,23x1548288,1x154288,1x6488,2x15360 allowOverlap=1 phys_start_1=0x00001000 phys_end_1=0x00008000 pools_1=1x28672
12.Rebuild the DVSDK and run the demos as usual!
- for aac encoder example:
root@128.247.105.95:/opt/dvsdk/dm365# ./encode -a test.aac
Notes
- All the audio decoders require
params.dataEndianness = XDM_LE_16; - If a codec fails to create, some of the static params and dynamic params are probably wrong. Review the documentation and sample application for correct params.
Comments
Comments on DM365 Audio Codecs Integration with DVSDK 2.10.01.18 Demos

codecInterfaces should be updated for new version audio codec.
var codecInterfaces = [
];
should be updated because the new version audio codecs downloaded from page:
http://software-dl.ti.com/dsps/dsps_public_sw/codecs/DM365/index_FDS.html
does not include extensions directory any longer except for AEC.
so it might be like below:
var codecInterfaces = [
];
otherwise you will encounter the following error (AAC for example):
Unable to locate alg "aacenc" (type "ittiam.extensions.audio1.IAUDENC1").
--Johnny.Ling 00:55, 11 June 2010 (CDT)