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

Issue 2067863003: Mixing audio with different latency requirements (Closed)

Created:
4 years, 6 months ago by o1ka
Modified:
4 years, 5 months ago
CC:
chromium-reviews, darin-cc_chromium.org, feature-media-reviews_chromium.org, jam, mcasas+watch+vc_chromium.org, miu+watch_chromium.org, mkwst+moarreviews-renderer_chromium.org, mlamouri+watch-content_chromium.org, posciak+watch_chromium.org, vanellope-cl_google.com
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Mixing audio with different latency requirements. Follow-up is introducing mixing for audio other than media elements (under finch). ** Helper changes: 1) AudioDeviceFactory: Added separate categories for WebAudio source basing on expected output latency. Not used by WebAudio right now, but they give a sense of what to expect in the nearest future regarding output latency requirements. (May be dropped for now). 2) AudioLatency class is introduced; latency-based output buffer size calculation is moved into it. ** Mixing changes: 3) AudioRendererMixerPool/AudioRendererMixerManager: * latency requirement is introduced as one more ARMInput parameter; now it’s a part of ARM key. The mixing strategy (see ARM key comparison) is that only inputs with the same latency requirements can be mixed together; LATENCY_EXACT_MS inputs are mixed only with the likewise and only if they have the same buffer duration. * ARMM adjusts mixer output buffer siza based on input latency and output sample rate. BUG=560378, 564472 Committed: https://crrev.com/6bbdb8b35b1977bd45e74b882dce8e70416cf190 Cr-Commit-Position: refs/heads/master@{#403120}

Patch Set 1 #

Patch Set 2 : mixing inputs of the same latency #

Total comments: 42

Patch Set 3 : revew comments addressed #

Patch Set 4 : UMA added, LATENCY_EXACT_MS support removed #

Patch Set 5 : Unit tests, cleanup #

Total comments: 27

Patch Set 6 : rebase #

Total comments: 5

Patch Set 7 : UMA fix, unit tests and compile error fixes on some platforms, review comments addressed #

Total comments: 42

Patch Set 8 : fixing bot redness #

Total comments: 10

Patch Set 9 : Review comments addressed #

Total comments: 3

Patch Set 10 : UMA boundary fixes according to recomendations, rebase #

Patch Set 11 : android test fix #

Unified diffs Side-by-side diffs Delta from patch set Stats (+955 lines, -289 lines) Patch
M content/renderer/media/audio_device_factory.h View 1 2 1 chunk +9 lines, -3 lines 0 comments Download
M content/renderer/media/audio_device_factory.cc View 1 2 3 4 5 6 7 8 9 6 chunks +26 lines, -3 lines 0 comments Download
M content/renderer/media/audio_renderer_mixer_manager.h View 1 2 3 4 5 6 7 8 6 chunks +20 lines, -6 lines 0 comments Download
M content/renderer/media/audio_renderer_mixer_manager.cc View 1 2 3 4 5 6 7 8 9 6 chunks +127 lines, -43 lines 0 comments Download
M content/renderer/media/audio_renderer_mixer_manager_unittest.cc View 1 2 3 4 5 6 7 15 chunks +386 lines, -62 lines 0 comments Download
M content/renderer/media/renderer_webaudiodevice_impl.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/renderer/media/track_audio_renderer.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M content/renderer/media/webrtc_audio_renderer.h View 1 1 chunk +0 lines, -4 lines 0 comments Download
M content/renderer/media/webrtc_audio_renderer.cc View 1 3 chunks +2 lines, -34 lines 0 comments Download
M media/base/BUILD.gn View 1 2 3 4 5 2 chunks +3 lines, -0 lines 0 comments Download
M media/base/audio_hardware_config.h View 1 1 chunk +0 lines, -7 lines 0 comments Download
M media/base/audio_hardware_config.cc View 1 2 chunks +0 lines, -54 lines 0 comments Download
M media/base/audio_hardware_config_unittest.cc View 1 1 chunk +0 lines, -38 lines 0 comments Download
A media/base/audio_latency.h View 1 2 3 4 5 6 7 8 1 chunk +42 lines, -0 lines 0 comments Download
A media/base/audio_latency.cc View 1 2 3 4 5 6 7 8 1 chunk +129 lines, -0 lines 0 comments Download
A media/base/audio_latency_unittest.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +55 lines, -0 lines 0 comments Download
M media/base/audio_renderer_mixer.h View 1 2 3 4 5 6 7 8 3 chunks +12 lines, -1 line 0 comments Download
M media/base/audio_renderer_mixer.cc View 1 2 3 4 5 6 7 8 3 chunks +41 lines, -2 lines 0 comments Download
M media/base/audio_renderer_mixer_input.h View 1 2 3 4 5 3 chunks +4 lines, -1 line 0 comments Download
M media/base/audio_renderer_mixer_input.cc View 1 2 3 4 5 5 chunks +8 lines, -5 lines 0 comments Download
M media/base/audio_renderer_mixer_input_unittest.cc View 1 2 3 4 5 6 7 8 5 chunks +12 lines, -10 lines 0 comments Download
M media/base/audio_renderer_mixer_pool.h View 1 2 3 4 5 6 2 chunks +3 lines, -4 lines 0 comments Download
M media/base/audio_renderer_mixer_unittest.cc View 1 2 3 4 5 6 7 8 4 chunks +9 lines, -7 lines 0 comments Download
M media/media.gyp View 1 2 3 4 5 6 7 8 2 chunks +3 lines, -0 lines 0 comments Download
M media/renderers/audio_renderer_impl.cc View 1 2 3 4 5 2 chunks +2 lines, -2 lines 0 comments Download
M tools/metrics/histograms/histograms.xml View 1 2 3 4 5 6 7 8 9 1 chunk +59 lines, -0 lines 0 comments Download

