audio:hal: Fix to set ASRC mode for use case with combo device
-Asrc mode is not getting set on headphone device for ringtone
playback with concurrent native DSD or 44.1 Khz playback.
Check and set ASRC mode is done in select_devices function where
it has combo device for ringtone playback and hence it does not set
asrc mode.
-Invoke check_and_set_asrc_mode API from enable_snd_device where
combo device is split.
CRs-Fixed: 1106679
Change-Id: I2e79dcffa8022532801c0feb7d527de81a885001
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index e60ce6e..7d60af3 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -778,6 +778,9 @@
} else {
ALOGD("%s: snd_device(%d: %s)", __func__, snd_device, device_name);
+ if (platform_check_codec_asrc_support(adev->platform))
+ check_and_set_asrc_mode(adev, snd_device);
+
if ((SND_DEVICE_OUT_BT_A2DP == snd_device) &&
(audio_extn_a2dp_start_playback() < 0)) {
ALOGE(" fail to configure A2dp control path ");
@@ -1597,8 +1600,6 @@
/* Enable new sound devices */
if (out_snd_device != SND_DEVICE_NONE) {
check_usecases_codec_backend(adev, usecase, out_snd_device);
- if (platform_check_codec_asrc_support(adev->platform))
- check_and_set_asrc_mode(adev, out_snd_device);
enable_snd_device(adev, out_snd_device);
}