aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMemAllocator <omerkisoss@gmail.com>2015-01-30 17:38:01 +0200
committerSergiu Cozma <lssjbrolli@gmail.com>2015-03-28 11:45:46 +0200
commit36011f2b1d32df2a99d176c26653c19f0741152e (patch)
treeec4d4d8649aeb1f17cb6bb79608d721ca0a43a01
parent04a425269191da688cc68105ce268ea2a7bdf787 (diff)
Update audio_hw.c
trying to fix google voice recognition which causes instabilities with mic... took it from here: http://code.metager.de/source/xref/android/4.4/device/samsung/manta/audio/audio_hw.c
-rw-r--r--audio/audio_hw.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/audio/audio_hw.c b/audio/audio_hw.c
index 5d93bb6..95d5671 100644
--- a/audio/audio_hw.c
+++ b/audio/audio_hw.c
@@ -339,6 +339,10 @@ static void select_devices(struct audio_device *adev)
new_es325_preset =
route_configs[input_source_id][output_device_id]->es325_preset[adev->es325_mode];
}
+ // disable noise suppression when capturing front and back mic for voice recognition
+ if ((adev->input_source == AUDIO_SOURCE_VOICE_RECOGNITION) &&
+ (adev->in_channel_mask == AUDIO_CHANNEL_IN_FRONT_BACK))
+ new_es325_preset = -1;
} else {
if (output_device_id != OUT_DEVICE_NONE) {
output_route =
@@ -1592,9 +1596,10 @@ static int adev_open_input_stream(struct audio_hw_device *dev,
*stream_in = NULL;
- /* Respond with a request for stereo if a different format is given. */
- if (config->channel_mask != AUDIO_CHANNEL_IN_STEREO) {
- config->channel_mask = AUDIO_CHANNEL_IN_STEREO;
+ /* Respond with a request for mono if a different format is given. */
+ if (config->channel_mask != AUDIO_CHANNEL_IN_MONO &&
+ config->channel_mask != AUDIO_CHANNEL_IN_FRONT_BACK) {
+ config->channel_mask = AUDIO_CHANNEL_IN_MONO;
return -EINVAL;
}