Re: OfflineAudioContext Concerns

On Mar 13, 2013, at 12:53 AM, Chris Rogers <crogers@google.com> wrote:
> 
> Second, the behavior with ScriptProcessorNodes as implemented in Chrome is currently not helpful.  Inside "online" audio contexts, the script processors work on the main thread, asynchronously from the main processing.  If they do not produce buffers in time, the buffers are dropped.  Currently, the behavior is the same for offline audio contexts.
> 
> This is really a limitation/bug in Chrome and not a limitation of the idea of using ScriptProcessorNodes with an OfflineAudioContext.

I agree, but my point was that what Chrome is doing currently doesn't violate the specification.  My sense in this case case is that adding a clause about ScriptProcessorNodes being waited for in offline audio contexts may perhaps be justified.

>  
> Of course, changing this would not be trivial on the implementation side, and the main javascript thread would effectively be blocked while the mix down happens due to constant onaudioprocess callbacks.  
> First of all, the proper synchronization between the offline context and the main thread is very solvable.  And second, Web Workers present the exact same implementation difficulties because there's still a synchronization that needs to happen between two threads.

I was just making excuses for the current implementation, but my point was that in a correct implementation under chrome, the main thread would often be busy handling javascript onaudioprocess callbacks rather than performing UI work during offline rendering.  Web Workers would actually fix this, because they have no other responsibilities and wouldn't fight with the main thread.

> I agree with you that Web Workers are interesting for ScriptProcessorNode.

As a sociopolitical question, what's the best way of contributing something like this for me, someone not directly associated with Mozilla, Google, Apple, or W3C?  My first instinct is to just hack something together in WebKit, then try to get the change adopted there, then pester you guys after that point to get it added to the spec. Please let me know if there's a better path.

Thanks,
-Russell

Received on Wednesday, 13 March 2013 19:57:00 UTC