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

Issue 12379071: Use multiple shared memory buffers cyclically for audio capture. (Closed)

Created:
7 years, 9 months ago by wjia(left Chromium)
Modified:
7 years, 9 months ago
CC:
chromium-reviews, joi+watch-content_chromium.org, feature-media-reviews_chromium.org, jam, darin-cc_chromium.org
Visibility:
Public.

Description

Use multiple shared memory buffers cyclically for audio capture. Currently, only one buffer of shared memory (10ms) is used to transfer captured audio data from browser process to renderer process. This results in data overwriting on both desktop and mobile, since it gives renderer process only 10ms to pick up the data and renderer process will likely miss reading data in time from time to time due to various reasons, e.g., thread scheduling. This patch adds a scheme using multiple buffers of shared memory cyclically so that renderer process can have much more time to pick up the data. This can mitigate most data owerwriting cases which happen typically in burst mode. This approach does not introduce any new delay in browser process. The number of buffers is currently set to 10. It can be set to any positive number and be tuned if needed. BUG=178040 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=187393

Patch Set 1 #

Total comments: 14

Patch Set 2 : code review #

Patch Set 3 : #

Total comments: 1

Patch Set 4 : rebase #

Total comments: 2

Patch Set 5 : aggregate buffers #

Total comments: 10

Patch Set 6 : remove writing segment index to socket #

Patch Set 7 : address a missed comment #

Total comments: 28

Patch Set 8 : code review #

Patch Set 9 : code review #

Unified diffs Side-by-side diffs Delta from patch set Stats (+133 lines, -52 lines) Patch
M content/browser/renderer_host/media/audio_input_renderer_host.h View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M content/browser/renderer_host/media/audio_input_renderer_host.cc View 1 2 3 4 5 5 chunks +18 lines, -7 lines 0 comments Download
M content/browser/renderer_host/media/audio_input_sync_writer.h View 1 2 3 4 5 6 2 chunks +5 lines, -1 line 0 comments Download
M content/browser/renderer_host/media/audio_input_sync_writer.cc View 1 2 3 4 5 6 7 8 2 chunks +18 lines, -5 lines 0 comments Download
M content/common/media/audio_messages.h View 1 2 3 4 2 chunks +10 lines, -7 lines 0 comments Download
M content/renderer/media/audio_input_message_filter.h View 1 2 3 4 5 6 7 2 chunks +10 lines, -4 lines 0 comments Download
M content/renderer/media/audio_input_message_filter.cc View 1 2 3 4 5 6 7 3 chunks +7 lines, -4 lines 0 comments Download
M content/renderer/pepper/pepper_platform_audio_input_impl.h View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M content/renderer/pepper/pepper_platform_audio_input_impl.cc View 1 2 3 4 5 6 7 5 chunks +7 lines, -4 lines 0 comments Download
M media/audio/audio_device_thread.h View 1 2 3 4 5 2 chunks +4 lines, -1 line 0 comments Download
M media/audio/audio_device_thread.cc View 1 2 3 4 5 6 7 8 1 chunk +8 lines, -2 lines 0 comments Download
M media/audio/audio_input_device.h View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M media/audio/audio_input_device.cc View 1 2 3 4 5 6 7 8 9 chunks +26 lines, -9 lines 0 comments Download
M media/audio/audio_input_ipc.h View 1 2 3 4 5 6 7 2 chunks +11 lines, -4 lines 0 comments Download
M media/audio/audio_output_device.cc View 1 2 3 4 5 6 7 8 2 chunks +3 lines, -1 line 0 comments Download

Messages

