Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Bug Reports

Reply
 
Thread Tools Display Modes
Old 01-14-2022, 12:59 AM   #1
Phazma
Human being with feelings
 
Join Date: Jun 2019
Posts: 2,872
Default Constant low level signal in most JSFX (even Cockos)

A licecap is worth a thousand words:



I find this behavior in most (but not all) JSFX. The Cockos metering JS are unaffected but metering JS by other developers (even without audio code) are affected.

Also other plugin types are not affected. So I guess this is some JS bug.
Phazma is offline   Reply With Quote
Old 01-14-2022, 04:11 AM   #2
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 15,749
Default

It's anti-denormalization. See ext_nodenorm here:
https://www.reaper.fm/sdk/js/vars.php#js_specialvars
schwa is offline   Reply With Quote
Old 01-14-2022, 06:56 AM   #3
Phazma
Human being with feelings
 
Join Date: Jun 2019
Posts: 2,872
Default

Ok thanks adding ext_nodenorm=1 makes it go away.. I am wondering what anti-denormalization actually is and why it is there by default. For sure it has some benefits. But I guess a google search will answer that question.
Phazma is offline   Reply With Quote
Old 01-14-2022, 08:26 AM   #4
Phazma
Human being with feelings
 
Join Date: Jun 2019
Posts: 2,872
Default

Found the option Preferences > Plug-Ins > Compatibility > "Reduce denormalization from plug-ins"

This is a good explanation. So it seems it is needed to avoid potential high CPU spikes.

Strangely this signal doesn't disappear if I disable the preference (even if I reload a plugin).

But I guess it is better to leave it on anyway. At least now I know what this is and that it's there on purpose.
Phazma is offline   Reply With Quote
Old 01-14-2022, 08:35 AM   #5
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 15,749
Default

That general preference affects everything *but* jsfx. JSFX have anti-denorm enabled by default, unless the specific plugin includes ext_nodenorm in the @init section.
schwa is offline   Reply With Quote
Old 01-14-2022, 08:48 AM   #6
Phazma
Human being with feelings
 
Join Date: Jun 2019
Posts: 2,872
Default

Ok got it. Thanks for letting me know.
Phazma is offline   Reply With Quote
Old 01-14-2022, 11:54 AM   #7
ashcat_lt
Human being with feelings
 
Join Date: Dec 2012
Posts: 7,271
Default

OK but this issue comes from the discussion of the meter plugin, right?

https://forum.cockos.com/showthread.php?p=2516247

That code doesn’t output any audio and it feels pretty unintuitive that it would change the audio at all. Does it have to?
ashcat_lt is online now   Reply With Quote
Old 01-14-2022, 12:25 PM   #8
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 15,749
Default

No plugin has to, the plugin author can add ext_nodenorm if they want to.

The purpose of anti-denormalization is to prevent the audio processing from entering a state that is more CPU intensive than necessary. It doesn't matter if the plugin is generating output, as long as it is doing any calculations using the signal input, then denormalization is relevant.

The benefit of anti-denormalization varies, but the cost, namely extra signal at -300dB, is extremely small.
schwa is offline   Reply With Quote
Old 01-14-2022, 01:27 PM   #9
ashcat_lt
Human being with feelings
 
Join Date: Dec 2012
Posts: 7,271
Default

I guess there are things one can do in their code to avoid these CPU spikes? But of course we can’t really assume that any given plugin has done any of that. In fact, I feel like we almost have to assume they haven’t unless they’ve already added that line. So it’s not really safe to just go sticking it in anywhere I feel like I want it. If it’s just the way she goes, then that’s where we’re at.

I haven’t actually looked into this at all, and I’m not in a place I can look, but does disconnecting the plug’s output pins solve this issue. I would expect that to keep it from altering the audio stream at all, but...
ashcat_lt is online now   Reply With Quote
Old 01-15-2022, 12:28 PM   #10
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 15,721
Default

We could probably remove the anti-denormal noise in JSFX (the other mechanisms to avoid denormals have evolved since it was originally introduced), though doing so would be of little benefit anyway.

(and there might be plugins that have their performance get degraded by denormals in certain instances)

Last edited by Justin; 01-15-2022 at 12:33 PM.
Justin is offline   Reply With Quote
Old 01-16-2022, 02:45 PM   #11
Phazma
Human being with feelings
 
Join Date: Jun 2019
Posts: 2,872
Default

Quote:
Originally Posted by Justin View Post
We could probably remove the anti-denormal noise in JSFX (the other mechanisms to avoid denormals have evolved since it was originally introduced), though doing so would be of little benefit anyway.

(and there might be plugins that have their performance get degraded by denormals in certain instances)
Hmm, how about extending "Preferences > Plug-Ins > Compatibility > Reduce denormalization from plug-ins" to affect also JSFX? The creator of a JSFX could override the preference by defining ext_nodenorm as either 0 or 1 and if undefined the user preference is used.
Phazma is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 01:00 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.