audio: enable SoundMonitor to handle ADSP SSR events
Enable SoundMonitor in audio hal to handle ADSP SSR events,
do required cleanup and restore any active sessions gracefully.
Change-Id: I83270b7c12095e56a6677f41efe0f5618a27e0e5
diff --git a/hal/audio_extn/qaf.c b/hal/audio_extn/qaf.c
index bf731f6..8cb80e9 100644
--- a/hal/audio_extn/qaf.c
+++ b/hal/audio_extn/qaf.c
@@ -629,7 +629,6 @@
{
int ret = 0;
struct audio_device *adev = out->dev;
- int snd_card_status = get_snd_card_state(adev);
if ((out->usecase < 0) || (out->usecase >= AUDIO_USECASE_MAX)) {
ret = -EINVAL;
@@ -641,7 +640,8 @@
__func__, &out->stream, out->usecase, use_case_table[out->usecase],
out->devices);
- if (SND_CARD_STATE_OFFLINE == snd_card_status) {
+ if (CARD_STATUS_OFFLINE == out->card_status ||
+ CARD_STATUS_OFFLINE == adev->card_status) {
ALOGE("%s: sound card is not active/SSR returning error", __func__);
ret = -EIO;
usleep(50000);