diff options
author | Rios Kao <rioskao@google.com> | 2019-07-26 12:26:00 -0700 |
---|---|---|
committer | Rios Kao <rioskao@google.com> | 2019-07-26 12:29:06 -0700 |
commit | 1089bfc54556fbcace2be9e1e37801e7aa000d99 (patch) | |
tree | 310c567d1097fa300b0d5449ffbc4e5e287d5af9 | |
parent | 4d5652116ffb1a1449652b5e92f9c3f9197e8fd5 (diff) | |
download | android_hardware_knowles_athletico_sound_trigger_hal-1089bfc54556fbcace2be9e1e37801e7aa000d99.tar.gz android_hardware_knowles_athletico_sound_trigger_hal-1089bfc54556fbcace2be9e1e37801e7aa000d99.tar.bz2 android_hardware_knowles_athletico_sound_trigger_hal-1089bfc54556fbcace2be9e1e37801e7aa000d99.zip |
sthal: incorrect order of microphone SRC plugin
note: During the recovery, the sequence of mic-src and EC
plugin endpoint is incorrect, need to create the source(mic)
before use it (EC).
Test: manually test recovery sequence for bargein
Bug: 135929701
Change-Id: I6429419e58a30472e70d5680e3853c4b165067a9
-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 4a88600..44f3cba 100644 --- a/sound_trigger_hw_iaxxx.c +++ b/sound_trigger_hw_iaxxx.c @@ -1544,9 +1544,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) { @@ -1588,20 +1606,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) { |