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

Commit 6f2d0e6c authored by Atneya Nair's avatar Atneya Nair
Browse files

[soundtrigger] Fix releaseAudioSession deadlock

Calling into releaseAudioSession holding the STM lock is dangerous, as
the STM lock is waited for by STHAL callbacks (including abort). This
callback fires from the HAL while servicing startRecord calls, which
holds APM/AF locks. releaseAudioSession waits for the APM lock,
causing a cross deadlock.

Although the STHAL callback model in general is prone to these deadlocks
due to upcalls, spot-fix this by pulling the releaseAudioSession call
outside of the ST locks. This is fine, since there are no
post-conditions on this call: it is essentially cleanup/gc (all the ids
involved are monotonically increasing).

Test: manual hotword
Test: manual now playing
Flag: EXEMPT bugfix
Bug: 391620601
Change-Id: I67b8b2ee484be7c7aefb26d9df64689e5e3f5d00
parent 5e659e32
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment