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

Issue 194112: Fixing audio in mac (Closed)

Created:
11 years, 3 months ago by Alpha Left Google
Modified:
9 years, 6 months ago
Reviewers:
cpu_(ooo_6.6-7.5)
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

Fixing audio in mac TEST=media_unittests BUG=21574 Several problems in mac audio: 1. AudioQueueEnqueueBuffer doesn't accept empty buffers. But we often hit buffer underrun with various reasons. In order to simulate the behavior of Windows that empty buffer would make the callback be called after a short time, we write a short buffer of silence. 2. Mac audio doesn't provide pending bytes (unplayed buffer size in audio buffer). This is now fixed by having a running counter. 3. After Stop() is called, Start() will take a long time for the audio packet to be played. It is found that AudioQueueEnqueueBuffer should be called before AudioQueueStart otherwise we'll hit this problem of long delay for start. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=26510

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+94 lines, -8 lines) Patch
M media/audio/mac/audio_output_mac.h View 1 chunk +4 lines, -0 lines 0 comments Download
M media/audio/mac/audio_output_mac.cc View 5 chunks +32 lines, -8 lines 2 comments Download
M media/audio/mac/audio_output_mac_unittest.cc View 2 chunks +58 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
Alpha Left Google
11 years, 3 months ago (2009-09-15 01:49:16 UTC) #1
Alpha Left Google
Taking an example of AudioQueue usage from this page: http://developer.apple.com/mac/library/samplecode/AudioQueueTools/listing1.html
11 years, 3 months ago (2009-09-15 01:50:58 UTC) #2
cpu_(ooo_6.6-7.5)
Sorry for the delay. Looking at this now. On 2009/09/15 01:50:58, Alpha wrote: > Taking ...
11 years, 3 months ago (2009-09-16 17:59:03 UTC) #3
cpu_(ooo_6.6-7.5)
http://codereview.chromium.org/194112/diff/1/2 File media/audio/mac/audio_output_mac.cc (right): http://codereview.chromium.org/194112/diff/1/2#newcode184 Line 184: Won't it be much easier we just simply ...
11 years, 3 months ago (2009-09-16 18:06:26 UTC) #4
Alpha Left Google
http://codereview.chromium.org/194112/diff/1/2 File media/audio/mac/audio_output_mac.cc (right): http://codereview.chromium.org/194112/diff/1/2#newcode184 Line 184: On 2009/09/16 18:06:26, cpu wrote: > Won't it ...
11 years, 3 months ago (2009-09-16 18:25:34 UTC) #5
cpu_(ooo_6.6-7.5)
11 years, 3 months ago (2009-09-16 23:09:43 UTC) #6
Ok. LGTM


On 2009/09/16 18:25:34, Alpha wrote:
> http://codereview.chromium.org/194112/diff/1/2
> File media/audio/mac/audio_output_mac.cc (right):
> 
> http://codereview.chromium.org/194112/diff/1/2#newcode184
> Line 184: 
> On 2009/09/16 18:06:26, cpu wrote:
> > Won't it be much easier we just simply don't call AudioQueueEnqueueBuffer()
if
> > filled == 0 ?
> > 
> 
> AudioQueue works as a circular buffer, if we don't enqueue buffer you don't
get
> a callback. The output stream is a pull base model and we can't signal it to
> enqueue buffer again once there's enough buffer. So doing this to simulate the
> behavior of windows. In windows, if you waveOutWrite(0) you get a callback
after
> ~2ms.

Powered by Google App Engine
This is Rietveld 408576698