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

Issue 11889041: Fix VirtualAudioInputStream callback timing issues. (Closed)

Created:
7 years, 11 months ago by justinlin
Modified:
7 years, 11 months ago
Reviewers:
DaleCurtis, miu
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, jam, feature-media-reviews_chromium.org
Visibility:
Public.

Description

Fix VirtualAudioInputStream callback timing issues. - While mirroring is activated, the VirtualAudioInputStream drives the audio, so we need to account for the time spent in AudioConverters as well as imprecisions from PostDelayedTask when scheduling callbacks to not slow video playback down. - Need to use microseconds for the buffer size because for 44.1kHz, we are asked to use a 440 frame buffer. BUG=168532 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=177570

Patch Set 1 #

Total comments: 4

Patch Set 2 : comments #

Total comments: 10

Patch Set 3 : Increase buffer size to 2048 #

Patch Set 4 : update comment #

Total comments: 1

Patch Set 5 : remove buffer size change #

Total comments: 2

Patch Set 6 : Use microseconds for buffer length because for some reason input params specify a 440 frame buffer … #

Total comments: 2

Patch Set 7 : nit #

Unified diffs Side-by-side diffs Delta from patch set Stats (+18 lines, -4 lines) Patch
M media/audio/virtual_audio_input_stream.h View 1 2 3 4 5 6 1 chunk +2 lines, -1 line 0 comments Download
M media/audio/virtual_audio_input_stream.cc View 1 2 3 4 5 6 3 chunks +16 lines, -3 lines 0 comments Download

Messages

