Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Issue 399623008: Use audio thread for the fake input audio stream. (Closed)

Created:
6 years, 5 months ago by no longer working on chromium
Modified:
6 years, 5 months ago
CC:
chromium-reviews, feature-media-reviews_chromium.org
Project:
chromium
Visibility:
Public.

Description

Use audio thread for the fake input audio stream. Previously the fake input stream is creating a new thread to pump the callbacks, this is unnecessary and FakeAudioInputStream::Stop() might take time to stop the thread. I suspect that this is one of the potential causes for the timeout in WebRtc content browser tests on Android bots. This patch changes the code to use AudioManager audio thread instead, hopefully this can reduce the flakiness on Android tests. Also it changes |beep_lock| from a global lock to a lock used only by BeepContext privately. BUG=387895 TEST=bots Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=283822

Patch Set 1 #

Total comments: 4

Patch Set 2 : fixed the mac bots #

Unified diffs Side-by-side diffs Delta from patch set Stats (+50 lines, -22 lines) Patch
M media/audio/fake_audio_input_stream.h View 2 chunks +5 lines, -1 line 0 comments Download
M media/audio/fake_audio_input_stream.cc View 1 8 chunks +45 lines, -21 lines 0 comments Download

Messages

Total messages: 17 (0 generated)
no longer working on chromium
Henrik, please review. Thanks, SX
6 years, 5 months ago (2014-07-17 11:17:31 UTC) #1
henrika (OOO until Aug 14)
https://codereview.chromium.org/399623008/diff/1/media/audio/fake_audio_input_stream.cc File media/audio/fake_audio_input_stream.cc (right): https://codereview.chromium.org/399623008/diff/1/media/audio/fake_audio_input_stream.cc#newcode107 media/audio/fake_audio_input_stream.cc:107: base::Bind(&FakeAudioInputStream::DoCallback, weak_factory_.GetWeakPtr()), Why do you need a weak pointer ...
6 years, 5 months ago (2014-07-17 11:21:21 UTC) #2
henrika (OOO until Aug 14)
https://codereview.chromium.org/399623008/diff/1/media/audio/fake_audio_input_stream.cc File media/audio/fake_audio_input_stream.cc (right): https://codereview.chromium.org/399623008/diff/1/media/audio/fake_audio_input_stream.cc#newcode29 media/audio/fake_audio_input_stream.cc:29: class BeepContext { How are the changes related to ...
6 years, 5 months ago (2014-07-17 11:21:59 UTC) #3
no longer working on chromium
https://codereview.chromium.org/399623008/diff/1/media/audio/fake_audio_input_stream.cc File media/audio/fake_audio_input_stream.cc (right): https://codereview.chromium.org/399623008/diff/1/media/audio/fake_audio_input_stream.cc#newcode107 media/audio/fake_audio_input_stream.cc:107: base::Bind(&FakeAudioInputStream::DoCallback, weak_factory_.GetWeakPtr()), On 2014/07/17 11:21:21, henrika wrote: > Why ...
6 years, 5 months ago (2014-07-17 11:22:48 UTC) #4
no longer working on chromium
https://codereview.chromium.org/399623008/diff/1/media/audio/fake_audio_input_stream.cc File media/audio/fake_audio_input_stream.cc (right): https://codereview.chromium.org/399623008/diff/1/media/audio/fake_audio_input_stream.cc#newcode29 media/audio/fake_audio_input_stream.cc:29: class BeepContext { On 2014/07/17 11:21:59, henrika wrote: > ...
6 years, 5 months ago (2014-07-17 11:31:15 UTC) #5
no longer working on chromium
Henrik, FYI, description has been updated.
6 years, 5 months ago (2014-07-17 11:31:43 UTC) #6
henrika (OOO until Aug 14)
LGTM. Did you also verify the performance locally to ensure that the Beep signal works?
6 years, 5 months ago (2014-07-17 11:35:20 UTC) #7
no longer working on chromium
On 2014/07/17 11:35:20, henrika wrote: > LGTM. Did you also verify the performance locally to ...
6 years, 5 months ago (2014-07-17 11:39:22 UTC) #8
no longer working on chromium
The CQ bit was checked by xians@chromium.org
6 years, 5 months ago (2014-07-17 11:39:26 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/xians@chromium.org/399623008/1
6 years, 5 months ago (2014-07-17 11:40:08 UTC) #10
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: mac_chromium_rel on tryserver.chromium ...
6 years, 5 months ago (2014-07-17 15:48:44 UTC) #11
no longer working on chromium
The CQ bit was checked by xians@chromium.org
6 years, 5 months ago (2014-07-17 16:15:39 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/xians@chromium.org/399623008/20001
6 years, 5 months ago (2014-07-17 16:16:28 UTC) #13
commit-bot: I haz the power
Change committed as 283822
6 years, 5 months ago (2014-07-17 18:30:30 UTC) #14
DaleCurtis
This is okay for now since this isn't actually used in production (AFAIK), but it ...
6 years, 5 months ago (2014-07-17 18:32:04 UTC) #15
no longer working on chromium
On 2014/07/17 18:32:04, DaleCurtis wrote: > This is okay for now since this isn't actually ...
6 years, 5 months ago (2014-07-17 18:46:35 UTC) #16
DaleCurtis
6 years, 5 months ago (2014-07-17 18:50:05 UTC) #17
Message was sent while issue was closed.
My worry is that we create these fake streams in the production AudioManager, so
it's not inconceivable that one day someone enables this in production without
realizing the consequences.  Is there a CHECK() you can put anywhere to ensure
this doesn't happen?

Your weakptr violation is probably because you're crossing threads, the
fakeaudioconsumer goes out of its way to be thread safe across multiple threads.
 I think it'd be pretty easy to swap it out and cleaner to boot.

Powered by Google App Engine
This is Rietveld 408576698