Hi everyone,
I’m planning to integrate Tracktion Engine into an Electron application by building Tracktion Engine as a static library and linking it directly into the Electron source code, specifically to be used within the Electron main process.
Before diving deeper, I want to clarify my context and constraints to focus the discussion:
- Build & Linking: I am experienced with building Electron from source and linking native static libraries. The process of building and linking Tracktion Engine this way is not my concern.
- UI Approach: I will be using Tracktion Engine in a “headless” manner. I will not be using the JUCE UI framework provided by Tracktion Engine or JUCE itself. Any necessary UI will be built using standard Electron techniques (e.g., JavaScript in the main process calling the C++ Tracktion Engine functions, then communicating with the renderer process). Therefore, potential issues related to integrating JUCE’s UI components or message loop with Electron’s are not my primary concern here.
My Core Question & Primary Concern:
My absolute main focus and concern is the stability and quality of the real-time audio processing.
Specifically, I need to understand the viability and risks of running Tracktion Engine’s (and therefore JUCE’s) high-priority, real-time audio thread directly within the Electron main process. This process simultaneously runs the Node.js event loop and the V8 JavaScript engine.
- How likely is interference from the Node.js environment – such as event loop activity, background tasks managed by libuv, and particularly V8 Garbage Collection pauses (“Stop-the-World”) – to disrupt the precise, low-latency scheduling required by the audio thread?
- My application demands high audio stability and pristine audio quality. Is running the audio thread within the same process space as Node.js/V8 fundamentally incompatible with these requirements, potentially leading to unavoidable glitches, dropouts, or increased latency in practice?
Other Potential Pitfalls?
Given that I’m handling the build/linking and explicitly avoiding JUCE UI integration issues, are there any other significant, non-obvious pitfalls specific to running headless Tracktion Engine within the Electron main process that I should be aware of, beyond the core audio stability concern?
