summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavan Chikkala <pavanc@codeaurora.org>2016-06-30 16:28:37 +0530
committerArne Coucheron <arco68@gmail.com>2019-12-01 04:38:57 +0100
commitdbcfaf3d2b18581024787f7ffb597ee4e1e38e18 (patch)
treeda8cea78c3e7f5b360d06c7cf19a5f7b7de41138
parent6d7bef0fa3885f4268ac9a890076cc12e2f0c2b7 (diff)
downloadhardware_qcom_audio-dbcfaf3d2b18581024787f7ffb597ee4e1e38e18.tar.gz
hardware_qcom_audio-dbcfaf3d2b18581024787f7ffb597ee4e1e38e18.tar.bz2
hardware_qcom_audio-dbcfaf3d2b18581024787f7ffb597ee4e1e38e18.zip
mm-audio: Avoid command thread loop if omx component is stopped
When omx init and deinit are called in short duration,there is a possibility that deinit is called before command thread is started. omx_thread_stop closes respective pipe and waits for the command thread to exit. In a specific scenario, same pipe fd is allocated in another module and command thread in omx continues to read from the same pipe although it is closed by the main omx thread. omx_thread_stop is blocked infinitely due to this reason Fix is to set a flag in omx_thread_stop to avoid command thread to go into the read loop if it is started after omx_thread_stop is called Change-Id: I4b9c4909c7178010568219fddcd05eaafdddc769
-rw-r--r--mm-audio/aenc-aac/qdsp6/src/aenc_svr.c3
-rw-r--r--mm-audio/aenc-amrnb/qdsp6/src/aenc_svr.c3
-rw-r--r--mm-audio/aenc-evrc/qdsp6/src/aenc_svr.c3
-rw-r--r--mm-audio/aenc-qcelp13/qdsp6/src/aenc_svr.c3
4 files changed, 8 insertions, 4 deletions
diff --git a/mm-audio/aenc-aac/qdsp6/src/aenc_svr.c b/mm-audio/aenc-aac/qdsp6/src/aenc_svr.c
index 9a8448a9..53e371ed 100644
--- a/mm-audio/aenc-aac/qdsp6/src/aenc_svr.c
+++ b/mm-audio/aenc-aac/qdsp6/src/aenc_svr.c
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2010, The Linux Foundation. All rights reserved.
+Copyright (c) 2010, 2016, The Linux Foundation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -189,6 +189,7 @@ fail_pipe:
void omx_aac_thread_stop(struct aac_ipc_info *aac_info) {
DEBUG_DETAIL("%s stop server\n", __FUNCTION__);
+ aac_info->dead = 1;
close(aac_info->pipe_in);
close(aac_info->pipe_out);
pthread_join(aac_info->thr,NULL);
diff --git a/mm-audio/aenc-amrnb/qdsp6/src/aenc_svr.c b/mm-audio/aenc-amrnb/qdsp6/src/aenc_svr.c
index dea7c7f2..f283c327 100644
--- a/mm-audio/aenc-amrnb/qdsp6/src/aenc_svr.c
+++ b/mm-audio/aenc-amrnb/qdsp6/src/aenc_svr.c
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2010, The Linux Foundation. All rights reserved.
+Copyright (c) 2010, 2016, The Linux Foundation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -189,6 +189,7 @@ fail_pipe:
void omx_amr_thread_stop(struct amr_ipc_info *amr_info) {
DEBUG_DETAIL("%s stop server\n", __FUNCTION__);
+ amr_info->dead = 1;
close(amr_info->pipe_in);
close(amr_info->pipe_out);
pthread_join(amr_info->thr,NULL);
diff --git a/mm-audio/aenc-evrc/qdsp6/src/aenc_svr.c b/mm-audio/aenc-evrc/qdsp6/src/aenc_svr.c
index 4f828fcf..feda0a5c 100644
--- a/mm-audio/aenc-evrc/qdsp6/src/aenc_svr.c
+++ b/mm-audio/aenc-evrc/qdsp6/src/aenc_svr.c
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2010, The Linux Foundation. All rights reserved.
+Copyright (c) 2010, 2016, The Linux Foundation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -189,6 +189,7 @@ fail_pipe:
void omx_evrc_thread_stop(struct evrc_ipc_info *evrc_info) {
DEBUG_DETAIL("%s stop server\n", __FUNCTION__);
+ evrc_info->dead = 1;
close(evrc_info->pipe_in);
close(evrc_info->pipe_out);
pthread_join(evrc_info->thr,NULL);
diff --git a/mm-audio/aenc-qcelp13/qdsp6/src/aenc_svr.c b/mm-audio/aenc-qcelp13/qdsp6/src/aenc_svr.c
index bdc96acf..6304918e 100644
--- a/mm-audio/aenc-qcelp13/qdsp6/src/aenc_svr.c
+++ b/mm-audio/aenc-qcelp13/qdsp6/src/aenc_svr.c
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2010, The Linux Foundation. All rights reserved.
+Copyright (c) 2010, 2016, The Linux Foundation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -191,6 +191,7 @@ fail_pipe:
void omx_qcelp13_thread_stop(struct qcelp13_ipc_info *qcelp13_info) {
DEBUG_DETAIL("%s stop server\n", __FUNCTION__);
+ qcelp13_info->dead = 1;
close(qcelp13_info->pipe_in);
close(qcelp13_info->pipe_out);
pthread_join(qcelp13_info->thr,NULL);