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

Issue 10918098: Introduce AudioOutputResampler for browser side resampling. (Closed)

Created:
8 years, 3 months ago by DaleCurtis
Modified:
8 years, 3 months ago
CC:
chromium-reviews, feature-media-reviews_chromium.org
Base URL:
http://git.chromium.org/chromium/src.git@master
Visibility:
Public.

Description

As titled! AudioOutputResampler is a single stream output resampler which uses the existing AudioOutputDispatcherImpl to handle the heavy lifting. It intercepts the AudioSourceCallback provided during OpenStream() and replaces it with a call to itself. An AudioFifo object is used to ensure we interface with the renderer and downstream components using the same buffer size they were configured with. A MultiChannelResampler object interfaces with a provided callback method which pulls data from the AudioFifo if available and otherwise retrieves more data from the client (using the buffer size the client expects). The pending bytes value is scaled according to the input / output sample rate and bits per channel values. Outstanding data is tracked between OnMoreData() calls in order to provide the client with an accurate delay estimate. Feature is behind the "--enable-audio-output-resampler" for a/b testing. Will be removed from behind the flag after tuning and functionality can be verified by the Pepper Flash team. BUG=147572 TEST=PepperFlash + 192kHz->44kHz, 48kHz->44kHz, 44kHz->96kHz. Manual testing by various parties. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=155968

Patch Set 1 : First draft! #

Total comments: 31

Patch Set 2 : Comments & Flags! #

Patch Set 3 : Unittests! Bugs! #

Total comments: 29

Patch Set 4 : Comments. #

Total comments: 14

Patch Set 5 : Comments! #

