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

Commit fa5be521 authored by Ramu Gottipati's avatar Ramu Gottipati Committed by Gerrit - the friendly Code Review server
Browse files

hal: Add AEC and NS effects for VOICE_RECOGNITION device

- AEC or NS effect is not taking for voice_rec path due to
  missing entry in effect table.
- Add entry to apply the effect.

Change-Id: I6a6a0101bfeb90e9ae1d0ca0011e3408f44a305d
parent 0ec934a6
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -147,6 +147,7 @@
        <device name="SND_DEVICE_IN_UNPROCESSED_HEADSET_MIC" acdb_id="147"/>
        <device name="SND_DEVICE_IN_HANDSET_GENERIC_QMIC" acdb_id="191"/>
        <device name="SND_DEVICE_IN_VOICE_HEARING_AID" acdb_id="11"/>
        <device name="SND_DEVICE_IN_VOICE_REC_MIC" acdb_id="200"/>
        <device name="SND_DEVICE_OUT_VOICE_HANDSET_TMUS" acdb_id="7"/>
        <device name="SND_DEVICE_IN_BT_A2DP" acdb_id="201"/>
    </acdb_ids>
+2 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2013-2021, The Linux Foundation. All rights reserved.
 * Copyright (c) 2013-2022, The Linux Foundation. All rights reserved.
 * Not a Contribution.
 *
 * Copyright (C) 2013 The Android Open Source Project
@@ -7548,6 +7548,7 @@ static int add_remove_audio_effect(const struct audio_stream *stream,
        ALOGD("NS enable %d", enable);
        if (!in->standby) {
            if (in->source == AUDIO_SOURCE_VOICE_COMMUNICATION ||
                in->source == AUDIO_SOURCE_VOICE_RECOGNITION ||
                in->dev->mode == AUDIO_MODE_IN_COMMUNICATION) {
                if (enable_disable_effect(in->dev, EFFECT_NS, enable) == ENOSYS)
                    select_devices(in->dev, in->usecase);
+4 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2013-2021, The Linux Foundation. All rights reserved.
 * Copyright (c) 2013-2022, The Linux Foundation. All rights reserved.
 * Not a Contribution.
 *
 * Copyright (C) 2013 The Android Open Source Project
@@ -846,6 +846,9 @@ static struct audio_effect_config effect_config_table[GET_IN_DEVICE_INDEX(SND_DE
    [GET_IN_DEVICE_INDEX(SND_DEVICE_IN_SPEAKER_MIC_NN)][EFFECT_NS] = {TX_VOICE_FLUENCE_SM_NN, 0x8000, 0x10EAF, 0x02},
    [GET_IN_DEVICE_INDEX(SND_DEVICE_IN_HANDSET_MIC_NN)][EFFECT_AEC] = {TX_VOICE_FLUENCE_SM_NN, 0x8000, 0x10EAF, 0x01},
    [GET_IN_DEVICE_INDEX(SND_DEVICE_IN_HANDSET_MIC_NN)][EFFECT_NS] = {TX_VOICE_FLUENCE_SM_NN, 0x8000, 0x10EAF, 0x02},
    [GET_IN_DEVICE_INDEX(SND_DEVICE_IN_VOICE_REC_MIC)][EFFECT_AEC] = {TX_VOICE_FLUENCEV5_SM, 0x0, 0x10EAF, 0x01},
    [GET_IN_DEVICE_INDEX(SND_DEVICE_IN_VOICE_REC_MIC)][EFFECT_NS] = {TX_VOICE_FLUENCEV5_SM, 0x0, 0x10EAF, 0x02},
};
static struct audio_fluence_mmsecns_config fluence_mmsecns_table = {TOPOLOGY_ID_MM_HFP_ECNS, MODULE_ID_MM_HFP_ECNS,
+2 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2013-2020, The Linux Foundation. All rights reserved.
 * Copyright (c) 2013-2020, 2022, The Linux Foundation. All rights reserved.
 * Not a Contribution.
 *
 * Copyright (C) 2013 The Android Open Source Project
@@ -760,6 +760,7 @@ enum {
#define TX_VOICE_FLUENCE_SM_SB 0x10F38
#define TX_VOICE_FLUENCE_MM_SB 0x10F39
#define TX_VOICE_FLUENCE_SM_NN 0x10B0F
#define TX_VOICE_FLUENCEV5_SM 0x10F32

/* multi-mic surround ECNS zone control */
#define TOPOLOGY_ID_MM_HFP_ECNS 0x1FFF0002