【转】DM8168添加DSP音频编解码算法--集成现有voice或audio codec

本文根据“How to integrate audio/voice in RPE in EZSDK.pdf”整理,建议读者直接下载,参考原文件。原文件下载链接:

http://download.csdn.net/detail/guo8113/8122945

ps:本文只是参考文档进行定制补充,但目前笔者没有完成移植,仅供参考。

转载请注明:http://blog.csdn.net/guo8113/article/details/40820897

DVR_RDK RPE添加其他音频编码

DM8168中音频算法(DVR-RDK中已经集成了aac的enc、dec)采用RPE(远程程序调用)的机制,该机制的介绍可以参考ti_tools/rpe中的文档,或者参考笔者的博客与论文。

 

1.更新构建环境变量

/remote-processor-execute/makerules/env.mk

L42:

#####################################################

# Codecs Paths

#####################################################

 

# AACDEC - AAC Decoder

aaclcdec_PATH =$(EXTERNAL_SW_ROOT)/c674x-aaclcdec_01_41_00_00_elf

aaclcdec_INCLUDE =$(aaclcdec_PATH)/packages

 

# AACENC - AAC Encoder

aaclcenc_PATH =$(EXTERNAL_SW_ROOT)/c674x_aaclcenc_01_00_01_00_elf

aaclcenc_INCLUDE =$(aaclcenc_PATH)/packages

#

# <Integrator>: Add more codec pathshere.

#

 

2.添加codec到编译列表:

ti_tools/rpe/remote-processor-execute/src/config/codecs.mk

INCLUDE_CODEC_INTERFACES = aaclcdecaaclcenc

 

3.更新client配置文件

ti_tools/rpe/remote-processor-execute/src/config/client_config.c

/* Get structure definitions for AACLCAudio Decoder Interface */

#include<ti/sdo/codecs/aaclcdec/iaacdec.h>

#include<ti/sdo/codecs/aaclcenc/imp4aacenc.h>

由于已经集成AAC enc和dec所以使用XDM接口的类已经定义了各一个,如果要同时运行其他codec,可能还需要进行添加。

 

4.更新server配置文件

ti_tools/rpe/remote-processor-execute/src/config/server_config_c67x.c

(1)模仿const XdmServer_ServerConfig TI_AACDEC_serverConfig{}编写自己的classconfigratiion

 

(2)更新:

const Rpe_ServerConfig*Rpe_serverConfigArray[] =

{

   (const Rpe_ServerConfig *) & TI_AACDEC_serverConfig,

   (const Rpe_ServerConfig *) & TI_AACENC_serverConfig,

   & Rpe_endServerConfig

};

当然也要包含必要的头文件。

 

5.修改/dvr_rdk/rules.make

L101行:

# Audio framework (RPE) and Codecs

rpe_PATH        :=$(TI_SW_ROOT)/rpe/remote-processor-execute

aaclcdec_PATH    :=$(TI_SW_ROOT)/codecs/c674x_aaclcdec_01_41_00_00_elf

aaclcenc_PATH    :=$(TI_SW_ROOT)/codecs/c674x_aaclcenc_01_00_01_00_elf_patched

 

L301:

RPE_BUILD_VARS =ipc_PATH="${ipc_PATH}" \

         bios_PATH="${bios_PATH}"\

         xdc_PATH="${xdc_PATH}"\

         xdais_PATH="${xdais_PATH}"\

         syslink_PATH="${syslink_PATH}"\

         kernel_PATH="${KERNELDIR}"\

         CODESOURCERY_PATH="${CODEGEN_PATH_A8}"\

         CGT_ARM_PREFIX="${CSTOOL_PREFIX}"\

         CODEGEN_PATH_DSP="${CODEGEN_PATH_DSP}"\

         CODEGEN_PATH_DSPELF="${CODEGEN_PATH_DSP}"\

         ROOTDIR="${rpe_PATH}"\

         aaclcdec_PATH="${aaclcdec_PATH}"\

         aaclcenc_PATH="${aaclcenc_PATH}"

 

L373:

export aaclcdec_PATH   

export aaclcenc_PATH   

 

6.添加库

dvr_rdk/makerules/rules_c674.mk

L192:

LIB_PATHS += $(RTSLIB_PATH)  \

             $(aaclcdec_PATH)/packages/ti/sdo/codecs/aaclcdec/lib/aacdec_tii_lc_elf.l64P\

            $(aaclcenc_PATH)/packages/ti/sdo/codecs/aaclcenc/lib/mp4aacenc_tij_lc_elf.l67

