hal: set backend sample rate with default rate
During device switch from headphone-44.1 to headphone, afe
output sample rate for headphone still is set to 44.1Khz
due to stream output sample rate is 44.1Khz. This causes
afe sample rate mismatch with configured device.
Fix it by setting AFE at default sample rate when stream
rate mismatch with configured device, and resetting codec
config when device backend is different.
CRs-Fixed: 2206207
Change-Id: I3af8051595e721604bd7086632b6c34997c8ea65
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 9ebe142..e186199 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -1361,7 +1361,9 @@
platform_get_snd_device_name(snd_device),
platform_get_snd_device_name(usecase->out_snd_device),
platform_check_backends_match(snd_device, usecase->out_snd_device));
- if ((usecase->type != PCM_CAPTURE) && (usecase != uc_info)) {
+ if ((usecase->type != PCM_CAPTURE) &&
+ (usecase->type != VOICE_CALL) &&
+ (usecase != uc_info)) {
uc_derive_snd_device = derive_playback_snd_device(adev->platform,
usecase, uc_info, snd_device);
if (((uc_derive_snd_device != usecase->out_snd_device) || force_routing) &&