summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRavi Kumar Alamanda <ralama@codeaurora.org>2015-08-31 17:42:44 -0700
committerEric Laurent <elaurent@google.com>2015-09-02 18:47:47 -0700
commit5a95ff689b4a1827488d576f02b6292e4318abb2 (patch)
tree8a6778426dcf5b11dcc1fa8d134994c12a209e4f
parent88e6fb26adb91de5c914713a820a2fe21048d1b5 (diff)
downloadandroid_hardware_qcom_audio-5a95ff689b4a1827488d576f02b6292e4318abb2.tar.gz
android_hardware_qcom_audio-5a95ff689b4a1827488d576f02b6292e4318abb2.tar.bz2
android_hardware_qcom_audio-5a95ff689b4a1827488d576f02b6292e4318abb2.zip
hal: Fix incorrect audio calibration after device switch
Start mp3 offload playback on headset, plug-out headset and resume playback on speaker very quickly (within 500ms) and plug-in the headset back within next 2s. Observe that music sound louder because the playback continues with previous speaker calibration as headset calibration is not pushed. Push the calibration data before enabling every use case instead of pushing only once while enabling the sound device to fix the issue. Bug: 23568067 Change-Id: Iade2e42183009b460991bb6ee48b09cff0bcfa8b
-rw-r--r--hal/audio_hw.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 70ce0dc3..86072c0c 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -308,6 +308,8 @@ int enable_snd_device(struct audio_device *adev,
return -EINVAL;
}
+ platform_send_audio_calibration(adev->platform, snd_device);
+
adev->snd_dev_ref_cnt[snd_device]++;
if (adev->snd_dev_ref_cnt[snd_device] > 1) {
ALOGV("%s: snd_device(%d: %s) is already active",
@@ -323,13 +325,6 @@ int enable_snd_device(struct audio_device *adev,
if (audio_extn_spkr_prot_is_enabled())
audio_extn_spkr_prot_calib_cancel(adev);
- if (platform_send_audio_calibration(adev->platform, snd_device) < 0) {
- adev->snd_dev_ref_cnt[snd_device]--;
- audio_extn_sound_trigger_update_device_status(snd_device,
- ST_EVENT_SND_DEVICE_FREE);
- return -EINVAL;
- }
-
audio_extn_dsm_feedback_enable(adev, snd_device, true);
if ((snd_device == SND_DEVICE_OUT_SPEAKER ||