Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 515f5d48 authored by Laxminath Kasam's avatar Laxminath Kasam Committed by Gerrit - the friendly Code Review server
Browse files

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
parent cc70d4bd
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -1152,6 +1152,11 @@ error_open:

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 @@ int start_output_stream(struct stream_out *out)
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;
}