NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.

MP3 Decoder Integration in EZSDK

From Texas Instruments Wiki
Jump to: navigation, search

How to integrate MP3 Decoder in EZSDK


Introduction[edit]


The EZSDK supports both AAC-LC Decoder & MP3 Decoder. However, MP3 Decoder is not part of the EZSDK package and needs to be downloaded separately. This article explains the steps to download, install, integrate, build and test MP3 Decoder in EZSDK.

The following should be noted with respect to the pre-built DSP & IL Client omx examples -

1. The pre-built DSP binary & A8 IL Client does not support MP3 Decoder. The steps mentioned in this article needs to be followed to add MP3 & decode MP3 files. The pre-built dsp binary is available at /usr/share/ti/ti-media-controller-utils/*.xe674 in the EZSDK.

2. Sample IL client is intended for decoding of a MP3 or AAC elementary bit stream. Currently the decoded output does not play out, instead decoded output is written back to a file in 16 bit linear format (Intel format). Playing out the PCM is scoped for future EZSDK release. The pre-built sample IL Client is available at /usr/share/ti/ti-omx

Throughout this document there will be commands spelled out to execute. Some are to be executed on the Linux development host, some on the Linux target and some on the u-boot (bootloader) prompt. They are distinguished by different command prompts as follows:

host $ <this command is to be executed on the host>

target # <this command is to be executed on the target> u-boot :> <this command is to be executed on the u-boot prompt>

Version Information and Compatibility[edit]

Note! These instructions have been validated on EZSDK 5.02.01.59. These instructions are applicable to DM816x and DM814x devices.

Installing MP3 Decoder[edit]


Users may download MP3 Decoder from the following URL - http://software-dl.ti.com/dsps/dsps_public_sw/codecs/C674X_Audio_Codecs/01_00_001/index_FDS.html.

This URL contains linux installer for MP3 Decoder. Although users may install MP3 Decoder anywhere in the linux filesystem, it is recommended to install the MP3 Decoder along side the AAC Decoder in the EZSDK host filesystem under component-sources. This simplifies setting up the build environment variables to point to the MP3 Decoder package.

Integration and Build steps[edit]

1. Update / provide the path of mp3 decoder in $EZSDK/ Rules.mk file.

Update the path in OMX_BUILD_VARS

aaclcdec_PATH=${AACLCDEC_INSTALL_DIR}
mp3dec_PATH=${MP3DEC_INSTALL_DIR}

Provide the path of mp3 codec installed -

AACLCDEC_INSTALL_DIR=$(DVSDK_INSTALL_DIR)/component-sources/c674x-aaclcdec_01_41_00_00_elf

  MP3DEC_INSTALL_DIR=$(DVSDK_INSTALL_DIR)/component-sources/c674x-mp3dec_01_41_00_00_elf

  2. Update the build environment variables in $EZSDK/component-sources/omx_xx_yy_zz_bb/makerules/env.mk to point to the installation of MP3 Decoder. Here xx_yy_zz_bb represents the installed omx version. See example below -

 host $ cd $EZSDK/component-sources/omx_xx_yy_zz_bb/makerules/

host $ vi env.mk

<syntaxhighlight lang="javascript">

  1. MP3DEC - MP3 Decoder

mp3dec_PATH = $(EXTERNAL_SW_ROOT)/c674x_mp3dec_01_41_00_00_elf mp3dec_INCLUDE = $(mp3dec_PATH)/packages

  1. AACDEC - AAC Decoder

aaclcdec_PATH = $(EXTERNAL_SW_ROOT)/c674x_aaclcdec_01_41_00_00_elf aaclcdec_INCLUDE = $(aaclcdec_PATH)/packages </syntaxhighlight>

3. Modify the Codec Engine create parameters in $EZSDK/component-sources/omx_xx_yy_zz_bb/packages/ti/omx/demos/dm81xx/DspAppMain.cfg to include MP3 Decoder as shown below -

 host $ cd $EZSDK/component-sources/omx_xx_yy_zz_bb/examples/ti/omx/demos/dm81xx/

host $ vi DspAppMain.cfg

<syntaxhighlight lang="javascript">

// use mp3dec
var mp3dec = xdc.useModule('ti.sdo.codecs.mp3dec.ce.MP3DEC');
// ======== Engine Configuration ========
var Engine = xdc.useModule('ti.sdo.ce.Engine');
var myEngine = Engine.create("adec", [
{
name : "mp3dec",
mod : mp3dec,
local: true
},
{
name : "aaclcdec",
mod : aaclcdec,
local: true
}
]);

</syntaxhighlight>

This results in the inclusion of MP3 Decoder libraries in the build and also includes MP3 decoder in the list of algorithms codec engine supports. Note that AAC Decoder is already present by default.

4. Add MP3 Decoder to the list of codecs in $EZSDK/component-sources/omx_xx_yy_zz_bb/examples/ti/omx/demos/dm81xx/app_properties.mk as shown below -

 host $ cd $EZSDK/component-sources/omx_xx_yy_zz_bb/examples/ti/omx/demos/dm81xx/

host $ vi app_properties.mk

<syntaxhighlight lang="javascript"> CODECS_IN_APP = aaclcdec mp3dec </syntaxhighlight>

5. Add MP3 Decoder to the list of header files in $EZSDK/component-sources/omx_xx_yy_zz_bb/src/ti/omx/comp/aenc/makefile as shown below -

 host $ cd $EZSDK/component-sources/omx_xx_yy_zz_bb/packages/ti/omx/comp/aenc

host $ vi makefile

<syntaxhighlight lang="javascript"> INCLUDE_EXERNAL_INTERFACES = bios xdc omx omxcore omxbase timmosal fc xdais \

ce aaclcenc aaclcdec mp3dec

note: This step is required as common header file in encode / decode will access these codec files.

</syntaxhighlight>


This step completes modifications on DSP side.

6. Add MP3 Decoder to the list of codecs in $EZSDK/component-sources/omx_xx_yy_zz_bb/examples/ti/omx/demos/adec_snt/app_properties.mk as shown below -

 host $ cd $EZSDK/component-sources/omx_xx_yy_zz_bb/examples/ti/omx/demos/adec_snt/

host $ vi app_properties.mk

<syntaxhighlight lang="javascript"> CODECS_IN_APP = aaclcdec mp3dec </syntaxhighlight>

This step completes modification on A8 side (IL Client)

7. Go to the root directory of EZSDK and execute the following make command to rebuild omx -

host $ cd $EZSDK

host $ make omx_clean

host $ make omx

8. The following DSP and A8 side binaries are rebuilt as a result of 5 above -

For DM816x: <syntaxhighlight lang="javascript"> $EZSDK/component-sources/omx_xx_yy_zz_bb/bin/dm81xx/bin/ti816x-evm/dm81xx_c6xdsp_debug.xe674 $EZSDK/component-sources/omx_xx_yy_zz_bb/bin/adec_snt/bin/ti816x-evm/adec_snt_a8host_debug.xv5T </syntaxhighlight>

For DM814x: <syntaxhighlight lang="javascript"> $EZSDK/component-sources/omx_xx_yy_zz_bb/bin/dm81xx/bin/ti814x-evm/dm81xx_c6xdsp_debug.xe674 $EZSDK/component-sources/omx_xx_yy_zz_bb/bin/adec_snt/bin/ti814x-evm/adec_snt_a8host_debug.xv5T </syntaxhighlight>

9. Rename the DSP binary to match the names on the target filesystem as shown below -

<syntaxhighlight lang="javascript"> For DM816x, rename to dm816x_c6xdsp.xe674 For DM814x, rename to dm814x_c6xdsp.xe674 </syntaxhighlight>

10. Copy the newly generated DSP binary to the target filesystem under /usr/share/ti/ti-media-controller-utils

11. Copy the newly generated A8 binary to the target filesystem under /usr/share/ti/ti-omx

How to test[edit]


The IL Client executable adec_snt_a8host_debug.xv5T is used in the following way to test MP3 Decoder -


target # firmware_loader 0 dm81xx_c6xdsp_debug.xe674 start
target # ./adec_snt_a8host_debug.xv5T -i input.mp3 -o output.pcm -c mp3


FAQ[edit]


1. What has changed with regard to MP3 Audio Decoder in EZSDK 05.03.00.09 which uses OMX 05.02.00.26? Some streams which were being decoded earlier are not working now.

Ans: The IL-Client on A8 (adec_snt) has been modified to exit safely if the decoder returns bytesConsumed as zero. This is a new feature that has been added for application safety with the proper message saying (see adec_snt\src\ilclient.c around line 774):

"Bytes Consumed is zero by the decoder. Hence stopping further decoding".

It is possible that streams with ID3 header is being given for decoding (not elementary streams). For this case, the decoder returns bytesConsumed as zero. Therefore, such streams fail to decode now. The user may either -

  • strip off the ID3 header and pass only the elementary stream for decoding
  • or, continue decoding ignoring this error, for which the IL-Client needs to be modified by removing the following lines (around line 770 to 774)
 if((gbytesInInputBuffer - pBuffer->nFilledLen) == 0) {
   gEOF = 1;
   gbytesInInputBuffer = 0;
   pBuffer->nFilledLen = 0;
   printf("\nBytes Consumed is Zero by decoder......\nHence Stopping further decoding\n");
 }

Download the Latest EZSDK[edit]

The latest EZSDK is available for download from http://software-dl.ti.com/dsps/dsps_public_sw/ezsdk/latest/index_FDS.html.

The current version is 5.05.02.00. The supported platforms are DM816x and DM814x.

EZSDK Support
E2e.jpg {{
  1. switchcategory:MultiCore=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article MP3 Decoder Integration in EZSDK here.

Keystone=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article MP3 Decoder Integration in EZSDK here.

C2000=For technical support on the C2000 please post your questions on The C2000 Forum. Please post only comments about the article MP3 Decoder Integration in EZSDK here. DaVinci=For technical support on DaVincoplease post your questions on The DaVinci Forum. Please post only comments about the article MP3 Decoder Integration in EZSDK here. MSP430=For technical support on MSP430 please post your questions on The MSP430 Forum. Please post only comments about the article MP3 Decoder Integration in EZSDK here. OMAP35x=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article MP3 Decoder Integration in EZSDK here. OMAPL1=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article MP3 Decoder Integration in EZSDK here. MAVRK=For technical support on MAVRK please post your questions on The MAVRK Toolbox Forum. Please post only comments about the article MP3 Decoder Integration in EZSDK here. For technical support please post your questions at http://e2e.ti.com. Please post only comments about the article MP3 Decoder Integration in EZSDK here.

}}

Hyperlink blue.png Links

Amplifiers & Linear
Audio
Broadband RF/IF & Digital Radio
Clocks & Timers
Data Converters

DLP & MEMS
High-Reliability
Interface
Logic
Power Management

Processors

Switches & Multiplexers
Temperature Sensors & Control ICs
Wireless Connectivity