audio: Remove timeout from waits on event flags in HAL driver threads
This fixes a power regression caused by periodic wakeups of
the driver threads even when the device is idle.
The timeout is really not needed, it used to be there to ensure that
the thread exits its loop, but then an explicit wake-up call before
closing the thread had been added for this purpose.
Bug: 34682579
Test: Follow repro steps from the bug, compare power consumption
to the legacy version of the audio HAL.
Change-Id: I0bfc2079a449894c5d0bd6ef19b53ca425795a9e
diff --git a/audio/effect/2.0/default/Effect.cpp b/audio/effect/2.0/default/Effect.cpp
index 0a4aeb7..83c8e09 100644
--- a/audio/effect/2.0/default/Effect.cpp
+++ b/audio/effect/2.0/default/Effect.cpp
@@ -77,10 +77,7 @@
// as the Thread uses mutexes, and this can lead to priority inversion.
while(!std::atomic_load_explicit(mStop, std::memory_order_acquire)) {
uint32_t efState = 0;
- mEfGroup->wait(
- static_cast<uint32_t>(MessageQueueFlagBits::REQUEST_PROCESS_ALL),
- &efState,
- NS_PER_SEC);
+ mEfGroup->wait(static_cast<uint32_t>(MessageQueueFlagBits::REQUEST_PROCESS_ALL), &efState);
if (!(efState & static_cast<uint32_t>(MessageQueueFlagBits::REQUEST_PROCESS_ALL))
|| (efState & static_cast<uint32_t>(MessageQueueFlagBits::REQUEST_QUIT))) {
continue; // Nothing to do or time to quit.