From a5f9f3650d8156d3e96a88a280d07b266a04384d Mon Sep 17 00:00:00 2001 From: Daniel Hillenbrand Date: Mon, 15 Apr 2013 17:08:25 +0200 Subject: p3100: add incall noise suppression support Change-Id: I8cba9a1b5b98d2bb3accbd8f32ff5cdc4b5e568d --- audio/audio_hw.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'audio/audio_hw.c') diff --git a/audio/audio_hw.c b/audio/audio_hw.c index 2dde2eb..2fcd739 100755 --- a/audio/audio_hw.c +++ b/audio/audio_hw.c @@ -476,7 +476,7 @@ void audio_set_wb_amr_callback(void *data, int enable) /* reopen the modem PCMs at the new rate */ if (adev->in_call) { end_call(adev); - set_eq_filter(adev); + select_output_device(adev); start_call(adev); } } @@ -2584,6 +2584,21 @@ static int adev_set_parameters(struct audio_hw_device *dev, const char *kvpairs) adev->screen_off = true; } + ret = str_parms_get_str(parms, "noise_suppression", value, sizeof(value)); + if (ret >= 0) { + if (strcmp(value, "true") == 0) { + ALOGE("%s: enabling two mic control", __func__); + ril_set_two_mic_control(&adev->ril, AUDIENCE, TWO_MIC_SOLUTION_ON); + /* sub mic */ + set_bigroute_by_array(adev->mixer, noise_suppression, 1); + } else { + ALOGE("%s: disabling two mic control", __func__); + ril_set_two_mic_control(&adev->ril, AUDIENCE, TWO_MIC_SOLUTION_OFF); + /* sub mic */ + set_bigroute_by_array(adev->mixer, noise_suppression_disable, 1); + } + } + str_parms_destroy(parms); return ret; } @@ -2808,6 +2823,7 @@ static const struct { { AUDIO_DEVICE_OUT_ALL_SCO, "sco-out" }, { AUDIO_DEVICE_IN_BUILTIN_MIC, "builtin-mic" }, + { AUDIO_DEVICE_IN_BACK_MIC, "back-mic" }, { AUDIO_DEVICE_IN_WIRED_HEADSET, "headset-in" }, { AUDIO_DEVICE_IN_ALL_SCO, "sco-in" }, }; -- cgit v1.1