Comments (7)
would it be possible to have option whether to use "standard" AWP (where DSP is rendered in audio thread) or "powerhouse" (where DSP is rendered in Worker) implementation ?
i think powerhouse has definite use cases (like sample streaming from a virtual file system), but my concern is that since worker thread has lower priority than audio thread, it might be affected by what is going on in main thread. Also, SABs introduce latency (in chrome this is one buffer, in Firefox it at least used to be > 1 buffer) which needs to be compensated. edit: could also be because of worker thread priorities differ in browsers, might not be result of different SAB latencies.
from iplug2.
i guess what really needs to be done is to profile the current implementation. I currently have this hack, which is not right and the main thing i want to fix..., how do you think I could have an equivalent of OnIdle() on the main thread in AWP
from iplug2.
in answer to your question it may well be possible... need to experiment with this stuff
from iplug2.
iiuc you want to inform main thread that AWP is idle? AWP used to have state
member and a notification message from AWP -> AWN. it was removed from spec, can't remember why that was, but i guess one workaround option is to call postMessage("set", "state", "idle")
to notify the main thread Controller. And post another message when state changes, i.e., not for each buffer. Another way is to use a SAB, but then you'd need to poll in main thread.
from iplug2.
OnIdle() is a regular poll on the main thread. Not sure how to set that up within AudioWorkletGlobalScope
from iplug2.
right, so host calls OnIdle() ? Web Audio API calls AWP periodically: first it checks if there are any messages, and if so, it invokes AWP.port.onmessage() for each message from main thread. right after that it invokes AWP.process(). currently there's only one thread in AudioWorkletGlobalScope, so it is impossible to do any processing between onmessage and process calls.
unless setTimeout is available in AWGS, but even if it is, it might not be a good idea to steal processing time from other AWPs.
from iplug2.
closing this. may reopen in the future to provide powerhouse pattern as an option
from iplug2.
Related Issues (20)
- iOS: UITableViewPopup menu bounds should be based on content
- MacOS OpenGLContext leaks ~4MB on window close HOT 1
- WebUI example crashes when double-clicked HOT 4
- IMidiMsg.mOffset HOT 1
- ShowMessageBox mixes up message and caption on mac HOT 2
- Missing color search info the background of IVControls HOT 1
- IOS App plugin never gets deconstructed HOT 5
- Strange behavior IGraphics::Resize in Kushview Element (Windows, VST3)
- Skia METAL bitmap colours appear incorrect HOT 4
- Macos OpenGL: multiple instances clash
- Dropping const qualifier in IGraphics/Platforms/IGraphicsWin
- [CMake branch] Clang support on windows HOT 1
- CMakeLists for Examples/IPlugWebUI HOT 1
- MIDI velocity values get rounded incorrectly HOT 1
- IGraphicsSkia::GetLayerBitmapData() crashes in iOS AUv3 HOT 1
- iPlug2 doesn't compile on windows in 32-bit due to missing macros
- AUv2 hosts reporting negative ppq becomes -1 in iPlug
- Add DirtyState()/Rework DirtyParametersFromUI()
- Unable to get raw name for Unknown host HOT 1
- CLAP: PLUG_CHANNEL_IO "1-1 2-2" does not work in Reaper
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from iplug2.