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

Issue 10830268: Allow audio system to handle synchronized low-latency audio I/O (Closed)

Created:
8 years, 4 months ago by Chris Rogers
Modified:
8 years, 3 months ago
CC:
chromium-reviews, joi+watch-content_chromium.org, feature-media-reviews_chromium.org, jam, darin-cc_chromium.org
Visibility:
Public.

Description

Allow audio system to handle synchronized low-latency audio I/O As an important part of WebAudio/WebRTC integration, we need to be able to process and analyse live audio. This change adds the ability to our audio system for handling synchronized audio input and output in the same callback (same thread) which is important for good performance and low-latency. As a part of this change, the audio IPC system now takes an optional |input_channels| argument in the CreateStream() message and associated browser-side code in AudioRendererHost::OnCreateStream(), etc. |input_channels| will be 0 during normal operation of audio output (and no input). But when synchronized audio I/O is needed, then a non-zero value can be passed in here. The |params| passed in represents both the input and output format, particularly the frames_per_buffer() and sample_rate(). AudioRendererSink now has an new InitializeIO() method which will allow the use of synchronized I/O with the |input_channels| argument. AudioRendererSink::RenderCallback now has a new RenderIO() which will be called instead of Render() in the case where a non-zero value is passed in for |input_channels|. BUG=none TEST=none (manual testing on early Mac OS X and Windows audio back-ends) Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=156234

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Total comments: 11

Patch Set 6 : #

Patch Set 7 : #

Patch Set 8 : #

Patch Set 9 : #

Patch Set 10 : #

Total comments: 15

Patch Set 11 : #

Patch Set 12 : #

Total comments: 8

Patch Set 13 : #

Patch Set 14 : #

Total comments: 10

Patch Set 15 : #

Patch Set 16 : #

