这段时间在一直在研究android 2.3的多媒体框架,起初还以为TI给DVEM3730 开发板提供的android源码的多媒体stagefright底层是支持codec enginer的,可是经过一段时间的源码解读,发现提供的源码连接dsp ,用的还是dsp bridge ,这个是用在以前的omaps系列上的。所以后来就谷歌专门有个小组在开发TI 的davnic的产品为其配置android 源码名字叫做rowboat,具体的是在http://code.google.com/p/rowboat/ :上面有具体的instruction 用来下载专用的android 2.3 bingerbread源码,使用的是repo ,同步下载的两个支持dsp 的xml 是
rowboat-gingerbread-dsp.xml
TI-Android-GingerBread-DSP-2.3-DevKit-1.0.xml
大家可以从这里下载,大概的区别就是下面有/hardware/omx,/external/ti-dsp.这个是关键的区别和TI 官网上的那个源码(其实就是来自于TI-Android-GingerBread-2.3-DevKit-2.0.xml),
下载代码是最痛苦的这我在前面的文章中也提到过。唉通宵啊/
。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
下面我先简单说一下ti 的dvsdk(Digital Video Software Development Kit):主要是支持linux系统就,里面有dsplink,dsp/bios,codec-enginer,codec-omap3530专用编解码器,dvtb ,demo,linux内核,xdctool特定的包编译工具(也算是是codec enginger的特点吧),c6000 dsp编译工具等等。
上面的很多内容都够很多方向的让学习,包括dsp算法,dsp 集成等工程师学习,内容很庞大,我也只是了解了个大概,这里不好意思多讲,反正是拿来实现的,不做这一块,但是dsp算法工程师就要去了解这个xdm,xdais的算法接口封装架构。感觉蛮复杂的但是有自带列子可以参考。
。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
简单的说了一下dvsdk的内容,dvsdk 的安装其实有好多方法,
法1 ,直接./dvsdk_dm3730-evm_04_03_00_06_setuplinux,前提是可以执行,具体安装步骤和windows窗口化安装软件一样很简单,但是安装一次大概半小时,看电脑配置。
4.1的dvsdk会让你选择 编译器的目录,TI 推荐使用CodeSourcery/Sourcery_G++_Lite/bin,具体要看你安装的目录
注意:dvsdk 最新4以上貌似基本是在10.04的ubuntu下面编译,所以下面直接执行会遇到support 10.04窗口后没有next可以点击,但是不用担心,直接敲击enter就课进入下一步。当然最简单是你输入命令时外加--forcehost,兼容不同版本的ubuntu 和pc操作系统,当然是得linux的系统。
前面已经说过这个dvsdk 基本上是在linux系统下使用的,因此我们把他用到android上当然也是可以的,因为底层都是linux内核嘛,当然我们知道两者还是不同的,所以如果单独使用dvsdk 只是在linux下面使用那就直接make clean ,make 编译就可以成功了的。
如果要兼容到android 中请看法2
法2 .
在/external/ti-dsp 下面的目录主要有
-rw-r--r-- 1 root root 0 2012-04-03 04:47 already_clean
drwxrwxrwx 2 root root 4096 2012-03-26 12:29 fake-toolchain
-rwxrwxrwx 1 root root 2706 2012-04-06 01:58 get_tidsp.sh
-rwxrwxrwx 1 root root 1174 2012-04-05 08:28 install_dvsdk4.exp
-rwxrwxrwx 1 root root 5433 2012-04-05 22:26 Makefile
-rwxrwxrwx 1 root root 152 2012-04-05 06:57 md5sum.list
drwxrwxrwx 2 root root 4096 2012-04-05 22:03 patches
在/external/ti-dsp,里面其实是有安装脚本的,他可以方便完成对dvsdk的安装,包括前期的环境配置等等,最重要的是安装完成后他会添加patches,这个是最重要的,前面的窗口式安装是没有这个的,这个可以通过安装的输出log查看,会发现两者是的dvsdk目录下有的内容是有区别的。安装的几个脚本文件也比较简单,就是先判断有没有安装的目录是否已经安装好,再看有没有安装包,最后就是打补丁。
法3,当然这个最简单就是在编译的时候直接同时进行安装,这个为何会安装?在顶层编译时build/core/rowboat.mk在起作用,这个编译android 的都知道,其源码编译都是将xxx.mk为makfile 进行编译的。下面是他的内容
kernel_not_configured := $(wildcard kernel/.config)
dvsdk_not_installed := $(wildcard external/ti-dsp/already_clean)//看是否这个文件存在,不然应该是空
DSP_PATH := $(wildcard external/ti-dsp)
OMAPES := 5.x
rowboat: dvsdk sgx
.PHONY: kernel
kernel: droid
ifeq ($(strip $(kernel_not_configured)),)
ifeq ($(TARGET_PRODUCT), beagleboard)
make -C kernel ARCH=arm omap3_beagle_android_defconfig
endif
ifeq ($(TARGET_PRODUCT), omap3evm)
make -C kernel ARCH=arm omap3_evm_android_defconfig
endif
ifeq ($(TARGET_PRODUCT), igepv2)
make -C kernel ARCH=arm igep0020_android_defconfig
endif
endif
make -C kernel ARCH=arm CROSS_COMPILE=../$($(combo_target)TOOLS_PREFIX) uImage
.PHONY: dvsdk
dvsdk: kernel
上面这段if, 是用来判断目录下面有没有already_clean的这个文件,要是没有从上面的定义可知,这个应该是空格,strip是把这个文件名去掉开头和结尾的空格,wildcard后要是没有这个目录文件,就应该是空格。所以空格=空格判断if成立,于是进入if中执行的dvsdk的安装,包括对ti-dsp的clean,完成在编译时前的操作。
ifeq ($(strip $(dvsdk_not_installed)),)
TOOLS_DIR=$(dir `pwd`/$($(combo_target)TOOLS_PREFIX))../ ./external/ti-dsp/get_tidsp.sh
touch ./external/ti-dsp/already_clean //touch 第一次看到在makefile里面,貌似是如果没有这个文件就创建并把文件建立时间改为当前,有的话,运行后时间改为当前
make -C external/ti-dsp combo_target=$(combo_target) $(combo_target)TOOLS_PREFIX=$($(combo_target)TOOLS_PREFIX) HOST_PREBUILT_TAG=$(HOST_PREBUILT_TAG) clean
endif
下面是if以后的内容,无论是否存在都会继续编译,包括dsp和omx,因为omx要使用ti-dsp 的dvsdk中的某些库文件所以先编译
make -C external/ti-dsp combo_target=$(combo_target) $(combo_target)TOOLS_PREFIX=$($(combo_target)TOOLS_PREFIX) HOST_PREBUILT_TAG=$(HOST_PREBUILT_TAG)
make -C hardware/ti/omx combo_target=$(combo_target) $(combo_target)TOOLS_PREFIX=$($(combo_target)TOOLS_PREFIX) HOST_PREBUILT_TAG=$(HOST_PREBUILT_TAG)
dvsdk_clean:
make -C external/ti-dsp combo_target=$(combo_target) $(combo_target)TOOLS_PREFIX=$($(combo_target)TOOLS_PREFIX) HOST_PREBUILT_TAG=$(HOST_PREBUILT_TAG) clean
kernel_clean:
make -C kernel ARCH=arm clean
rm kernel/.config
sgx: kernel
make -C hardware/ti/sgx ANDROID_ROOT_DIR=`pwd` TOOLS_PREFIX=$($(combo_target)TOOLS_PREFIX) OMAPES=$(OMAPES)
make -C hardware/ti/sgx ANDROID_ROOT_DIR=`pwd` TOOLS_PREFIX=$($(combo_target)TOOLS_PREFIX) OMAPES=$(OMAPES) install
sgx_clean:
make -C hardware/ti/sgx OMAPES=$(OMAPES) clean
rowboat_clean: clean dvsdk_clean sgx_clean kernel_clean
上面讲述的法3是top层编译的最好方法,一键完成,这个是我几天来的总结,学到多。当然光编译linux dvsdk就会出现许多错误,还有错误在解决中
错误如下:
直接在dvsdk目录下编译dvsdk出错
error 1:
/home/rowboat/rowboat_android/external/ti-dsp/ti-dvsdk_dm3730-evm_4_01_00_09/psp/linux-2.6.32-psp03.00.01.06/scripts/Makefile.modpost:42:include/config/auto.conf: No such file or directory
binary sgx_init_test ->/system/bin/sgx_init_test
make[5]: *** No rule to make target`include/config/auto.conf'. Stop.
make[4]: *** [modules] Error 2
make[4]: Leaving directory`/home/rowboat/rowboat_android/external/ti-dsp/ti-dvsdk_dm3730-evm_4_01_00_09/psp/linux-2.6.32-psp03.00.01.06'
make[3]: *** [debug] Error 2
make[3]: Leaving directory`/home/rowboat/rowboat_android/external/ti-dsp/ti-dvsdk_dm3730-evm_4_01_00_09/dsplink_1_65_00_02/dsplink/gpp/src'
make[2]: *** [dsplink_arm] Error 2
make[2]: Leaving directory`/home/rowboat/rowboat_android/external/ti-dsp/ti-dvsdk_dm3730-evm_4_01_00_09'
make[1]: *** [dvsdk] Error 2
make[1]: Leaving directory`/home/rowboat/rowboat_android/external/ti-dsp'
make: *** [dvsdk] Error 2
make: *** Waiting for unfinishedjobs....
解决方法,是编译dvsdk时需要,先配置自带的linux内核,因为编译其他的dvsdk模块要用到,所以
法1:所以顶层编译前,直接makedsplink时会出现linux内核没有配置的问题,因此在 之前ti-dsp/makefile添加makelinux
法2:make 时使用配置文件omap3_evm_defconfig
error2 make liunx in Makefile
# all files complete.
======== all[/home/rowboat/rowboat_android/external/ti-dsp/ti-dvsdk_dm3730-evm_4_01_00_09/c6accel_1_01_00_02/soc/packages/ti/c6accel/ce]========
#
# all files complete.
all files complete: Thu Apr 5 22:42:19CST 2012.
/home/rowboat/rowboat_android/external/ti-dsp/ti-dvsdk_dm3730-evm_4_01_00_09/xdctools_3_16_03_36/xdc-PR packages
making all: Thu Apr 5 22:42:19 CST 2012...
======== .interfaces[packages/ti/sdo/codecs/aachedec] ========
package.mak:17: *** target patterncontains no `%'. Stop.
gmake: ***[packages/ti/sdo/codecs/aachedec,.interfaces] Error 2
make[3]: *** [.all-packages] Error 2
make[3]: Leaving directory`/home/rowboat/rowboat_android/external/ti-dsp/ti-dvsdk_dm3730-evm_4_01_00_09/codecs-omap3530_4_01_00_00'
make[2]: *** [codecs] Error 2
make[2]: Leaving directory`/home/rowboat/rowboat_android/external/ti-dsp/ti-dvsdk_dm3730-evm_4_01_00_09'
make[1]: *** [dvsdk] Error 2
make[1]: Leaving directory`/home/rowboat/rowboat_android/external/ti-dsp'
make: *** [dvsdk] Error 2
解决方法:首先需要makeclean
Linkinglinux/audio_decode1_dm3730.x470MV from appMain.dm3730.o470MVlinux/main.dm3730.o470MVlinux/audio_decode1_dm3730_config/linker.cmd..
/home/rowboat/rowboat_android/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc -lcutils -lm -lasound -fuse-ld=bfd -lc -lstdc++ -lm -nostdlib-Bdynamic-Wl,-rpath-link=/home/rowboat/rowboat_android/out/target/product/omap3evm/obj/lib-L/home/rowboat/rowboat_android/out/target/product/omap3evm/obj/lib-Wl,-T,/home/rowboat/rowboat_android/build/core/armelf.x-Wl,-dynamic-linker,/system/bin/linker -Wl,--gc-sections-Wl,-z,nocopyreloc/home/rowboat/rowboat_android/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/../lib/gcc/arm-eabi/4.4.3/libgcc.a/home/rowboat/rowboat_android/out/target/product/omap3evm/obj/lib/crtend_android.o/home/rowboat/rowboat_android/out/target/product/omap3evm/obj/lib/crtbegin_dynamic.o-L/home/rowboat/rowboat_android/out/target/product/omap3evm/obj/STATIC_LIBRARIES/libasound_intermediates-L/home/rowboat/rowboat_android/out/target/product/omap3evm/obj/STATIC_LIBRARIES/libasound_intermediates-Wl,-Map,linux/audio_decode1_dm3730.x470MV.map -olinux/audio_decode1_dm3730.x470MV appMain.dm3730.o470MVlinux/main.dm3730.o470MV linux/audio_decode1_dm3730_config/linker.cmd
/home/rowboat/rowboat_android/external/ti-dsp/ti-dvsdk_dm3730-evm_4_01_00_09/codec-engine_2_26_01_09/packages/ti/sdo/ce/lib/release/ce.av5T(Engine.ov5T):In function `callServer':
Engine.c:(.text+0x3b8):undefined reference to `__assert_fail'
/home/rowboat/rowboat_android/external/ti-dsp/ti-dvsdk_dm3730-evm_4_01_00_09/codec-engine_2_26_01_09/packages/ti/sdo/ce/lib/release/ce.av5T(Engine.ov5T):In function `Engine_init':
Engine.c:(.text+0x1a84):undefined reference to `__assert_fail'
Engine.c:(.text+0x1aa8):undefined reference to `__assert_fail'
Engine.c:(.text+0x1acc):undefined reference to `__assert_fail'
/home/rowboat/rowboat_android/external/ti-dsp/ti-dvsdk_dm3730-evm_4_01_00_09/codec-engine_2_26_01_09/packages/ti/sdo/ce/lib/release/ce.av5T(Engine.ov5T):In function `collectDspTrace':
Engine.c:(.text+0x2060):undefined reference to `stdout'
/home/rowboat/rowboat_android/external/ti-dsp/ti-dvsdk_dm3730-evm_4_01_00_09/codec-engine_2_26_01_09/packages/ti/sdo/ce/lib/release/ce.av5T(Engine.ov5T):In function `Engine_createNode2':
Engine.c:(.text+0x31f8):undefined reference to `__assert_fail'
Engine.c:(.text+0x33ac):undefined reference to `__assert_fail'
/home/rowboat/rowboat_android/external/ti-dsp/ti-dvsdk_dm3730-evm_4_01_00_09/codec-engine_2_26_01_09/packages/ti/sdo/ce/lib/release/ce.av5T(visa.ov5T):In function `VISA_freeMsg':
visa.c:(.text+0x30c):undefined reference to `__assert_fail'
/home/rowboat/rowboat_android/external/ti-dsp/ti-dvsdk_dm3730-evm_4_01_00_09/codec-engine_2_26_01_09/packages/ti/sdo/ce/lib/release/ce.av5T(visa.ov5T):In function `VISA_create2':
visa.c:(.text+0xdd8):undefined reference to `__strtol_internal'
visa.c:(.text+0xe4c):undefined reference to `__strtol_internal'
visa.c:(.text+0x1060):undefined reference to `__strtol_internal'
/home/rowboat/rowboat_android/external/ti-dsp/ti-dvsdk_dm3730-evm_4_01_00_09/codec-engine_2_26_01_09/packages/ti/sdo/ce/ipc/dsplink/lib/release/ipc_dsplink_3530.av5T(Processor_dsplink.ov5T):In function `daemon':
Processor_dsplink.c:(.text+0x2f48):undefined reference to `_IO_getc'
Processor_dsplink.c:(.text+0x33f4):undefined reference to `stdin'
/home/rowboat/rowboat_android/external/ti-dsp/ti-dvsdk_dm3730-evm_4_01_00_09/codec-engine_2_26_01_09/packages/ti/sdo/ce/ipc/dsplink/lib/release/ipc_dsplink_3530.av5T(Comm_dsplink.ov5T):In function `Comm_init':
Comm_dsplink.c:(.text+0x55c):undefined reference to `__assert_fail'
/home/rowboat/rowboat_android/external/ti-dsp/ti-dvsdk_dm3730-evm_4_01_00_09/codec-engine_2_26_01_09/packages/ti/sdo/ce/ipc/dsplink/lib/release/ipc_dsplink_3530.av5T(Comm_dsplink.ov5T):In function `Comm_alloc':
Comm_dsplink.c:(.text+0xde4):undefined reference to `__assert_fail'
/home/rowboat/rowboat_android/external/ti-dsp/ti-dvsdk_dm3730-evm_4_01_00_09/codec-engine_2_26_01_09/packages/ti/sdo/ce/osal/linux/lib/release/osal_linux_470.av5T(GT_config_libC.ov5T):In function `GTConfig_vprintf':
GT_config_libC.c:(.text+0xe0):undefined reference to `stdout'
/home/rowboat/rowboat_android/external/ti-dsp/ti-dvsdk_dm3730-evm_4_01_00_09/codec-engine_2_26_01_09/packages/ti/sdo/ce/osal/linux/lib/release/osal_linux_470.av5T(File_posix.ov5T):In function `File_stat':
File_posix.c:(.text+0x18):undefined reference to `__xstat'
/home/rowboat/rowboat_android/external/ti-dsp/ti-dvsdk_dm3730-evm_4_01_00_09/codec-engine_2_26_01_09/packages/ti/sdo/ce/osal/linux/lib/release/osal_linux_470.av5T(Memory_cmem.ov5T):In function `Memory_init':
Memory_cmem.c:(.text+0x504):undefined reference to `__assert_fail'
/home/rowboat/rowboat_android/external/ti-dsp/ti-dvsdk_dm3730-evm_4_01_00_09/codec-engine_2_26_01_09/packages/ti/sdo/ce/osal/linux/lib/release/osal_linux_470.av5T(Global_noOS.ov5T):In function `Global_abort':
Global_noOS.c:(.text+0x2d8):undefined reference to `stdout'
/home/rowboat/rowboat_android/external/ti-dsp/ti-dvsdk_dm3730-evm_4_01_00_09/codec-engine_2_26_01_09/packages/ti/sdo/ce/osal/linux/lib/release/osal_linux_470.av5T(Thread_posix.ov5T):In function `Thread_delete':
Thread_posix.c:(.text+0x608):undefined reference to `pthread_cancel'
/home/rowboat/rowboat_android/external/ti-dsp/ti-dvsdk_dm3730-evm_4_01_00_09/codec-engine_2_26_01_09/packages/ti/sdo/ce/osal/linux/lib/release/osal_linux_470.av5T(Thread_posix.ov5T):In function `runStub':
Thread_posix.c:(.text+0x8dc):undefined reference to `pthread_setcanceltype'
/home/rowboat/rowboat_android/external/ti-dsp/ti-dvsdk_dm3730-evm_4_01_00_09/codec-engine_2_26_01_09/packages/ti/sdo/ce/osal/linux/lib/release/osal_linux_470.av5T(GT_config_posix.ov5T):In function `GTConfig_tracePrintf':
GT_config_posix.c:(.text+0x14c):undefined reference to `stdout'
/home/rowboat/rowboat_android/external/ti-dsp/ti-dvsdk_dm3730-evm_4_01_00_09/codec-engine_2_26_01_09/packages/ti/sdo/ce/osal/linux/lib/release/osal_linux_470.av5T(GT_config_posix.ov5T):In function `GTConfig_posixInit':
GT_config_posix.c:(.text+0x314):undefined reference to `stdout'
collect2:ld returned 1 exit status
make[5]:*** [linux/audio_decode1_dm3730.x470MV] Error 1
make[5]:Leaving directory`/home/rowboat/rowboat_android/external/ti-dsp/ti-dvsdk_dm3730-evm_4_01_00_09/dmai_2_20_00_14/packages/ti/sdo/dmai/apps/audio_decode1'
make[4]:*** [audio_decode1/] Error 2
make[4]:Leaving directory`/home/rowboat/rowboat_android/external/ti-dsp/ti-dvsdk_dm3730-evm_4_01_00_09/dmai_2_20_00_14/packages/ti/sdo/dmai/apps'
make[3]:*** [all] Error 2
make[3]:Leaving directory`/home/rowboat/rowboat_android/external/ti-dsp/ti-dvsdk_dm3730-evm_4_01_00_09/dmai_2_20_00_14'
make[2]:*** [dmai] Error 2
make[2]:Leaving directory`/home/rowboat/rowboat_android/external/ti-dsp/ti-dvsdk_dm3730-evm_4_01_00_09'
make[1]:*** [dvsdk] Error 2
make[1]:Leaving directory `/home/rowboat/rowboat_android/external/ti-dsp'
make:*** [dvsdk] Error 2
这个是我犯的一个错误,因为当初把源码的安装脚本的编译器给换了opt的,上面提到过,那个是单独编译linux dvsdk ,如果要android 下面的,就不要去修改安装脚本,上面的错误可能是两个编译器不兼容,不能识别,所以请大家注意,安装什么就用什么