This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 17405 - (DynamicLifetime): Dynamic Lifetime
Summary: (DynamicLifetime): Dynamic Lifetime
Status: CLOSED WORKSFORME
Alias: None
Product: AudioWG
Classification: Unclassified
Component: Web Audio API (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: TBD
Assignee: Chris Rogers
QA Contact: This bug has no owner yet - up for the taking
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-05 12:30 UTC by Michael[tm] Smith
Modified: 2013-04-25 15:31 UTC (History)
4 users (show)

See Also:


Attachments

Description Michael[tm] Smith 2012-06-05 12:30:36 UTC
Audio-ISSUE-94 (DynamicLifetime): Dynamic Lifetime [Web Audio API]

http://www.w3.org/2011/audio/track/issues/94

Raised by: Philip Jägenstedt
On product: Web Audio API

https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#DynamicLifetime

"When the note has finished playing, the context will automatically release the reference to the AudioBufferSourceNode, which in turn will release references to any nodes it is connected to, and so on. The nodes will automatically get disconnected from the graph and will be deleted when they have no more references. Nodes in the graph which are long-lived and shared between dynamic voices can be managed explicitly."

This look like a requirement on the implementation, but it's not normative or detailed enough to test or implement.

The above quoted text appears to not be the wanted behavior, unless "has a reference" means "can produce output". For example, if an AudioBufferSourceNode produces output for n milliseconds and is followed by a DelayNode with delay n milliseconds, certainly the lifetime of the delay node should be 2*n. To collect all of the downstream elements because the AudioBufferSourceNode reaches FINISHED_STATE is not sensible. If circular routing is allowed (https://www.w3.org/2011/audio/track/issues/24) it will be possible to create subgraphs which never stop producing output and can (should) thus never be collected.

For reference, HTMLMediaElement has the concept of "potentially playing" and is not destroyed while it may still produce output. Something similar for the Web Audio API seems logical, as the result would otherwise be sensitive to GC intervals.
Comment 1 Olivier Thereaux 2012-06-07 08:17:26 UTC
[admin] Assigning items currently being worked on by editor.
Comment 2 Olivier Thereaux 2012-06-07 15:03:12 UTC
Changeset from the editor:

Detailed text added:
https://dvcs.w3.org/hg/audio/rev/c86957261db6
Comment 3 Olivier Thereaux 2012-06-07 15:03:56 UTC
Awaiting feedback.
Comment 4 Marcus Geelnard (Opera) 2012-06-12 09:57:02 UTC
The tail-time for specific AudioNodes need to be defined. In particular, what tail-time should a JavaScriptAudioNode have?
Comment 5 Olivier Thereaux 2013-04-04 14:31:48 UTC
The Lifetime section(s) are now informative, or about to be made informative (see e.g Bug #21523). Seems like this bug should be closed as a result.