From 19a03502b08922bf6b338803988c395c41cd40ff Mon Sep 17 00:00:00 2001 From: rioskao Date: Mon, 17 Jun 2019 23:20:50 -0700 Subject: sthal: close active tunneling during stop recognition note: The application layer abnormal behavior will stop active tunneling streaming. That will cause codec problem. So we close active tunneling when the application try to stop the recognition. Test: verify the ambient fetching data and on/off stress. Bug: 135360204 Change-Id: Iec990897ad023ce3c336cebe3672b74bac0dee95 --- sound_trigger_hw_iaxxx.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sound_trigger_hw_iaxxx.c b/sound_trigger_hw_iaxxx.c index e8ad4c0..b6ec400 100644 --- a/sound_trigger_hw_iaxxx.c +++ b/sound_trigger_hw_iaxxx.c @@ -2002,6 +2002,13 @@ static int stop_recognition(struct knowles_sound_trigger_device *stdev, goto exit; } + if (stdev->adnc_strm_handle[handle] != 0) { + ALOGD("%s: stop tunnling for index:%d", __func__, handle); + stdev->adnc_strm_close(stdev->adnc_strm_handle[handle]); + stdev->adnc_strm_handle[handle] = 0; + stdev->is_streaming--; + } + model->is_active = false; tear_package_route(stdev, model->uuid, stdev->is_bargein_route_enabled); -- cgit v1.2.3