LinpPhone在Mini2410上的移植

 LINUX中的音频驱动有OSS和ALSA两种,OSS是商业性质的而且只公布了部分源码,现在内核里带的都是老版本的,并且不支持多线程的(我再移植过程中发现,OSS只能在一时刻提供一种功能,录音的话就不能播音,播音的话就不能录音),ALSA是内核中现在最常用的音频驱动,支持多线程并且是完全开源的。
OSS提供的设备接口有 mixer和dsp,ALSA提供pcm,midi,mixer,controlc,seq,timer等,要成功实现语音要使用ALSA驱动,在移植前期请确保你的内核中还有ALSA驱动,一般内核都带有驱动,只是设备文件的目录可能并不在默认的/dev/snd下并且要移植相应的库文件到板子上,,这时候你就要再编译的时候注意参数的设置,在MINI上首先ls看下ALSA的设备文件是否都在,若都再得话就可以开始编译了。
 
1.首先编译ALSA的库文件
root@chenhao-desktop:/usr/local/arm   . /configure --prefix=/home/chen/linphone/arm_target/ --host=arm-linux CC=arm-linux-gcc --disable-aload --disable-rawmidi --disable-seq --disable-ucm --disable-alisp --disable-old-symbols --disable-python --with-alsa-devdir=/dev
2.再编译linphone依赖的库,请再linphone的源码中读取相关的版本依赖关系

(1)cd ncurses-5.7/
root@chenhao-desktop:/usr/local/arm/ncurses-5.7/#
 ./configure --prefix=/install --host=arm-linux --with-gnu-ld --with-shared
root@chenhao-desktop:/usr/local/arm/ncurses-5.7/#
 make
root@chenhao-desktop:/usr/local/arm/ncurses-5.7/#
 make install DESTDIR=/home/chen/linphone/arm_target/

(2)cd readline-6.1/
root@chenhao-desktop:/usr/local/arm/readline-6.1/#
 
./configure --prefix=/install --host=arm-linux --with-gnu-ld --disable-static
root@chenhao-desktop:/usr/local/arm/readline-6.1/#
 make
root@chenhao-desktop:/usr/local/arm/readline-6.1/#
 make install DESTDIR=/home/chen/linphone/arm_target/
在这里,发现--with-gnu-ld无效,后面发现配置参数不支持这个参数,不知道怎么回事,也许是本身默认吧????

(3)cd libosip2-3.3.0/
root@chenhao-desktop:/usr/local/arm/libosip2-3.3.0/#
 ./configure --prefix=/install --host=arm-linux --with-gnu-ld --disable-static
root@chenhao-desktop:/usr/local/arm/libosip2-3.3.0/#
 
make
root@chenhao-desktop:/usr/local/arm/libosip2-3.3.0/#
 make install DESTDIR=/home/chen/linphone/arm_target/

(4)cd  libbogg-1.2.0/
root@chenhao-desktop:/usr/local/arm/libbogg-1.2.0/#
 ./configure --prefix=/install --host=arm-linux
root@chenhao-desktop:/usr/local/arm/libbogg-1.2.0/#
 make
root@chenhao-desktop:/usr/local/arm/libbogg-1.2.0/#
 make install DESTDIR=/home/chen/linnphone/arm_target/

(5)cd speex-1.2rc1/
 root@chenhao-desktop:/usr/local/arm/speex-1.2rc1#
 ./configure --prefix=/home/chen/linphone/arm_target/ --host=arm-linux --disable-static --enable-fixed-point --enable-arm-asm --with-ogg-libraries=/home/chen/linphone/arm_target --with-ogg-includes=/home/chen/linphone/arm_target

root@chenhao-desktop:/usr/local/arm/speex-1.2rc1#
 make
root@chenhao-desktop:/usr/local/arm/speex-1.2rc1#
 make install DESTDIR=/home/chen/linphone/arm_target/

(6)cd libeXosip2-3.1.0/
root@chenhao-desktop:/usr/local/arm/libeXosip2-3.1.0./configure OSIP_CFLAGS=-I/home/chen/linphone/arm_target/include OSIP_LIBS=-"L/home/chen/linphone/arm_target -losip2 -losipparser2" --prefix=/home/chen/linphone/arm_target --host=arm-linux

root@chenhao-desktop:/usr/local/arm/libeXosip2-3.1.0# make
可能会出现个缺少文件的错误,在libosip中拷贝到安装目录下,
root@chenhao-desktop:/usr/local/arm/libeXosip2-3.1.0# make -k install DESTDIR=/home/chen/linphone/arm_target/
 
到此,linphone的库编译就告一段落了
3.下来就要编译linphone了
root@chenhao-desktop:/usr/local/arm/linphone-3.2.0# ./configure --prefix=/home/chen/linphone/arm_target --host=arm-linux --with-gnu-ld --disable-static  --enable-alsa=yes  --disable-glib --with-osip=/home/chen/linphone/arm_target  --with-readline=/home/chen/    SPEEX_CFLAGS="I/home/chen/linphonc/arm_target/include"  SPEEX_LIBS="-L/home/chen/linphone/arm_target/ lspeex lspeexdsp"  OSIP_CFLAGS="-I/home/chen/linphone/arm_target/include"  OSIP_LIBS="-L/home/chen/linphone/arm_target  -losip2 -leXosip2 -losipparser2" --disable-video --disable-gtk_ui PKG_CONFIG_PATH=/homelinphone/arm_target/lib/pkgconfig/

 

记的要--enable-alsa=yes


root@chenhao-desktop:/usr/local/arm/linphone-3.2.0# make
 
root@chenhao-desktop:/usr/local/arm /linphone-3.2.0# make -k install DESTDIR=/home/chen/linphone/arm_target
 
此时一个LINPHONE就编译成功了,把工具和相关库拷贝到板子上,建立相关符号连接,启动LINPHONE查看下声卡设备是否发现了ALSA,如果没有说明期中没有编译成功,因为LINPHONE默认的是OSS声卡,但是要实现语音必须用ALSA,就检查参数,看是否指明了让其自动寻找ALSA
,此时一个没有界面的LINPHONE就实现了,要实现界面除非你的板子上的图形系统是基于WINDOW X的,你在编译linphone时去掉--disable-gtk_ui并且编译了GTK的库到安装文件中,然后把GTK的库考到板子上,应该就可以了(我没有尝试过)我的板子上图形是QT得,若使QT的只有自己调用LINPHONE的相关库来写了,感觉很麻烦,不知道由什么方便的方法,有人说可以修改相关的linphone代码把GTK的改成QT的不过感觉太复杂了,还是有时间想想吧
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值