From 850b646d59a836d7d8092793c27d9ab65bfd7fce Mon Sep 17 00:00:00 2001 From: Daniel Hillenbrand Date: Mon, 27 May 2013 13:54:26 +0200 Subject: i9300: audio: always request stereo input Change-Id: Id721c2727fb23340a0730746979843c6dfb41285 --- audio/audio_hw.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/audio/audio_hw.c b/audio/audio_hw.c index e2ff4eb..a322386 100755 --- a/audio/audio_hw.c +++ b/audio/audio_hw.c @@ -668,7 +668,7 @@ static void select_input_device(struct m0_audio_device *adev) ALOGD("%s: AUDIO_DEVICE_IN_BUILTIN_MIC", __func__); break; case AUDIO_DEVICE_IN_BACK_MIC: - ALOGD("%s: AUDIO_DEVICE_IN_BACK_MIC", __func__); + ALOGD("%s: AUDIO_DEVICE_IN_BACK_MIC | AUDIO_DEVICE_IN_BUILTIN_MIC", __func__); // Force use both mics for video recording adev->in_device = (AUDIO_DEVICE_IN_BACK_MIC | AUDIO_DEVICE_IN_BUILTIN_MIC) & ~AUDIO_DEVICE_BIT_IN; break; @@ -2356,7 +2356,6 @@ static int in_remove_audio_effect(const struct audio_stream *stream, in->preprocessors[in->num_preprocessors].effect_itfe = NULL; in->preprocessors[in->num_preprocessors].channel_configs = NULL; - /* check compatibility between main channel supported and possible auxiliary channels */ in_update_aux_channels(in, NULL); @@ -2626,6 +2625,13 @@ static int adev_open_input_stream(struct audio_hw_device *dev, struct m0_audio_device *ladev = (struct m0_audio_device *)dev; struct m0_stream_in *in; int ret; + + /* 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; + return -EINVAL; + } + int channel_count = popcount(config->channel_mask); *stream_in = NULL; -- cgit v1.1