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

Skip to content
Commit f548cd3e authored by Mikhail Naganov's avatar Mikhail Naganov Committed by Android Build Cherrypicker Worker
Browse files

Add handling of "hard" I/O errors to AudioFlinger

"Hard" errors are unrecoverable errors reported by the HAL. In
AIDL HAL, "hard" errors are indicated by switching the stream
into the `ERROR` state, which only allows closing it.

The asynchronous error callback in the AIDL stream interface is
also used to indicate that an unrecoverable error has occured
(for example, it can be a DSP firmware crash). In this case the
I/O stream must be re-opened. So far, audioflinger did not have
support for this scenario. What was happening before is that the
offload track was invalidated, causing the output thread to be
closed. Then track recreation by the client caused the thread to
be created again. However, this sequence is a race between the
audioserver and the app, and thus it is possible that the track
gets recreated on still the same thread, which is unusable
because the HAL stream is in the `ERROR` state.

Bug: 339400414
Test: repro steps in the bug
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:bf203ce4210f480a6ddf158c6fb0b49b4f80f345)
Merged-In: I100d235506f5e3fdfb781a043bbf64746e918d84
Change-Id: I100d235506f5e3fdfb781a043bbf64746e918d84
parent ae029140
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment