= Using Audio Proxy Server (APS) in PJSIP = [[TracNav(Getting-Started/TOC)]] [[BR]] '''Table of Contents''' [[PageOutline(2-3,,inline)]] [[BR]] Audio Proxy Server (APS) is a wrapper to the Nokia S60 sound device. Its main purpose is to bypass the Vendor ID (VID) related restrictions on S60 3rd Edition and S60 3rd Edition, FP1 platforms, when streaming audio data in 3rd party applications. The component is most suitable for VoIP developers who need to set the appropriate audio priority and preference values in order to utilize full duplex audio (quoted from [http://wiki.forum.nokia.com/index.php/Audio_Proxy_Server Nokia wiki page on APS]). APS has some benefits over Audio Streaming API: - Much lower latency. The Audio Streaming API has few hundreds milliseconds of latency at best, while using APS it is possible to bring down the latency to only about 30ms! - Ability to switch audio-routing (to earpiece or loudspeaker). Routing to earpiece can also avoid echo. == Requirements == To build PJSIP with APS support, we need: 1. Successfully build non-APS pjsip as described [wiki:Getting-Started/Symbian Getting Started for Symbian] 1. APS release 2.4.3 that is packaged in [http://wiki.forum.nokia.com/index.php/SDK_API_Plugin SDK API Plug-in], e.g: - [http://www.forum.nokia.com/info/sw.nokia.com/id/53439e01-f605-4491-96f4-62d003bd4c0c/S60_3rd_SDK_MR_API_Plug-In_Pack1.zip.html APS for MR] - [http://www.forum.nokia.com/info/sw.nokia.com/id/4ff42a22-7099-4cc9-91bf-5e66166bd28d/S60_3rd_SDK_FP1_API_Plug-In_Pack.html APS for FP1] - we're not sure how APS should work for FP2 2. MMF !DevSound API (i.e.: to get {{{sounddevice.h}}}): - for S60 3rd edition MR, it can be found in [http://www.forum.nokia.com/info/sw.nokia.com/id/48a93bd5-028a-4b3e-a0b1-148ff203b2b3/Extensions_plugin_S60_3rd_ed.exe.html Extensions plug-in for S60 3rd Edition SDK for Symbian OS for C++ MR]. Note that the page may say that this extension has been superseded by the plugin above, but you still need to install this one. - for S60 3rd edition FP1 & FP2, it is bundled in the SDK API Plug-in above. 3. You need a '''Symbian Developer Certificate''' of type Open Signed Offline and with valid Publisher ID to install the application that uses APS on the device. APS requires '''MultimediaDD''' capability and this capability is among the restricted capabilities so the application needs to be signed with a valid developer certificate to use the capability. The signing options for applications that need these restricted capabilities are Open Signed Offline or Certified Signed. Please see [http://www.symbiansigned.com Symbian Signed website] for more detail. == Building Steps == Here are a few steps to build PJSIP with APS support: 1. 1.0.x: Specify that sound device implementation is using APS, and turn off MDA i.e in config_site.h: {{{ #if defined(PJ_SYMBIAN) || PJ_SYMBIAN==1 # define PJMEDIA_SOUND_IMPLEMENTATION PJMEDIA_SOUND_SYMB_APS_SOUND #endif }}} 1.1 and above: macro PJMEDIA_SOUND_IMPLEMENTATION is deprecated, so it should be defined as: {{{ #if defined(PJ_SYMBIAN) || PJ_SYMBIAN==1 # define PJMEDIA_AUDIO_DEV_HAS_SYMB_APS 1 # define PJMEDIA_AUDIO_DEV_HAS_SYMB_MDA 0 #endif }}} 1. 1.0.x: Edit {{{bld.inf}}} and application's .mmp files (e.g: {{{symbian_ua.mmp}}}, {{{symbian_ua_gui.mmp}}}, {{{symsndtest.mmp}}}), and activate {{{SND_USE_APS}}} macro: {{{ #define SND_USE_NULL 0 #define SND_USE_APS 1 #define SND_USE_VAS 0 }}} 1.1 and 1.2: Edit {{{bld.inf}}} and to comment out {{{symbian_ua_gui.mmp}}}. Edit {{{symbian_ua.mmp}}}: {{{ #define SND_HAS_APS 1 #define SND_HAS_VAS 0 #define SND_HAS_MDA 0 }}} 1. Refresh the makefiles: Refresh the project (right click '''bld.inf''' from the '''Symbian Project Navigator''' pane, and select '''Refresh'''). * 1.0.x: '''symbian_audio_aps.mmp''' should be there after the refresh done. * If you are building from command line, use '''bldmake clean''' then '''bldmake bldfiles'''. * 1.1 and above: {{{symbian_audio_aps.mmp}}} is no longer used, all symbian audio implementations are bundled in {{{pjmedia_audiodev.mmp}}}. 4. Clean and rebuild the whole project. Please note that WINSCW target doesn't seem to support APS. 5. Make the installer (.sis file) for the application. == Installation == 1. Install APS Server '''apsserver2.sisx''' to device, the installer comes with the APS SDK package i.e in folder '''!InstallToDevice/AudioProxyServer243'''. You will need to do this only once for each device. 1. Sign the application installer with APS support with '''Developer Certificate using Open Signed Offline/with Publisher ID'''. 1. Install the application to the device. == Developing Application with APS Support == 1. Specify application UID in a global variable named '''APP_UID''' whose base type '''TPtrC''', e.g: {{{ TPtrC APP_UID = _L("2000521C"); }}} 1. Link the application to APS library, i.e: {{{ LIBRARY APSSession2.lib }}} 1. Add MultimediaDD capability to your application, i.e. in application MMP: {{{ CAPABILITY MultimediaDD ... }}} There are some notes for developing application with APS support: - There seems binary compatibility issue among Symbian OS versions, you will have to use appropriate '''SDK API Plug-in''' and '''apsserver2.sisx''' for each OS version. == Limitations == - Currently, this APS wrapper can only work in S60 3rd edition device that supports G.711, which perhaps means all S60 3rd edition devices. == Issues == We found some issues with APS, such as noisy audio or no audio at all, please go to [wiki:FAQ#symbian Symbian Section in our FAQ] for more information.