How to build and run PJSIP 2.2 and higher versions with bdIMAD for Linux

Libraries and demo are not provided as downloading material for linux operating systems. Please contact bdSound to request them: techsupport@bdsound.com.

The following information are valid for both x86 and ARM processors.

This chapter will describe how to compile PJSIP with bdIMAD and test it with PJSUA in Linux environment (x86 and ARM family of processors). Once the PJSIP project has been downloaded from the PJSIP website, it is necessary to follow these additional steps to compile PJSIP and PJSUA with bdIMAD support. For general PJSIP compilation issues please refers to PJSIP wiki.

To compile please note that ALSA are required. If missing, you have to install them before to continue; for example in Ubuntu:

1
sudo apt-get install libasound2
sudo apt-get install libasound2

1] Create (or modify if present) the file config_site.h in the directory /pjlib/include/pj as below, in order to enable bdIMAD support and disable other I/O audio libraries:

1
2
3
4
5
#include "config_site_sample.h"
#define PJMEDIA_AUDIO_DEV_HAS_PORTAUDIO 0
#define PJMEDIA_AUDIO_DEV_HAS_WMME 0
#define PJMEDIA_AUDIO_DEV_HAS_COREAUDIO 0
#define PJMEDIA_AUDIO_DEV_HAS_BDIMAD 1
#include "config_site_sample.h"
#define PJMEDIA_AUDIO_DEV_HAS_PORTAUDIO	0
#define PJMEDIA_AUDIO_DEV_HAS_WMME 0
#define PJMEDIA_AUDIO_DEV_HAS_COREAUDIO	0
#define PJMEDIA_AUDIO_DEV_HAS_BDIMAD 1

2] Copy libbdIMADpj.so and libbdClientValidation.a libraries to /third_party/lib/

Only for bdIMAD 2.0.0-beta:
– replace bdimad.h in PJDIR/third_party/bdsound/include getting the one from the Modified_Files/pjsip folder of the downloaded package.
– replace bdimad_dev.c in PJDIR/pjmedia/src/pjmedia-audiodev getting the one from the Modified_Files/pjsip folder of the downloaded package.

3] For cross-compile mode only, copy the libasound.so.2.0.0 in your building tree, renaming it to libasound.so, or creating a link with that name.

4] Create (or edit) in pjsip project directory a file user.mak with the following lines:

1
2
3
#link the bdSound libraries
export LDFLAGS += -L$(PJDIR)/third_party/lib/-lbdIMADpj -lbdClientValidation
export CFLAGS += -march=armv7-a
#link the bdSound libraries
export LDFLAGS += -L$(PJDIR)/third_party/lib/-lbdIMADpj -lbdClientValidation
export CFLAGS += -march=armv7-a

5] In cross-compile mode only, edit the above file user.mak adding also the following lines:

1
2
#link the alsa library
export LDFLAGS += -L/path/to/alsa/lib -lasound
#link the alsa library
export LDFLAGS += -L/path/to/alsa/lib -lasound

6] Open a shell in pjsip project directory then run:

1
2
3
./configure
make dep
make
./configure
make dep
make

7] Executable output file will be in pjsip-apps/bin

8] Finally, be sure to disable the following feature in PJSIP application; for example in PJSUA, pass the following line arguments to the application

1
--ec-tail=0 --no-vad --capture-lat=0 --playback-lat=0
--ec-tail=0 --no-vad --capture-lat=0 --playback-lat=0

Fabio Cagnetti has written 15 articles