hal: Send A2DP backend config for each routed stream
There exists a corner case where A2DP backend config is not
sent after BE is closed and reopened leading to slimbus
running at default rate. This happens because A2DP snd_device
is already active, hence backend config for A2DP is not sent.
However, audio route is disabled and enabled i.e. BE is closed
and reopened. Thus, slimbus is configured at 8 KHz which is a
problem for A2DP.
Fix this by sending backend config for each stream that gets
routed to A2DP and A2DP snd_device is enabled.
Change-Id: I3edfcaaac9d0bc81f7be4090f8057f3947b1e5d0
diff --git a/hal/audio_extn/a2dp.c b/hal/audio_extn/a2dp.c
index 4bd9125..105c88d 100644
--- a/hal/audio_extn/a2dp.c
+++ b/hal/audio_extn/a2dp.c
@@ -1303,6 +1303,14 @@
return is_configured;
}
+bool a2dp_set_source_backend_cfg()
+{
+ if (a2dp.a2dp_source_started && !a2dp.a2dp_source_suspended)
+ return a2dp_set_backend_cfg(SOURCE);
+
+ return false;
+}
+
bool configure_aac_dec_format(audio_aac_dec_config_t *aac_bt_cfg)
{
struct mixer_ctl *ctl_dec_data = NULL, *ctrl_bit_format = NULL;