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.
How to integrate audio/voice in RPE in EZSDK
How to integrate audio/voice in RPE in EZSDK
Contents
Introduction[edit]
The Remote Processor Execution component in EZSDK supports any audio/voice codec that runs on DSP. However, only AAC Decoder is a part of the package and rest of the codecs have to be downloaded separately. This article explains the steps to download, install, integrate, build and test audio/voice in EZSDK.
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;>
Version Information and Compatibility[edit]
Note! These instructions have been validated on EZSDK 5.03.0x.xx. These instructions are applicable to DM816x and DM814x devices.
Installing Audio/Voice codecs[edit]
Users may download Audio codecs from the following URL - http://software-dl.ti.com/dsps/dsps_public_sw/codecs/C674X_Audio_Codecs/01_00_001/index_FDS.html.
Users may download Voice codecs from the following URL - http://software-dl.ti.com/dsps/dsps_public_sw/codecs/C64XPlus_Speech/index_FDS.html
This URL contains linux installer for Audio/Voice codecs. Although users may install codecs anywhere in the linux filesystem, it is recommended to install them 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 codec package. Integration of MP3 decoder is explained below. Steps to integrate any other codec will be identical.
Integration and Build steps[edit]
1. Update the build environment variables in $EZSDK/component-sources/remote-processor-execute/makerules/env.mk to point to the installation of MP3 Decoder. See example below -
host $ cd $EZSDK/component-sources/remote-processor-execute/makerules/
host $ vi env.mk
<syntaxhighlight lang="javascript">
- MP3DEC - MP3 Decoder
mp3dec_PATH = $(EXTERNAL_SW_ROOT)/c674x_mp3dec_01_41_00_00_elf mp3dec_INCLUDE = $(mp3dec_PATH)/packages
- AACDEC - AAC Decoder
aaclcdec_PATH = $(EXTERNAL_SW_ROOT)/c674x_aaclcdec_01_41_00_00_elf aaclcdec_INCLUDE = $(aaclcdec_PATH)/packages </syntaxhighlight>
2. Add mp3 decoder in the list of codecs to be built in codecs.mk
host $ cd $EZSDK/component-sources/remote-processor-execute/src/config
host $ vi codecs.mk
INCLUDE_CODEC_INTERFACES = aaclcdec mp3dec
3. Update the makefile to add mp3 as a part of dsp binary -
host $ cd $EZSDK/component-sources/remote-processor-execute/examples/dm81xx
host $ vi makefile
EXTLIBS_c6xdsp = $(aaclcdec_PATH)/packages/ti/sdo/codecs/aaclcdec/lib/aacdec_tii_lc_elf.l64P \ $(mp3dec_PATH)/packages/ti/sdo/codecs/mp3dec/lib/mp3_tii_lc_elf.l64P \
4. Create a component "mp3dec" that contains mp3 application that runs on A8 processor along the path $EZSDK/component-sources/remote-processor-execute/examples/. This will be similar to the "aacdec" component which is available along the same path. Please refer to AAC decoder component (aacdec) and modify it for mp3 accordingly..
5. Update the client configuration file for mp3 decoder.
host $ cd $EZSDK/component-sources/remote-processor-execute/src/config
host $ vi client_config.c Add an audio decoder class using XDM interface. Since AAC decoder is part of examples there will be no need to add any class for mp3 decoder. But if any encoder is integrated, then the corresponding class has to be added.
{ /* Audio decoder class using XDM IAUDDEC1 interface */ .classId = RPE_TI_IAUDDEC1_CLASS, .marshallProcessArgsFxn = XdmClient_marshallXdm1BufDescArgs, .unmarshallProcessArgsFxn = XdmClient_unmarshallXdm1BufDescArgs },
6. Update the server configuration file for mp3 decoder. You will have to add a new class configuration if you are creating an encoder.
host $ cd $EZSDK/component-sources/remote-processor-execute/src/config
host $ vi server_config_c67x.c
const Rpe_ServerClassConfig TI_AUDDEC1_serverClassConfig = { .classId = RPE_TI_IAUDDEC1_CLASS, .createFxn = XdmServer_create, .deleteFxn = XdmServer_delete, .controlFxn = XdmServer_control, .processFxn = XdmServer_process, .marshallProcessFxn = XdmServer_marshallXdm1BufDescArgs, .serverTaskEntry = RpeServer_defaultServerTask, .serverHandleSize = sizeof(XdmServer_ServerObj), .numControlArgs = 3, .numProcessArgs = 4 };
const XdmServer_ServerConfig TI_AACDEC_serverConfig = { .serverConfig = { .name = "AAC_ADEC_TI", .classId = RPE_TI_IAUDDEC1_CLASS, .taskStackSize = 1024 * 10, .inBufCpuAccessMode = RPE_ALLBUFS_CPU_ACCESS_MODE_READ, .outBufCpuAccessMode = RPE_ALLBUFS_CPU_ACCESS_MODE_WRITE, .sizeofCreateArgs = sizeof(IAACDEC_Params), .sizeofControlArgs = { sizeof(IAACDEC_Cmd), sizeof(IAACDEC_DynamicParams), sizeof(IAACDEC_Status)}, .sizeofProcessArgs = { sizeof(XDM1_BufDesc), sizeof(XDM1_BufDesc), sizeof(IAACDEC_InArgs), sizeof(IAACDEC_OutArgs)}, }, .xdmFxns = (XDM_Fxns *)&AACDEC_TII_IAACDEC.iauddec, };
const XdmServer_ServerConfig TI_MP3DEC_serverConfig = { .serverConfig = { .name = "MP3_ADEC_TI", .classId = RPE_TI_IAUDDEC1_CLASS, .taskStackSize = 1024 * 10, .inBufCpuAccessMode = RPE_ALLBUFS_CPU_ACCESS_MODE_WRITE, .outBufCpuAccessMode = RPE_ALLBUFS_CPU_ACCESS_MODE_WRITE, .sizeofCreateArgs = sizeof(IMP3DEC_Params), .sizeofControlArgs = { sizeof(IMP3DEC_Cmd), sizeof(IMP3DEC_DynamicParams), sizeof(IMP3DEC_Status)}, .sizeofProcessArgs = { sizeof(XDM1_BufDesc), sizeof(XDM1_BufDesc), sizeof(IMP3DEC_InArgs), sizeof(IMP3DEC_OutArgs)}, }, .xdmFxns = (XDM_Fxns *)&MP3DEC_TII_IMP3DEC.iauddec, };
Care should be taken parameter ".name" is step 6 should be same as that passed to application in step 4.
Also the integrator has to set the stack size appropriately for the corresponding codec. This information is available in codec data sheet.
Update the server class configuration if you are integrating encoder
const Rpe_ServerClassConfig *Rpe_serverClassConfigArray[] = { & TI_AUDDEC1_serverClassConfig, & Rpe_endServerClassConfig };
Update the server configuration for MP3 decoder
const Rpe_ServerConfig *Rpe_serverConfigArray[] = { (const Rpe_ServerConfig *) & TI_AACDEC_serverConfig, (const Rpe_ServerConfig *) & TI_MP3DEC_serverConfig, & Rpe_endServerConfig };
7. Update the makefile to build mp3dec component
host $ cd $EZSDK/component-sources/remote-processor-execute/
host $ vi makefile
$(Q)$(MAKE) $(SILENT) -C examples/aacdec CORE=a8host $(Q)$(MAKE) $(SILENT) -C examples/mp3dec CORE=a8host
8. Go to the root directory of RPE and execute the following make command to rebuild it
host $ cd $EZSDK/component-sources/remote-processor-execute/
Type the below commands to build RPE framework
host $ make clean host $ make all
9. Following binaries are built as a result of step 9
$EZSDK/component-sources/remote-processor-execute/lib/dm81xx/bin/ti816x-evm/dm81xx_c6xdsp_debug.xe674 $EZSDK/component-sources/remote-processor-execute/lib/aacdec/bin/ti816x-evm/aacdec_a8host_debug.xv5T $EZSDK/component-sources/remote-processor-execute/lib/mp3dec/bin/ti816x-evm/mp3dec_a8host_debug.xv5T
How to test[edit]
For running the executable mp3dec_a8host_debug.xv5T following steps are required (These steps assume that all the binaries are stored in same folder). Please note, SDK might autoload the binaries as part of demonstration application, which should be disabled before following the procedure below. It assumes that EVM has been booted and user has logged in as root. If init sequence in SDK is not disabled, following steps are not required, and user can proceed with Matrix GUI disabling step.
•# /prcm_config_app s • Insert syslink module # insmod syslink.ko • Load the Firmware using firmware_loader utility provided in SDK. Firmware will be available at component-sources/remote-processor-execute/lib/dm81xx/bin/ti816x-evm/ folder ( By default in the init scripts of Linux, firmware might be getting loaded, so care needs to taken) i. # firmware_loader 0 dm81xx_c6xdsp_debug.xe674 start
If Matrix GUI is running as part of SDK initialization scripts, It needs to be turned off
# /etc/init.d/matrix-gui-e stop # /etc/init.d/pvr-init stop
• Run the application
# ./mp3dec_a8host_debug.xv5T -i mp3dectest.cfg
• mp3dectest.cfgis the decoder configuration file. It has the following parameters that needs to be set by user
# 1 /* 1 - alsa playback, 0 - write output to file */ # 2 /* number of audio channels */ # audio.mp3 /* input file to be decoded */ # audio.pcm /* output file name */