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

Issue 1596523005: Drop WebRTC audio data if OS has skipped frames. (Closed)

Created:
4 years, 11 months ago by Henrik Grunell
Modified:
4 years, 8 months ago
CC:
chromium-reviews, mlamouri+watch-content_chromium.org, posciak+watch_chromium.org, jam, mcasas+watch_chromium.org, feature-media-reviews_chromium.org, darin-cc_chromium.org, mkwst+moarreviews-renderer_chromium.org, o1ka, 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

Drop WebRTC audio data if OS has skipped frames. This ensures that we get what is actually played out with what we feed to the echo canceler as far-end data back in sync as quickly as possible after a skip, which in turn reduces the risk of echo. We drop data in WebRtcAudioRenderer::Render. The fifo is created (if it doesn't exist) if the number of skipped frames is not 10 ms of data. This CL also removes creating a new fifo unecessarily if only the sink's frames per buffer changes but not the source's (when they differ). BUG=560371 Committed: https://crrev.com/b4bc1f2da7414fcbc7d18d860dd7c8260dd9c891 Cr-Commit-Position: refs/heads/master@{#370686}

Patch Set 1 #

Patch Set 2 : Smaller fixes. #

Total comments: 4

Patch Set 3 : Code review, updated unit test, and one more fix. #

Total comments: 16

Patch Set 4 : Code review (peah@) + rebase. #

Total comments: 2

Patch Set 5 : Code review - cleaning up existing code a bit. #

Patch Set 6 : Code review (tommi@) #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+73 lines, -56 lines) Patch
M content/renderer/media/webrtc_audio_renderer.h View 2 chunks +2 lines, -5 lines 0 comments Download
M content/renderer/media/webrtc_audio_renderer.cc View 1 2 3 4 5 chunks +55 lines, -46 lines 2 comments Download
M media/base/audio_pull_fifo.h View 1 2 3 4 5 1 chunk +3 lines, -0 lines 0 comments Download
M media/base/audio_pull_fifo.cc View 1 2 3 4 5 1 chunk +4 lines, -0 lines 0 comments Download
M media/base/audio_pull_fifo_unittest.cc View 1 2 1 chunk +9 lines, -5 lines 0 comments Download

Messages

Total messages: 31 (11 generated)
Henrik Grunell
Tommi: content/renderer/media/* Dale: media/* Per: High level from AEC perspective. This CL replaces https://codereview.chromium.org/1528473003/ with ...
4 years, 11 months ago (2016-01-15 15:57:22 UTC) #4
Henrik Grunell
On 2016/01/15 15:57:22, Henrik Grunell wrote: > Tommi: content/renderer/media/* > Dale: media/* > Per: High ...
4 years, 11 months ago (2016-01-15 16:03:22 UTC) #5
DaleCurtis
media/ lgtm
4 years, 11 months ago (2016-01-15 18:25:26 UTC) #6
tommi (sloooow) - chröme
https://codereview.chromium.org/1596523005/diff/20001/content/renderer/media/webrtc_audio_renderer.cc File content/renderer/media/webrtc_audio_renderer.cc (right): https://codereview.chromium.org/1596523005/diff/20001/content/renderer/media/webrtc_audio_renderer.cc#newcode455 content/renderer/media/webrtc_audio_renderer.cc:455: // Pull the data we shall deliver. nit: s/shall/will ...
4 years, 11 months ago (2016-01-15 18:50:04 UTC) #7
Henrik Grunell
Per, please review too. Tommi & Per: please verify that I got the fifo delay ...
4 years, 11 months ago (2016-01-18 13:00:54 UTC) #8
peah
Hi, I have quite a lot of newbie questions. Sorry for that, but as I'm ...
4 years, 11 months ago (2016-01-19 10:13:52 UTC) #9
Henrik Grunell
Answering questions and one fix. https://codereview.chromium.org/1596523005/diff/40001/content/renderer/media/webrtc_audio_renderer.cc File content/renderer/media/webrtc_audio_renderer.cc (right): https://codereview.chromium.org/1596523005/diff/40001/content/renderer/media/webrtc_audio_renderer.cc#newcode440 content/renderer/media/webrtc_audio_renderer.cc:440: if (!audio_fifo_ && frames_skipped ...
4 years, 11 months ago (2016-01-19 13:03:41 UTC) #10
peah
https://codereview.chromium.org/1596523005/diff/40001/content/renderer/media/webrtc_audio_renderer.cc File content/renderer/media/webrtc_audio_renderer.cc (right): https://codereview.chromium.org/1596523005/diff/40001/content/renderer/media/webrtc_audio_renderer.cc#newcode440 content/renderer/media/webrtc_audio_renderer.cc:440: if (!audio_fifo_ && frames_skipped != frames_per_10ms) { On 2016/01/19 ...
4 years, 11 months ago (2016-01-20 15:16:47 UTC) #11
Henrik Grunell
https://codereview.chromium.org/1596523005/diff/40001/content/renderer/media/webrtc_audio_renderer.cc File content/renderer/media/webrtc_audio_renderer.cc (right): https://codereview.chromium.org/1596523005/diff/40001/content/renderer/media/webrtc_audio_renderer.cc#newcode440 content/renderer/media/webrtc_audio_renderer.cc:440: if (!audio_fifo_ && frames_skipped != frames_per_10ms) { On 2016/01/20 ...
4 years, 11 months ago (2016-01-21 08:55:46 UTC) #12
peah
https://codereview.chromium.org/1596523005/diff/40001/content/renderer/media/webrtc_audio_renderer.cc File content/renderer/media/webrtc_audio_renderer.cc (right): https://codereview.chromium.org/1596523005/diff/40001/content/renderer/media/webrtc_audio_renderer.cc#newcode440 content/renderer/media/webrtc_audio_renderer.cc:440: if (!audio_fifo_ && frames_skipped != frames_per_10ms) { On 2016/01/21 ...
4 years, 11 months ago (2016-01-21 09:16:25 UTC) #13
peah
After offline discussions about how the FIFO works, I'm convinced this properly compensates the AEC ...
4 years, 11 months ago (2016-01-21 11:47:18 UTC) #14
tommi (sloooow) - chröme
lgtm https://codereview.chromium.org/1596523005/diff/60001/media/base/audio_pull_fifo.cc File media/base/audio_pull_fifo.cc (right): https://codereview.chromium.org/1596523005/diff/60001/media/base/audio_pull_fifo.cc#newcode49 media/base/audio_pull_fifo.cc:49: int AudioPullFifo::SizeInFrames() { can this method be const?
4 years, 11 months ago (2016-01-21 11:51:12 UTC) #15
Henrik Grunell
I did some cleaning in the existing code since it was difficult to follow when ...
4 years, 11 months ago (2016-01-21 12:26:17 UTC) #16
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1596523005/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1596523005/100001
4 years, 11 months ago (2016-01-21 12:28:52 UTC) #18
tommi (sloooow) - chröme
lgtm
4 years, 11 months ago (2016-01-21 12:40:15 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1596523005/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1596523005/100001
4 years, 11 months ago (2016-01-21 13:00:42 UTC) #23
commit-bot: I haz the power
Committed patchset #6 (id:100001)
4 years, 11 months ago (2016-01-21 13:46:16 UTC) #25
commit-bot: I haz the power
Patchset 6 (id:??) landed as https://crrev.com/b4bc1f2da7414fcbc7d18d860dd7c8260dd9c891 Cr-Commit-Position: refs/heads/master@{#370686}
4 years, 11 months ago (2016-01-21 13:47:26 UTC) #27
o1ka
Henrik, could you take a look at my question? Thanks, Olga https://codereview.chromium.org/1596523005/diff/100001/content/renderer/media/webrtc_audio_renderer.cc File content/renderer/media/webrtc_audio_renderer.cc (right): ...
4 years, 11 months ago (2016-01-22 13:15:03 UTC) #29
Henrik Grunell
4 years, 11 months ago (2016-01-25 11:56:23 UTC) #30
Message was sent while issue was closed.
https://codereview.chromium.org/1596523005/diff/100001/content/renderer/media...
File content/renderer/media/webrtc_audio_renderer.cc (right):

https://codereview.chromium.org/1596523005/diff/100001/content/renderer/media...
content/renderer/media/webrtc_audio_renderer.cc:659: (audio_fifo_ &&
On 2016/01/22 13:15:03, o1ka wrote:
> So in certain cases an existing fifo is reset. Doesn't it mean that some
frames
> can be dropped, which will result in a glitch?
> What is the scenario when source buffer size changes?

[We talked about this offline, summarizing here.]
Yes, some data will be dropped and we'll get a glitch. It was the case before as
well, but now we only recreate the fifo when its size has actually changed. The
only case we recreate the fifo is when the source buffer size changes, which
only happens when the sample rate changes. It won't happen often, and when it
does the user will likely expect/accept audio artifacts anyway.

Powered by Google App Engine
This is Rietveld 408576698