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

Issue 2888383002: Stop source and fire MediaStreamTrack ended event if missing audio input callbacks are detected. (Closed)

Created:
3 years, 7 months ago by Henrik Grunell
Modified:
3 years, 7 months ago
CC:
chromium-reviews, mlamouri+watch-content_chromium.org, imcheng+watch_chromium.org, feature-media-reviews_chromium.org, posciak+watch_chromium.org, chfremer+watch_chromium.org, jam, avayvod+watch_chromium.org, darin-cc_chromium.org, jasonroberts+watch_google.com, xjz+watch_chromium.org, mfoltz+watch_chromium.org, isheriff+watch_chromium.org, miu+watch_chromium.org, o1ka, Max Morin
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Stop source and fire MediaStreamTrack ended event if missing audio input callbacks are detected. This way the javascript application is informed when there's a problem with the input device. Since the detection is in the renderer process we would also catch any other issues in the pipeline, including on the process border (i.e. the socket pair), should it render the same type of symptom. * Detection is done in AudioInputDevice as this corresponds to a physical device which is what we want to detect missing callbacks for. * When detected we call CaptureError() on the capturer, which stops the source and puts the track in ended state and fires the ended event. * The time with missing callbacks before detecting is chosen to 12 seconds, so that other components down the stack have a chance to defer start if needed and report startup success stats. Specifically the Mac implementation. See also code comment in the CL. * UMA stats is added; reporting a boolean when stopping. Tested manually by altering a Linux build with https://codereview.chromium.org/2891303002/ and using a WebRTC test page with the MediaStreamTrack.onended set to log that the event was fired. BUG=722335 TEST=See above. CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel Review-Url: https://codereview.chromium.org/2888383002 Cr-Commit-Position: refs/heads/master@{#474383} Committed: https://chromium.googlesource.com/chromium/src/+/dc44616c932d390c6ee11c2eb5931d51e7df91a7

Patch Set 1 #

Total comments: 2

Patch Set 2 : Moved detection to AudioInputDevice. Cleaned up. #

Total comments: 4

Patch Set 3 : Code review (tommi@) #

Patch Set 4 : Added WebRTC logging in LocalMediaStreamAudioSource::OnCaptureError(). #

Total comments: 11

Patch Set 5 : Code review (ossu@ and tommi@). #

Total comments: 4

Patch Set 6 : Code review (ossu@). #

Patch Set 7 : Storing TimeTicks' internal value instead. #

Total comments: 2

Patch Set 8 : Code review (isherman@), reduced wait time, fixed init of a variable. #

Patch Set 9 : Revert changes in audio_low_latency_input_mac.cc. #

Patch Set 10 : Fixed typo. #

Patch Set 11 : Added missing include and moved back an include. #

Patch Set 12 : Changing to post task instead of atomic operation since Atomic64 exists not on 32-bit platforms. #

Total comments: 4

Patch Set 13 : Code review (ossu@). #

Patch Set 14 : Removed dependency on test CL. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+130 lines, -7 lines) Patch
M content/renderer/media/local_media_stream_audio_source.cc View 1 2 3 2 chunks +2 lines, -0 lines 0 comments Download
M media/audio/audio_input_device.h View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +31 lines, -0 lines 0 comments Download
M media/audio/audio_input_device.cc View 1 2 3 4 5 6 7 8 9 10 11 12 9 chunks +83 lines, -7 lines 0 comments Download
M tools/metrics/histograms/enums.xml View 1 2 3 4 5 6 7 1 chunk +5 lines, -0 lines 0 comments Download
M tools/metrics/histograms/histograms.xml View 1 2 3 4 5 6 7 1 chunk +9 lines, -0 lines 0 comments Download

Messages