Total messages: 22 (0 generated)
wjia(left Chromium)
7 years, 9 months ago (2013-03-03 18:16:56 UTC) #1
henrika (OOO until Aug 14)
Thanks Wei, I have tested the path on my Windows machine for different WebRTC clients ...
7 years, 9 months ago (2013-03-04 13:12:51 UTC) #2
DaleCurtis
Very cool! Haven't had a chance to review yet, but cc: crogers since he was ...
7 years, 9 months ago (2013-03-04 17:33:50 UTC) #3
wjia(left Chromium)
PTAL. This patch is focused on webrtc audio capture. So it doesn't change # of ...
7 years, 9 months ago (2013-03-05 02:40:13 UTC) #4
Chris Rogers
+miu As Henrik mentions, we need to be careful to not diverge too much between ...
7 years, 9 months ago (2013-03-05 04:08:15 UTC) #5
miu
It doesn't feel right that we are creating N separate shared memory mappings, and then ...
7 years, 9 months ago (2013-03-05 04:58:55 UTC) #6
henrika (OOO until Aug 14)
LGTM. Assuming you will reply to feedback from Yuri as well. Nice work Wei!
7 years, 9 months ago (2013-03-05 10:53:14 UTC) #7
Chris Rogers
On 2013/03/05 10:53:14, henrika wrote: > LGTM. Assuming you will reply to feedback from Yuri ...
7 years, 9 months ago (2013-03-05 18:23:54 UTC) #8
DaleCurtis
I don't think there's any need to send any more information across the shared memory. ...
7 years, 9 months ago (2013-03-06 01:12:51 UTC) #9
wjia(left Chromium)
I will try to address all comments in this message: C1: Do not diverge audio ...
7 years, 9 months ago (2013-03-06 05:32:22 UTC) #10
miu
https://codereview.chromium.org/12379071/diff/38001/content/browser/renderer_host/media/audio_input_renderer_host.cc File content/browser/renderer_host/media/audio_input_renderer_host.cc (right): https://codereview.chromium.org/12379071/diff/38001/content/browser/renderer_host/media/audio_input_renderer_host.cc#newcode33 content/browser/renderer_host/media/audio_input_renderer_host.cc:33: uint32 shared_memory_segment_size; I think you can get rid of ...
7 years, 9 months ago (2013-03-06 18:06:41 UTC) #11
miu
BTW--Testing?
7 years, 9 months ago (2013-03-06 18:07:17 UTC) #12
henrika (OOO until Aug 14)
Would it be possible if each reviewer states what they really feel must be solved ...
7 years, 9 months ago (2013-03-06 20:52:01 UTC) #13
Chris Rogers
On 2013/03/06 20:52:01, henrika wrote: > Would it be possible if each reviewer states what ...
7 years, 9 months ago (2013-03-06 21:13:02 UTC) #14
wjia(left Chromium)
PTAL. I did the change to remove writing segment index into socket even though I ...
7 years, 9 months ago (2013-03-06 22:12:41 UTC) #15
DaleCurtis
nothing but nits. https://codereview.chromium.org/12379071/diff/41004/content/browser/renderer_host/media/audio_input_sync_writer.cc File content/browser/renderer_host/media/audio_input_sync_writer.cc (right): https://codereview.chromium.org/12379071/diff/41004/content/browser/renderer_host/media/audio_input_sync_writer.cc#newcode20 content/browser/renderer_host/media/audio_input_sync_writer.cc:20: DCHECK_LT(0, shared_memory_segment_count); No yoda checks please; ...
7 years, 9 months ago (2013-03-07 02:04:37 UTC) #16
wjia(left Chromium)
PTAL. Regarding parameter order in CHECK, I'd like to have clarification since I'v got conflicted ...
7 years, 9 months ago (2013-03-10 18:19:49 UTC) #17
DaleCurtis
https://codereview.chromium.org/12379071/diff/41004/content/browser/renderer_host/media/audio_input_sync_writer.cc File content/browser/renderer_host/media/audio_input_sync_writer.cc (right): https://codereview.chromium.org/12379071/diff/41004/content/browser/renderer_host/media/audio_input_sync_writer.cc#newcode20 content/browser/renderer_host/media/audio_input_sync_writer.cc:20: DCHECK_LT(0, shared_memory_segment_count); On 2013/03/10 18:19:49, wjia wrote: > On ...
7 years, 9 months ago (2013-03-11 20:00:47 UTC) #18
wjia(left Chromium)
PTAL. I leave pepper file untouched in order to favor consistency there. https://codereview.chromium.org/12379071/diff/41004/content/browser/renderer_host/media/audio_input_sync_writer.cc File content/browser/renderer_host/media/audio_input_sync_writer.cc ...
7 years, 9 months ago (2013-03-11 20:34:27 UTC) #19
DaleCurtis
lgtm
7 years, 9 months ago (2013-03-11 21:03:33 UTC) #20
yzshen1
On 2013/03/11 21:03:33, DaleCurtis wrote: > lgtm file:.*pepper.* LGTM
7 years, 9 months ago (2013-03-11 22:14:44 UTC) #21
wjia(left Chromium)
7 years, 9 months ago (2013-03-11 22:41:21 UTC) #22
Message was sent while issue was closed.
Committed patchset #9 manually as r187393.

Powered by Google App Engine
This is Rietveld 408576698