summaryrefslogtreecommitdiffstats
path: root/hal
diff options
context:
space:
mode:
authorJean-Michel Trivi <jmtrivi@google.com>2015-09-25 15:06:53 -0700
committerJean-Michel Trivi <jmtrivi@google.com>2015-09-25 15:06:53 -0700
commit8c83fe85b6d1257298208de043acece927787c3f (patch)
treeb189958e91c49e932f81528b4e7b204a5da701ac /hal
parent04643599078ac0501b64493e791320277ac05a47 (diff)
downloadhardware_qcom_audio-8c83fe85b6d1257298208de043acece927787c3f.tar.gz
hardware_qcom_audio-8c83fe85b6d1257298208de043acece927787c3f.tar.bz2
hardware_qcom_audio-8c83fe85b6d1257298208de043acece927787c3f.zip
Add support for voice recognition on headset use case
Add sound device for voice recognition headset mic. Map it by default to same ACDB as headset mic. Use it when sound source is VOICE_RECOGNITION and the input audio device is AUDIO_DEVICE_IN_WIRED_HEADSET. Bug 22504877 Change-Id: I7ebd9ed0f805c6c6941ba9ddfa3aa7ad0587effb
Diffstat (limited to 'hal')
-rw-r--r--hal/msm8974/platform.c5
-rw-r--r--hal/msm8974/platform.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/hal/msm8974/platform.c b/hal/msm8974/platform.c
index a753c0f1..66da2498 100644
--- a/hal/msm8974/platform.c
+++ b/hal/msm8974/platform.c
@@ -246,6 +246,7 @@ static const char * const device_table[SND_DEVICE_MAX] = {
[SND_DEVICE_IN_VOICE_REC_MIC_NS] = "voice-rec-mic",
[SND_DEVICE_IN_VOICE_REC_DMIC_STEREO] = "voice-rec-dmic-ef",
[SND_DEVICE_IN_VOICE_REC_DMIC_FLUENCE] = "voice-rec-dmic-ef-fluence",
+ [SND_DEVICE_IN_VOICE_REC_HEADSET_MIC] = "headset-mic",
[SND_DEVICE_IN_VOICE_RX] = "voice-rx",
@@ -329,6 +330,7 @@ static int acdb_device_table[SND_DEVICE_MAX] = {
[SND_DEVICE_IN_VOICE_REC_MIC_NS] = 113,
[SND_DEVICE_IN_VOICE_REC_DMIC_STEREO] = 35,
[SND_DEVICE_IN_VOICE_REC_DMIC_FLUENCE] = 43,
+ [SND_DEVICE_IN_VOICE_REC_HEADSET_MIC] = 8,
[SND_DEVICE_IN_VOICE_RX] = 44,
@@ -419,6 +421,7 @@ static const struct name_to_index snd_device_name_index[SND_DEVICE_MAX] = {
{TO_NAME_INDEX(SND_DEVICE_IN_VOICE_REC_MIC_NS)},
{TO_NAME_INDEX(SND_DEVICE_IN_VOICE_REC_DMIC_STEREO)},
{TO_NAME_INDEX(SND_DEVICE_IN_VOICE_REC_DMIC_FLUENCE)},
+ {TO_NAME_INDEX(SND_DEVICE_IN_VOICE_REC_HEADSET_MIC)},
{TO_NAME_INDEX(SND_DEVICE_IN_THREE_MIC)},
{TO_NAME_INDEX(SND_DEVICE_IN_QUAD_MIC)},
@@ -1934,6 +1937,8 @@ snd_device_t platform_get_input_snd_device(void *platform, audio_devices_t out_d
else
snd_device = SND_DEVICE_IN_VOICE_REC_MIC;
}
+ } else if (in_device & AUDIO_DEVICE_IN_WIRED_HEADSET) {
+ snd_device = SND_DEVICE_IN_VOICE_REC_HEADSET_MIC;
}
} else if (source == AUDIO_SOURCE_VOICE_COMMUNICATION) {
if (out_device & (AUDIO_DEVICE_OUT_SPEAKER | AUDIO_DEVICE_OUT_SPEAKER_SAFE))
diff --git a/hal/msm8974/platform.h b/hal/msm8974/platform.h
index c1f901ca..4b4332e0 100644
--- a/hal/msm8974/platform.h
+++ b/hal/msm8974/platform.h
@@ -128,6 +128,7 @@ enum {
SND_DEVICE_IN_VOICE_REC_MIC_NS,
SND_DEVICE_IN_VOICE_REC_DMIC_STEREO,
SND_DEVICE_IN_VOICE_REC_DMIC_FLUENCE,
+ SND_DEVICE_IN_VOICE_REC_HEADSET_MIC,
SND_DEVICE_IN_VOICE_RX,