summaryrefslogtreecommitdiffstats
path: root/hal
diff options
context:
space:
mode:
authorZhou Song <zhous@codeaurora.org>2019-12-30 17:52:10 +0800
committerGerrit - the friendly Code Review server <code-review@localhost>2020-01-09 00:36:53 -0800
commit82ec30df57f544e0ce1f306a9f95741474d2e0b3 (patch)
tree1be7fc67a8a57b02b8376c53368bd38c2f452ffb /hal
parente3d362ff6e0c6f298ae3d7ac01f5a690a407e09f (diff)
downloadandroid_hardware_qcom_audio-82ec30df57f544e0ce1f306a9f95741474d2e0b3.tar.gz
android_hardware_qcom_audio-82ec30df57f544e0ce1f306a9f95741474d2e0b3.tar.bz2
android_hardware_qcom_audio-82ec30df57f544e0ce1f306a9f95741474d2e0b3.zip
hal: check out_snd_device to get a2dp sample rate
There could be one usecase which: - there're two active streams in AHAL playing on BT_SCO device; - then if one of the active stream receives param "routing=a2dp" and switch path to a2dp, the other one will also be switched to a2dp as part of check_usecases_codec_backend, but the out device is still BT_SCO; - so the app sample rate get for this output is wrong. Instead of checking out device, check snd_device for querying app sample rate. Change-Id: Icb7dbba8dc24ee8e5611b1e813e0e4aa2aa3f990
Diffstat (limited to 'hal')
-rw-r--r--hal/audio_extn/utils.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/hal/audio_extn/utils.c b/hal/audio_extn/utils.c
index d3335a73..4675fc39 100644
--- a/hal/audio_extn/utils.c
+++ b/hal/audio_extn/utils.c
@@ -1077,7 +1077,9 @@ int audio_extn_utils_get_app_sample_rate_for_device(
(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) {
+ } else if (usecase->out_snd_device == SND_DEVICE_OUT_BT_A2DP ||
+ usecase->out_snd_device == SND_DEVICE_OUT_SPEAKER_AND_BT_A2DP ||
+ usecase->out_snd_device == SND_DEVICE_OUT_SPEAKER_SAFE_AND_BT_A2DP) {
/*
* For a2dp playback get encoder sampling rate and set copp sampling rate,
* for bit width use the stream param only.