添加包含目录:dvr_rdk/makerules/env.mk

aaclcdec_INCLUDE =$(aaclcdec_PATH)/packages

aaclcenc_INCLUDE =$(aaclcenc_PATH)/packages

 

7.在ARM侧指定RPE的编译包含路径

dvr_rdk/makerules/includes_a8.mk

L18:

RPE_INC=-I$(rpe_PATH)/include-I$(rpe_PATH)/src/include -I$(aaclcdec_PATH)/packages-I$(aaclcenc_PATH)/packages -I$(xdais_PATH)/packages

 

8. DVRRDK_03.00.00.00/dvr_rdk/mcfw/src_bios6/cfg/BIOS_c6xdsp.cfg

Program.sectMap["aacEncProgram"]              = "DSP_CODE_MEM";

 

9.dm8168的DSP和ARM添加库与调用

在DSP里面调用elf格式的lib库

注:lib库需是elf格式的,用ccs5.2可编译elf格式lib库,lib库如何生成具体见1.1.2

1>把Jupitercar.lib拷贝到

/home/DVRRDK/DVRRDK_04.00.00.03/dvr_rdk/mcfw/src_bios6/alg/va/lib

2>rules_c674.mk里添加imglib2_elf.lib所在的路径

在/home/DVRRDK/DVRRDK_04.00.00.03/dvr_rdk/makerules
下打开rules_c674.mk在里面添加:
LIB_PATHS += $(RTSLIB_PATH)  \
             $(fc_INCLUDE)/ti/sdo/fc/ecpy/lib/debug/ecpy.ae674 \
             $(dvr_rdk_PATH)/mcfw/src_bios6/alg/scd/lib/scd.ae674\
             $(dvr_rdk_PATH)/mcfw/src_bios6/alg/va/lib/vlib.ae674\
             $(dvr_rdk_PATH)/mcfw/src_bios6/alg/va/lib/Jupitercar.lib\           
最后一个$(dvr_rdk_PATH)/mcfw/src_bios6/alg/va/lib/Jupitercar.lib\是我添加进去的。

在ARM里面加linux的动态库.so库

注:这个库可以放任意目录中,只要路径加的正确就ok,(dvr_rdk_PATH)=DVRRDK_03.50.00.05\dvr_rdk,(LIB_DIR)=DVRRDK_03.50.00.05\dvr_rdk\lib\ti816x-evm
example:

1>把libcarview.so拷贝到Z:\duth\DVRRDK_03.50.00.05\dvr_rdk\UnitCheck\src

2>看看Z:\duth\DVRRDK_03.50.00.05\dvr_rdk\UnitCheck\src目录下的makefile

include $(dvr_rdk_PATH)/makerules/includes_a8.mk $(dvr_rdk_PATH)/makerules/common_header_a8.mk
includes_a8.mk是添加库的文件
  LIBS= $(LIB_DIR)/dvr_rdk_demo_mcfw_api.a $(MCFW_LIBS) $(AUDIO_LIBS) 
LIBS= $(LIB_DIR)/UnitCheck.a $(MCFW_LIBS) $(AUDIO_LIBS) $(RPE_LIBS) 
看到生成静态库dvr_rdk_demo_mcfw_api.a需要$(MCFW_LIBS) $(AUDIO_LIBS)这2个库
看到生成我们要运行代码的静态库需要$(AUDIO_LIBS) $(RPE_LIBS)这2个库 

3>进入includes_a8.mk看到

AUDIO_LIBS=$(linuxdevkit_PATH)/usr/lib/libasound.so.2
MCFW_LIBS=$(LIB_DIR)/dvr_rdk_mcfw_api.a $(LIB_DIR)/dvr_rdk_link_api.a $(LIB_DIR)/dvr_rdk_osa.a $(SYSLINK_LIBS) 
RPE_LIBS=$(rpe_PATH)/lib/lib/a8/debug/rpe.av5T


接下来加自己的库(仿造上面写)
CAR_LIBS=$(dvr_rdk_PATH)/UnitCheck/src/libcarview.so
然后加到自己要生成文件后面

LIBS= $(LIB_DIR)/UnitCheck.a $(MCFW_LIBS) $(AUDIO_LIBS) $(RPE_LIBS) $(CAR_LIBS)

库只有链接的时候才会验证函数的定义。

转自:http://blog.csdn.net/mianhuantang848989/article/details/27224383

posted on 2015-03-17 13:36  CSlunatic  阅读(1218)  评论(0编辑  收藏  举报

导航