hal: Set device sample rate for A2DP CoPP
Device sample rates can vary for BT A2DP. Fetch the current
sample rate for A2DP encoder and set app type config with
the A2DP sample rate.
Bug: 111085074
Test: Manual testing with SBC/AAC/AptX/LDAC headsets
Change-Id: If5a6019dd86eee3c653ab139714811d979e337a1
diff --git a/hal/audio_extn/utils.c b/hal/audio_extn/utils.c
index 73de0ab..79dd9e5 100644
--- a/hal/audio_extn/utils.c
+++ b/hal/audio_extn/utils.c
@@ -281,6 +281,10 @@
usecase->out_snd_device,
out->sample_rate,
sample_rate);
+ } else if (out->devices & AUDIO_DEVICE_OUT_ALL_A2DP) {
+ audio_extn_a2dp_get_sample_rate(sample_rate);
+ ALOGI("%s: Using sample rate %d for A2DP CoPP", __func__,
+ *sample_rate);
}
app_type_cfg->mode = flags_to_mode(0 /*playback*/, out->flags);