calf-studio-gear / calf

Developers repository of Calf Studio Gear. Expect some issues when using it for production.
http://calf-studio-gear.org
GNU Lesser General Public License v2.1
681 stars 96 forks source link

Calf-Vocoder causes xruns in the system, even when CPU load is low #142

Closed unfa closed 6 years ago

unfa commented 7 years ago

I've been playing with Calf Vocoder (from calf-git package) and I've noticed excessive DSP load.

I had a pretty simple Ardour 5 session with a few tracks and on a 16-thread Ryzen 7 1700 CPU it causes xruns like I never had on this system before, even when running huge sessions.

Not sure how to debug this.

Anybody had similar experiences?

unfa commented 7 years ago

After a recent upgrade in calf-plugins-git package I experience this even more. The Calf Vocoder plugin bogs down my entire Ardour session to the point of DSP load around 98% all the time and a flood of xruns. If I disable the bus with the Calf Vocoder - it's back to 33% DSP load and no xruns.

Ramping up jack_bufsize to 8192 from 512 seems to help - but the latency of the whole system is obviously huge at this point, and recording vocals is a no go because of that.

boomshop commented 7 years ago

Vocoder is a CPU hog, depending on your settings since it's quite analog without making any use of FFT. There are at least (n = amount of bands) n filters on modulator and n filters on carrier at the same time. The isolation knob multiplies the amount of filters, so isolation of ~4 and 32 bands means 4 2 32 = 256 filters at the same time. So a 1.7 GHz CPU might not be enough for higher settings.

unfa commented 7 years ago

Hmm. I'm running it on a Ryzen 7 1700 CPU with 8 cores / 16 threads running between 1.5 and 3.0 GHz. I never had such problems with performance, and I wouldn't expect it ever to be a problem on this CPU.

I can't tell if it's really just the nature of the effect, or if something is really different between "stable" and "git" versions that could be corrected to ease off the DSP load.

boomshop commented 7 years ago

Hm, on my i7-4800MQ CPU @ 2.70GHz it takes ~4% CPU with 32 bands and full isolation when running Vocoder in calfjackhost. Latest git version (not KXStudio but self-compiled). Strange.

kfoltman commented 6 years ago

Side note, the number of cores/threads is no help with plugins like this one - all processing is strictly single-threaded. I've done some experiments in another project (a sampler engine in calfbox) to try to make use of multiple cores in a single callback, but the synchronization overheads generally make it not perform well. It might be doable for something like a sampler, but much harder for an audio processing plugin like a vocoder.

The bug you're seeing may be another instance of the floating point underflow issue. Does it get worse when the input is silence? It may also be compiler version-dependent, as different versions of the compiler might use FPU vs SSE instructions for the code involved, SSE instructions being mostly immune to the underflow issue. It may also be input dependent.

I'll take a closer look, but that might be post-release.

kfoltman commented 6 years ago

Yep, denormals. Should now be fixed in commit 924d678303a9bb310d619ff183710f11655f3790.

boomshop commented 6 years ago

Could you please test and report back?

boomshop commented 6 years ago

No activity for ~5 months, so closing this report. Feel free to re-open if this is still an issue.