Cross-compiled Linphone for audio (Video-free)

Source: Internet
Author: User
Tags linphone

Cross-compiled Linphone for audio (Video-free)


Environment: ubuntu10.04, FCL mx53

Linphone3.6.1

Dependent libraries: alsa-lib-1.0.18 ncurses-5.9 readline-5.1 libosip2-3.6.0 libeXosip2-3.6.0 libogg-1.1.4 speex-1.2rc1 libxml2-2.7.6


Install configure dependency tool:

Sudo apt-Get install libtool automake Autoconf


Set environment variables:

Export prefix =/home/Ray/Linphone/Target

Export host = arm-Linux


Compile the dependency Library:

Alsa-lib-1.0.18

. /Configure -- prefix = $ prefix -- Host = $ host -- disable-static -- disable-aload -- disable-rawmidi -- disable-seq -- disable-UCM -- disable-alisp -- disable-old -symbols -- disable-Python -- With-ALSA-devdir =/dev & make install


Ncurses-5.9

./Configure -- prefix = $ prefix -- Host = $ host -- With-GNU-LD -- With-shared -- disable-Static & make install


Readline-5.1

./Configure -- prefix = $ prefix -- Host = $ host -- With-GNU-LD -- With-shared -- disable-Static & make install


Libosip2-3.6.0

./Configure -- prefix = $ prefix -- Host = $ host -- With-GNU-LD -- With-shared -- disable-Static & make install


LibeXosip2-3.6.0

. /Configure -- prefix = $ prefix -- Host = $ host -- disable-static osip_cflags =-I $ prefix/include osip_libs =-"L $ prefix/lib-losip2-losipparser2" & amp "&& make & make install


Libogg-1.1.4

./Configure -- prefix = $ prefix -- Host = $ host -- With-GNU-LD -- With-shared -- disable-Static & make install


Speex-1.2rc1

. /Configure -- prefix = $ prefix -- Host = $ host -- disable-static -- enable-fixed-point -- enable-arm-ASM -- With-Ogg-libraries = $ prefix/lib -- with-Ogg-nodes des = $ prefix/include & make install


Libxml2-2.7.6

./Configure -- prefix = $ prefix -- Host = $ host -- With-GNU-LD -- With-shared -- disable-Static & make install


Compile Linphone:

Linphone3.6.1

. /Configure -- Host = $ host -- prefix = $ prefix/Linphone -- With-GNU-LD -- disable-static -- disable-video -- disable-OSS -- disable-gtk_ui -- disable-pulseaudio -- enable -ALSA pkg_config_path = $ prefix/lib/pkgconfig


At this time, a Linphone is compiled successfully. Copy the tool and related libraries to the board, establish a symbolic connection, and start Linphone to check whether ALSA is found on the sound card device, if not, it indicates that the compilation was not successful, because Linphone uses the OSS sound card by default, but ALSA must be used to implement speech. Check the parameters to see if they are specified for automatic search for ALSA.

Note:

After compilation, linphonec and linphonecsh are generated. You must add the directory where linphonec is located to the environment variable path to run linphonecsh successfully, such as linphonecsh init-C/root /. linphonerc-A. If you want to run the video version, add-c-d (you need to configure the Linphone library's loading path environment variable LD_LIBRARY_PATH );

The default configuration file is/root/. linphonerc. You can modify the asterisk Server IP address and port in the configuration file and the logon username and password. Other configurations are configured according to the input parameters initialized by linphonecsh;

You can select OSS or ALSA as the audio library. After running linphonec, you can use the Soundcard list to view the currently loaded video card driver. Call the driver as the call ID and ID as the user name registered under asterisk, such as call 1129;


ALSA sound card cannot be found when linphonec is running on the Development Board:

Run env on Ubuntu

Path =/opt/Freescale/usr/local/gcc-4.4.4-glibc-2.11.1-multilib-1.0/ARM-FSL-Linux-gnueabi/bin

Put ALSA under the Lib of the Cross Compiler:

/Opt/Freescale/usr/local/gcc-4.4.4-glibc-2.11.1-multilib-1.0/ARM-FSL-Linux-gnueabi/Multi-libs/lib
/Opt/Freescale/usr/local/gcc-4.4.4-glibc-2.11.1-multilib-1.0/ARM-FSL-Linux-gnueabi/Multi-libs/usr/lib

Re-compile Linphone

Then, test ALSA under the Development Board/usr/lib.

Linphonec> Soundcard list
0: ALSA: default device
1: ALSA: imx-3stack
2: ALSA: imx-3stack-spdif


I have not understood the reason why the Alsa sound card can be found under the Lib of the compiler by taking the Alsa application library as an example.


Appendix:

There are two types of audio drivers in Linux: OSS and ALSA. OSS is commercial and only some source code is published. Now all the old versions are included in the kernel, and does not support multithreading (I found during the porting process that the OSS can only provide one function at a time, so the recording cannot be broadcast, and the recording cannot be broadcast ), ALSA is the most commonly used audio driver in the kernel. It supports multiple threads and is completely open-source.
The device interfaces provided by OSS include mixer and DSP. ALSA provides PCM, Midi, mixer, controlc, seq, timer, and so on. To realize voice successfully, ALSA driver must be used, before porting, make sure that your kernel has an ALSA driver. Generally, the kernel has a driver, the Directory of the device file may not be in the default/dev/snd directory and the corresponding library file should be transplanted to the board. At this time, you should pay attention to parameter settings during compilation, on the Development Board, first check whether all the Alsa device files are in the LS file. If you have all the files, you can start compiling.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.