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
Loading
Please register or sign in to comment