Changes between Version 1 and Version 2 of Ticket #1888


Ignore:
Timestamp:
Oct 1, 2015 6:27:28 AM (4 years ago)
Author:
ming
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #1888 – Description

    v1 v2  
    2626 
    2727Alternatively, you can build the stripped down version of !WebRtc instead, which will only build the required AEC module and its required dependencies. These steps below are tested on a Mac machine: 
    28 1. Create a working directory, for example: {{{webrtc-android}}}, and create a {{{jni/}}} folder inside it. 
    29 2. Copy {{{Application.mk}}} and {{{Android.mk}}} (provided in the ticket attachment below) into the {{{jni}}} directory. 
    30 3. Create {{{src/}}} folder inside the {{{jni}}} directory. 
    31 4. Copy the entire {{{webrtc}}} folder from another platform's !WebRtc installation (such as from Mac or iOS), which should be located in {{{[webrtc_work_dir]/src}}}, into {{{webrtc-android/jni/src}}}. 
    32  In the end of this step, you should have both {{{.mk}}} files in {{{jni}}} folder and a full !WebRtc source inside {{{jni/src/webrtc}}}. 
    33 5. Go to {{{jni}}} folder and run {{{ndk-build}}}. 
    34 6. Copy the resulting .so files from {{{../libs/[target_architecture]}}} into your Android application project directory, for example: 
     281. Create a working directory, for example: {{{webrtc-android}}}. 
     291. Go to the work dir and unzip {{{webrtc-android-jni.zip}}} (provided in the ticket attachment below). 
     301. Go to {{{jni}}} folder and run {{{ndk-build}}}. 
     311. Copy the resulting .so files from {{{../libs/[target_architecture]}}} into your Android application project directory, for example: 
    3532 {{{ 
    3633cp ../libs/armeabi/*.so /Users/me/pjproject/pjsip-apps/src/swig/java/android/libs/armeabi 
    3734 }}} 
    38 7. Add this in PJSIP's user.mak, located inside PJSIP's work dir: 
     351. Add this in PJSIP's user.mak, located inside PJSIP's work dir: 
    3936 {{{ 
    4037export CFLAGS += -I"/Users/me/webrtc-android/src" -DPJMEDIA_HAS_WEBRTC_AEC=1 -DPJMEDIA_WEBRTC_AEC_USE_MOBILE=1 
     
    4946{{{ 
    5047export CFLAGS += -I"/Users/me/webrtc/src" -DPJMEDIA_HAS_WEBRTC_AEC=1 
    51 # Uncomment below if you are on mobile platform 
     48# Uncomment below if you want to use the lighter, mobile-optimized version 
    5249# export CFLAGS += -DPJMEDIA_WEBRTC_AEC_USE_MOBILE=1 
    5350export LDFLAGS += -L/Users/me/webrtc/[WebRTC_lib_path] -laudio_processing -lcommon_audio -lsystem_wrappers 
     
    7067 
    7168= Poor !WebRtc EC quality = 
    72 Change the definition of {{{SHOW_DELAY_METRICS}}} in {{{pjmedia/src/pjmedia/echo_webrtc.c}}} to a non-zero value. For example, if you set to 250, with ptime 20ms, it will print the delay metrics stats every 5 seconds or so. 
     69Disable {{{PJMEDIA_WEBRTC_AEC_USE_MOBILE}}} (set it to 0), then change the definition of {{{SHOW_DELAY_METRICS}}} in {{{pjmedia/src/pjmedia/echo_webrtc.c}}} to a non-zero value. For example, if you set to 250, with ptime 20ms, it will print the delay metrics stats every 5 seconds or so. 
    7370{{{ 
    7471#define SHOW_DELAY_METRICS      250 
     
    7673What you need to see in the log is the line: 
    7774{{{ 
    78 fraction of poor delays=%f 
     75median=%d, std=%d, fraction of poor delays=%f 
    7976}}} 
    80 Which is a value between 0 and 1. The closer the value to 1, the poorer the EC quality, try adjusting the EC tail value to the median value to achieve better quality. 
     77Fraction of poor delays is a value between 0 and 1. The closer the value to 1, the poorer the EC quality. 
     78 
     79To improve the EC quality, here are a few things you can try: 
     80- Adjust the EC tail value to the median value. 
     81- Activate noise suppression (pass the options when creating EC with flag {{{PJMEDIA_ECHO_USE_NOISE_SUPPRESSOR}}}). 
     82- Increase EC aggressiveness (pass the options when creating EC with flag {{{PJMEDIA_ECHO_AGGRESSIVENESS_AGGRESSIVE}}}). 
     83- Disable the mobile version by setting {{{PJMEDIA_WEBRTC_AEC_USE_MOBILE}}} to 0 (by doing this, AEC will operate in floating-point mode (instead of integer), which may decrease performance).