Commit 3d143aff authored by benzh's avatar benzh Committed by Commit bot

Hotword: Fix always-on case by removing MS_CONFIGURED timeout

The behavior of MediaStreamAudioTrack::Configure() has changed:

Configure() used to be able to complete before any audio sample
is received because the AudioParameter can be obtained from a
WebRtcLocalAudioTrack according to
https://codereview.chromium.org/857093002

After the media stream refactoring http://crbug.com/577874
Configure() remains pending until the first audio frame is
received. For always-on hotword detection with a DSP audio
source, no audio sample is sent until the DSP detects a
potential hotword trigger.

This patch removes MS_CONFIGURED timeout so that the plugin
can keep waiting for a hotword instead of reporting a timeout
error.

BUG=616203
TEST=Verified always-on hotwording on Samus and Chell
Signed-off-by: default avatarBen Zhang <benzh@chromium.org>
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation

Review-Url: https://codereview.chromium.org/2306803003
Cr-Commit-Position: refs/heads/master@{#418997}
parent b03d43e3
...@@ -460,8 +460,12 @@ NaClManager.prototype.handleModelLoaded_ = function() { ...@@ -460,8 +460,12 @@ NaClManager.prototype.handleModelLoaded_ = function() {
return; return;
} }
this.sendDataToPlugin_(this.stream_.getAudioTracks()[0]); this.sendDataToPlugin_(this.stream_.getAudioTracks()[0]);
this.waitForMessage_(hotword.constants.TimeoutMs.LONG, // The plugin will send a MS_CONFIGURED, but don't set a timeout waiting for
hotword.constants.NaClPlugin.MS_CONFIGURED); // it. MediaStreamAudioTrack::Configure() will remain pending until the first
// audio buffer is received. When the audio source is a DSP for always-on
// detection, no audio sample is sent until the DSP detects a potential
// hotword trigger. Thus, Configure would remain pending indefinitely if we
// were to wait here. See https://crbug.com/616203
}; };
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment