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

Issue 12049070: Avoids irregular OnMoreData callbacks on Windows using Core Audio (Closed)

Created:
7 years, 11 months ago by henrika (OOO until Aug 14)
Modified:
7 years, 10 months ago
CC:
chromium-reviews, feature-media-reviews_chromium.org, dwkang1
Visibility:
Public.

Description

Avoids irregular OnMoreData callbacks on Windows using Core Audio. Browser changes: - Improves how native audio buffer sizes are derived on Windows. - Forces user to always open up at native audio paramters. - Improved internal scheme to set up the actial endpoint buffer based on input size. - Refactored WSAPI output implementation and introduced CoreAudioUtil methods. - Harmonized WSAPI output implementation with exusting unified implementation (to prepare for future merge). - Changed GetAudioHardwareBufferSize() in audio_util. Render changes for WebRTC: - WebRTC now always asks for an output stream using native parameters to avoid rebuffering in the audio converter. - Any buffer-size mismatch is now taken care of in WebRtcAudioRendrer using a pull FIFO. Delay estimates are also compensated if FIFO is used. - Added DCHECKs to verify that methods are called on the expected threads. BUG=170498 TEST=media_unittests, content_unittests, HTML5 audio tests in Chrome, WebAudio and Flash tests in Chrome, WebRTC tests in Chrome. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=180936

Patch Set 1 #

Patch Set 2 : Added support for exclusive mode #

Patch Set 3 : Improved buffer handling #

Patch Set 4 : cleaned up #

Total comments: 49

Patch Set 5 : Changes based on review #

Patch Set 6 : Moved FillRenderEndpointBufferWithSilence to CoreAudioUtil #

Total comments: 12

Patch Set 7 : Changed proposed by Tommi #

Total comments: 1

Patch Set 8 : Fixed audio glitch at startup #

Total comments: 10

Patch Set 9 : nit #

Patch Set 10 : Non trivial rebase #

Total comments: 8

Patch Set 11 : Improved buffer handling #

Patch Set 12 : Improved delay handling based on tests on Mac #

Patch Set 13 : More delay fixes in the WebRTC client #

Patch Set 14 : Reverted more complex GetPreferredAudioParameters #

Patch Set 15 : nit #

Patch Set 16 : #

Patch Set 17 : #

Patch Set 18 : #

Patch Set 19 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+3 lines, -1 line) Patch
M gpu/command_buffer/service/gl_utils.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +0 lines, -1 line 0 comments Download
M ui/gl/gl_bindings.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

Messages

