Closed Bug 1558123 Opened 5 years ago Closed 5 years ago

call AudioWorkletProcessor.process()

Categories

(Core :: Web Audio, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
mozilla70
Tracking Status
firefox69 --- wontfix
firefox70 --- fixed

People

(Reporter: karlt, Assigned: karlt)

References

Details

Attachments

(6 files)

No description provided.
Depends on: 1558131

This is set in the AudioNodeStream constructor and does not change.

It is easier to make a span than an nsTArray.

This also clarifies that the output array lengths are not modified.

Depends on D34833

Depends on D34834

Objects are retained for re-use to reduce garbage generation and other
performance benefits. This is currently unspecified.

https://github.com/WebAudio/web-audio-api/issues/1934
https://github.com/WebAudio/web-audio-api/issues/1933

https://github.com/WebAudio/web-audio-api/issues/1935 tracks specification of
zero-channels of input when inputs are not actively processing.

Depends on D34835

Direct use of aInput buffers for ArrayBuffer elements is not possible in
general. aInput buffers are const because they may be used elsewhere but
ArrayBuffer elements may be modified by script. If necessary, it would be
possible to later add a mechanism to mix inputs directly into the ArrayBuffer,
but often no mixing is required.

Direct use of output ArrayBuffer elements would require DetachArrayBuffer to
ensure the elements are not modified by script, but that would require
creation of a new ArrayBuffer JS object on each call.

https://github.com/WebAudio/web-audio-api/issues/1932 tracks specification of
making output data available for reading (for downstream node input).

Depends on D34836

https://heycam.github.io/webidl/#invoke-a-callback-function is not used here
because that would "perform a microtask checkpoint" in "clean up after running
script", which would be in conflict with "Any Promise resolved within the
execution of process method will be queued into the microtask queue in the
AudioWorkletGlobalScope" in
https://webaudio.github.io/web-audio-api/#rendering-loop

See also https://github.com/WebAudio/web-audio-api/issues/1933

There are also some small optimizations possible with using JS::Call() directly:
JS::ExposeObjectToActiveJS() is not necessary because parameters are
PersistentRooted and so won't be gray. MaybeWrapObjectValue() is not
necessary because parameters are already in the appropriate compartment.

Depends on D34837

The patches here are enough to run the example at
https://googlechromelabs.github.io/web-audio-samples/audio-worklet/basic/hello-audio-worklet/
with dom.audioworklet.enabled and dom.worklet.enabled preferences set to true.
https://treeherder.mozilla.org/#/jobs?repo=try&revision=24478da1c4aadb12bd83995cc2125f96dae99925

Attachment #9071825 - Attachment description: Bug 1558123 create JSObjects for inputs/outputs AudioWorkletProcessor.process() parameters r?padenot → bug 1558123 create JSObjects for inputs/outputs AudioWorkletProcessor.process() parameters r?padenot
Attachment #9071827 - Attachment description: Bug 1558123 call AudioWorkletProcessor.process() r?padenot → bug 1558123 call AudioWorkletProcessor.process() r?padenot
Blocks: 1566312
Attachment #9071824 - Attachment description: Bug 1558123 set AudioWorkletNode output channel counts r?padenot → bug 1558123 set AudioWorkletNode output channel counts r?padenot
Attachment #9071827 - Attachment description: bug 1558123 call AudioWorkletProcessor.process() r?padenot → Bug 1558123 call AudioWorkletProcessor.process() r?padenot
Attachment #9071826 - Attachment description: Bug 1558123 copy audio samples to/from JS arrays r?padenot → Bug 1558123 copy audio samples to/from JS arrays r=padenot
Attachment #9071827 - Attachment description: Bug 1558123 call AudioWorkletProcessor.process() r?padenot → bug 1558123 call AudioWorkletProcessor.process() r?padenot
Pushed by ktomlinson@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/995621b87983 don't set outputs array length in ProcessBlocksOnPorts r=padenot
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
Pushed by ktomlinson@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a3b0501db27e Pass spans to ProcessBlocksOnPorts to facilitate forwarding from ProcessBlock() r=padenot https://hg.mozilla.org/integration/autoland/rev/317f1a974015 set AudioWorkletNode output channel counts r=padenot https://hg.mozilla.org/integration/autoland/rev/3cbbbf45fe77 create JSObjects for inputs/outputs AudioWorkletProcessor.process() parameters r=padenot,bzbarsky https://hg.mozilla.org/integration/autoland/rev/bd4d8b6059f2 copy audio samples to/from JS arrays r=padenot https://hg.mozilla.org/integration/autoland/rev/a87f84004aaa call AudioWorkletProcessor.process() r=padenot,bzbarsky
Blocks: 1473176
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: