diff options
author | Rios Kao <rioskao@google.com> | 2019-07-29 17:03:57 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2019-07-29 17:03:57 +0000 |
commit | 03ff3215a9468ebe03700e6ecc98d9a4ca5e8ed9 (patch) | |
tree | d7f51e2d05317203de77b4477877466070ab16fd | |
parent | f2a7fcbee820a9ae062a83bf508f6a611b367e18 (diff) | |
parent | 1089bfc54556fbcace2be9e1e37801e7aa000d99 (diff) | |
download | android_hardware_knowles_athletico_sound_trigger_hal-03ff3215a9468ebe03700e6ecc98d9a4ca5e8ed9.tar.gz android_hardware_knowles_athletico_sound_trigger_hal-03ff3215a9468ebe03700e6ecc98d9a4ca5e8ed9.tar.bz2 android_hardware_knowles_athletico_sound_trigger_hal-03ff3215a9468ebe03700e6ecc98d9a4ca5e8ed9.zip |
Merge "sthal: incorrect order of microphone SRC plugin" into qt-r1-dev
-rw-r--r-- | sound_trigger_hw_iaxxx.c | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/sound_trigger_hw_iaxxx.c b/sound_trigger_hw_iaxxx.c index 9247f00..1d322a2 100644 --- a/sound_trigger_hw_iaxxx.c +++ b/sound_trigger_hw_iaxxx.c @@ -1559,9 +1559,27 @@ static int restart_recognition(struct knowles_sound_trigger_device *stdev) /* * Reset mic and src package if sound trigger recording is active - * If sound trigger recording isn't active, then we don't need to - * recover src package. + * The src-mic, src-amp must be enable before AEC enable, because + * the endpoint sequence control. + * + * The stream 0 should be enable at last moment for the data alignment. */ + if (stdev->is_mic_route_enabled == true) { + // recover src package if sound trigger recording is active + err = setup_src_plugin(stdev->odsp_hdl, SRC_MIC); + if (err != 0) { + ALOGE("failed to load SRC package"); + } + err = enable_src_route(stdev->route_hdl, false, SRC_MIC); + if (err != 0) { + ALOGE("Failed to tear SRC-mic route"); + } + err = enable_src_route(stdev->route_hdl, true, SRC_MIC); + if (err != 0) { + ALOGE("Failed to restart SRC-mic route"); + } + } + if (stdev->is_music_playing == true && stdev->is_bargein_route_enabled == true) { if (is_mic_controlled_by_audhal(stdev) == true) { @@ -1603,20 +1621,6 @@ static int restart_recognition(struct knowles_sound_trigger_device *stdev) } if (stdev->is_mic_route_enabled == true) { - // recover src package if sound trigger recording is active - err = setup_src_plugin(stdev->odsp_hdl, SRC_MIC); - if (err != 0) { - ALOGE("failed to load SRC package"); - } - err = enable_src_route(stdev->route_hdl, false, SRC_MIC); - if (err != 0) { - ALOGE("Failed to tear SRC-mic route"); - } - err = enable_src_route(stdev->route_hdl, true, SRC_MIC); - if (err != 0) { - ALOGE("Failed to restart SRC-mic route"); - } - if (is_mic_controlled_by_audhal(stdev) == false) { err = enable_mic_route(stdev->route_hdl, false, ct); if (err != 0) { |