Merge "st-hal: Check active tx concurrency before disable stale device"
diff --git a/sound_trigger_hw.c b/sound_trigger_hw.c
index 4891b50..1d3b001 100644
--- a/sound_trigger_hw.c
+++ b/sound_trigger_hw.c
@@ -45,6 +45,8 @@
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
+ *
+ *Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
  */
 #define LOG_TAG "sound_trigger_hw"
 #define ATRACE_TAG (ATRACE_TAG_HAL)
@@ -808,7 +810,8 @@
         if (event_type == AUDIO_EVENT_CAPTURE_DEVICE_INACTIVE &&
             !platform_stdev_is_dedicated_sva_path(stdev->platform) &&
             platform_stdev_backend_reset_allowed(stdev->platform))
-            platform_stdev_disable_stale_devices(stdev->platform);
+            if (stdev->tx_concurrency_active == 0)
+                platform_stdev_disable_stale_devices(stdev->platform);
         pthread_mutex_unlock(&stdev->lock);
         return;
     }