audio: adev_close does not exit [1/1]
PD#OTT-70920
Problem:
The open function blocks the "audio_debug_thread";
Solution:
Change the open function to a non-blocking type;
Verify:
zapper
Change-Id: I7b08c016c4c6336ace63f0b51794861a2f9dc68c
Signed-off-by: haiyang.ren <haiyang.ren@amlogic.com>
(cherry picked from commit da715c7085167002fc0d0e3fa3cc3aacc25db09b)
diff --git a/audio_hal/audio_hw.c b/audio_hal/audio_hw.c
index f16bf87..c93b33a 100644
--- a/audio_hal/audio_hw.c
+++ b/audio_hal/audio_hw.c
@@ -8514,7 +8514,7 @@
goto Error;
}
- fd = open(AUDIO_DEBUG_FIFO_NAME, O_CREAT|O_RDONLY, 0666);
+ fd = open(AUDIO_DEBUG_FIFO_NAME, O_CREAT|O_RDONLY|O_NONBLOCK, 0666);
if (fd > 0) {
while (!adev->audio_debug_thread_exit) {
@@ -9038,6 +9038,7 @@
#ifdef NO_SERVER
+ adev->audio_debug_thread_exit = false;
if (pthread_create(&(adev->audio_debug_thread), NULL, &audio_debug_threadloop, (void *)adev)) {
AM_LOGE("create audio debug thread fail!!!");
} else {