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
diff --git a/configs/lahaina/audio_platform_info_yupikidp.xml b/configs/lahaina/audio_platform_info_yupikidp.xml
index 8cf7b2a..fa65dc8 100644
--- a/configs/lahaina/audio_platform_info_yupikidp.xml
+++ b/configs/lahaina/audio_platform_info_yupikidp.xml
@@ -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>
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index afa6dca..81f08fd 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -1,5 +1,5 @@
/*
- * 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 @@
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);
diff --git a/hal/msm8974/platform.c b/hal/msm8974/platform.c
index 48462c6..d259a70 100755
--- a/hal/msm8974/platform.c
+++ b/hal/msm8974/platform.c
@@ -1,5 +1,5 @@
/*
- * 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 @@
[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,
diff --git a/hal/msm8974/platform.h b/hal/msm8974/platform.h
index 07cf8be..4d09144 100755
--- a/hal/msm8974/platform.h
+++ b/hal/msm8974/platform.h
@@ -1,5 +1,5 @@
/*
- * 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 @@
#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