hal: set default sample rate during voice/voip call
During voip call, backend sample rate is changed from
48Khz to 44.1Khz when starting 44.1Khz playback. This
is due to voip call using audio path is failed to check
to cause backend sample rate is changed.
Add voip call using audio path usecase condition check to
ensure default sample rate is set.
CRs-Fixed: 2405457
Change-Id: I9001abc059b554be6dda132a3a6b2c54227effd2
diff --git a/hal/msm8916/platform.c b/hal/msm8916/platform.c
index d8deae8..ca98ccc 100644
--- a/hal/msm8916/platform.c
+++ b/hal/msm8916/platform.c
@@ -5792,7 +5792,10 @@
if (voice_is_in_call(adev) || adev->mode == AUDIO_MODE_IN_COMMUNICATION) {
list_for_each(node, &adev->usecase_list) {
uc = node_to_item(node, struct audio_usecase, list);
- if (uc && (uc->type == VOICE_CALL || uc->type == VOIP_CALL) && uc->stream.out) {
+ if (uc && uc->stream.out &&
+ (uc->type == VOICE_CALL ||
+ uc->type == VOIP_CALL ||
+ uc->id == USECASE_AUDIO_PLAYBACK_VOIP)) {
out_snd_device = platform_get_output_snd_device(adev->platform, uc->stream.out);
backend_idx = platform_get_backend_index(out_snd_device);
break;
diff --git a/hal/msm8974/platform.c b/hal/msm8974/platform.c
index a31b048..d2af736 100644
--- a/hal/msm8974/platform.c
+++ b/hal/msm8974/platform.c
@@ -5971,7 +5971,10 @@
if (voice_is_in_call(adev) || adev->mode == AUDIO_MODE_IN_COMMUNICATION) {
list_for_each(node, &adev->usecase_list) {
uc = node_to_item(node, struct audio_usecase, list);
- if (uc && (uc->type == VOICE_CALL || uc->type == VOIP_CALL) && uc->stream.out) {
+ if (uc && uc->stream.out &&
+ (uc->type == VOICE_CALL ||
+ uc->type == VOIP_CALL ||
+ uc->id == USECASE_AUDIO_PLAYBACK_VOIP)) {
out_snd_device = platform_get_output_snd_device(adev->platform, uc->stream.out);
backend_idx = platform_get_backend_index(out_snd_device);
break;