How to build and run PJSIP 2.1 with bdIMAD for Apple OS-X

To compile PJSIP with bdIMAD support in version 2.1 it is necessary to manually perform those modifications already present in version 2.x.


Once the PJSIP project 2.1 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 PJSIP 2.1 with bdIMAD support follow these steps:

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

Only for bdIMAD 2.0.0-beta, for following step use:
bdimad.h located in the folder Modified_Files/pjsip of the downloaded package for OSX.
bdimad_dev.c located in the folder Modified_Files/pjsip of the downloaded package for OSX.

2] Create the directory third_party/bdsound/include and copy bdimad.h within this directory

3] Add the created directory to the project pjmedia_audiodev, in order to include the header file bdimad.h, that is located under the directory ../../third_party/bdsound/include

4] Create a directory containing the bdIMADpj.liband bdClientValidation.lib files from bdSound and link these libraries to PJSUA project;

5] Copy the file bdimad_dev.c from the SRC_Files_for_PJSIP_2.1 folder into the directory /pjmedia/src/pjmedia-audiodev/ and add it to the pjmedia_audiodev project

6] Copy errno.c and audiodev.c from the SRC_Files_for_PJSIP_2.1 folder into the same directory /pjmedia/src/pjmedia-audiodev/

7] Copy and overwrite errno.h and config.h from the SRC_Files_for_PJSIP_2.1 folder into /pjmedia/include/pjmedia-audiodev.h

8] Copy bdIMADpj.dylib and bdClientValidation.a libraries to pjsip-apps/Frameworks

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

10] In the same shell run: make dep

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

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

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