Total messages: 60 (34 generated)
ossu-chromium
Seems straightforward enough. Great! :) https://codereview.chromium.org/2888383002/diff/1/content/renderer/media/webrtc/processed_local_audio_source.cc File content/renderer/media/webrtc/processed_local_audio_source.cc (right): https://codereview.chromium.org/2888383002/diff/1/content/renderer/media/webrtc/processed_local_audio_source.cc#newcode281 content/renderer/media/webrtc/processed_local_audio_source.cc:281: base::subtle::Release_Store(&input_callback_is_active_, true); Perhaps just ...
3 years, 7 months ago (2017-05-18 13:38:54 UTC) #3
Henrik Grunell
https://codereview.chromium.org/2888383002/diff/1/content/renderer/media/webrtc/processed_local_audio_source.cc File content/renderer/media/webrtc/processed_local_audio_source.cc (right): https://codereview.chromium.org/2888383002/diff/1/content/renderer/media/webrtc/processed_local_audio_source.cc#newcode281 content/renderer/media/webrtc/processed_local_audio_source.cc:281: base::subtle::Release_Store(&input_callback_is_active_, true); On 2017/05/18 13:38:54, ossu-chromium wrote: > Perhaps ...
3 years, 7 months ago (2017-05-19 06:00:00 UTC) #4
tommi (sloooow) - chröme
drive-by https://codereview.chromium.org/2888383002/diff/20001/media/audio/audio_input_device.cc File media/audio/audio_input_device.cc (right): https://codereview.chromium.org/2888383002/diff/20001/media/audio/audio_input_device.cc#newcode310 media/audio/audio_input_device.cc:310: base::TimeDelta::FromSeconds(kMissingCallbacksTimeBeforeErrorSeconds)) {} https://codereview.chromium.org/2888383002/diff/20001/media/audio/audio_input_device.cc#newcode311 media/audio/audio_input_device.cc:311: callback_->OnCaptureError("Detected missing callbacks."); what ...
3 years, 7 months ago (2017-05-19 09:11:49 UTC) #5
Henrik Grunell
Ha, Tommi you did a drive-by at the same time as I added you as ...
3 years, 7 months ago (2017-05-19 09:17:41 UTC) #9
tommi (sloooow) - chröme
looks pretty good. just a couple of questions. https://codereview.chromium.org/2888383002/diff/60001/media/audio/audio_input_device.cc File media/audio/audio_input_device.cc (right): https://codereview.chromium.org/2888383002/diff/60001/media/audio/audio_input_device.cc#newcode36 media/audio/audio_input_device.cc:36: const ...
3 years, 7 months ago (2017-05-19 11:00:37 UTC) #11
ossu-chromium
https://codereview.chromium.org/2888383002/diff/60001/media/audio/audio_input_device.cc File media/audio/audio_input_device.cc (right): https://codereview.chromium.org/2888383002/diff/60001/media/audio/audio_input_device.cc#newcode58 media/audio/audio_input_device.cc:58: DataCallbackNotificationCallback data_callback_notification_callback); On 2017/05/19 11:00:37, tommi (sloooow) - chröme ...
3 years, 7 months ago (2017-05-19 11:26:48 UTC) #12
Henrik Grunell
https://codereview.chromium.org/2888383002/diff/60001/media/audio/audio_input_device.cc File media/audio/audio_input_device.cc (right): https://codereview.chromium.org/2888383002/diff/60001/media/audio/audio_input_device.cc#newcode36 media/audio/audio_input_device.cc:36: const int kMissingCallbacksTimeBeforeErrorSeconds = 20; On 2017/05/19 11:00:37, tommi ...
3 years, 7 months ago (2017-05-20 08:40:51 UTC) #14
ossu-chromium
This looks generally good, but I'm concerned about the performance implications of the current implementation, ...
3 years, 7 months ago (2017-05-22 11:27:35 UTC) #21
Max Morin
https://codereview.chromium.org/2888383002/diff/60001/media/audio/audio_input_device.cc File media/audio/audio_input_device.cc (right): https://codereview.chromium.org/2888383002/diff/60001/media/audio/audio_input_device.cc#newcode58 media/audio/audio_input_device.cc:58: DataCallbackNotificationCallback data_callback_notification_callback); On 2017/05/22 11:27:35, ossu-chromium wrote: > On ...
3 years, 7 months ago (2017-05-22 11:44:59 UTC) #22
Henrik Grunell
I'll do one change to this, so hold reviewing for a little while. https://codereview.chromium.org/2888383002/diff/60001/media/audio/audio_input_device.cc File ...
3 years, 7 months ago (2017-05-22 15:04:54 UTC) #23
Henrik Grunell
Ptal. Added isherman@ for histograms.xml.
3 years, 7 months ago (2017-05-22 16:08:01 UTC) #25
Ilya Sherman
Metrics LGTM https://codereview.chromium.org/2888383002/diff/140001/tools/metrics/histograms/histograms.xml File tools/metrics/histograms/histograms.xml (right): https://codereview.chromium.org/2888383002/diff/140001/tools/metrics/histograms/histograms.xml#newcode26680 tools/metrics/histograms/histograms.xml:26680: +<histogram name="Media.Audio.Capture.DetectedMissingCallbacks" enum="Boolean"> nit: Please use a ...
3 years, 7 months ago (2017-05-22 20:38:25 UTC) #26
ossu-chromium
Sweet! LGTM. Oh, did you test it again after the last changes? :)
3 years, 7 months ago (2017-05-23 10:33:35 UTC) #27
Henrik Grunell
On 2017/05/23 10:33:35, ossu-chromium wrote: > Sweet! LGTM. > > Oh, did you test it ...
3 years, 7 months ago (2017-05-23 10:50:05 UTC) #28
Henrik Grunell
Tommi could you take a look? The only remaining change I know of is reducing ...
3 years, 7 months ago (2017-05-23 19:35:25 UTC) #29
miu
Drive-by questions: Do we understand why audio input callbacks are not being invoked? Is it ...
3 years, 7 months ago (2017-05-23 19:47:43 UTC) #30
tommi (sloooow) - chröme
lgtm - can you run this one more time by ossu after the last changes ...
3 years, 7 months ago (2017-05-23 20:37:26 UTC) #31
Henrik Grunell
On 2017/05/23 19:47:43, miu wrote: > Drive-by questions: Do we understand why audio input callbacks ...
3 years, 7 months ago (2017-05-24 12:39:42 UTC) #32
Henrik Grunell
Oskar: please take a look now again. https://codereview.chromium.org/2888383002/diff/140001/tools/metrics/histograms/histograms.xml File tools/metrics/histograms/histograms.xml (right): https://codereview.chromium.org/2888383002/diff/140001/tools/metrics/histograms/histograms.xml#newcode26680 tools/metrics/histograms/histograms.xml:26680: +<histogram name="Media.Audio.Capture.DetectedMissingCallbacks" ...
3 years, 7 months ago (2017-05-24 12:42:17 UTC) #33
Henrik Grunell
On 2017/05/24 12:42:17, Henrik Grunell wrote: > Oskar: please take a look now again. And ...
3 years, 7 months ago (2017-05-24 12:48:58 UTC) #36
ossu-chromium
On 2017/05/24 12:48:58, Henrik Grunell wrote: > On 2017/05/24 12:42:17, Henrik Grunell wrote: > > ...
3 years, 7 months ago (2017-05-24 15:52:01 UTC) #47
Henrik Grunell
https://codereview.chromium.org/2888383002/diff/260001/media/audio/audio_input_device.cc File media/audio/audio_input_device.cc (right): https://codereview.chromium.org/2888383002/diff/260001/media/audio/audio_input_device.cc#newcode318 media/audio/audio_input_device.cc:318: if (base::TimeTicks::Now() - last_callback_time_ > On 2017/05/24 15:52:00, ossu-chromium ...
3 years, 7 months ago (2017-05-24 17:18:10 UTC) #48
commit-bot: I haz the power
This CL has an open dependency (Issue 2891303002 Patch 1). Please resolve the dependency and ...
3 years, 7 months ago (2017-05-24 17:19:27 UTC) #52
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2888383002/300001
3 years, 7 months ago (2017-05-24 17:25:32 UTC) #55
commit-bot: I haz the power
Committed patchset #14 (id:300001) as https://chromium.googlesource.com/chromium/src/+/dc44616c932d390c6ee11c2eb5931d51e7df91a7
3 years, 7 months ago (2017-05-24 19:12:23 UTC) #58
emircan
3 years, 7 months ago (2017-05-24 20:48:42 UTC) #59
Message was sent while issue was closed.
On 2017/05/24 19:12:23, commit-bot: I haz the power wrote:
> Committed patchset #14 (id:300001) as
>
https://chromium.googlesource.com/chromium/src/+/dc44616c932d390c6ee11c2eb593...

This seems to break webrtc tests on Mac, see
https://build.chromium.org/p/chromium.webrtc/builders/Mac%20Tester/builds/68150.

I am doing a revert to see if it helps:
https://codereview.chromium.org/2901333002/. I can't do it through rietveld UI
as it gives an error(probably because histograms.xml is too large).

Powered by Google App Engine
This is Rietveld 408576698