Skip to content

Active Source Flag meaning is incomplete #1463

Closed

Description

@rtoy

The spec defines and refers to an Active Source Flag in a worklet processor. But the spec basically only says what the initial value is and that it's set by the return value of the process() method. (And also reflects the processor state, which we are probably going to remove completely.)

This isn't my memory of the long and detailed discussion we had on this. My memory was that the active source flag was set to the return value of process(), but once the flag became false, it could never be changed to true. And when it became false, process() would not get called anymore and the worklet node would essentially become a sink, pulling on it's inputs for processing, but always producing silence.

In this way, the worklet could continue to process if references to the worklet node itself were dropped. When the flag became false, this signaled to the system that the processor (and node) could be GCed.

I can't find any such description of this in the spec.

Activity

  1. added
    Needs Discussion
    on Dec 11, 2017
  2. joeberkovitz commented on Dec 14, 2017

    @joeberkovitz

    I don't think you're correct about this. The spec does say more than that, and it's pretty clear that process() can be called after returning false as long as there are connected inputs:

    The process() method is called synchronously by the audio rendering thread at every render quantum, if ANY of the following active processing conditions are true:

    The associated AudioWorkletProcessor's active source flag is equal to true.
    There are one or more connected inputs to the AudioWorkletNode.

    So, as long as there are connected inputs, process() continues to get called.

  3. added this to the Web Audio V1 milestone on Dec 14, 2017
  4. rtoy commented on Jan 18, 2018

    @rtoy
    MemberAuthor

    Reconsider after discussing #1471.

  5. rtoy commented on Feb 22, 2018

    @rtoy
    MemberAuthor

    #1471 isn't relevant to this issue any more.

  6. removed
    Needs Discussion
    on Feb 22, 2018
  7. added
    Needs Discussion
    on Mar 1, 2018
  8. rtoy commented on Mar 8, 2018

    @rtoy
    MemberAuthor

    Close this because #1471 should take care this and we're not changing the meaning of the flag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs Discussion

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions