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 12-28-2018, 07:36 PM   #1
Nonlinear
Human being with feelings
 
Join Date: Apr 2018
Posts: 396
Default Plugin works perfectly in real time - fails on render

A plugin that I am building works perfectly in every host I have tried in real time but fails when I try to render in Wavelab Pro 9 with “a serious error has occurred”.

Is there a typical/most likely cause for this situation? How do I diagnose this?
Nonlinear is offline   Reply With Quote
Old 12-28-2018, 08:22 PM   #2
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Run a debug build under the debugger to see where exactly it fails? Or does Wavelab refuse to run under a debugger?
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
Xenakios is offline   Reply With Quote
Old 12-28-2018, 09:54 PM   #3
Nonlinear
Human being with feelings
 
Join Date: Apr 2018
Posts: 396
Default

I am familiar with debugging/stepping through “exe” builds but not dlls running in a separate host. Appreciate any tips or links on how to set this up. Currently testing VST3 on x64 PC.


BTW - I have found this render issue only happens in WAVELAB - works properly in other DAWs.

Last edited by Nonlinear; 12-28-2018 at 10:47 PM.
Nonlinear is offline   Reply With Quote
Old 12-28-2018, 11:19 PM   #4
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Quote:
Originally Posted by Nonlinear View Post
I am familiar with debugging/stepping through “exe” builds but not dlls running in a separate host.
Just set the host's .exe as the "command" to be run in the Visual Studio project debugging settings. Pressing F5 to start debugging will then launch the host and if the built plugin crashes or asserts, the debugger should bring up the IDE. (This is for Visual Studio but things work similarly for XCode on macOs.)
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
Xenakios is offline   Reply With Quote
Old 12-28-2018, 11:26 PM   #5
Nonlinear
Human being with feelings
 
Join Date: Apr 2018
Posts: 396
Default

Yes - got it - thank you.

Problem is with "SetLatency()" - Exception thrown in WaveLab9_1_64.exe: 0xC0000005: Access violation reading location 0x0000000000000000.

I'm calling SetLatency() at the beginning of each ProcessDoubleReplacing() block after checking sample rate. The plugin's latency does not change with any user controls but IS a function of sample rate - is there a better place to check sample rate and call SetLatency() in this case?

And why is this only a problem when rendering and not in real time playback - and why only in Wavelab?

Last edited by Nonlinear; 12-28-2018 at 11:45 PM.
Nonlinear is offline   Reply With Quote
Old 12-29-2018, 06:02 AM   #6
random_id
Human being with feelings
 
random_id's Avatar
 
Join Date: May 2012
Location: PA, USA
Posts: 356
Default

I have had problems like this before.

Try replacing IPlugVST3::SetLatency in IPlugVST3.cpp with this...
Code:
  IPlugBase::SetLatency(latency);
  if (componentHandler != NULL) {
	  FUnknownPtr<IComponentHandler>handler(componentHandler);
	  handler->restartComponent(kLatencyChanged);
  }
__________________
Website: LVC-Audio
random_id is offline   Reply With Quote
Old 12-29-2018, 09:35 AM   #7
Nonlinear
Human being with feelings
 
Join Date: Apr 2018
Posts: 396
Default

Quote:
Originally Posted by random_id View Post
I have had problems like this before.

Try replacing IPlugVST3::SetLatency in IPlugVST3.cpp with this...
Code:
  IPlugBase::SetLatency(latency);
  if (componentHandler != NULL) {
	  FUnknownPtr<IComponentHandler>handler(componentHandler);
	  handler->restartComponent(kLatencyChanged);
  }

Thank you, yes I saw your thread with similar issue. Will try the code above.

Curious why this isn't a common question/problem posted here?
Nonlinear is offline   Reply With Quote
Old 12-30-2018, 11:14 AM   #8
Nonlinear
Human being with feelings
 
Join Date: Apr 2018
Posts: 396
Default

Quote:
Originally Posted by random_id View Post
I have had problems like this before.

Try replacing IPlugVST3::SetLatency in IPlugVST3.cpp with this...
Code:
  IPlugBase::SetLatency(latency);
  if (componentHandler != NULL) {
	  FUnknownPtr<IComponentHandler>handler(componentHandler);
	  handler->restartComponent(kLatencyChanged);
  }
Yes! That fixed it. Thank you! I would have never found that on my own, how did you drill down to that solution?
Nonlinear is offline   Reply With Quote
Old 12-30-2018, 11:21 AM   #9
random_id
Human being with feelings
 
random_id's Avatar
 
Join Date: May 2012
Location: PA, USA
Posts: 356
Default

Quote:
Originally Posted by Nonlinear View Post
Yes! That fixed it. Thank you! I would have never found that on my own, how did you drill down to that solution?
I stepped through debugging and found that componentHandler wasn't initialized (e.g., set to NULL). Some DAWs and plugin formats do some weird things between Reset, ProcessDoubleReplacing, and the plugin's constructor.
__________________
Website: LVC-Audio
random_id is offline   Reply With Quote
Old 12-30-2018, 01:01 PM   #10
pressplay
Human being with feelings
 
pressplay's Avatar
 
Join Date: Sep 2017
Location: Berlin
Posts: 47
Default

Quote:
Originally Posted by Nonlinear View Post
is there a better place to check sample rate and call SetLatency() in this case?
If the sample rate changes, you can assume that reset() is called. You should override this function, get the sample rate and recalculate the latency there. Doing it on every processing block is probably wrong or at least inefficient.
pressplay 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 09:22 AM.


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