COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :

Go Back   Cockos Incorporated Forums > Other Software Discussion > WDL users forum

Reply
 
Thread Tools Display Modes
Old 07-17-2019, 06:27 PM   #1
Nonlinear
Human being with feelings
 
Join Date: Apr 2018
Posts: 396
Default SetLatency() doesn't work in Pro Tools?

I have an aaxplugin that I cloned from another plugin that works successfully in Pro Tools. The new one, however, doesn't work. Pro Tools gives an error message when I try to load the plug (see attached).

Visual Studio debugger reports the following upon attempting to load the plugin:

Invalid parameter passed to C runtime function.
Exception thrown at 0x00007FFF06839129 (KernelBase.dll) in ProTools.exe: 0x000006BA: The RPC server is unavailable.


A possible difference between the plugin that does NOT work and the one that DOES work is that the faulty plugin reports latency to the host. Is there a special requirement - or place in the code blocks - for reporting plugin latency to Pro Tools? I am currently using GetSampleRate() followed by SetLatency() in the Reset() function (also called as the last step in the constructor).

Maybe it's something else entirely? IDK

Any help appreciated!
Attached Images
File Type: png PT AAE error.png (11.4 KB, 294 views)

Last edited by Nonlinear; 07-18-2019 at 09:09 AM.
Nonlinear is offline   Reply With Quote
Old 07-17-2019, 10:36 PM   #2
Nonlinear
Human being with feelings
 
Join Date: Apr 2018
Posts: 396
Default

OK, I have confirmed that "SetLatency()" is the problem. When commented out the plugin loads and runs in Pro Tools.


So, what is the trick to reporting latency to Pro Tools? I can't use a fixed number - I need to change it (for FIR filters, buffers, etc.) depending on return value of "GetSampleRate()".
Nonlinear is offline   Reply With Quote
Old 07-18-2019, 10:48 AM   #3
earlevel
Human being with feelings
 
Join Date: Dec 2015
Posts: 331
Default

Quote:
Originally Posted by Nonlinear View Post
A possible difference between the plugin that does NOT work and the one that DOES work is that the faulty plugin reports latency to the host. Is there a special requirement - or place in the code blocks - for reporting plugin latency to Pro Tools? I am currently using GetSampleRate() followed by SetLatency() in the Reset() function (also called as the last step in the constructor).
I use GetSampleRate/SetLatency in my Reset, successfully.

You say, "also called as the last step in the constructor". I'm not sure whether that's a problem, but I think Reset is called for you (from EffectInit, I think). I don't have time to check that out, but offhand it seems the only thing you're doing different from me is calling Reset or SetLatency in the constructor.

I'm using https://github.com/earlevel/wdl-ol/tree/earlevel, but I don't think I changed anything that affects SetLatency directly.
earlevel is offline   Reply With Quote
Old 07-18-2019, 11:31 AM   #4
Nonlinear
Human being with feelings
 
Join Date: Apr 2018
Posts: 396
Default

Quote:
Originally Posted by earlevel View Post
I use GetSampleRate/SetLatency in my Reset, successfully.

You say, "also called as the last step in the constructor". I'm not sure whether that's a problem, but I think Reset is called for you (from EffectInit, I think). I don't have time to check that out, but offhand it seems the only thing you're doing different from me is calling Reset or SetLatency in the constructor.

I'm using https://github.com/earlevel/wdl-ol/tree/earlevel, but I don't think I changed anything that affects SetLatency directly.
Hmm, I will try that but I read somewhere that some hosts don’t reliably call Reset() so I’ve been intentionally calling it as the last line in my constructors. Is that bad or at least unnecessary? I need to make sure delay arrays, filters, etc. are all cleared and initialized for the current sample rate.

Last edited by Nonlinear; 07-18-2019 at 11:45 AM.
Nonlinear is offline   Reply With Quote
Old 07-18-2019, 12:04 PM   #5
earlevel
Human being with feelings
 
Join Date: Dec 2015
Posts: 331
Default