Patch Set 6 : Rebase. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+638 lines, -151 lines) Patch
M content/browser/renderer_host/render_process_host_impl.cc View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M content/renderer/pepper/pepper_platform_audio_output_impl.cc View 1 2 3 4 3 chunks +13 lines, -5 lines 0 comments Download
M media/audio/audio_manager_base.h View 1 1 chunk +9 lines, -0 lines 0 comments Download
M media/audio/audio_manager_base.cc View 1 2 3 3 chunks +42 lines, -14 lines 0 comments Download
M media/audio/audio_output_proxy_unittest.cc View 1 2 3 12 chunks +195 lines, -129 lines 0 comments Download
A media/audio/audio_output_resampler.h View 1 2 3 4 1 chunk +112 lines, -0 lines 0 comments Download
A media/audio/audio_output_resampler.cc View 1 2 3 4 5 1 chunk +196 lines, -0 lines 0 comments Download
M media/base/media_switches.h View 1 1 chunk +2 lines, -0 lines 0 comments Download
M media/base/media_switches.cc View 1 1 chunk +3 lines, -0 lines 0 comments Download
M media/base/multi_channel_resampler.h View 1 1 chunk +3 lines, -0 lines 0 comments Download
M media/base/multi_channel_resampler.cc View 1 chunk +6 lines, -0 lines 0 comments Download
M media/base/multi_channel_resampler_unittest.cc View 1 3 chunks +9 lines, -1 line 0 comments Download
M media/base/sinc_resampler.h View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M media/base/sinc_resampler.cc View 1 chunk +6 lines, -0 lines 0 comments Download
M media/base/sinc_resampler_unittest.cc View 1 2 chunks +36 lines, -2 lines 0 comments Download
M media/media.gyp View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 26 (0 generated)
DaleCurtis
PTAL and provide early feedback (don't worry about nits for now). Works locally on my ...
8 years, 3 months ago (2012-09-06 16:27:45 UTC) #1
Chris Rogers
Thanks Dale, I can see you're hacking into the AudioFifo directly instead of using the ...
8 years, 3 months ago (2012-09-06 19:18:25 UTC) #2
henrika (OOO until Aug 14)
I am sure Dale can add usage of the AudioPullFifo tomorrow. On Thu, Sep 6, ...
8 years, 3 months ago (2012-09-06 19:47:35 UTC) #3
DaleCurtis
I figured out how to enable PepperFlash on my Mac and resampling / buffer rate ...
8 years, 3 months ago (2012-09-07 13:06:37 UTC) #4
scherkus (not reviewing)
looking good so far -- haven't done a deep inspection of the actual output resampler ...
8 years, 3 months ago (2012-09-07 13:30:16 UTC) #5
henrika (OOO until Aug 14)
Nice work Dale. My plan was to wait for complete CL (with AudioPullFifo) and try ...
8 years, 3 months ago (2012-09-07 14:08:10 UTC) #6
DaleCurtis
Will address nits later. Just comments for now. http://codereview.chromium.org/10918098/diff/2001/media/audio/audio_manager_base.cc File media/audio/audio_manager_base.cc (right): http://codereview.chromium.org/10918098/diff/2001/media/audio/audio_manager_base.cc#newcode165 media/audio/audio_manager_base.cc:165: //dispatcher ...
8 years, 3 months ago (2012-09-07 14:17:35 UTC) #7
DaleCurtis
PTAL. Working out a quick unittest using the existing AudioOutputProxy settings now. https://chromiumcodereview.appspot.com/10918098/diff/2001/media/audio/audio_manager_base.cc File media/audio/audio_manager_base.cc ...
8 years, 3 months ago (2012-09-10 12:06:24 UTC) #8
henrika (OOO until Aug 14)
Some trivial high-level comments. Have not dived in to the details yet. Rather heavy stuff. ...
8 years, 3 months ago (2012-09-10 12:41:16 UTC) #9
scherkus (not reviewing)
https://chromiumcodereview.appspot.com/10918098/diff/9009/content/renderer/pepper/pepper_platform_audio_output_impl.cc File content/renderer/pepper/pepper_platform_audio_output_impl.cc (right): https://chromiumcodereview.appspot.com/10918098/diff/9009/content/renderer/pepper/pepper_platform_audio_output_impl.cc#newcode126 content/renderer/pepper/pepper_platform_audio_output_impl.cc:126: // TODO(dalecurtis): Limit to windows and 2ch linux/mac only ...
8 years, 3 months ago (2012-09-10 12:47:46 UTC) #10
henrika (OOO until Aug 14)
Dale, would it be possible to add some sort of diagram of the relationship between ...
8 years, 3 months ago (2012-09-10 13:23:56 UTC) #11
DaleCurtis
https://chromiumcodereview.appspot.com/10918098/diff/9009/content/renderer/pepper/pepper_platform_audio_output_impl.cc File content/renderer/pepper/pepper_platform_audio_output_impl.cc (right): https://chromiumcodereview.appspot.com/10918098/diff/9009/content/renderer/pepper/pepper_platform_audio_output_impl.cc#newcode126 content/renderer/pepper/pepper_platform_audio_output_impl.cc:126: // TODO(dalecurtis): Limit to windows and 2ch linux/mac only ...
8 years, 3 months ago (2012-09-10 14:05:51 UTC) #12
scherkus (not reviewing)
https://chromiumcodereview.appspot.com/10918098/diff/4008/content/renderer/pepper/pepper_platform_audio_output_impl.cc File content/renderer/pepper/pepper_platform_audio_output_impl.cc (right): https://chromiumcodereview.appspot.com/10918098/diff/4008/content/renderer/pepper/pepper_platform_audio_output_impl.cc#newcode128 content/renderer/pepper/pepper_platform_audio_output_impl.cc:128: // Rely on AudioOutputResampler to handle any inconsistenties between ...
8 years, 3 months ago (2012-09-10 14:25:32 UTC) #13
scherkus (not reviewing)
https://chromiumcodereview.appspot.com/10918098/diff/4008/content/renderer/pepper/pepper_platform_audio_output_impl.cc File content/renderer/pepper/pepper_platform_audio_output_impl.cc (right): https://chromiumcodereview.appspot.com/10918098/diff/4008/content/renderer/pepper/pepper_platform_audio_output_impl.cc#newcode127 content/renderer/pepper/pepper_platform_audio_output_impl.cc:127: if (cmd_line->HasSwitch(switches::kEnableAudioOutputResampler)) { Doesn't this switch need to be ...
8 years, 3 months ago (2012-09-10 14:34:11 UTC) #14
DaleCurtis
https://chromiumcodereview.appspot.com/10918098/diff/4008/content/renderer/pepper/pepper_platform_audio_output_impl.cc File content/renderer/pepper/pepper_platform_audio_output_impl.cc (right): https://chromiumcodereview.appspot.com/10918098/diff/4008/content/renderer/pepper/pepper_platform_audio_output_impl.cc#newcode127 content/renderer/pepper/pepper_platform_audio_output_impl.cc:127: if (cmd_line->HasSwitch(switches::kEnableAudioOutputResampler)) { On 2012/09/10 14:34:11, scherkus wrote: > ...
8 years, 3 months ago (2012-09-10 14:53:51 UTC) #15
scherkus (not reviewing)
LGTM
8 years, 3 months ago (2012-09-10 15:29:13 UTC) #16
scherkus (not reviewing)
(I tested this both w/ FIFO only and w/ FIFO+Resampler on a variety of clips ...
8 years, 3 months ago (2012-09-10 15:29:47 UTC) #17
DaleCurtis
Rebased against landed AudioPullFifo. +brettw for content/* and general PPAPI comments.
8 years, 3 months ago (2012-09-10 17:09:10 UTC) #18
brettw
lgtm
8 years, 3 months ago (2012-09-10 23:47:57 UTC) #19
henrika (OOO until Aug 14)
LGTM. I will do more tests on Windows today and get back with feedback in ...
8 years, 3 months ago (2012-09-11 07:06:51 UTC) #20
Nico
(fyi, the title doesn't end up in the commit message, so the commit message for ...
8 years, 3 months ago (2012-09-11 08:27:46 UTC) #21
viettrungluu
LGTM (at least the change to pepper_platform_audio_output_impl.cc). My only concern is that if, for some ...
8 years, 3 months ago (2012-09-11 21:25:33 UTC) #22
henrika (OOO until Aug 14)
The !=2 channel case should be solved by now. I did tests with a 7.1 ...
8 years, 3 months ago (2012-09-11 21:48:27 UTC) #23
brettw
On Tue, Sep 11, 2012 at 2:47 PM, Henrik Andreasson <henrika@chromium.org> wrote: > The !=2 ...
8 years, 3 months ago (2012-09-11 21:50:16 UTC) #24
henrika (OOO until Aug 14)
I can check tomorrow and come back with more details. I know that Dale is ...
8 years, 3 months ago (2012-09-11 21:52:55 UTC) #25
DaleCurtis
8 years, 3 months ago (2012-09-12 15:06:11 UTC) #26
On 2012/09/11 21:52:55, henrika wrote:
> I can check tomorrow and come back with more details. I know that Dale is
> working on a fall-back patch as well. He might have more information.
> 
> 
> On Tue, Sep 11, 2012 at 11:50 PM, Brett Wilson <mailto:brettw@chromium.org>
wrote:
> 
> > On Tue, Sep 11, 2012 at 2:47 PM, Henrik Andreasson
<mailto:henrika@chromium.org>
> > wrote:
> > > The !=2 channel case should be solved by now. I did tests with a 7.1
> > headset
> > > today.
> > > However, we will most likely fail if the user selects 24-bit mode.
> >
> > Okay, thanks. We'll need to fix this (or be able to fall back on
> > wavout) before we can enable this by default.
> >
> > Bre
> >

Automatic Fallback is in the CQ now: http://codereview.chromium.org/10909151/ .

Powered by Google App Engine
This is Rietveld 408576698