hal: Set default backend sample rate for headset device
When music playback at 22.05Khz with headset, the afe
backend sample rate is set to 22.05khz as well. When
there is touch tone, it requires afe backend sample
rate to 48Khz. The rate change will cause music playback
disable and reroute to cause interruption during playback.
Fix it by setting backend sample rate to 48Khz if sample
rate less than 44.1Khz.
CRs-Fixed: 2258133
Change-Id: I711407537c0c41dbac99fea059710912ba6d1af3
diff --git a/hal/msm8916/platform.c b/hal/msm8916/platform.c
index d65c389..7c7b83d 100644
--- a/hal/msm8916/platform.c
+++ b/hal/msm8916/platform.c
@@ -6154,6 +6154,11 @@
ALOGD("%s:becf: afe: napb not active - set non fractional rate",
__func__);
}
+ /*ensure AFE set to 48khz when sample rate less than 44.1khz*/
+ if (sample_rate < OUTPUT_SAMPLING_RATE_44100) {
+ sample_rate = CODEC_BACKEND_DEFAULT_SAMPLE_RATE;
+ ALOGD("%s:becf: afe: napb set sample rate to default Sample Rate(48k)",__func__);
+ }
}
/*
diff --git a/hal/msm8974/platform.c b/hal/msm8974/platform.c
index a5f36ba..82586e3 100644
--- a/hal/msm8974/platform.c
+++ b/hal/msm8974/platform.c
@@ -6129,6 +6129,11 @@
ALOGD("%s:becf: afe: napb not active - set non fractional rate",
__func__);
}
+ /*ensure AFE set to 48khz when sample rate less than 44.1khz*/
+ if (sample_rate < OUTPUT_SAMPLING_RATE_44100) {
+ sample_rate = CODEC_BACKEND_DEFAULT_SAMPLE_RATE;
+ ALOGD("%s:becf: afe: napb set sample rate to default Sample Rate(48k)",__func__);
+ }
}
/*