audio: aptX: don't set bit-width explicitly
While finding the output profile for the aptX HD
A2DP the bit-width set to 24, but this leads to using
default app-type if there is no matching profile
for current audio format with 24 bit-width.
Don't set bit-width to 24 explicitly in case of
aptX HD.
CRs-Fixed: 2011277
Change-Id: If28ff26fb8e242d20ba0a98ff229fe278f1ec299
diff --git a/hal/audio_extn/utils.c b/hal/audio_extn/utils.c
index cac1369..3653444 100644
--- a/hal/audio_extn/utils.c
+++ b/hal/audio_extn/utils.c
@@ -736,12 +736,6 @@
sample_rate = OUTPUT_SAMPLING_RATE_DSD128;
}
- if(devices & AUDIO_DEVICE_OUT_ALL_A2DP) {
- //TODO: Handle fractional sampling rate configuration for LL
- audio_extn_a2dp_get_apptype_params(&sample_rate, &bit_width);
- ALOGI("%s using %d sampling rate %d bit width for A2DP CoPP",
- __func__, sample_rate, bit_width);
- }
ALOGV("%s: flags: %x, format: %x sample_rate %d, profile %s, app_type %d",
__func__, flags, format, sample_rate, profile, app_type_cfg->app_type);
@@ -988,6 +982,14 @@
(usecase->stream.out->sample_rate < OUTPUT_SAMPLING_RATE_44100)) {
/* Reset to default if no native stream is active*/
usecase->stream.out->app_type_cfg.sample_rate = DEFAULT_OUTPUT_SAMPLING_RATE;
+ } else if (usecase->stream.out->devices & AUDIO_DEVICE_OUT_ALL_A2DP) {
+ /*
+ * For a2dp playback get encoder sampling rate and set copp sampling rate,
+ * for bit width use the stream param only.
+ */
+ audio_extn_a2dp_get_sample_rate(&usecase->stream.out->app_type_cfg.sample_rate);
+ ALOGI("%s using %d sample rate rate for A2DP CoPP",
+ __func__, usecase->stream.out->app_type_cfg.sample_rate);
}
sample_rate = usecase->stream.out->app_type_cfg.sample_rate;