SKUtility Developer Options

The Starter Kit Utility (SKUtility) includes options for developers to build, flash, run and debug the AWX Amp application on the Starter Kit hardware. Following is the help text for the developer options:
python3 SKUtility.py dev -h

A screenshot of a computer program Description automatically generated
SKUtility developer options help text

Following are the developer actions that can be executed using the SKUtility Tool:

Developer Function Command
Build the AWX Amp application (rpiVirtualAmp) To build the AWX Amp application with the modified AWX External Object, run the command:
python3 SKUtility.py dev -pr rpiVirtualAmp -b
Build the DSP library (VirtualAmp.dll) for GTT To build the DSP library to be used in GTT with the modified AWX External Object, run the command:
python3 SKUtility.py dev -pr virtualAmp -b
Clean the build directory To remove traces of previous builds of either the AWX Amp application or the DSP library in the build directory, run the command:
python3 SKUtility.py dev -pr <rpiVirtualAmp/virtualAmp> -c
Flash the AWX Amp application To flash the custom AWX Amp application (built with the modified AWX External Object) on the Starter Kit hardware, run the command:
python3 SKUtility.py dev -pr rpiVirtualAmp -f
Start the AWX Amp application To start the newly flashed AWX Amp application, run the command:
python3 SKUtility.py dev -pr rpiVirtualAmp -rAlternatively, the following command can be used to reset the AWX Amp application on the Starter Kit hardware:
python3 SKUtility.py rmt -rst

Build AWX External Object

The GTT installation includes the source code for an example audio object called the “AWXAudioObjExt” in the following directory:

C:\Program Files\Harman\HarmanAudioworX\ext-reference-algorithms\external

It is accompanied by an audio object specification document named “AwxAudioObjExt.pdf” in the “docs” directory, explaining how the AO interacts with Extendable Audio Framework (xAF) API to implement a simple gain object.

The files “inc\AwxAudioObjExt\AwxAudioObjExt.h” and “src\AwxAudioObjExt\generic\AwxAudioObjExt.cpp” implement a class named “CAwxAudioObjExt”, which contain the functions that are called by the audio framework during initialization, tuning and run-time:

  1. init(): Called during initialization of the SFD. Assigns memory records and sets up initial states for the AO.
  2. calc(): Called at runtime with input and output stream buffers. Receives audio input frames from the framework and returns processed output audio frames in real-time.
  3. tuneXTP(): Called by a parallel tuning thread to change tuning states of the AO.

These functions can be modified as required to implement a custom audio processing algorithm.

Further information can be found APIs Basic Features and APIs.

C:\Program Files\Harman\HarmanAudioworX\ext‑reference‑algorithms\external\docs\AwxAudioObjExt\AwxAudioObjExt.pdf

The custom AO source code must then be compiled and built into the DSP library for GTT and the AWX Amp application for the Starter Kit hardware, both of which can be executed using the SKUtility tool. The following sections provide instructions on building the custom dll and executable for using the custom AWX External Object.

Building DSP Library with Custom Audio Object

The “ext-reference-algorithms” directory in the installation folder contains build configuration files to build the AWX External Object. Since the modifications are assumed to be made within the existing source code, the custom DSP library for GTT file can be built directly without any updates to the build configuration files by running the following commands in the “StarterKitUtility” directory of the installation folder:

python3 SKUtility.py dev -pr virtualAmp -c # clean the build directory

python3 SKUtility.py dev -pr virtualAmp -b # build the VirtualAmp.dll file

Upon successful compilation of the code, the output DSP library dll can be found in the following location in the installation folder.

xAF\public\lib\win64\Release\VirtualAmpExternal.dll

However, if there are additional files to be compiled along with the AWX External Object source files, they must be included in the below CMake file.

ext-reference-algorithms\external\src\AwxAudioObjExt\CMakeLists.txt

A close-up of a computer screen Description automatically generated

Loading the Custom DSP Library in GTT

The DSP library provides a toolbox of AOs for use in a signal flow, with information on configurations and tuning parameters and their memory requirements on different core types. To be able to use the custom AO in an SFD, the custom-built DSP library must be imported into GTT.

  1. First, start a new instance of GTT in “administrator” mode from the start menu, by right-clicking GTT and clicking Run As Administrator.
  2. In the home screen of GTT, go to the “Audio Library Manager’ and click the Load Audio Library button.
    A screenshot of a computer Description automatically generated
  3. Select the newly built “VirtualAmpExternal.dll” and click Open.
    A screenshot of a computer Description automatically generated
    GTT may show a warning if the imported DSP library has the same version number as an existing one in the library manager. It is recommended that a backup of any previously loaded DSP library is taken for safety. The default DSP library can still be found in the “AudioFrameworkDLLs” of the installation directory.
  4. Once the new DSP library is loaded, the custom AWX External Object can be accessed from the “Toolbox” panel under “External” tab in the signal flow designer view.
    A screenshot of a computer Description automatically generated

Building AWX Amp Application with the Custom Audio Object

