Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Significant CPU spikes with Filter using more than 4 threads #1001

Open
W4too opened this issue May 4, 2024 · 7 comments · Fixed by #1002
Open

Significant CPU spikes with Filter using more than 4 threads #1001

W4too opened this issue May 4, 2024 · 7 comments · Fixed by #1002

Comments

@W4too
Copy link

W4too commented May 4, 2024

I don't know if this issue is related to VCV, my system or the Surge XT plugin but i noticed that i get CPU spikes when i have to use more than 4 threads with my patches and modulating a third Filter instance. With 2 instances, nothing really moves on the max digit but with 3, it can easely jump from 50 % to 200 or 300 %.

It's less visible in my example (a very basic patch) but this gap is multiplied by the patch size wich is problematic knowing i adapt the thread number to the ressource behavior.

I noticed the problem only with the Surge Filter but it could be related to my setup.

4_threads

5_threads

@baconpaul
Copy link
Contributor

Well its probably related to all three.

The filter uses a bunch of optimizations to run well in a single threaded environment which, i could easily imagine, deal poorly with thread migration and the like. I'm suprised it's that extreme though.

But also I note you don't have any audio in on the filter. I wonder if that's somehow messing me up! Have you tried it with just noise-in-noise-out on the stereo channel to make sure that it is a full test?

@W4too
Copy link
Author

W4too commented May 4, 2024

I first noticed the problem in a big patch using the stereo in and out of the filter.

Here's a first situational screen capture with 4 threads :
4_threads2

Here's the same patch with 5 threads :
5_threads2

As soon as i remove the LFO from the filter modulation input, the peak disapear.

Maybe i should make a test with sound-in / sound-out in a minimal patch but it will probably result the same way.
Could be usefull to know if other users get the same peaks in the same context to know if this is eventualy only related to my setup.

@baconpaul
Copy link
Contributor

I doubt it’s only your setup. Let me see this week if I can repro on my Mac.

i do have one thought which involves fpu flags and a bug we fixed in surge proper. If I make a nightly this week you know how to install and run thst yes? If not I’ll help out. But won’t get to it today.

interesting. On and absent modulation no problem right? And the problem is only at high mod depths?

@W4too
Copy link
Author

W4too commented May 4, 2024

If a nightly is a .vcvplugin to put in the VCV plugin folder, i know how to install it (i'm on Windows).
I didn't notice any problem without modulation but i don't know if it starts at high mod depths (more than 5v ?).
Thanks anyway.

@baconpaul
Copy link
Contributor

Ok cool I have a theory but can’t get to it until Monday. Will post here with more in the week

thanks for the report

baconpaul added a commit to baconpaul/surge-rack that referenced this issue May 5, 2024
Upgrade surge to 1.3.2

Also set the FPU guard in the VCF to perhaps address surge-synthesizer#1001

If this doesn't fix surge-synthesizer#1001 back down that FPU Guard
baconpaul added a commit that referenced this issue May 5, 2024
Upgrade surge to 1.3.2

Also set the FPU guard in the VCF to perhaps address #1001

If this doesn't fix #1001 back down that FPU Guard
@baconpaul baconpaul reopened this May 5, 2024
@baconpaul
Copy link
Contributor

Hi. sorry GitHub auto closed this when i referred to it in a PR. So re-opened.

I couldn't reproduce this on my mac, but i had one thought and made a change to the code.

https://github.com/surge-synthesizer/surge-rack/releases/tag/Nightly

Can you let me know if you still see it with that nightly? If that fixes it then I think there's a bug in rack which I need to mail support about - I'd sooner not leave that change in the codebase - but if that's not it then i'll need to boot windows and try and repro myself there.

@W4too
Copy link
Author

W4too commented May 6, 2024

Hi
I made the test with the nightly build and got the same problem.
Hope you can reproduce it on windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants