hal: configure slimbus Rx channel for APTX AD at 96KHz
Configure slimbus Rx for aptX Adaptive at 96KHz to reduce
the time to transfer the packets across the slimbus.
CRs-Fixed: 2324088
Change-Id: I77ef702702414126a95aaa2db1d386bda483444e
diff --git a/hal/audio_extn/a2dp.c b/hal/audio_extn/a2dp.c
index 41ea408..17ba960 100644
--- a/hal/audio_extn/a2dp.c
+++ b/hal/audio_extn/a2dp.c
@@ -844,10 +844,16 @@
uint32_t sampling_rate_rx = a2dp.enc_sampling_rate;
struct mixer_ctl *ctl_sample_rate = NULL, *ctrl_in_channels = NULL;
- //For LDAC encoder open slimbus port at 96Khz for 48Khz input
- //and 88.2Khz for 44.1Khz input.
+ /* For LDAC encoder open slimbus port at 96Khz for 48Khz input
+ * and 88.2Khz for 44.1Khz input.
+ * For APTX AD encoder, open slimbus port at 96Khz for 48Khz input.
+ */
if ((a2dp.bt_encoder_format == ENC_CODEC_TYPE_LDAC) &&
- (sampling_rate_rx == 48000 || sampling_rate_rx == 44100 )) {
+ (sampling_rate_rx == SAMPLING_RATE_48K ||
+ sampling_rate_rx == SAMPLING_RATE_441K)) {
+ sampling_rate_rx *= 2;
+ } else if (a2dp.bt_encoder_format == ENC_CODEC_TYPE_APTX_AD &&
+ sampling_rate_rx == SAMPLING_RATE_48K) {
sampling_rate_rx *= 2;
}