The GTT installation also includes the necessary files to build the AWX Amp application along with the custom AO in “StarterKitrpiamp” directory of the installation folder.
To build the custom AWX Amp application, run the following commands from the “StarterKitUtility” folder.

python3 SKUtility.py dev -pr rpiVirtualAmp -c

python3 SKUtility.py dev -pr rpiVirtualAmp -b

A screen shot of a computer program

On successful completion, the “rpiVirtualAmp” executable can be found in the below location.

StarterKit\public\bin\arm64‑v8a\Release\rpiVirtualAmp

Flash the custom AWX Amp application on to the Starter Kit hardware by running the command:

python3 SKUtility.py dev -f

To start the AWX Amp application in the Starter Kit, run the command:

python3 SKUtility.py dev -r

Running Debug Session

The AWX Starter Kit facilitates remote debugging of custom Audio object code on the hardware with VS Code using a VS Code workspace and debug configurations that are included in the GTT installation.

Running a remote debug session requires some essential Linux packages to be present on the Raspberry Pi, which are pre-installed in the custom Raspberry PI image <download link>. When using the official Raspbian OS, these packages can be installed using the SKUtility tool by running the command.

python3 SKUtility.py dev -stp

The Raspberry Pi must be connected to the internet to install the required packages.

Running a Debug Session for the Custom AWX External Object

The below steps illustrate how to start a remote debug session and step-through the source code of the custom AWX External Object in an SFD on the Starter Kit hardware.

  1. First, set the Starter Kit to developer mode using the interactive configuration as explained in Starter Kit Utility Tool.
  2. Build the AWX Amp application in “debug” mode, flash it on to the Starter Kit, and start the AWX Amp application on the Starter Kit hardware by running the following commands.
    python3 SKUtility.py dev -pr rpiVirtualAmp -b -d
    python3 SKUtility.py dev -pr rpiVirtualAmp -f -d
    python3 SKUtility.py dev -r
  3. Now, in the GTT window, include the AWX External Object from the toolbox into the SFD, save the SFD and click “Send Device Config” from the “Device Designer” tab of GTT to flash the SFD on to the Starter Kit.
  4. Open a new window of VS Code, go to File > Open Workspace from File, and select the VS Code workspace file named “StartKitDebug.code-workspace” in “StarterKit” directory of the installation directory.
    A screenshot of a computer Description automatically generated
  5. Open the AWX External Object source file “external\src\AwxAudioObjExt\generic\AwxAudioObjExt.cpp” from the file tree.
    A screenshot of a computer Description automatically generated
  6. Place breakpoints in the source code by clicking to the left of the line number intended as shown below (line 42):
    A screenshot of a computer Description automatically generated
  7. Press the “F5” key to start the debug session. This step makes use of the following files to first start a “gdbserver” on the Starter Kit hardware, and thstarts a debug session on VS Code that attaches to the remote gdbserver.

StarterKit\StarterKitUtility\.vscode\launch.json
StarterKit\StarterKitUtility\.vscode\tasks.json

Once the debug session has started, the code will stop at the placed breakpoints as shown below.
A screenshot of a computer

Overview

The AudioworX Starter Kit apart from being a tool for quick onboarding and integration, also caters to audio algorithm developers enabling building and testing custom audio objects for AudioworX. The software package of the Starter Kit includes the source code for an example external audio object, which can be used as boilerplate code to implement custom audio algorithms, and VS Code workspace files for debugging the source code, along with additional options in the Starter Kit Utility to streamline development and testing.

This document provides instructions on setting up the developer environment for building and testing custom audio algorithms, starting with the installation of the toolchain, building the custom audio object in the DSP Library to be used in GTT, building the custom executable to be run on the Starter Kit hardware, and finally running a remote debug session to step-through code on the Starter Kit.

Related Topics

 

Setting Up the Developer Environment

Following is a list of software applications to be installed on a Windows PC to develop, build and debug custom audio objects (AOs) on the Starter Kit:

Download and install the above-mentioned pre-requisites on a Windows 10 or 11 PC.

For steps on how to install GTT and its pre-requisites, Refer to Installing AudioworX Setup.

The Raspberry Pi Toolchain

The main audio processing component of the AWX Starter Kit is the Raspberry Pi 5, which has ARM v8a (64-bit) cores. To cross-compile source code for this architecture, the GCC 10.2.1 toolchain is recommended and can be downloaded from Windows Toolchain for Raspberry Pi.

A screenshot of a computer Description automatically generated
Tool chain Installation

Install the toolchain in the default location (C:\SysGCC\raspberry64).

Python Dependencies

The GTT installation includes the Starter Kit Utility tool (SKUtility), a Python command-line application that provides the ability to remotely operate the Starter Kit hardware over the network. This tool is installed in the following directory (default GTT installation folder):

C:\Program Files\Harman\HarmanAudioworX\StarterKit\StarterKitUtility

For more information on Starter Kit installation and setup, refer to the “Required Software Applications” section of Starter Kit Requirements.