Total messages: 21 (0 generated)
henrika (OOO until Aug 14)
Dale, please take a look.
7 years, 10 months ago (2013-01-30 15:08:41 UTC) #1
DaleCurtis
+tommi for more eyes on the windows and webrtc specific bits. https://codereview.chromium.org/12049070/diff/7001/content/renderer/media/webrtc_audio_renderer.cc File content/renderer/media/webrtc_audio_renderer.cc (right): ...
7 years, 10 months ago (2013-01-31 02:34:33 UTC) #2
tommi (sloooow) - chröme
https://codereview.chromium.org/12049070/diff/7001/content/renderer/media/webrtc_audio_device_unittest.cc File content/renderer/media/webrtc_audio_device_unittest.cc (right): https://codereview.chromium.org/12049070/diff/7001/content/renderer/media/webrtc_audio_device_unittest.cc#newcode101 content/renderer/media/webrtc_audio_device_unittest.cc:101: int valid_input_rates[] = {16000, 32000, 44100, 48000, 96000}; nit: ...
7 years, 10 months ago (2013-01-31 13:42:08 UTC) #3
henrika (OOO until Aug 14)
Thanks! Done all changes as requested. PTAL. https://codereview.chromium.org/12049070/diff/7001/content/renderer/media/webrtc_audio_device_unittest.cc File content/renderer/media/webrtc_audio_device_unittest.cc (right): https://codereview.chromium.org/12049070/diff/7001/content/renderer/media/webrtc_audio_device_unittest.cc#newcode101 content/renderer/media/webrtc_audio_device_unittest.cc:101: int valid_input_rates[] ...
7 years, 10 months ago (2013-01-31 14:29:37 UTC) #4
henrika (OOO until Aug 14)
Sorry, forgot to move one more method to the util as Dale requested. Coming up...
7 years, 10 months ago (2013-01-31 14:30:31 UTC) #5
henrika (OOO until Aug 14)
Again, PTAL.
7 years, 10 months ago (2013-01-31 15:48:51 UTC) #6
tommi (sloooow) - chröme
https://codereview.chromium.org/12049070/diff/11003/media/audio/win/audio_low_latency_output_win.cc File media/audio/win/audio_low_latency_output_win.cc (right): https://codereview.chromium.org/12049070/diff/11003/media/audio/win/audio_low_latency_output_win.cc#newcode104 media/audio/win/audio_low_latency_output_win.cc:104: eRender, eConsole, &format)) ? strange indentation since eRender is ...
7 years, 10 months ago (2013-01-31 16:18:24 UTC) #7
henrika (OOO until Aug 14)
Thanks Tommi. Fixed. Also added a new unit test for CoreAudioUtil::FillRenderEndpointBufferWithSilence. Will do more tests ...
7 years, 10 months ago (2013-02-01 10:55:56 UTC) #8
henrika (OOO until Aug 14)
https://codereview.chromium.org/12049070/diff/9006/media/audio/win/audio_unified_win.cc File media/audio/win/audio_unified_win.cc (right): https://codereview.chromium.org/12049070/diff/9006/media/audio/win/audio_unified_win.cc#newcode336 media/audio/win/audio_unified_win.cc:336: DVLOG(1) << "SetVolume(volume=" << volume << ")"; I noticed ...
7 years, 10 months ago (2013-02-01 10:58:43 UTC) #9
tommi (sloooow) - chröme
lgtm with the below fixed. https://codereview.chromium.org/12049070/diff/9007/media/audio/win/audio_unified_win.cc File media/audio/win/audio_unified_win.cc (right): https://codereview.chromium.org/12049070/diff/9007/media/audio/win/audio_unified_win.cc#newcode337 media/audio/win/audio_unified_win.cc:337: float volume_float = static_cast<float>(volume); ...
7 years, 10 months ago (2013-02-01 11:57:53 UTC) #10
henrika (OOO until Aug 14)
Done. Will add some more (minor) changes which are only related to a flag which ...
7 years, 10 months ago (2013-02-01 12:23:52 UTC) #11
henrika (OOO until Aug 14)
Dale: PTAL. I decided to skip adding support for GetUserBufferSize() since it mess up the ...
7 years, 10 months ago (2013-02-01 15:03:51 UTC) #12
DaleCurtis
lgtm https://codereview.chromium.org/12049070/diff/26001/content/renderer/media/webrtc_audio_renderer.cc File content/renderer/media/webrtc_audio_renderer.cc (right): https://codereview.chromium.org/12049070/diff/26001/content/renderer/media/webrtc_audio_renderer.cc#newcode314 content/renderer/media/webrtc_audio_renderer.cc:314: if (state_ != PLAYING) you may want to ...
7 years, 10 months ago (2013-02-02 00:19:51 UTC) #13
henrika (OOO until Aug 14)
Comments only. https://codereview.chromium.org/12049070/diff/26001/content/renderer/media/webrtc_audio_renderer.cc File content/renderer/media/webrtc_audio_renderer.cc (right): https://codereview.chromium.org/12049070/diff/26001/content/renderer/media/webrtc_audio_renderer.cc#newcode314 content/renderer/media/webrtc_audio_renderer.cc:314: if (state_ != PLAYING) Thanks. https://codereview.chromium.org/12049070/diff/26001/media/audio/audio_util.cc File ...
7 years, 10 months ago (2013-02-04 08:25:38 UTC) #14
henrika (OOO until Aug 14)
Dale, I have now added one extra step in CoreAudioUtil::GetPreferredAudioParameters() to ensure that we will ...
7 years, 10 months ago (2013-02-04 12:18:26 UTC) #15
DaleCurtis
Are there any performance impacts for initializing a device on every GetAudioHardwareBufferSize() call? Currently we're ...
7 years, 10 months ago (2013-02-04 19:18:02 UTC) #16
henrika (OOO until Aug 14)
Repeated a simple test 1000 timed which calls GetAudioHardwareBufferSize() two times. Without init => ~27 ...
7 years, 10 months ago (2013-02-05 08:27:29 UTC) #17
tommi (sloooow) - chröme
Is GetAudioHardwareBufferSize always called on a known, same, thread? If so then it would be ...
7 years, 10 months ago (2013-02-05 10:27:54 UTC) #18
henrika (OOO until Aug 14)
It can also be called on the IO thread in void RenderMessageFilter::OnGetAudioHardwareConfig(). Good point. I ...
7 years, 10 months ago (2013-02-05 10:41:24 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/henrika@chromium.org/12049070/53006
7 years, 10 months ago (2013-02-05 14:16:16 UTC) #20
commit-bot: I haz the power
7 years, 10 months ago (2013-02-05 17:09:52 UTC) #21
Retried try job too often on win_rel for step(s) sync_integration_tests
http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_rel&nu...

Powered by Google App Engine
This is Rietveld 408576698