Skip to content
This repository has been archived by the owner on Oct 7, 2021. It is now read-only.

Specify and implement transferable streams #78

Closed
guest271314 opened this issue May 15, 2020 · 2 comments
Closed

Specify and implement transferable streams #78

guest271314 opened this issue May 15, 2020 · 2 comments
Labels
feature Feature request
Projects

Comments

@guest271314
Copy link

guest271314 commented May 15, 2020

Describe the feature
The comparision between using transferring a single stream (ReadableStream; WritableStream) and transferring hundreds of thousands of TypedArrays using MessagePort.postMessage() is not even close.

AudioWorklet invariably outputs multiple gaps of silence at both Chromium and Firefox when thousands of messages are posted/TypedArrays transferred.

Is there a prototype?

Yes.

Describe the feature in more detail

See https://bugs.chromium.org/p/chromium/issues/detail?id=910471#c11.

Posting a single ReadableStream, e.g., from a TransformStream substantially reduces observable gaps in playback to 1 (that bug is currently isolated to being observable at the end of reading/writing the stream, not the underlying network request in the code used to get the stream) from multiple gaps randomly occurring during playback https://bugzilla.mozilla.org/show_bug.cgi?id=1629384#c24.

Compare for yourself https://plnkr.co/edit/nECtUZ (transferable streams implemented at Chromium behind --enable-experimental-web-platform-features); https://plnkr.co/edit/yh5A66UhMnlpq0JF (thousands of postMessage(<TypedArray>, [<TypedArray.buffer>]) calls).

@guest271314 guest271314 added the feature Feature request label May 15, 2020
@mdjp mdjp added this to Untriaged in V2 Jun 9, 2020
@padenot
Copy link
Member

padenot commented Jun 16, 2020

@padenot padenot closed this as completed Jun 16, 2020
V2 automation moved this from Untriaged to Done Jun 16, 2020
@guest271314
Copy link
Author

@padenot

Perhaps the Virtual F2F participants did not understand the Issue.

Am stating MessagePort does not work without gaps in audio output for substantial amount of input data.

Get rid of MessagePort altogether and substitute a TransformStream

Main thread context (WritableStream) <= TransformStream => AudioWorkletProcessor (AudioWorkletGlobalScope``) context (ReadableStream`)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature Feature request
Projects
V2
  
Done
Development

No branches or pull requests

2 participants