Merge "hal: Start A2DP playback after fetching parameters for audio route" into pi-dev
am: 05a9b1f252
Change-Id: Ic807eb66bf0d75d73090d5bc8132abaee705bdfd
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index bf25400..7bbdb66 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -678,12 +678,6 @@
audio_extn_dsm_feedback_enable(adev, snd_device, true);
- if (is_a2dp_device(snd_device) &&
- (audio_extn_a2dp_start_playback() < 0)) {
- ALOGE("%s: failed to configure A2DP control path", __func__);
- goto on_error;
- }
-
if ((snd_device == SND_DEVICE_OUT_SPEAKER ||
snd_device == SND_DEVICE_OUT_SPEAKER_SAFE ||
snd_device == SND_DEVICE_OUT_SPEAKER_REVERSE ||
@@ -711,6 +705,13 @@
}
ALOGD("%s: snd_device(%d: %s)", __func__, snd_device, device_name);
+
+ if (is_a2dp_device(snd_device) &&
+ (audio_extn_a2dp_start_playback() < 0)) {
+ ALOGE("%s: failed to configure A2DP control path", __func__);
+ goto on_error;
+ }
+
audio_route_apply_and_update_path(adev->audio_route, device_name);
}
on_success:
diff --git a/hal/msm8974/platform.c b/hal/msm8974/platform.c
index 2d87ae5..5f52c1c 100644
--- a/hal/msm8974/platform.c
+++ b/hal/msm8974/platform.c
@@ -1899,6 +1899,7 @@
hw_info_append_hw_type(my_data->hw_info, snd_device, device_name);
} else {
strlcpy(device_name, "none", DEVICE_NAME_MAX_SIZE);
+ return -EINVAL;
}
return 0;