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

Issue 10823100: Adds support for multi-channel output audio for the low-latency path in Windows. (Closed)

Created:
8 years, 4 months ago by henrika (OOO until Aug 14)
Modified:
8 years, 4 months ago
CC:
chromium-reviews, feature-media-reviews_chromium.org, DaleCurtis
Visibility:
Public.

Description

Adds support for multi-channel output audio for the low-latency path in Windows. What's new? ======== Output stream is always opened up using the native number of channels and channel configuration. The user can set a lower number of channels during construction and for this case up-mixing (typically 2 -> 7.1) takes place since the audio source does not deliver sufficient number of channels for this case. It is still possible to avoid up-mixing simply by creating up the stream using the native channel count (which can be queried before construction). TODO ==== - Clean up ChannelUpMix(). - Add support for 8-bit and 24-bit audio? - Add support for 2 -> 1 down-mixing? - More mixing combinations? - Add accessors for ChannelCount/Layout. - Improve usage of channel_factor to detect mixing mode. BUG=138762 TEST=media_unittests --gtest_filter=WASAPIAudioOutput* Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=150307

Patch Set 1 #

Total comments: 52

Patch Set 2 : First review round #

Total comments: 14

Patch Set 3 : More changes proposed by Andrew #

Patch Set 4 : Added more mixing cases and improved the tests #

Total comments: 21

Patch Set 5 : Added test files and 2 -> 5.1 up-mixing #

Patch Set 6 : Fixed nit #

Total comments: 2

Patch Set 7 : Fixed bug in GetMixFormat #

Total comments: 2

Patch Set 8 : Added TODO(henrika) #

Patch Set 9 : Rebased #

Unified diffs Side-by-side diffs Delta from patch set Stats (+620 lines, -145 lines) Patch
M media/audio/win/audio_low_latency_input_win.h View 1 chunk +1 line, -1 line 0 comments Download
M media/audio/win/audio_low_latency_output_win.h View 1 2 3 4 5 6 7 8 chunks +53 lines, -7 lines 0 comments Download
M media/audio/win/audio_low_latency_output_win.cc View 1 2 3 4 5 6 22 chunks +455 lines, -108 lines 0 comments Download
M media/audio/win/audio_low_latency_output_win_unittest.cc View 1 2 3 4 20 chunks +113 lines, -31 lines 0 comments Download
A media/test/data/speech_16b_mono_44kHz.raw View 1 2 3 4 0 chunks +-1 lines, --1 lines 0 comments Download
A media/test/data/speech_16b_mono_48kHz.raw View 1 2 3 4 0 chunks +-1 lines, --1 lines 0 comments Download

Messages

