Re: Exclusive access to audio hardware

On Thu, May 10, 2012 at 10:55 AM, Chris Rogers <crogers@google.com> wrote:

> On Wed, May 9, 2012 at 3:32 PM, Robert O'Callahan <robert@ocallahan.org>wrote:
>
>> I think it would be simpler for authors if everything "just worked" as
>> far as possible. With the proposed renderState and onrenderstatechange,
>> some developers are likely to simply forget to handle it --- if the
>> renderState is never idle on their platform or they simply don't test that
>> case --- and their apps will be broken.
>>
>> So how about adding no new APIs, but instead just automatically pause the
>> entire audio graph while the page does not have access to the audio
>> hardware?
>>
>
> I could be wrong, but I think Jer is saying that the graph *would* be
> automatically paused.  It's the restarting/resuming that Jer would like
> authors to have the opportunity to control instead of it automatically
> starting to play the instant the phone call ends.
>

OK. That isn't very different from in-app pause-and-resume to handle
different modes which happen to be in the same app, for which game devs
have already asked for pause and resume API, and which I think we should
provide (preferably per-node/stream but could be per-context). Also,
developers who want to extend the pause after other activity ends should
opt into that; the default needs to be automatic resume, so that apps don't
get stuck.

So I suggest providing API for explicit pause and resume, and define its
interaction with UA-imposed pausing so that the graph is paused if it has
been paused by the author *or* it has been paused by the UA. Then an author
who wants to wait for some interaction before resuming can pause
explicitly, say when their app loses focus, and resume explicitly whenever
they want to.

Rob
-- 
“You have heard that it was said, ‘Love your neighbor and hate your enemy.’
But I tell you, love your enemies and pray for those who persecute you,
that you may be children of your Father in heaven. ... If you love those
who love you, what reward will you get? Are not even the tax collectors
doing that? And if you greet only your own people, what are you doing more
than others?" [Matthew 5:43-47]

Received on Wednesday, 9 May 2012 23:12:10 UTC