From 632b1cd048ad9e0d0ea02bc220841251bafe0946 Mon Sep 17 00:00:00 2001 From: Jaideep Sharma Date: Wed, 20 Sep 2023 11:43:17 +0530 Subject: [PATCH] audio: Fix Effect worker thread When a effect is closed and reopened from framework, mExit and mStop states are not reset,that causes threadloop to exit and eventually blocks framework as FMQs are never filled from effects HAL. Reset the state of mExit and mStop on every time when thread is created, so open->close->open kind of scenarios can be handled. Bug: 301214647 Test: run vts-hal-audio Change-Id: If54c8fa62827e5f28e620dd841d638028149b1b8 --- audio/aidl/default/EffectThread.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/audio/aidl/default/EffectThread.cpp b/audio/aidl/default/EffectThread.cpp index cd2ba5375b..47ba9f44cb 100644 --- a/audio/aidl/default/EffectThread.cpp +++ b/audio/aidl/default/EffectThread.cpp @@ -48,6 +48,8 @@ RetCode EffectThread::createThread(std::shared_ptr context, const mPriority = priority; { std::lock_guard lg(mThreadMutex); + mStop = true; + mExit = false; mThreadContext = std::move(context); auto statusMQ = mThreadContext->getStatusFmq(); EventFlag* efGroup = nullptr;