|
07-17-2019, 06:27 PM
|
#1
|
Human being with feelings
Join Date: Apr 2018
Posts: 396
|
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!
Last edited by Nonlinear; 07-18-2019 at 09:09 AM.
|
|
|
07-17-2019, 10:36 PM
|
#2
|
Human being with feelings
Join Date: Apr 2018
Posts: 396
|
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()".
|
|
|
07-18-2019, 10:48 AM
|
#3
|
Human being with feelings
Join Date: Dec 2015
Posts: 331
|
Quote:
Originally Posted by Nonlinear
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.
|
|
|
07-18-2019, 11:31 AM
|
#4
|
Human being with feelings
Join Date: Apr 2018
Posts: 396
|
Quote:
Originally Posted by earlevel
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.
|
|
|
07-18-2019, 12:04 PM
|
#5
|
Human being with feelings
Join Date: Dec 2015
Posts: 331
|
Quote:
Originally Posted by Nonlinear
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.
|
|
|
07-18-2019, 02:19 PM
|
#6
|
Human being with feelings
Join Date: Apr 2018
Posts: 396
|
Quote:
Originally Posted by earlevel
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. 👍
|
|
|
07-18-2019, 02:47 PM
|
#7
|
Human being with feelings
Join Date: Dec 2015
Posts: 331
|
Quote:
Originally Posted by Nonlinear
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...
|
|
|
07-18-2019, 06:30 PM
|
#8
|
Human being with feelings
Join Date: Apr 2018
Posts: 396
|
Quote:
Originally Posted by earlevel
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?
|
|
|
07-19-2019, 09:36 AM
|
#9
|
Human being with feelings
Join Date: Dec 2015
Posts: 331
|
Quote:
Originally Posted by Nonlinear
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.
|
|
|
09-28-2019, 09:06 AM
|
#10
|
Human being with feelings
Join Date: May 2014
Location: Germany
Posts: 643
|
Quote:
Originally Posted by Nonlinear
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!
|
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 11:52 PM.
|