Quote:
Originally Posted by Nonlinear View Post
Hmm, I will try that but I read somewhere that some hosts don’t reliably call Reset() so I’ve been intentionally calling it as the last line in my constructors. Is that bad or at least unnecessary? I need to make sure delay arrays, filters, etc. are all cleared and initialized for the current sample rate.
Don't know for sure offhand, but the question only matters if you remove the Reset call from the constructor and it fixes your plug-in failure.
earlevel is offline   Reply With Quote
Old 07-18-2019, 02:19 PM   #6
Nonlinear
Human being with feelings
 
Join Date: Apr 2018
Posts: 396
Default

Quote:
Originally Posted by earlevel View Post
Don't know for sure offhand, but the question only matters if you remove the Reset call from the constructor and it fixes your plug-in failure.
That’s true - as long as it doesn’t break it somewhere else!

Thank you for the info. 👍
Nonlinear is offline   Reply With Quote
Old 07-18-2019, 02:47 PM   #7
earlevel
Human being with feelings
 
Join Date: Dec 2015
Posts: 331
Default

Quote:
Originally Posted by Nonlinear View Post
That’s true - as long as it doesn’t break it somewhere else!
Well, what I mean is that if you remove the Reset from the constructor and it fixes the problem, then it's time to figure out if that removal might cause another problem. If it doesn't fix it, though, you can put it back and not necessarily care about that question—but of course you need to dig further to find the crash problem...
earlevel is offline   Reply With Quote
Old 07-18-2019, 06:30 PM   #8
Nonlinear
Human being with feelings
 
Join Date: Apr 2018
Posts: 396
Default

Quote:
Originally Posted by earlevel View Post
Well, what I mean is that if you remove the Reset from the constructor and it fixes the problem, then it's time to figure out if that removal might cause another problem. If it doesn't fix it, though, you can put it back and not necessarily care about that question—but of course you need to dig further to find the crash problem...
Understood - and it worked! Commenting out the call to Reset() in the constructor fixed the Pro Tools problem. I checked at several sample rates and latency compensation is spot on. Now I need to check in VST and AU hosts to make sure nothing broke...

Hmmm - wonder if this caused problems anywhere else that I wasn't aware of?

So, do you only call SetLatency() inside your Reset() block? Ever had any issues with your plugin's latency NOT being picked up here?
Nonlinear is offline   Reply With Quote
Old 07-19-2019, 09:36 AM   #9
earlevel
Human being with feelings
 
Join Date: Dec 2015
Posts: 331
Default

Quote:
Originally Posted by Nonlinear View Post
So, do you only call SetLatency() inside your Reset() block? Ever had any issues with your plugin's latency NOT being picked up here?
Not that I know of, but it's not something I've tested extensively.
earlevel is offline   Reply With Quote
Old 09-28-2019, 09:06 AM   #10
TBProAudio
Human being with feelings
 
TBProAudio's Avatar
 
Join Date: May 2014
Location: Germany
Posts: 643
Default

Quote:
Originally Posted by Nonlinear View Post
I have an aaxplugin that I cloned from another plugin that works successfully in Pro Tools. The new one, however, doesn't work. Pro Tools gives an error message when I try to load the plug (see attached).

Visual Studio debugger reports the following upon attempting to load the plugin:

Invalid parameter passed to C runtime function.
Exception thrown at 0x00007FFF06839129 (KernelBase.dll) in ProTools.exe: 0x000006BA: The RPC server is unavailable.


A possible difference between the plugin that does NOT work and the one that DOES work is that the faulty plugin reports latency to the host. Is there a special requirement - or place in the code blocks - for reporting plugin latency to Pro Tools? I am currently using GetSampleRate() followed by SetLatency() in the Reset() function (also called as the last step in the constructor).

Maybe it's something else entirely? IDK

Any help appreciated!

A little bit late but:


AAX->SetLatency() works perfectly in audio thread!
__________________
www.tbproaudio.de
TBProAudio 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 04:34 PM.


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