About This Guide
This Application Note explains how to trace your custom module code in Native mode in Visual Studio and MATLAB.
Prerequisites
MATLAB r2017b or later with Audio Signal Processing Toolbox license
Microsoft Visual Studio 2019
DSP Concepts Audio Weaver Pro License with Signal Processing Toolbox
DSP Concepts Custom Module Developer’s License
The Custom Module Developers’ Guide
Follow the instructions at Creating Custom Modules (dspconcepts.com) to get started developing code for your module.
Build the Example modules
In your Audio Weaver Pro installation folder, open the Visual Studio 2019 solution file
C:\DSP Concepts\<AWE Pro Path>\AWEModules\Source\Examples\ Examples_VS2019.sln
Set the configuration for “Debug x86”.
...
3. The following step is not necessary if FrameDll.lib is already in C:\DSP Concepts\<AWE Pro Path>\Bin\win32-vc142-dbg.
...
If the file is not found, you will see:
...
Rebuild the solution to recompile everything. Successful output is shown below.
...
Copy the ExamplesDLL.dll and ExamplesDLL.pdb files to your Audio Weaver’s Bin folder, e.g.
C:\DSP Concepts\<AWE Pro path>\Bin\win32-vc142-rel
Run Audio Weaver from MATLAB.
...
Confirm that the Examples folder is in your module path (File->Set Module Path).
...
Debugging MATLAB code
At some point you may wish to stop the MATLAB code and single step to see which path it takes, and/or look at variables.
...
No further MATLAB breakpoints are encountered in this simple example. More elaborate modules may contain additional MATLAB functions.
Debugging C/C++ code in Visual Studio 2019
You should already have the Examples_VS2019.sln solution open in Visual Studio 2019.
...
The green lines highlight the inner loop which processes all samples in the block one by one.
Debugging strategies
The Scaler Example, due to its simplicity, does not implement many of the possible functions available to module developers. The following example demonstrates a more elaborate module.
...
This guide has asked you to hit “Continue” at each breakpoint, just to understand what makes each one happen and get to the next one. It is highly recommended that you additionally single step through the various functions provided in the Example modules.
Modifying C code in VS2019
While it is possible to make changes directly to your ModModuleName.c source file in Visual Studio and recompile it to quickly check changes, remember that the file is generated from the “Inner” source code fragments and will be overwritten the next time you run the module’s “make” MATLAB script. Be sure to copy any valid changes back to your Inner .c files!
Bad things can happen
AWE Server can crash. It may be necessary to reconnect to restart it from AWE Designer.
AWE Designer can crash. It may be necessary to restart it.
It may be necessary to restart MATLAB.
It may be necessary to force kill MATLAB using Task Manager.
You may have to reattach the VS2019 debugger to AWE Server (use “Debug->Reattach to Process”)
1
...