hal: send calibration parameters in stream route
The stream's output rendering policy requires calibration to be
sent when stream routing configuration is set instead of the
device enable as each stream can have it's own routing with
different calibration needs.
Change-Id: If8bd365c4a6c616ed86b9383ba540ee8e28c4079
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index e93abdb..188223b 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -257,6 +257,7 @@
audio_extn_dolby_set_dmid(adev);
audio_extn_dolby_set_endpoint(adev);
#endif
+ audio_extn_utils_send_audio_calibration(adev, usecase);
audio_extn_utils_send_app_type_cfg(usecase);
strcpy(mixer_path, use_case_table[usecase->id]);
platform_add_backend_name(mixer_path, snd_device);
@@ -323,6 +324,10 @@
if ((snd_device == SND_DEVICE_OUT_SPEAKER ||
snd_device == SND_DEVICE_OUT_VOICE_SPEAKER) &&
audio_extn_spkr_prot_is_enabled()) {
+ if (audio_extn_spkr_prot_get_acdb_id(snd_device) < 0) {
+ adev->snd_dev_ref_cnt[snd_device]--;
+ return -EINVAL;
+ }
if (audio_extn_spkr_prot_start_processing(snd_device)) {
ALOGE("%s: spkr_start_processing failed", __func__);
return -EINVAL;
@@ -334,7 +339,7 @@
and audio, notify listen hal before audio calibration is sent */
audio_extn_listen_update_status(snd_device,
LISTEN_EVENT_SND_DEVICE_BUSY);
- if (platform_send_audio_calibration(adev->platform, snd_device) < 0) {
+ if (platform_get_snd_device_acdb_id(snd_device) < 0) {
adev->snd_dev_ref_cnt[snd_device]--;
audio_extn_listen_update_status(snd_device,
LISTEN_EVENT_SND_DEVICE_FREE);