DPF to VST data problem ?

Programming applications for making music on Linux.

Moderators: khz, MattKingUSA

User avatar
marbangens
Established Member
Posts: 21
Joined: Fri Nov 16, 2018 8:39 pm

DPF to VST data problem ?

Postby marbangens » Sat Aug 24, 2019 2:20 pm

Hey, sometimes when I create more then 1 vst's in the daw, they crash.
What happens is that I hear a click then the audio on that channel is dead.
The Ui still works and running more then one standalone jack works fine.

what could cause this? :?
I tried google but I don't understand the problem or what to look for
https://github.com/martinbangens/DistoTV/blob/master/plugins/DistoTV/DistoTVUI.hpp

jpcima
Established Member
Posts: 5
Joined: Tue Aug 13, 2019 6:18 am

Re: DPF to VST data problem ?

Postby jpcima » Sat Aug 24, 2019 2:35 pm

It's typical of a dsp which produces NaN values or infinity at some point, and this math error propagates to the output signal and cuts the sound.

User avatar
Michael Willis
Established Member
Posts: 845
Joined: Mon Oct 03, 2016 3:27 pm
Location: Rocky Mountains, North America
Contact:

Re: DPF to VST data problem ?

Postby Michael Willis » Sat Aug 24, 2019 5:25 pm

Like jpcima says, it might be a problem with NaN or infinite. Look at UNDENORMAL from freeverb3 or SR2_UNDENORMAL from libsamplerate for the countermeasure.

It is also possible that you are using global or static variables, in which case multiple instances of your plugin will contend over the same memory.

Also you need to be very careful with pointers. If you are using pointers and anything goes wrong, it can corrupt memory and cause any manner of bad behavior or crash your plugin and the DAW with it.

User avatar
marbangens
Established Member
Posts: 21
Joined: Fri Nov 16, 2018 8:39 pm

Re: DPF to VST data problem ?

Postby marbangens » Sat Aug 24, 2019 7:08 pm

Thanks :D gonna look into it :D

User avatar
marbangens
Established Member
Posts: 21
Joined: Fri Nov 16, 2018 8:39 pm

Re: DPF to VST data problem ?

Postby marbangens » Sun Aug 25, 2019 11:08 am

Don't get any NuN or Inf from std::fpclassify() like this

Code: Select all

float CheckForBadEggs(double input){
    switch(std::fpclassify(input)) {
        case FP_INFINITE:
     had_Inf = true;
     return 0.0;
        case FP_NAN:
     had_NuN = true;
     return 0.0;

        default:
     return 0.0;
   }
}

That code would work for checking that correctly right?
I think it's a pointer problem. Here is a good video I think explains this
https://www.youtube.com/watch?v=iNuTwvD6ciI

jpcima
Established Member
Posts: 5
Joined: Tue Aug 13, 2019 6:18 am

Re: DPF to VST data problem ?

Postby jpcima » Sun Aug 25, 2019 9:40 pm

Did you take in account the flag -ffast-math which DPF has as default? maybe try to build in DEBUG=true.

A reason is that, under fast-math optimization, the compiler can consider anormal values as not happening.
It can allow itself to remove isnan() checks, and produce simpler assembly for fpclassify().

You can compare yourself between -O2 -ffast-math, and with only -O2
https://godbolt.org/z/sYcmMP

User avatar
marbangens
Established Member
Posts: 21
Joined: Fri Nov 16, 2018 8:39 pm

Re: DPF to VST data problem ?

Postby marbangens » Mon Aug 26, 2019 12:36 pm

I got this with DEBUG=true

Code: Select all

had_NuN=1

seems to be from the one vst of 3 that failed
I can't really separate them.
so something like this

Code: Select all

        // Wet knob final blend in
         outFinalL = (sigL1*0.0001*fWet) + sigDryL1 - (sigDryL1*0.0001*fWet);
         outFinalR = (sigR2*0.0001*fWet) + sigDryR2 - (sigDryR2*0.0001*fWet);

would brake the vst? I Haven't seen any problems with the jack stand alone version, why is that different?
wont the host separate them in ram or it has nothing to do with it?

User avatar
marbangens
Established Member
Posts: 21
Joined: Fri Nov 16, 2018 8:39 pm

Re: DPF to VST data problem ?

Postby marbangens » Fri Aug 30, 2019 12:43 pm

I found the problem :D

Code: Select all

sig = sig * (2*gain);
 
  if (sig < 0.000000001f and sig > -0.000000001f){
   sig = sin(sig);
  }
  sig = sig + sin(0.000000000000000000000000001f);

Don't do that :lol:
but now one of them was created with full volume :lol:
oh man...


Return to “Developer's Section”

Who is online

Users browsing this forum: No registered users and 5 guests