Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d7a724e6 authored by Eric Laurent's avatar Eric Laurent
Browse files

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
parent 87805ca3
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@

#define LOG_TAG "AudioGroup"
#include <cutils/atomic.h>
#include <cutils/properties.h>
#include <utils/Log.h>
#include <utils/Errors.h>
#include <utils/RefBase.h>
@@ -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;