Debugging VST 2.4 part 1 : Visual Studio

VST 2.4 is still mandatory if you want to be compatible with most of the DAW / Sequencer applications on the market.
For this first article, we’ll talk about Visual Studio on Windows.

1. Debug 32 bit VST in Visual Studio

When it comes to debugging, you want something fast!
Here’s some useful softwares for debugging.
We need applications that can take a VST plugin as command line argument, are lightweight, fast to open, and bug-free (ideally).

1.1 Setup debugging in your Visual project

1) open the properties of your project (Menu -> Project -> Properties , or right click on the project name in the solution explorer and choose “properties”).
Then go to “Configuration Properties” -> Debugging

Debug properties in Visual Studio

Debug properties in Visual Studio

2) then you need to fill the three first fields with the right information

Command : the path to the VST host application
Command Arguments : the command line arguments you pass to the executable, in our case, the name of the plugin we are coding.
Working Directory : the directory where your plugin is ! in our case, the debug directory.

Now you can use “start debugging (F5)” : this will launch the VST host application, with your plugin loaded in. You can set debug break points in your code

1.2 Debug VST with Cantabile 1.2 Lite

Cantabile 1.2

Cantabile 1.2 lite

download : Cantabile 1.2 lite on archive.org

Cantabile lite is fast, has a clean and nice interface, and can take a VST plugin as command line argument.

1) installation :
if you’re on Windows XP, just run the setup executable and follow the instructions.
if you’re on Windows Vista , or Windows 7 or higher, run setup as administrator and change the target directory for the application : choose a target directory other than “Program Files (x86)”, because Cantabile may need to write log files (useful when debugging). You can install it in something like C:/MyPrograms/ .

2) setting up the Cantabile VST Host application :
You can make your workflow even faster with some settings, launch Cantabile Lite then go to Tools -> Options :
in “General” tab : uncheck “prompt to save modified sessions”
in “Startup / shutdown” tab : uncheck “Prompt before exiting” and check “Escape key exits”
in “VST Plugins” : check “Automatically open plugin editor when loading plugins”

In “General” tab you also have the “Diagnostic and troubleshooting” button:

Cantabile diagnostic options

Cantabile diagnostic options

You have useful options when it comes to VST debugging.
Cantabile can write a log file, you have different log level, the log file may be useful for debugging.

Cantabile can also route the audio in directly to the plugin, it’s useful when debugging VST effects.

 

1.3 Debug with SAVIHost 32 bit

VST Speek in Savihost

VST Speek in Savihost

You can download Savihost 32 here : http://www.hermannseib.com/english/savihost.htm

Like Cantabile, you can run it directly from the debugger.
Savihost have also two useful command line parameters for debugging :
/noexc  : “No Exception Check” it turns off the outermost exception handler.
/noft  : “No Fault Tolerance” :  turns off all exception checks.

1.4 VST Plugins Unit Test

VST-Plugin Unit Test

VST-Plugin Unit Test

informations and download : http://www.savioursofsoul.de/Christian/programs/tools/#VUnit

note : the PDF manual is only present in the .exe setup download.
This VST host doesn’t make any sound, it’s designed for stress test!
You can torture test your plugin : this program runs automated tests for  your VST plugin.
It can be helpful for testing your plugin in extreme conditions.

 

1.5 VST Host by Hermann Seib

VST Host (open source)

VST Host (open source)

download here : http://www.hermannseib.com/english/vsthost.htm

You can use it like Savihost, it also has the same command line option for the exception checking :
/noexc  : “No Exception Check” it turns off the outermost exception handler.
/noft  : “No Fault Tolerance” :  turns off all exception checks.

 

1.6 VST Host open source

VST Host (open source)

VST Host (open source)

For even more advanced debugging, you can load the open source version of VST Host and set a multi project in Visual Studio with VST Host and your plugin.

1) load VST Host open source v1.16q  by Hermann Seib : http://www.hermannseib.com/english/vsthost.htm

2) you may need to download ASIO 2 SDK http://www.steinberg.net/en/company/developers.html and / or Microsoft DirectX SDK : http://www.microsoft.com/en-us/download/details.aspx?id=6812
We suppose you already have the VST SDK 2.4.

3) open the VST host solution file

3) right click on the solution’s name in the Visual Studio solution browser and choose Add->Existing project…
then select the vcproj/vcxproj file of your plugin project

4) select “start debugging (F5)” : this will launch VST Host, then load your plugin from VST Host : choose your plugin .dll file in your debug folder, then quit VST Host without unloading the plugin. VST host remember the last opened plugin(s) et reload it the next time. Or you can just setup the “command argument” in the debugging tab of the VST Host project properties so it loads your plugin when launched from the debugger.

5) now you can setup break points in your plugin code AND in the VST host code : this can be helpful for a better understanding of how your plugin communicate with the host and vice versa.

 

1.7 Using PluginConsultant

PluginConsultant

PluginConsultant

Download : http://www.hermannseib.com/PluginConsultant/

This one is a VST plugin, it monitors and log the dispatcher and audiomaster call between the plugin and the host

 

2. if you develop 64 bit version :

Cantabile Lite exists only as 32 bit application.
You can download Savihost 64 and  VST Host 64 : http://www.hermannseib.com/english/

 

One thought on “Debugging VST 2.4 part 1 : Visual Studio

Leave a Reply

Your email address will not be published. Required fields are marked *