Re: Questioning the current direction of the Web Audio API

2013-10-25 14:16, Robert O'Callahan skrev:
> On Fri, Oct 25, 2013 at 11:14 AM, Marcus Geelnard < 
> <>> wrote:
>     Yes, you can do pretty evil things with several Web technologies
>     today. GLSL is one example (I can make the complete UI crash on my
>     Android phone, and I can make a desktop environment completely
>     unresponsive).
> With the state of GPU hardware and drivers today, our only choices are 
> "don't do 3D on the Web at all" or "accept these potential crashes". 
> This is not a good situation, and it's not one we want to emulate, and 
> it is not comparable to what we face with audio.

Yes, let's not be THAT bad. On the other hand it's quite a different 
situation. With GLSL you're more or less sending code across the kernel 
barrier, as it's executed in one of the most privileged environments on 
any device (if your code triggers a graphics driver bug, it may block or 
mess up all graphics operations on that device).

With audio, we're talking about executing code in a limited script 
environment, in a separate thread, in a protected (maybe even sandboxed) 

>     Workers is another example (setting up a dozen of busy workers can
>     silently drain the battery of a device). I don't see a big
>     difference in doing a heavy convolution in a native audio node or
>     a heavy for-loop in a script processor node - both have similar
>     implications, and similar solutions (validation, watchdog timers
>     or similar).
> One potential difference is that browsers already do significant work 
> to make sure that a busy script can't make the browser unresponsive to 
> the point the user can't close the offending page. We'll need to 
> ensure that's still true if that script is running on a high-priority 
> audio thread.

What I meant was that just as you can write a CPU-hungry script node, 
you can configure a native convolver node to consume lots of CPU. 
Neither of those should block the main thread, nor otherwise make the 
system/page unresponsive. So yes, we need to be careful.


> Rob
> -- 
> Jtehsauts  tshaei dS,o n" Wohfy  Mdaon  yhoaus eanuttehrotraiitny  
> eovni le atrhtohu gthot sf oirng iyvoeu rs ihnesa.r"t sS?o  Whhei csha 
> iids  teoa stiheer :p atroa lsyazye,d  'mYaonu,r  "sGients  uapr,e  
> tfaokreg iyvoeunr, 'm aotr  atnod  sgaoy ,h o'mGee.t"  uTph eann dt 
> hwea lmka'n?  gBoutt  uIp  waanndt  wyeonut  thoo mken.o w *
> *

Marcus Geelnard
Technical Lead, Mobile Infrastructure
Opera Software

Received on Friday, 25 October 2013 12:55:27 UTC