Total messages: 22 (0 generated)
justinlin
7 years, 11 months ago (2013-01-15 20:31:57 UTC) #1
DaleCurtis
https://codereview.chromium.org/11889041/diff/1/content/renderer/media/audio_renderer_mixer_manager.cc File content/renderer/media/audio_renderer_mixer_manager.cc (right): https://codereview.chromium.org/11889041/diff/1/content/renderer/media/audio_renderer_mixer_manager.cc#newcode63 content/renderer/media/audio_renderer_mixer_manager.cc:63: hardware_sample_rate_, 16, 2048); You'll need to test this on ...
7 years, 11 months ago (2013-01-15 21:00:08 UTC) #2
justinlin
https://codereview.chromium.org/11889041/diff/1/content/renderer/media/audio_renderer_mixer_manager.cc File content/renderer/media/audio_renderer_mixer_manager.cc (right): https://codereview.chromium.org/11889041/diff/1/content/renderer/media/audio_renderer_mixer_manager.cc#newcode63 content/renderer/media/audio_renderer_mixer_manager.cc:63: hardware_sample_rate_, 16, 2048); On 2013/01/15 21:00:08, DaleCurtis wrote: > ...
7 years, 11 months ago (2013-01-15 22:36:21 UTC) #3
miu
https://codereview.chromium.org/11889041/diff/8001/content/renderer/media/audio_renderer_mixer_manager.cc File content/renderer/media/audio_renderer_mixer_manager.cc (right): https://codereview.chromium.org/11889041/diff/8001/content/renderer/media/audio_renderer_mixer_manager.cc#newcode56 content/renderer/media/audio_renderer_mixer_manager.cc:56: #if defined(OS_WIN) || defined(OS_MACOSX) Remove #if, since this would ...
7 years, 11 months ago (2013-01-15 23:28:35 UTC) #4
DaleCurtis
https://codereview.chromium.org/11889041/diff/8001/content/renderer/media/audio_renderer_mixer_manager.cc File content/renderer/media/audio_renderer_mixer_manager.cc (right): https://codereview.chromium.org/11889041/diff/8001/content/renderer/media/audio_renderer_mixer_manager.cc#newcode58 content/renderer/media/audio_renderer_mixer_manager.cc:58: // changes. WebRTC audio mirroring will use the input ...
7 years, 11 months ago (2013-01-15 23:30:03 UTC) #5
justinlin
https://codereview.chromium.org/11889041/diff/8001/content/renderer/media/audio_renderer_mixer_manager.cc File content/renderer/media/audio_renderer_mixer_manager.cc (right): https://codereview.chromium.org/11889041/diff/8001/content/renderer/media/audio_renderer_mixer_manager.cc#newcode56 content/renderer/media/audio_renderer_mixer_manager.cc:56: #if defined(OS_WIN) || defined(OS_MACOSX) On 2013/01/15 23:28:35, Yuri wrote: ...
7 years, 11 months ago (2013-01-15 23:52:45 UTC) #6
justinlin
Tested on Windows and Mac with some of the webm files in that xorax.sea directory ...
7 years, 11 months ago (2013-01-16 01:49:33 UTC) #7
miu
https://codereview.chromium.org/11889041/diff/8001/content/renderer/media/audio_renderer_mixer_manager.cc File content/renderer/media/audio_renderer_mixer_manager.cc (right): https://codereview.chromium.org/11889041/diff/8001/content/renderer/media/audio_renderer_mixer_manager.cc#newcode56 content/renderer/media/audio_renderer_mixer_manager.cc:56: #if defined(OS_WIN) || defined(OS_MACOSX) On 2013/01/15 23:52:45, justinlin wrote: ...
7 years, 11 months ago (2013-01-16 03:43:03 UTC) #8
DaleCurtis
Did you test with 192kHz output? I'd worry that 1024 might not work well in ...
7 years, 11 months ago (2013-01-16 19:06:04 UTC) #9
justinlin
Thanks, you're right, it didn't work well with 192kHz. We need a buffer size of ...
7 years, 11 months ago (2013-01-16 20:15:23 UTC) #10
miu
lgtm
7 years, 11 months ago (2013-01-16 21:06:30 UTC) #11
DaleCurtis
On 2013/01/16 21:06:30, Yuri wrote: > lgtm For the record what kind of latency increase ...
7 years, 11 months ago (2013-01-16 21:37:25 UTC) #12
justinlin
Hm.. these are the results I get: Macbook Pro (@44.1kHz): 11ms -> 138ms Windows Desktop ...
7 years, 11 months ago (2013-01-16 22:27:57 UTC) #13
miu
https://codereview.chromium.org/11889041/diff/19004/content/renderer/media/audio_renderer_mixer_manager.cc File content/renderer/media/audio_renderer_mixer_manager.cc (right): https://codereview.chromium.org/11889041/diff/19004/content/renderer/media/audio_renderer_mixer_manager.cc#newcode64 content/renderer/media/audio_renderer_mixer_manager.cc:64: buffer_size = std::max(hardware_buffer_size_, 2048); Why not make this a ...
7 years, 11 months ago (2013-01-16 22:56:57 UTC) #14
DaleCurtis
Hmm, that's a lot larger than I thought it would be. An alternate solution is ...
7 years, 11 months ago (2013-01-16 23:09:23 UTC) #15
justinlin
On 2013/01/16 23:09:23, DaleCurtis wrote: > Hmm, that's a lot larger than I thought it ...
7 years, 11 months ago (2013-01-16 23:26:38 UTC) #16
miu1
On Wed, Jan 16, 2013 at 11:06 AM, <dalecurtis@chromium.org> wrote: > Yuri, you can already ...
7 years, 11 months ago (2013-01-16 23:42:18 UTC) #17
DaleCurtis
Well, we've only done blocking shared memory on Windows, I don't think we'll add it ...
7 years, 11 months ago (2013-01-17 00:10:51 UTC) #18
justinlin
Sorry for the delay. Ran into another bug while verifying. For some reason videos were ...
7 years, 11 months ago (2013-01-17 22:21:05 UTC) #19
DaleCurtis
lgtm % naming nit. https://codereview.chromium.org/11889041/diff/26001/media/audio/virtual_audio_input_stream.h File media/audio/virtual_audio_input_stream.h (right): https://codereview.chromium.org/11889041/diff/26001/media/audio/virtual_audio_input_stream.h#newcode79 media/audio/virtual_audio_input_stream.h:79: base::TimeDelta buffer_duration_us_; As a time ...
7 years, 11 months ago (2013-01-17 22:34:21 UTC) #20
justinlin
https://codereview.chromium.org/11889041/diff/26001/media/audio/virtual_audio_input_stream.h File media/audio/virtual_audio_input_stream.h (right): https://codereview.chromium.org/11889041/diff/26001/media/audio/virtual_audio_input_stream.h#newcode79 media/audio/virtual_audio_input_stream.h:79: base::TimeDelta buffer_duration_us_; On 2013/01/17 22:34:21, DaleCurtis wrote: > As ...
7 years, 11 months ago (2013-01-17 22:50:15 UTC) #21
commit-bot: I haz the power
7 years, 11 months ago (2013-01-17 22:53:02 UTC) #22

Powered by Google App Engine
This is Rietveld 408576698