How to build and run PJSIP 2.2 and higher versions with bdIMAD for Apple OS-X

This chapter will describe how to compile PJSIP with bdIMAD and test it with PJSUA in Mac OS-X environment.

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.

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 bdIMADpj.dylib and bdClientValidation.a libraries to pjsip-apps/Frameworks

Only for bdIMAD 2.0.0-beta and higher versions:
– 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] Open a shell in pjsip project directory and launch this command line:

1
 CFLAGS="-arch i386 -O3 -DNDEBUG -I$(pwd)/third_party/bdsound/include" LDFLAGS="-arch i386 -O3 -DNDEBUG -L$(pwd)/pjsip-apps/Frameworks -lbdIMADpj -lbdClientValidation" ./configure --host=i386-apple-darwin10.8.0
 CFLAGS="-arch i386 -O3 -DNDEBUG -I$(pwd)/third_party/bdsound/include" LDFLAGS="-arch i386 -O3 -DNDEBUG -L$(pwd)/pjsip-apps/Frameworks -lbdIMADpj -lbdClientValidation" ./configure --host=i386-apple-darwin10.8.0

4] In the same shell run: make dep

5] And again, in the same shell run: make

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

7] 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