W3C home > Mailing lists > Public > public-audio@w3.org > July to September 2013

Re: New proposal for fixing race conditions

From: Jer Noble <jer.noble@apple.com>
Date: Fri, 19 Jul 2013 13:03:55 -0700
Cc: "public-audio@w3.org" <public-audio@w3.org>
Message-id: <B8672B7C-C6C0-4074-99F0-4CE013440EF9@apple.com>
To: Chris Rogers <crogers@google.com>

On Jul 19, 2013, at 11:54 AM, Chris Rogers <crogers@google.com> wrote:

> Jer, thanks for sharing the proposal.
> I can't support a solution like this because it:
> 1. Forces the need for copies both for setting and reading data.  PCM data is large and it's inefficient to be required to copy.
> 2. It needlessly complicates the API, where we now have a simple solution.
> 3. The "problem" it is supposed to solve is effectively a non-issue.

I agree with 3, as I’ve stated before repeatedly.  Even so, it is not unhelpful to propose a concrete ‘solution’, if only to have something concrete to discuss performance tradeoffs.

I disagree with 2; it simplifies the API by re-using existing method names (set(), slice(), etc.) from similar classes.

I (partially) disagree with 1.  For the standard playback model, there are precisely 0 extra memcpys and mallocs: decodeAudioData will continue to emit AudioBuffer objects which can be passed directly to an AudioBufferSourceNode.  It is only generated audio which requires an additional memcpy, and only for upfront data creation. ScriptProcessorNode playback requires the same number of copies as before.

Readback of decoded data will require extra copies.  This is necessary achieve the intended outcome.  For certain use cases, such as permutation of decoded data, OfflineAudioContext can be used to efficiently read and write AudioBuffers.


Received on Friday, 19 July 2013 20:04:23 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:03:23 UTC