Patch Set 17 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+420 lines, -101 lines) Patch
M chrome/app/generated_resources.grd View 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/browser/DEPS View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/about_flags.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +8 lines, -0 lines 0 comments Download
M content/browser/renderer_host/media/audio_renderer_host.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +3 lines, -1 line 0 comments Download
M content/browser/renderer_host/media/audio_renderer_host.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 4 chunks +21 lines, -3 lines 0 comments Download
M content/browser/renderer_host/media/audio_renderer_host_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -1 line 0 comments Download
M content/browser/renderer_host/media/audio_sync_reader.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 3 chunks +10 lines, -3 lines 0 comments Download
M content/browser/renderer_host/media/audio_sync_reader.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 4 chunks +34 lines, -12 lines 0 comments Download
M content/browser/renderer_host/render_process_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -0 lines 0 comments Download
M content/common/media/audio_messages.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +3 lines, -2 lines 0 comments Download
M content/renderer/media/audio_message_filter.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -1 line 0 comments Download
M content/renderer/media/audio_message_filter.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +3 lines, -2 lines 0 comments Download
M content/renderer/media/renderer_webaudiodevice_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +6 lines, -1 line 0 comments Download
M content/renderer/media/renderer_webaudiodevice_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 3 chunks +36 lines, -9 lines 0 comments Download
M content/renderer/pepper/pepper_platform_audio_output_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -1 line 0 comments Download
M media/audio/audio_device_thread.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +2 lines, -2 lines 0 comments Download
M media/audio/audio_device_thread.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +2 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 13 14 15 1 chunk +1 line, -1 line 0 comments Download
M media/audio/audio_io.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +6 lines, -2 lines 0 comments Download
M media/audio/audio_low_latency_input_output_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +7 lines, -0 lines 0 comments Download
M media/audio/audio_output_controller.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 3 chunks +9 lines, -3 lines 0 comments Download
M media/audio/audio_output_controller.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +10 lines, -3 lines 0 comments Download
M media/audio/audio_output_controller_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 4 chunks +4 lines, -4 lines 0 comments Download
M media/audio/audio_output_device.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 3 chunks +9 lines, -1 line 0 comments Download
M media/audio/audio_output_device.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 13 chunks +57 lines, -12 lines 0 comments Download
M media/audio/audio_output_device_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 10 chunks +66 lines, -15 lines 0 comments Download
M media/audio/audio_output_ipc.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +5 lines, -2 lines 0 comments Download
M media/audio/audio_output_proxy_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +3 lines, -0 lines 0 comments Download
M media/audio/audio_output_resampler.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +4 lines, -1 line 0 comments Download
M media/audio/audio_output_resampler.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 chunks +15 lines, -9 lines 0 comments Download
M media/audio/linux/alsa_output_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +3 lines, -0 lines 0 comments Download
M media/audio/linux/cras_output_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +3 lines, -0 lines 0 comments Download
M media/audio/mac/audio_output_mac_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +3 lines, -0 lines 0 comments Download
M media/audio/simple_sources.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +3 lines, -0 lines 0 comments Download
M media/audio/simple_sources.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +7 lines, -0 lines 0 comments Download
M media/audio/win/audio_low_latency_output_win_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +10 lines, -0 lines 0 comments Download
M media/audio/win/audio_output_win_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 3 chunks +15 lines, -0 lines 0 comments Download
M media/base/audio_bus.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +4 lines, -0 lines 0 comments Download
M media/base/audio_bus.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +14 lines, -8 lines 0 comments Download
M media/base/audio_renderer_sink.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +18 lines, -2 lines 0 comments Download
M media/base/media_switches.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +2 lines, -0 lines 0 comments Download
M media/base/media_switches.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 29 (0 generated)
Chris Rogers
Hey guys, I have an early patch ready for high-level comments. Some things to note: ...
8 years, 4 months ago (2012-08-10 22:31:29 UTC) #1
henrika (OOO until Aug 14)
Hi Chris, just took a very quick look at this today. My plan was to ...
8 years, 4 months ago (2012-08-13 15:43:59 UTC) #2
Chris Rogers
On 2012/08/13 15:43:59, henrika wrote: > Hi Chris, > > just took a very quick ...
8 years, 4 months ago (2012-08-13 17:27:25 UTC) #3
Ami GONE FROM CHROMIUM
drive-by I think you have a particular source & sink pair in mind, but I ...
8 years, 4 months ago (2012-08-14 06:24:23 UTC) #4
Chris Rogers
On 2012/08/14 06:24:23, Ami Fischman wrote: > drive-by > > I think you have a ...
8 years, 4 months ago (2012-08-14 06:51:27 UTC) #5
Ami GONE FROM CHROMIUM
Is this really about handling both input and output in the same timeslice, or is ...
8 years, 4 months ago (2012-08-14 06:56:16 UTC) #6
henrika (OOO until Aug 14)
Ami: my interpretation of this CL is that it allows us to process the captured ...
8 years, 4 months ago (2012-08-14 11:23:07 UTC) #7
scherkus (not reviewing)
we should definitely get a proper meta bug setup to track the work! crogers: let ...
8 years, 4 months ago (2012-08-15 20:06:02 UTC) #8
henrika (OOO until Aug 14)
crogers: as we have discussed. I'll try to come ups with something similar for Windows ...
8 years, 4 months ago (2012-08-17 14:00:04 UTC) #9
Chris Rogers
* Added --enable-webaudio-input. None of the new I/O stuff can run unless this flag has ...
8 years, 4 months ago (2012-08-25 02:03:09 UTC) #10
jtlinden
On 2012/08/25 02:03:09, Chris Rogers wrote: > * Added --enable-webaudio-input. None of the new I/O ...
8 years, 3 months ago (2012-08-29 14:41:33 UTC) #11
Chris Rogers
PTAL: now ready for formal review
8 years, 3 months ago (2012-09-06 01:36:45 UTC) #12
henrika (OOO until Aug 14)
Nice work Chris, one initial comment regarding the kEnableWebAudioInput flag which is notw in content. ...
8 years, 3 months ago (2012-09-06 07:13:39 UTC) #13
Ami GONE FROM CHROMIUM
(removing myself from reviewers as my previous comment was meant to be a drive-by) Chris: ...
8 years, 3 months ago (2012-09-06 07:21:10 UTC) #14
tommi (sloooow) - chröme
https://chromiumcodereview.appspot.com/10830268/diff/31001/content/public/common/content_switches.cc File content/public/common/content_switches.cc (right): https://chromiumcodereview.appspot.com/10830268/diff/31001/content/public/common/content_switches.cc#newcode233 content/public/common/content_switches.cc:233: const char kEnableWebAudioInput[] = "enable-webaudio-input"; looks like = should ...
8 years, 3 months ago (2012-09-07 09:58:18 UTC) #15
Chris Rogers
https://chromiumcodereview.appspot.com/10830268/diff/31001/content/public/common/content_switches.h File content/public/common/content_switches.h (right): https://chromiumcodereview.appspot.com/10830268/diff/31001/content/public/common/content_switches.h#newcode90 content/public/common/content_switches.h:90: CONTENT_EXPORT extern const char kEnableWebAudioInput[]; On 2012/09/07 09:58:19, tommi ...
8 years, 3 months ago (2012-09-07 20:34:01 UTC) #16
scherkus (not reviewing)
mostly nits There are two design decisions I'd like to see documented in the CL ...
8 years, 3 months ago (2012-09-10 11:46:32 UTC) #17
Chris Rogers
Andrew, thanks for taking a look. I think I've addressed your nits. I made some ...
8 years, 3 months ago (2012-09-10 19:21:38 UTC) #18
Chris Rogers
PTAL: Tommi: added tests in audio_output_device_unittest
8 years, 3 months ago (2012-09-11 03:32:54 UTC) #19
tommi (sloooow) - chröme
lgtm! Thanks for adding the test. I agree that it would be good if we ...
8 years, 3 months ago (2012-09-11 09:17:01 UTC) #20
DaleCurtis
https://chromiumcodereview.appspot.com/10830268/diff/42013/content/browser/renderer_host/media/audio_sync_reader.cc File content/browser/renderer_host/media/audio_sync_reader.cc (right): https://chromiumcodereview.appspot.com/10830268/diff/42013/content/browser/renderer_host/media/audio_sync_reader.cc#newcode113 content/browser/renderer_host/media/audio_sync_reader.cc:113: output_bus_->Zero(); This doesn't Zero everything when frames are padded; ...
8 years, 3 months ago (2012-09-11 09:44:39 UTC) #21
scherkus (not reviewing)
lgtm! http://codereview.chromium.org/10830268/diff/31014/media/base/media_switches.cc File media/base/media_switches.cc (right): http://codereview.chromium.org/10830268/diff/31014/media/base/media_switches.cc#newcode42 media/base/media_switches.cc:42: const char kEnableWebAudioInput[] = "enable-webaudio-input"; On 2012/09/10 19:21:38, ...
8 years, 3 months ago (2012-09-11 12:13:00 UTC) #22
DaleCurtis
Since we're a time zone away, LGTM assuming the AudioBus changes. http://codereview.chromium.org/10830268/diff/42013/media/audio/audio_output_controller.h File media/audio/audio_output_controller.h (right): ...
8 years, 3 months ago (2012-09-11 12:22:23 UTC) #23
jamesr
content/renderer lgtm
8 years, 3 months ago (2012-09-11 19:24:02 UTC) #24
henrika (OOO until Aug 14)
LGTM with some comments. I assume that the next step is to land the required ...
8 years, 3 months ago (2012-09-11 21:44:48 UTC) #25
piman
I only looked at content/ but LGTM there.
8 years, 3 months ago (2012-09-11 22:39:30 UTC) #26
Nico
chrome/ lgtm
8 years, 3 months ago (2012-09-12 01:55:06 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/crogers@google.com/10830268/44121
8 years, 3 months ago (2012-09-12 02:05:55 UTC) #28
commit-bot: I haz the power
8 years, 3 months ago (2012-09-12 04:37:06 UTC) #29
Change committed as 156234

Powered by Google App Engine
This is Rietveld 408576698