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

Issue 23296008: Adding audio unit tests for Android (Closed)

Created:
7 years, 4 months ago by henrika (OOO until Aug 14)
Modified:
7 years, 3 months ago
CC:
chromium-reviews, feature-media-reviews_chromium.org, Raymond Toy
Base URL:
http://git.chromium.org/chromium/src.git@master
Visibility:
Public.

Description

Adding audio unit tests for Android. This CL adds support for a new set of audio unit tests intended for Android. Some of them are suitable for trybots but some are mainly intended for offline benchmarks/testing on different devices. The idea is that we shall use these tests to check if a certain device has potential of providing low-latency, high-quality audio in full duplex or not. BUG=none TEST=media_unittests Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=222779

Patch Set 1 : First round #

Total comments: 44

Patch Set 2 : tommi@-#1 #

Total comments: 4

Patch Set 3 : @wjia #1 #

Patch Set 4 : Fixed test error #

Patch Set 5 : Now supports Start,Stop,Start #

Total comments: 14

Patch Set 6 : Feedback from tommi@ #

Total comments: 8

Patch Set 7 : nits #

Total comments: 3

Patch Set 8 : now thread safe #

Patch Set 9 : First attempt to make output side thread safe as well #

Patch Set 10 : rebased #

Total comments: 11

Patch Set 11 : tommi@ #

Patch Set 12 : rebased again #

Patch Set 13 : OVERRIDE #

Patch Set 14 : fixed includes #

Total comments: 27

Patch Set 15 : Removed Start/Stop support #

Patch Set 16 : dalecurtis@ #

Total comments: 18

Patch Set 17 : wjia@ #

Total comments: 2

Patch Set 18 : Now uses gmock #

Total comments: 20

Patch Set 19 : joi@ #

Total comments: 4

Patch Set 20 : rebased #

Patch Set 21 : reverted change in Windows unit test #

