hal: Avoid resampling when hifi audio is enabled
On internal codec, headset and speaker are on the same
backend. platform_check_codec_backend_cfg is wrongly
setting backend sample rate to 48 KHz when hifi audio
is enabled on headset.
Avoid resampling to default sample rate for headset
when hifi audio is enabled.
CRs-Fixed: 2210964
Change-Id: I170729fa286461f8de161fd4485a588a0303dac4
diff --git a/hal/msm8916/platform.c b/hal/msm8916/platform.c
index 50a094d..e5e8c19 100644
--- a/hal/msm8916/platform.c
+++ b/hal/msm8916/platform.c
@@ -6081,7 +6081,9 @@
* Check if the device is speaker or handset,assumption handset shares
* backend with speaker, and these devices are restricited to 48kHz.
*/
- if (platform_check_backends_match(SND_DEVICE_OUT_SPEAKER, snd_device)) {
+ if (platform_check_backends_match(SND_DEVICE_OUT_SPEAKER, snd_device) &&
+ !(codec_device_supports_native_playback(usecase->devices) &&
+ my_data->hifi_audio && !check_hdset_combo_device(snd_device))) {
sample_rate = CODEC_BACKEND_DEFAULT_SAMPLE_RATE;
if (bit_width >= 24) {