Skip to content

Commit d7a724e

Browse files
author
Eric Laurent
committed
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
1 parent 87805ca commit d7a724e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

voip/jni/rtp/AudioGroup.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
#define LOG_TAG "AudioGroup"
3232
#include <cutils/atomic.h>
33+
#include <cutils/properties.h>
3334
#include <utils/Log.h>
3435
#include <utils/Errors.h>
3536
#include <utils/RefBase.h>
@@ -619,6 +620,14 @@ bool AudioGroup::setMode(int mode)
619620
if (mode < 0 || mode > LAST_MODE) {
620621
return false;
621622
}
623+
//FIXME: temporary code to overcome echo and mic gain issues on herring board.
624+
// Must be modified/removed when proper support for voice processing query and control
625+
// is included in audio framework
626+
char value[PROPERTY_VALUE_MAX];
627+
property_get("ro.product.board", value, "");
628+
if (mode == NORMAL && !strcmp(value, "herring")) {
629+
mode = ECHO_SUPPRESSION;
630+
}
622631
if (mode == ECHO_SUPPRESSION && AudioSystem::getParameters(
623632
0, String8("ec_supported")) == "ec_supported=yes") {
624633
mode = NORMAL;

0 commit comments

Comments
 (0)