aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsjefdeklerk <sjefdeklerk@gmail.com>2014-11-18 20:58:11 -0400
committerSergiu Cozma <lssjbrolli@gmail.com>2015-03-28 11:42:40 +0200
commitc0e02de5321c3c8c80142daaf923d1ca821d41f8 (patch)
tree2c050036eac6498da42a8a7b19ebcfe2b086aa24
parent362ca9a8c174af36162de5a5cb3c59d4570ec33a (diff)
Currently bit rate switching is incorrect and this causes big problems: often times audio is muted in call. So this patch undoes the audio rate switching. Furthermore, this patch defaults in call audio to 16kb bitrate, this is the rate used by most modern modems (it's just the bitrate of audio between platform and modem). This causes better audio quality. Only problem is that since audio switching is now disabled, audio quality with old 8kb modems, like the '(in)famous' chinese modem will be bad. 'Solution' is to just use any modern modem and not the old Chinese 8kb modem.
Change-Id: I502cd3c3fa74da414fd5332e87482c94b511c43c
-rw-r--r--audio/audio_hw.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/audio/audio_hw.c b/audio/audio_hw.c
index c063c4e..1a3e487 100644
--- a/audio/audio_hw.c
+++ b/audio/audio_hw.c
@@ -386,6 +386,9 @@ static void start_bt_sco(struct audio_device *adev)
ALOGV("%s: Opening SCO PCMs", __func__);
+ //Remove this once WB_AMR audio rate switching works !
+ adev->wb_amr = 1;
+
if (adev->wb_amr)
sco_config = &pcm_config_sco_wide;
else
@@ -450,6 +453,9 @@ static int start_voice_call(struct audio_device *adev)
ALOGV("%s: Opening voice PCMs", __func__);
+ //Remove this once WB_AMR audio rate switching works !
+ adev->wb_amr = 1;
+
if (adev->wb_amr)
voice_config = &pcm_config_voice_wide;
else
@@ -515,12 +521,15 @@ static void adev_set_wb_amr_callback(void *data, int enable)
if (adev->wb_amr != enable) {
adev->wb_amr = enable;
+
/* reopen the modem PCMs at the new rate */
- if (adev->in_call) {
+ //FIX ME. THIS DOESN'T WORK CORRECTLY YET, AUDIO IS MUTED VERY OFTEN WHEN SWITCHING RATE
+ /* if (adev->in_call) {
end_voice_call(adev);
select_devices(adev);
start_voice_call(adev);
}
+ */
}
pthread_mutex_unlock(&adev->lock);
}