From d7a724e6d89420408200c20937baa3b2bd902742 Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Tue, 29 Mar 2011 18:22:57 -0700 Subject: [PATCH] Issue 4157048: mic gain for VoIP/SIP calls. Herring board exhibits a strong echo even in non speakerphone modes. To compensate the lack of AEC or AES when not in speakerphone, the mic gain had been reduced in the ADC. But this has an adverse effect on other VoIP applications that have their own AEC and are penalized by the weak mic gain. This workaround enables an acceptable mic gain for other VoIP apps while offering a SIP call experience which is not worse than it was with the residual echo that was present even with mic gain reduction. Change-Id: I33fd37858758e94e42ef5b545d3f0dc233220bf1 --- voip/jni/rtp/AudioGroup.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/voip/jni/rtp/AudioGroup.cpp b/voip/jni/rtp/AudioGroup.cpp index 2cbd023de9d84..ae071ce05789b 100644 --- a/voip/jni/rtp/AudioGroup.cpp +++ b/voip/jni/rtp/AudioGroup.cpp @@ -30,6 +30,7 @@ #define LOG_TAG "AudioGroup" #include +#include #include #include #include @@ -619,6 +620,14 @@ bool AudioGroup::setMode(int mode) if (mode < 0 || mode > LAST_MODE) { return false; } + //FIXME: temporary code to overcome echo and mic gain issues on herring board. + // Must be modified/removed when proper support for voice processing query and control + // is included in audio framework + char value[PROPERTY_VALUE_MAX]; + property_get("ro.product.board", value, ""); + if (mode == NORMAL && !strcmp(value, "herring")) { + mode = ECHO_SUPPRESSION; + } if (mode == ECHO_SUPPRESSION && AudioSystem::getParameters( 0, String8("ec_supported")) == "ec_supported=yes") { mode = NORMAL;