hal: audio_hw: Allow 50ms sleep if audio start fails before exit

If audio start for output/input fails for some reason, allow 50ms sleep
before exit, so next attempt to start output/input happens after 50ms.
This will facililate kernel drivers not to be flooded with
failure logs and helps in cases like SSR recovery.

Change-Id: I9e214f1d01dc8537c8a7800fb174676d9a6ee5c8
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 3f3f967..7d9836f 100755
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -1152,6 +1152,11 @@
 
 error_config:
     adev->active_input = NULL;
+    /*
+     * sleep 50ms to allow sufficient time for kernel
+     * drivers to recover incases like SSR.
+     */
+    usleep(50000);
     ALOGD("%s: exit: status(%d)", __func__, ret);
 
     return ret;
@@ -1675,6 +1680,11 @@
 error_open:
     stop_output_stream(out);
 error_config:
+    /*
+     * sleep 50ms to allow sufficient time for kernel
+     * drivers to recover incases like SSR.
+     */
+    usleep(50000);
     return ret;
 }