Total messages: 24 (0 generated)
henrika (OOO until Aug 14)
Initial (rough) version intended as base for discussions on how to proceed. Will add client ...
8 years, 4 months ago (2012-07-31 15:22:02 UTC) #1
Chris Rogers
Looks like a great start!
8 years, 4 months ago (2012-07-31 17:22:26 UTC) #2
henrika (OOO until Aug 14)
For the record. The new design does *not* cover the following cases (yet): 1) Client ...
8 years, 4 months ago (2012-07-31 21:03:17 UTC) #3
Chris Rogers
On 2012/07/31 21:03:17, henrika wrote: > For the record. The new design does *not* cover ...
8 years, 4 months ago (2012-07-31 21:21:04 UTC) #4
tommi (sloooow) - chröme
Excellent start indeed. Some suggestions below. https://chromiumcodereview.appspot.com/10823100/diff/1/media/audio/win/audio_low_latency_output_win.cc File media/audio/win/audio_low_latency_output_win.cc (right): https://chromiumcodereview.appspot.com/10823100/diff/1/media/audio/win/audio_low_latency_output_win.cc#newcode24 media/audio/win/audio_low_latency_output_win.cc:24: bool ChannelUpMix(void* input, ...
8 years, 4 months ago (2012-07-31 21:39:30 UTC) #5
scherkus (not reviewing)
few quick nits -- I'll take a deeper look tomorrow https://chromiumcodereview.appspot.com/10823100/diff/1/media/audio/win/audio_low_latency_output_win.cc File media/audio/win/audio_low_latency_output_win.cc (right): https://chromiumcodereview.appspot.com/10823100/diff/1/media/audio/win/audio_low_latency_output_win.cc#newcode75 ...
8 years, 4 months ago (2012-08-01 00:14:05 UTC) #6
henrika (OOO until Aug 14)
On 2012/07/31 21:21:04, Chris Rogers wrote: > Having thought about this a little bit, Dale ...
8 years, 4 months ago (2012-08-01 12:18:23 UTC) #7
tommi (sloooow) - chröme
Maybe instead of keeping the buffer in a vector of float*, we could have a ...
8 years, 4 months ago (2012-08-01 12:46:04 UTC) #8
henrika (OOO until Aug 14)
Thanks Andrew and Tommi. tommi: I think that you and I need to discuss reinterpret_cast<WAVEFORMATEX*>(&format_). ...
8 years, 4 months ago (2012-08-01 16:11:09 UTC) #9
scherkus (not reviewing)
few more nits http://codereview.chromium.org/10823100/diff/1/media/audio/win/audio_low_latency_output_win.h File media/audio/win/audio_low_latency_output_win.h (right): http://codereview.chromium.org/10823100/diff/1/media/audio/win/audio_low_latency_output_win.h#newcode252 media/audio/win/audio_low_latency_output_win.h:252: static HRESULT GetMixFormat(ERole device_role, WAVEFORMATEX** device_format); ...
8 years, 4 months ago (2012-08-02 00:41:57 UTC) #10
henrika (OOO until Aug 14)
Fixed all comments from Andrew. http://codereview.chromium.org/10823100/diff/8002/media/audio/win/audio_low_latency_output_win.cc File media/audio/win/audio_low_latency_output_win.cc (right): http://codereview.chromium.org/10823100/diff/8002/media/audio/win/audio_low_latency_output_win.cc#newcode51 media/audio/win/audio_low_latency_output_win.cc:51: HRESULT GetMixFormat(ERole device_role, WAVEFORMATEX** ...
8 years, 4 months ago (2012-08-02 09:01:16 UTC) #11
henrika (OOO until Aug 14)
Added support for 1->2 and 1->7.1 channel up-mixing. Added new test for playing out mono ...
8 years, 4 months ago (2012-08-02 15:27:50 UTC) #12
scherkus (not reviewing)
http://codereview.chromium.org/10823100/diff/1009/media/audio/win/audio_low_latency_output_win.cc File media/audio/win/audio_low_latency_output_win.cc (right): http://codereview.chromium.org/10823100/diff/1009/media/audio/win/audio_low_latency_output_win.cc#newcode77 media/audio/win/audio_low_latency_output_win.cc:77: HRESULT hr = CoCreateInstance(__uuidof(MMDeviceEnumerator), remove extra space between = ...
8 years, 4 months ago (2012-08-02 17:14:14 UTC) #13
tommi (sloooow) - chröme
Hey Henrik, please go ahead with the cl once other reviewers are happy. I won't ...
8 years, 4 months ago (2012-08-02 18:59:02 UTC) #14
cpu_(ooo_6.6-7.5)
Turns out this CL was pretty much needed for m21. We have a bit of ...
8 years, 4 months ago (2012-08-03 04:09:05 UTC) #15
tommi (sloooow) - chröme
rubberstamp lgtm.
8 years, 4 months ago (2012-08-03 09:44:27 UTC) #16
henrika (OOO until Aug 14)
Did my best to fix the most critical things before I go on vacation. I ...
8 years, 4 months ago (2012-08-03 14:55:56 UTC) #17
henrika (OOO until Aug 14)
http://codereview.chromium.org/10823100/diff/1009/media/audio/win/audio_low_latency_output_win.cc File media/audio/win/audio_low_latency_output_win.cc (right): http://codereview.chromium.org/10823100/diff/1009/media/audio/win/audio_low_latency_output_win.cc#newcode210 media/audio/win/audio_low_latency_output_win.cc:210: static int ChannelUpMix(void* input, More on the 8-bit case. ...
8 years, 4 months ago (2012-08-03 15:18:33 UTC) #18
henrika (OOO until Aug 14)
I think I know what can be causing the failing tests on the bots. See ...
8 years, 4 months ago (2012-08-03 19:56:29 UTC) #19
scherkus (not reviewing)
LGTM w/ one Q. let's get this in and iterate further http://codereview.chromium.org/10823100/diff/14008/media/audio/win/audio_low_latency_output_win.h File media/audio/win/audio_low_latency_output_win.h (right): ...
8 years, 4 months ago (2012-08-03 21:20:55 UTC) #20
scherkus (not reviewing)
also don't forget to update your CL description w/ the TODOs :)
8 years, 4 months ago (2012-08-03 21:21:17 UTC) #21
henrika (OOO until Aug 14)
Thanks Andrew. Added reply to your question, updated the description and added a TOOD(henrika) in ...
8 years, 4 months ago (2012-08-04 16:42:23 UTC) #22
scherkus (not reviewing)
I can't download + apply the .wav files -- you'll either: 1) email them to ...
8 years, 4 months ago (2012-08-06 19:15:11 UTC) #23
commit-bot: I haz the power
8 years, 4 months ago (2012-08-06 20:42:26 UTC) #24

Powered by Google App Engine
This is Rietveld 408576698