summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xaudio/audio_hw.c16
-rw-r--r--audio/audio_hw.h4
-rw-r--r--configs/tiny_hw.xml4
3 files changed, 17 insertions, 7 deletions
diff --git a/audio/audio_hw.c b/audio/audio_hw.c
index e6dd08e..a322386 100755
--- a/audio/audio_hw.c
+++ b/audio/audio_hw.c
@@ -661,12 +661,16 @@ static void select_output_device(struct m0_audio_device *adev)
static void select_input_device(struct m0_audio_device *adev)
{
- switch(adev->in_device) {
+ int input_device = AUDIO_DEVICE_BIT_IN | adev->in_device;
+
+ switch(input_device) {
case AUDIO_DEVICE_IN_BUILTIN_MIC:
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;
case AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET:
ALOGD("%s: AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET", __func__);
@@ -2352,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);
@@ -2622,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;
diff --git a/audio/audio_hw.h b/audio/audio_hw.h
index 4f0919a..7eabda0 100644
--- a/audio/audio_hw.h
+++ b/audio/audio_hw.h
@@ -32,8 +32,8 @@
#define PLAYBACK_PERIOD_COUNT 8
#define PLAYBACK_SHORT_PERIOD_COUNT 2
-#define CAPTURE_PERIOD_SIZE 1056
-#define CAPTURE_PERIOD_COUNT 2
+#define CAPTURE_PERIOD_SIZE 1024
+#define CAPTURE_PERIOD_COUNT 4
#define SHORT_PERIOD_SIZE 192
diff --git a/configs/tiny_hw.xml b/configs/tiny_hw.xml
index c9fba6b..e8b071d 100644
--- a/configs/tiny_hw.xml
+++ b/configs/tiny_hw.xml
@@ -252,7 +252,7 @@ We are able to have most of our routing static so do that
<device name="builtin-mic">
<path name="on">
<ctl name="Main Mic Switch" val="1"/>
- <ctl name="IN1L Volume" val="22"/>
+ <ctl name="IN1L Volume" val="28"/>
<ctl name="MIXINL IN1L Switch" val="1"/>
<ctl name="MIXINL IN1L Volume" val="1"/>
<ctl name="AIF1ADCL Source" val="0"/>
@@ -271,7 +271,7 @@ We are able to have most of our routing static so do that
<device name="back-mic">
<path name="on">
<ctl name="Sub Mic Switch" val="1"/>
- <ctl name="IN1R Volume" val="22"/>
+ <ctl name="IN1R Volume" val="28"/>
<ctl name="MIXINR IN1R Switch" val="1"/>
<ctl name="MIXINR IN1R Volume" val="1"/>
<ctl name="AIF1ADCR Source" val="1"/>