hal: avoid sending audio calibration during voice call
Pilot tone is audible during voice call over headset because of sending
wrong device calibration. Audio calibration is not required to send
during voice call. Fix this issue by not sending audio calibration
during voice call.
Change-Id: I923d1e39af805c9fccf386fb2930c2819ddf6363
diff --git a/hal/audio_extn/utils.c b/hal/audio_extn/utils.c
index fd35e28..e9c8ac0 100644
--- a/hal/audio_extn/utils.c
+++ b/hal/audio_extn/utils.c
@@ -1269,11 +1269,15 @@
platform_send_audio_calibration(adev->platform, usecase,
usecase->stream.in->app_type_cfg.app_type,
usecase->stream.in->app_type_cfg.sample_rate);
- } else {
+ } else if (type == PCM_HFP_CALL) {
/* when app type is default. the sample rate is not used to send cal */
platform_send_audio_calibration(adev->platform, usecase,
platform_get_default_app_type_v2(adev->platform, usecase->type),
48000);
+ } else {
+ /* No need to send audio calibration for voice and voip call usecases */
+ if ((type != VOICE_CALL) && (type != VOIP_CALL))
+ ALOGW("%s: No audio calibration for usecase type = %d", __func__, type);
}
}