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

Issue 160497: Reimplement the AlsaPcmOutputStream and fix the threading issues. (Closed)

Created:
11 years, 4 months ago by awong
Modified:
9 years, 7 months ago
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

Reimplement the AlsaPcmOutputStream and fix the threading issues. Changes the threading model from one thread per stream to one shared thread. Also, redoes the alsa reading/buffering logic to assume an asynchronous data source, and respect the different packet sizes. The Alsa device is set to non-blocking now. State transitions are cleaned up, and the threading semantics are reworked. Now linux audio will no longer crash on shutdown, seek, pause, or tab close. This implementation does still leak though. :( The leak will be fixed in another CL.

Patch Set 1 #

Patch Set 2 : This right set of files. #

Total comments: 28

Patch Set 3 : Address Alpha's comments. #

Patch Set 4 : More unittests. #

Total comments: 2

Patch Set 5 : More unittests. #

Patch Set 6 : Enough tests for this version. #

Patch Set 7 : This time for sure #

Patch Set 8 : blah blah #

Total comments: 35

Patch Set 9 : Rebased, uploading to check. #

Patch Set 10 : Again. #

Patch Set 11 : Rebaselined correctly. #

Patch Set 12 : Address Andrew's comments. Diff aginst Patch 8 please. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1139 lines, -512 lines) Patch
M media/audio/audio_output.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +1 line, -3 lines 0 comments Download
M media/audio/linux/alsa_output.h View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +145 lines, -103 lines 0 comments Download
M media/audio/linux/alsa_output.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +465 lines, -396 lines 0 comments Download
A media/audio/linux/alsa_output_unittest.cc View 1 2 3 4 5 6 7 9 10 1 chunk +379 lines, -0 lines 0 comments Download
A media/audio/linux/alsa_wrapper.h View 1 2 3 1 chunk +38 lines, -0 lines 0 comments Download
A media/audio/linux/alsa_wrapper.cc View 1 2 3 1 chunk +60 lines, -0 lines 0 comments Download
M media/audio/linux/audio_manager_linux.h View 2 chunks +20 lines, -0 lines 0 comments Download
M media/audio/linux/audio_manager_linux.cc View 3 chunks +28 lines, -10 lines 0 comments Download
M media/media.gyp View 2 chunks +3 lines, -0 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
awong
This is a rewrite of the AlsaPcmOutputStream. The unittest still needs to be beefed up ...
11 years, 4 months ago (2009-08-01 04:09:04 UTC) #1
Alpha Left Google
http://codereview.chromium.org/160497/diff/36/38 File media/audio/linux/alsa_output.cc (right): http://codereview.chromium.org/160497/diff/36/38#newcode148 Line 148: bytes_per_sample_(bits_per_sample/8), Space before and after / http://codereview.chromium.org/160497/diff/36/38#newcode208 Line ...
11 years, 4 months ago (2009-08-03 22:26:18 UTC) #2
awong
http://codereview.chromium.org/160497/diff/36/38 File media/audio/linux/alsa_output.cc (right): http://codereview.chromium.org/160497/diff/36/38#newcode208 Line 208: // Configure the device for software resampling, and ...
11 years, 4 months ago (2009-08-03 22:54:18 UTC) #3
Alpha Left Google
LGTM
11 years, 4 months ago (2009-08-03 23:01:25 UTC) #4
Alpha Left Google
Nothing big that I noticed, just style. http://codereview.chromium.org/160497/diff/62/66 File media/audio/linux/alsa_output_unittest.cc (right): http://codereview.chromium.org/160497/diff/62/66#newcode194 Line 194: PcmClose(kFakeHandle)) ...
11 years, 4 months ago (2009-08-04 02:55:09 UTC) #5
awong
Okay, this time for sure. I added as many unittests as I can do simply. ...
11 years, 4 months ago (2009-08-04 03:43:18 UTC) #6
awong
http://codereview.chromium.org/160497/diff/62/66 File media/audio/linux/alsa_output_unittest.cc (right): http://codereview.chromium.org/160497/diff/62/66#newcode194 Line 194: PcmClose(kFakeHandle)) On 2009/08/04 02:55:09, Alpha wrote: > this ...
11 years, 4 months ago (2009-08-04 03:47:31 UTC) #7
scherkus (not reviewing)
it looks good, I agree it's scary though thinking aloud... would it be useful for ...
11 years, 4 months ago (2009-08-04 14:31:33 UTC) #8
awong
fixed andrew's comments. http://codereview.chromium.org/160497/diff/124/1059 File media/audio/audio_output.h (right): http://codereview.chromium.org/160497/diff/124/1059#newcode1 Line 1: // Copyright (c) 2006-2008 The ...
11 years, 4 months ago (2009-08-04 21:12:57 UTC) #9
Alpha Left Google
LGTM
11 years, 4 months ago (2009-08-04 21:17:17 UTC) #10
scherkus (not reviewing)
11 years, 4 months ago (2009-08-05 04:05:52 UTC) #11
http://codereview.chromium.org/160497/diff/124/1060
File media/audio/linux/alsa_output.cc (right):

http://codereview.chromium.org/160497/diff/124/1060#newcode16
Line 16: // |shared_data_.lock| is held.
On 2009/08/04 21:12:57, awong wrote:
> On 2009/08/04 14:31:33, scherkus wrote:
> > lock -> lock_
> > 
> > how do you hold it?
> presumably by calling Lock?  Not sure I understand.
> 

Sorry wasn't clear.  Was just a comment that lock_ is private, so how can we
hold the lock (answer is the public methods do it for you!)

Powered by Google App Engine
This is Rietveld 408576698