Messages

Total messages: 60 (14 generated)
o1ka
Dale, PTAL at the approach. The main points I'm looking your input on are in ...
4 years, 6 months ago (2016-06-15 16:41:47 UTC) #3
DaleCurtis
I think we'll want to avoid stream restart as much as possible, some platforms have ...
4 years, 6 months ago (2016-06-15 23:16:30 UTC) #4
DaleCurtis
+chcunningham who I'd like to help review.
4 years, 6 months ago (2016-06-15 23:17:06 UTC) #6
o1ka
On 2016/06/15 23:16:30, DaleCurtis wrote: > I think we'll want to avoid stream restart as ...
4 years, 6 months ago (2016-06-16 15:10:16 UTC) #7
o1ka
PTAL at the new version. I'm also going to add UMA stat for maximum number ...
4 years, 6 months ago (2016-06-21 15:16:41 UTC) #9
DaleCurtis
Probably won't have time to look over this today, so defer to Chris and Henrik ...
4 years, 6 months ago (2016-06-21 19:50:30 UTC) #10
chcunningham
Apologies for the delay - I took some time to re-learn some of the affected ...
4 years, 6 months ago (2016-06-22 02:13:56 UTC) #11
chcunningham
https://codereview.chromium.org/2067863003/diff/20001/content/renderer/media/audio_renderer_mixer_manager.cc File content/renderer/media/audio_renderer_mixer_manager.cc (right): https://codereview.chromium.org/2067863003/diff/20001/content/renderer/media/audio_renderer_mixer_manager.cc#newcode61 content/renderer/media/audio_renderer_mixer_manager.cc:61: media::AudioLatency::GetInteractiveBufferSize( On 2016/06/21 15:16:41, o1ka wrote: > Also not ...
4 years, 6 months ago (2016-06-22 04:34:08 UTC) #12
o1ka
Answered questions, cleaned up the code. (working on metrics and some more unit tests now). ...
4 years, 6 months ago (2016-06-23 16:36:16 UTC) #13
o1ka
PTAL: Added UMA stats and some unit tests (unit tests is a work in progress); ...
4 years, 5 months ago (2016-06-27 14:18:54 UTC) #14
chcunningham
https://codereview.chromium.org/2067863003/diff/20001/content/renderer/media/audio_device_factory.h File content/renderer/media/audio_device_factory.h (right): https://codereview.chromium.org/2067863003/diff/20001/content/renderer/media/audio_device_factory.h#newcode41 content/renderer/media/audio_device_factory.h:41: kSourceWebAudioInteractive, On 2016/06/23 16:36:15, o1ka wrote: > On 2016/06/22 ...
4 years, 5 months ago (2016-06-27 23:12:25 UTC) #15
o1ka
https://codereview.chromium.org/2067863003/diff/20001/content/renderer/media/audio_renderer_mixer_manager.cc File content/renderer/media/audio_renderer_mixer_manager.cc (right): https://codereview.chromium.org/2067863003/diff/20001/content/renderer/media/audio_renderer_mixer_manager.cc#newcode46 content/renderer/media/audio_renderer_mixer_manager.cc:46: int output_buffer_size = input_params.frames_per_buffer(); On 2016/06/27 23:12:24, chcunningham wrote: ...
4 years, 5 months ago (2016-06-28 13:04:58 UTC) #16
o1ka
PTAL at the latest PS. henrika@: PTAL at buffer size calculations in audio_latency*, audio_renderer_mixer_manager* (including ...
4 years, 5 months ago (2016-06-28 13:07:13 UTC) #18
o1ka
Adding tommi@ as a reviewer to speed up things a bit.
4 years, 5 months ago (2016-06-28 13:14:33 UTC) #20
henrika (OOO until Aug 14)
Lot's of new stuff here and hard to see all implications. Regarding AudioLatency, could you ...
4 years, 5 months ago (2016-06-28 13:26:12 UTC) #21
henrika (OOO until Aug 14)
https://codereview.chromium.org/2067863003/diff/80001/media/base/audio_latency.cc File media/base/audio_latency.cc (right): https://codereview.chromium.org/2067863003/diff/80001/media/base/audio_latency.cc#newcode85 media/base/audio_latency.cc:85: // TODO(henrika): Keep tuning this scheme and espcicially for ...
4 years, 5 months ago (2016-06-28 13:26:25 UTC) #22
henrika (OOO until Aug 14)
https://codereview.chromium.org/2067863003/diff/80001/media/base/audio_latency_unittest.cc File media/base/audio_latency_unittest.cc (right): https://codereview.chromium.org/2067863003/diff/80001/media/base/audio_latency_unittest.cc#newcode17 media/base/audio_latency_unittest.cc:17: for (int i = 6400; i <= 204800; i ...
4 years, 5 months ago (2016-06-28 13:33:13 UTC) #23
tommi (sloooow) - chröme
https://codereview.chromium.org/2067863003/diff/80001/content/renderer/media/audio_renderer_mixer_manager.cc File content/renderer/media/audio_renderer_mixer_manager.cc (right): https://codereview.chromium.org/2067863003/diff/80001/content/renderer/media/audio_renderer_mixer_manager.cc#newcode26 content/renderer/media/audio_renderer_mixer_manager.cc:26: const media::AudioParameters& hardware_params, are the 'hardware' params for output ...
4 years, 5 months ago (2016-06-28 14:14:55 UTC) #24
o1ka
https://codereview.chromium.org/2067863003/diff/100001/content/renderer/media/audio_renderer_mixer_manager.cc File content/renderer/media/audio_renderer_mixer_manager.cc (right): https://codereview.chromium.org/2067863003/diff/100001/content/renderer/media/audio_renderer_mixer_manager.cc#newcode110 content/renderer/media/audio_renderer_mixer_manager.cc:110: // |mixers_| may leak (i.e., may be non-empty at ...
4 years, 5 months ago (2016-06-28 15:51:28 UTC) #25
o1ka
https://codereview.chromium.org/2067863003/diff/100001/content/renderer/media/audio_renderer_mixer_manager.cc File content/renderer/media/audio_renderer_mixer_manager.cc (right): https://codereview.chromium.org/2067863003/diff/100001/content/renderer/media/audio_renderer_mixer_manager.cc#newcode113 content/renderer/media/audio_renderer_mixer_manager.cc:113: LOCAL_HISTOGRAM_CUSTOM_COUNTS("Media.Audio.Render.AudioMixing.LatencyMap", On 2016/06/28 15:51:28, o1ka wrote: > The problem ...
4 years, 5 months ago (2016-06-28 16:05:32 UTC) #26
o1ka
https://codereview.chromium.org/2067863003/diff/100001/content/renderer/media/audio_renderer_mixer_manager.cc File content/renderer/media/audio_renderer_mixer_manager.cc (right): https://codereview.chromium.org/2067863003/diff/100001/content/renderer/media/audio_renderer_mixer_manager.cc#newcode113 content/renderer/media/audio_renderer_mixer_manager.cc:113: LOCAL_HISTOGRAM_CUSTOM_COUNTS("Media.Audio.Render.AudioMixing.LatencyMap", On 2016/06/28 16:05:32, o1ka wrote: > On 2016/06/28 ...
4 years, 5 months ago (2016-06-28 17:16:09 UTC) #27
chcunningham
Change is looking good to me. Lets see what Dale says :) https://codereview.chromium.org/2067863003/diff/20001/content/renderer/media/audio_renderer_mixer_manager.cc File content/renderer/media/audio_renderer_mixer_manager.cc ...
4 years, 5 months ago (2016-06-28 18:43:50 UTC) #28
DaleCurtis
https://codereview.chromium.org/2067863003/diff/20001/content/renderer/media/audio_renderer_mixer_manager.cc File content/renderer/media/audio_renderer_mixer_manager.cc (right): https://codereview.chromium.org/2067863003/diff/20001/content/renderer/media/audio_renderer_mixer_manager.cc#newcode46 content/renderer/media/audio_renderer_mixer_manager.cc:46: int output_buffer_size = input_params.frames_per_buffer(); On 2016/06/28 at 18:43:49, chcunningham ...
4 years, 5 months ago (2016-06-28 21:44:07 UTC) #29
o1ka
https://codereview.chromium.org/2067863003/diff/80001/content/renderer/media/audio_renderer_mixer_manager.cc File content/renderer/media/audio_renderer_mixer_manager.cc (right): https://codereview.chromium.org/2067863003/diff/80001/content/renderer/media/audio_renderer_mixer_manager.cc#newcode26 content/renderer/media/audio_renderer_mixer_manager.cc:26: const media::AudioParameters& hardware_params, On 2016/06/28 14:14:54, tommi-chrömium wrote: > ...
4 years, 5 months ago (2016-06-29 10:11:27 UTC) #30
o1ka
https://codereview.chromium.org/2067863003/diff/120001/media/base/audio_renderer_mixer.cc File media/base/audio_renderer_mixer.cc (right): https://codereview.chromium.org/2067863003/diff/120001/media/base/audio_renderer_mixer.cc#newcode20 media/base/audio_renderer_mixer.cc:20: // the destruciton. NOT thread-safe, make sure it is ...
4 years, 5 months ago (2016-06-29 10:12:08 UTC) #31
Henrik Grunell
Some comments. https://codereview.chromium.org/2067863003/diff/120001/content/renderer/media/audio_renderer_mixer_manager.cc File content/renderer/media/audio_renderer_mixer_manager.cc (right): https://codereview.chromium.org/2067863003/diff/120001/content/renderer/media/audio_renderer_mixer_manager.cc#newcode32 content/renderer/media/audio_renderer_mixer_manager.cc:32: int preferred_high_latency_output_bufffer_size = 0; fff -> ff ...
4 years, 5 months ago (2016-06-29 12:20:55 UTC) #32
tommi (sloooow) - chröme
qq - instead of the noop LogUma methods, can we create a noop callback object ...
4 years, 5 months ago (2016-06-29 12:26:52 UTC) #33
tommi (sloooow) - chröme
On 2016/06/29 12:26:52, tommi-chrömium wrote: > qq - instead of the noop LogUma methods, can ...
4 years, 5 months ago (2016-06-29 12:27:32 UTC) #34
o1ka
grunell@, tommi@, - thanks for the review. Comments addressed. https://codereview.chromium.org/2067863003/diff/120001/content/renderer/media/audio_renderer_mixer_manager.cc File content/renderer/media/audio_renderer_mixer_manager.cc (right): https://codereview.chromium.org/2067863003/diff/120001/content/renderer/media/audio_renderer_mixer_manager.cc#newcode32 content/renderer/media/audio_renderer_mixer_manager.cc:32: ...
4 years, 5 months ago (2016-06-29 13:57:32 UTC) #35
o1ka
On 2016/06/29 12:27:32, tommi-chrömium wrote: > On 2016/06/29 12:26:52, tommi-chrömium wrote: > > qq - ...
4 years, 5 months ago (2016-06-29 14:09:30 UTC) #36
o1ka
On 2016/06/28 13:26:12, henrika wrote: > Lot's of new stuff here and hard to see ...
4 years, 5 months ago (2016-06-29 14:21:28 UTC) #37
henrika (OOO until Aug 14)
LGTM
4 years, 5 months ago (2016-06-29 14:42:35 UTC) #38
o1ka
holte@ - PTAL at UMA histograms.
4 years, 5 months ago (2016-06-29 14:57:11 UTC) #40
o1ka
On 2016/06/29 14:57:11, o1ka wrote: > holte@ - PTAL at UMA histograms. Logged in audio_renderer_mixer_manager.cc ...
4 years, 5 months ago (2016-06-29 14:58:56 UTC) #41
o1ka
FYI: follow-up CL to enable the logic under finch for dev and canary https://codereview.chromium.org/2108673004/
4 years, 5 months ago (2016-06-29 15:54:17 UTC) #42
chcunningham
lgtm
4 years, 5 months ago (2016-06-29 16:48:12 UTC) #43
DaleCurtis
lgtm https://codereview.chromium.org/2067863003/diff/160001/media/base/audio_renderer_mixer.cc File media/base/audio_renderer_mixer.cc (right): https://codereview.chromium.org/2067863003/diff/160001/media/base/audio_renderer_mixer.cc#newcode19 media/base/audio_renderer_mixer.cc:19: // Tracks the maximum value of a counter ...
4 years, 5 months ago (2016-06-29 17:08:55 UTC) #44
Henrik Grunell
lgtm https://codereview.chromium.org/2067863003/diff/120001/content/renderer/media/audio_renderer_mixer_manager.cc File content/renderer/media/audio_renderer_mixer_manager.cc (right): https://codereview.chromium.org/2067863003/diff/120001/content/renderer/media/audio_renderer_mixer_manager.cc#newcode137 content/renderer/media/audio_renderer_mixer_manager.cc:137: media::AudioLatency::LatencyType latency) { On 2016/06/29 13:57:31, o1ka wrote: ...
4 years, 5 months ago (2016-06-29 17:41:46 UTC) #45
Steven Holte
lgtm % some bucket bounds issues. https://codereview.chromium.org/2067863003/diff/160001/content/renderer/media/audio_renderer_mixer_manager.cc File content/renderer/media/audio_renderer_mixer_manager.cc (right): https://codereview.chromium.org/2067863003/diff/160001/content/renderer/media/audio_renderer_mixer_manager.cc#newcode85 content/renderer/media/audio_renderer_mixer_manager.cc:85: 20); If you ...
4 years, 5 months ago (2016-06-29 18:34:25 UTC) #46
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/2067863003/180001
4 years, 5 months ago (2016-06-30 00:22:27 UTC) #49
o1ka
Thanks everybody for the timely review!
4 years, 5 months ago (2016-06-30 00:23:05 UTC) #50
commit-bot: I haz the power
Try jobs failed on following builders: linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_android_rel_ng/builds/96423)
4 years, 5 months ago (2016-06-30 02:34: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/2067863003/200001
4 years, 5 months ago (2016-06-30 06:00:35 UTC) #55
commit-bot: I haz the power
Committed patchset #11 (id:200001)
4 years, 5 months ago (2016-06-30 08:38:04 UTC) #57
commit-bot: I haz the power
CQ bit was unchecked.
4 years, 5 months ago (2016-06-30 08:38:15 UTC) #58
commit-bot: I haz the power
4 years, 5 months ago (2016-06-30 08:39:47 UTC) #60
Message was sent while issue was closed.
Patchset 11 (id:??) landed as
https://crrev.com/6bbdb8b35b1977bd45e74b882dce8e70416cf190
Cr-Commit-Position: refs/heads/master@{#403120}

Powered by Google App Engine
This is Rietveld 408576698