From 4ba88df00b5aff85fcac4e0d03bc0c99f37b4de0 Mon Sep 17 00:00:00 2001 From: Daniel Hillenbrand Date: Thu, 26 Jul 2012 02:33:17 +0200 Subject: audio: request 2 input channels by default --- audio/audio_hw.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'audio') diff --git a/audio/audio_hw.c b/audio/audio_hw.c index 8e26217..e861fc6 100755 --- a/audio/audio_hw.c +++ b/audio/audio_hw.c @@ -1407,7 +1407,7 @@ static uint32_t in_get_channels(const struct audio_stream *stream) { struct espresso_stream_in *in = (struct espresso_stream_in *)stream; - return in->main_channels; + return AUDIO_CHANNEL_IN_STEREO; } static audio_format_t in_get_format(const struct audio_stream *stream) @@ -2569,6 +2569,13 @@ static int adev_open_input_stream(struct audio_hw_device *dev, struct espresso_audio_device *ladev = (struct espresso_audio_device *)dev; struct espresso_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