Patch Set 22 : Nit #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1090 lines, -189 lines) Patch
A media/audio/android/audio_android_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +769 lines, -0 lines 0 comments Download
M media/audio/android/audio_manager_android.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 5 chunks +12 lines, -5 lines 0 comments Download
M media/audio/android/opensles_input.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 4 chunks +19 lines, -5 lines 0 comments Download
M media/audio/android/opensles_input.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 10 chunks +115 lines, -82 lines 0 comments Download
M media/audio/android/opensles_output.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 6 chunks +25 lines, -6 lines 0 comments Download
M media/audio/android/opensles_output.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 9 chunks +149 lines, -91 lines 0 comments Download
M media/media.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 54 (0 generated)
henrika (OOO until Aug 14)
This CL is very large but the main part is in the actual unit test ...
7 years, 3 months ago (2013-08-28 11:08:01 UTC) #1
wjia(left Chromium)
Thanks for fixing the racing condition! opensl output also has racing condition. I'd suggest you ...
7 years, 3 months ago (2013-08-28 22:23:16 UTC) #2
tommi (sloooow) - chröme
https://codereview.chromium.org/23296008/diff/28001/media/audio/android/opensles_input.cc File media/audio/android/opensles_input.cc (right): https://codereview.chromium.org/23296008/diff/28001/media/audio/android/opensles_input.cc#newcode52 media/audio/android/opensles_input.cc:52: DCHECK(thread_checker_.CalledOnValidThread()); nice to have the thread checker in here. ...
7 years, 3 months ago (2013-08-29 09:56:27 UTC) #3
henrika (OOO until Aug 14)
Wei, it feels more efficient to use this CL as base since I can then ...
7 years, 3 months ago (2013-08-29 11:59:07 UTC) #4
henrika (OOO until Aug 14)
Wei, thanks for checking the unit tests. I did not expect you to do that ...
7 years, 3 months ago (2013-08-29 14:13:58 UTC) #5
wjia(left Chromium)
https://codereview.chromium.org/23296008/diff/39001/media/audio/android/opensles_input.cc File media/audio/android/opensles_input.cc (right): https://codereview.chromium.org/23296008/diff/39001/media/audio/android/opensles_input.cc#newcode84 media/audio/android/opensles_input.cc:84: if (started_) No need to guard this check since ...
7 years, 3 months ago (2013-08-29 14:21:54 UTC) #6
henrika (OOO until Aug 14)
Wei, as a general reply to your comments: Do you know why we check start_ ...
7 years, 3 months ago (2013-08-29 16:04:00 UTC) #7
wjia(left Chromium)
On 2013/08/29 16:04:00, henrika wrote: > Wei, > > as a general reply to your ...
7 years, 3 months ago (2013-08-29 17:17:10 UTC) #8
tommi (sloooow) - chröme
Why is there a check in the callback? If it is needed, the code is ...
7 years, 3 months ago (2013-08-29 17:40:29 UTC) #9
wjia(left Chromium)
Let me try it again. |started_| is accessed on 2 threads, AudioManager thread and opensl ...
7 years, 3 months ago (2013-08-29 17:52:33 UTC) #10
tommi (sloooow) - chröme
Ok, I thought you were saying that the lock isn't needed to check it at ...
7 years, 3 months ago (2013-08-29 18:29:02 UTC) #11
tommi (sloooow) - chröme
Henrik and I just discussed this and I think that if locking is needed anywhere, ...
7 years, 3 months ago (2013-08-30 06:58:39 UTC) #12
henrika (OOO until Aug 14)
Thanks Tommi. I added such a method and also logs if it is hit. Have ...
7 years, 3 months ago (2013-08-30 11:09:17 UTC) #13
tommi (sloooow) - chröme
thanks, that approach sgtm https://codereview.chromium.org/23296008/diff/56001/media/audio/android/opensles_input.cc File media/audio/android/opensles_input.cc (right): https://codereview.chromium.org/23296008/diff/56001/media/audio/android/opensles_input.cc#newcode82 media/audio/android/opensles_input.cc:82: if (started_) now that you ...
7 years, 3 months ago (2013-08-30 12:43:33 UTC) #14
henrika (OOO until Aug 14)
Thanks Tommi, new version coming up. https://codereview.chromium.org/23296008/diff/56001/media/audio/android/opensles_input.cc File media/audio/android/opensles_input.cc (right): https://codereview.chromium.org/23296008/diff/56001/media/audio/android/opensles_input.cc#newcode82 media/audio/android/opensles_input.cc:82: if (started_) oops, ...
7 years, 3 months ago (2013-08-30 14:20:37 UTC) #15
henrika (OOO until Aug 14)
Think I've covered all input from tommi@. Did some trivial name changes in last patch ...
7 years, 3 months ago (2013-08-30 14:27:33 UTC) #16
tommi (sloooow) - chröme
lgtm for the opensles input files % nits https://codereview.chromium.org/23296008/diff/60001/media/audio/android/opensles_input.cc File media/audio/android/opensles_input.cc (right): https://codereview.chromium.org/23296008/diff/60001/media/audio/android/opensles_input.cc#newcode79 media/audio/android/opensles_input.cc:79: DCHECK(!callback_); ...
7 years, 3 months ago (2013-08-30 14:37:13 UTC) #17
henrika (OOO until Aug 14)
Done. Wei: PTAL https://codereview.chromium.org/23296008/diff/60001/media/audio/android/opensles_input.cc File media/audio/android/opensles_input.cc (right): https://codereview.chromium.org/23296008/diff/60001/media/audio/android/opensles_input.cc#newcode79 media/audio/android/opensles_input.cc:79: DCHECK(!callback_); On 2013/08/30 14:37:13, tommi wrote: ...
7 years, 3 months ago (2013-08-30 14:44:27 UTC) #18
henrika (OOO until Aug 14)
My plan was to: - Wait for Wei. - Repeat input style in output parts ...
7 years, 3 months ago (2013-08-30 14:46:04 UTC) #19
wjia(left Chromium)
https://codereview.chromium.org/23296008/diff/64001/media/audio/android/opensles_input.cc File media/audio/android/opensles_input.cc (right): https://codereview.chromium.org/23296008/diff/64001/media/audio/android/opensles_input.cc#newcode324 media/audio/android/opensles_input.cc:324: SLresult err = (*recorder_)->GetRecordState(recorder_, &state); This is a regression ...
7 years, 3 months ago (2013-08-30 16:25:17 UTC) #20
tommi (sloooow) - chröme
https://codereview.chromium.org/23296008/diff/64001/media/audio/android/opensles_input.cc File media/audio/android/opensles_input.cc (right): https://codereview.chromium.org/23296008/diff/64001/media/audio/android/opensles_input.cc#newcode324 media/audio/android/opensles_input.cc:324: SLresult err = (*recorder_)->GetRecordState(recorder_, &state); On 2013/08/30 16:25:18, wjia ...
7 years, 3 months ago (2013-08-30 16:31:54 UTC) #21
henrika (OOO until Aug 14)
Nice catch Wei. Are you OK with the other changes? https://codereview.chromium.org/23296008/diff/64001/media/audio/android/opensles_input.cc File media/audio/android/opensles_input.cc (right): https://codereview.chromium.org/23296008/diff/64001/media/audio/android/opensles_input.cc#newcode324 ...
7 years, 3 months ago (2013-08-31 09:54:45 UTC) #22
henrika (OOO until Aug 14)
Added check proposed by Wei. Had to remove DCHECK of callback in Start() since we ...
7 years, 3 months ago (2013-09-02 09:36:15 UTC) #23
tommi (sloooow) - chröme
https://codereview.chromium.org/23296008/diff/60001/media/audio/android/opensles_input.cc File media/audio/android/opensles_input.cc (right): https://codereview.chromium.org/23296008/diff/60001/media/audio/android/opensles_input.cc#newcode79 media/audio/android/opensles_input.cc:79: DCHECK(!callback_); On 2013/09/02 09:36:15, henrika wrote: > Actually, this ...
7 years, 3 months ago (2013-09-02 09:49:40 UTC) #24
tommi (sloooow) - chröme
make that: DCHECK(callback_ == NULL || callback_ == callback);
7 years, 3 months ago (2013-09-02 09:50:24 UTC) #25
henrika (OOO until Aug 14)
Added similar parts for the output side. One note: the Clear() call on the buffer ...
7 years, 3 months ago (2013-09-02 13:59:13 UTC) #26
tommi (sloooow) - chröme
lgtm for input and output implementations. great job. https://codereview.chromium.org/23296008/diff/38001/media/audio/android/audio_android_unittest.cc File media/audio/android/audio_android_unittest.cc (right): https://codereview.chromium.org/23296008/diff/38001/media/audio/android/audio_android_unittest.cc#newcode166 media/audio/android/audio_android_unittest.cc:166: printf("Reading ...
7 years, 3 months ago (2013-09-03 12:15:09 UTC) #27
henrika (OOO until Aug 14)
Thanks Tommi. Wei, would you mind checking again as well? Sorry for all the test ...
7 years, 3 months ago (2013-09-03 12:48:31 UTC) #28
wjia(left Chromium)
https://codereview.chromium.org/23296008/diff/92001/media/audio/android/opensles_input.cc File media/audio/android/opensles_input.cc (right): https://codereview.chromium.org/23296008/diff/92001/media/audio/android/opensles_input.cc#newcode86 media/audio/android/opensles_input.cc:86: DCHECK(callback_ == NULL || callback_ == callback); It's more ...
7 years, 3 months ago (2013-09-03 22:36:46 UTC) #29
henrika (OOO until Aug 14)
Only comments to input from Wei. Tommi and I gave discussed the usage of callback_ ...
7 years, 3 months ago (2013-09-04 07:44:56 UTC) #30
henrika (OOO until Aug 14)
Wei, it would be so nice if you had time to take another look. Thanks.
7 years, 3 months ago (2013-09-05 11:06:41 UTC) #31
henrika (OOO until Aug 14)
Dale, I realize that I have now owner for the media.gyp file. Care to take ...
7 years, 3 months ago (2013-09-05 11:10:08 UTC) #32
DaleCurtis
This seems to be moving away from the platform agnostic unit tests we've talked about ...
7 years, 3 months ago (2013-09-05 20:35:22 UTC) #33
henrika (OOO until Aug 14)
"This seems to be moving away from the platform agnostic unit tests we've talked about ...
7 years, 3 months ago (2013-09-05 21:35:27 UTC) #34
wjia(left Chromium)
https://codereview.chromium.org/23296008/diff/92001/media/audio/android/opensles_input.cc File media/audio/android/opensles_input.cc (right): https://codereview.chromium.org/23296008/diff/92001/media/audio/android/opensles_input.cc#newcode106 media/audio/android/opensles_input.cc:106: for (int i = 0; i < num_free_buffers; ++i) ...
7 years, 3 months ago (2013-09-05 22:09:03 UTC) #35
tommi (sloooow) - chröme
https://codereview.chromium.org/23296008/diff/38001/media/audio/android/audio_android_unittest.cc File media/audio/android/audio_android_unittest.cc (right): https://codereview.chromium.org/23296008/diff/38001/media/audio/android/audio_android_unittest.cc#newcode166 media/audio/android/audio_android_unittest.cc:166: printf("Reading from file: %s\n", file_path.value().c_str()); On 2013/09/03 12:48:32, henrika ...
7 years, 3 months ago (2013-09-06 06:39:16 UTC) #36
henrika (OOO until Aug 14)
Tommi, any input on how I can remove support for Start/Stop/Start and let the user ...
7 years, 3 months ago (2013-09-06 08:04:52 UTC) #37
henrika (OOO until Aug 14)
I guess we can use the OnError callback. So, I will remove the support and ...
7 years, 3 months ago (2013-09-06 08:15:20 UTC) #38
henrika (OOO until Aug 14)
Wei, I have now removed support for Start/Stop/Start, removed the unit test that checked the ...
7 years, 3 months ago (2013-09-06 13:38:09 UTC) #39
henrika (OOO until Aug 14)
Thanks Dale. Added comments and started out removing printfs. Did not finalize. https://codereview.chromium.org/23296008/diff/92001/media/audio/android/audio_android_unittest.cc File media/audio/android/audio_android_unittest.cc ...
7 years, 3 months ago (2013-09-06 15:59:50 UTC) #40
henrika (OOO until Aug 14)
Dale, looks like clang-format resulted in several changes. Hope that is OK. Not sure if ...
7 years, 3 months ago (2013-09-06 16:03:56 UTC) #41
DaleCurtis
I don't want to block this for another time zone cycle, so media.gyp lgtm, I ...
7 years, 3 months ago (2013-09-06 22:05:07 UTC) #42
wjia(left Chromium)
nice work! we are almost there. https://codereview.chromium.org/23296008/diff/127001/media/audio/android/opensles_input.cc File media/audio/android/opensles_input.cc (right): https://codereview.chromium.org/23296008/diff/127001/media/audio/android/opensles_input.cc#newcode147 media/audio/android/opensles_input.cc:147: callback_->OnClose(this); I don't ...
7 years, 3 months ago (2013-09-07 17:09:35 UTC) #43
tommi (sloooow) - chröme
https://codereview.chromium.org/23296008/diff/92001/media/audio/android/audio_android_unittest.cc File media/audio/android/audio_android_unittest.cc (right): https://codereview.chromium.org/23296008/diff/92001/media/audio/android/audio_android_unittest.cc#newcode504 media/audio/android/audio_android_unittest.cc:504: #define START_STREAM_AND_WAIT_FOR_EVENT(stream, dir) \ On 2013/09/06 22:05:07, DaleCurtis wrote: ...
7 years, 3 months ago (2013-09-08 18:53:41 UTC) #44
henrika (OOO until Aug 14)
Think I've covered your latest feedback Wei. PTAL. https://codereview.chromium.org/23296008/diff/127001/media/audio/android/opensles_input.cc File media/audio/android/opensles_input.cc (right): https://codereview.chromium.org/23296008/diff/127001/media/audio/android/opensles_input.cc#newcode147 media/audio/android/opensles_input.cc:147: callback_->OnClose(this); ...
7 years, 3 months ago (2013-09-10 11:17:18 UTC) #45
henrika (OOO until Aug 14)
Added comments to review from Dale. https://codereview.chromium.org/23296008/diff/127001/media/audio/android/audio_android_unittest.cc File media/audio/android/audio_android_unittest.cc (right): https://codereview.chromium.org/23296008/diff/127001/media/audio/android/audio_android_unittest.cc#newcode1 media/audio/android/audio_android_unittest.cc:1: // Copyright (c) ...
7 years, 3 months ago (2013-09-10 12:07:56 UTC) #46
wjia(left Chromium)
Thanks, Henrik! LGTM (on opensles_input, opensles_output and audiomanager) with one comment. I didn't spend much ...
7 years, 3 months ago (2013-09-10 16:33:34 UTC) #47
henrika (OOO until Aug 14)
Thanks all for great review input. I have now modified one concrete callback implementation into ...
7 years, 3 months ago (2013-09-11 13:25:01 UTC) #48
Jói
Hey, I looked only at the audio_android_unittest.cc file, see comments below. Cheers, Jói https://codereview.chromium.org/23296008/diff/146001/media/audio/android/audio_android_unittest.cc File ...
7 years, 3 months ago (2013-09-11 15:42:58 UTC) #49
henrika (OOO until Aug 14)
Thanks Jói. PTAL. https://codereview.chromium.org/23296008/diff/146001/media/audio/android/audio_android_unittest.cc File media/audio/android/audio_android_unittest.cc (right): https://codereview.chromium.org/23296008/diff/146001/media/audio/android/audio_android_unittest.cc#newcode71 media/audio/android/audio_android_unittest.cc:71: case CHANNEL_LAYOUT_UNSUPPORTED: On 2013/09/11 15:42:58, Jói ...
7 years, 3 months ago (2013-09-12 09:47:04 UTC) #50
Jói
LGTM with a couple of tiny nits. Looked only at the unit test. https://codereview.chromium.org/23296008/diff/150001/media/audio/android/audio_android_unittest.cc File ...
7 years, 3 months ago (2013-09-12 09:50:53 UTC) #51
henrika (OOO until Aug 14)
Thanks. Looks like I have OK from everyone now. Will ensure that the try bots ...
7 years, 3 months ago (2013-09-12 10:02:07 UTC) #52
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/henrika@chromium.org/23296008/161001
7 years, 3 months ago (2013-09-12 10:48:59 UTC) #53
commit-bot: I haz the power
7 years, 3 months ago (2013-09-12 13:35:28 UTC) #54
Message was sent while issue was closed.
Change committed as 222779

Powered by Google App Engine
This is Rietveld 408576698