Closed teknico closed 4 years ago
As far as I know, Duktape (the JavaScript engine) is completely thread-safe and independent. I couldn't reproduce this by using 2-4 instances of a script with 10% CPU.
Here is a patch that reproduces the problem for me (sorry for the cable mess).
When I load it on Ubuntu 19.04 under JACK, I get ongoing xruns but can still play it with a keyboard and hear one note with some noise.
If I then increase the polyphony setting in MIDI-CV and enable more Prototype modules, the noise increases and the patch becomes unplayable.
Can't reproduce the behavior using your patch until enabling all 8 Prototypes.
Interesting. So you get no glitches at all with less than eight, and then a little or a lot of noise with eight?
7 was perfectly fine. 8 hit the audio buffer deadline, so a hiccup was inserted every buffer, as expected.
I see. Thanks for checking.
I tried on a Mac and the behavior is as you got, so it's definitely a problem with my Linux notebook.
8 hit the audio buffer deadline, so a hiccup was inserted every buffer, as expected.
Could you please add some detail to this? Not sure what you mean.
Are multiple instances supposed to be working at the same time?
A single instance works beautifully, and my script takes ~10% CPU. If I activate another instance (polyphony 2) I hear occasional scratching noises. With four instances I get a lot more, and with eight the noise is almost constant.
Does the Javascript interpreter use any global state that makes it unsafe to use in a concurrent environment?