Components
Structure of a component
A component is a module that can be instantiated in a higher-level graph by referring to its template file (.comp file), and choosing values for a minimal subset of parameters. Component complexity may range from a single filter to audio graphs like echo filtering or active noise cancellation.
Each component must contain the following:
|<component>.comp
A YAML file that contains the general component model’s description. The main interface to reading and writing those files is theCMCore
package.|src
The source directory of the component model. The component model runs on the host computer (as opposed to an implementation, that builds and runs on the target)| |CMakeLists.txt
Build directive| |<component>.h
Public header| |<component>_int.h
Private header| |<component>.c
Component source file| |test_<component>_common.h
Test header| |main_<component>.c
Test source|test
The test directory of the component| |nonreg.py
The non-regression test script| | A collection of input and output test files|README.rst
The documentation of the component
Optionally, a component may also contain:
One directory for each implementation, called
<target>_<implementation>_<component>
. For the GAP9 target, implementations may be of typecluster
,fc
orsfu
, depending on the targeted block. For example, the FC implementation of the FFT is calledgap9_fc_fft
. The structure of the directory then mirrors that of the model, with a .comp file, asrc
and atest
directories.A
parameter_converter.py
script. It contains an instantiation of theParameterconverter
class, and is contains script that verify the consistency of the component instantiation.A
mat
directory, which contains the Matlab wrapper on top of the C model, as well as a Matlab model.A
py
directory, which contains the equivalent code for Python
A component may also contain implementation may also have directories such as cluster
or fc
that contain related source code to be build for the target (GAP9) application.
Some examples of components with several hardware and software implementations are:
components/downmixer
components/fft
Developing custom components
Other libraries
Several other tools are contained in the Audio Framework to help manage and create components:
CMCore is the library used to create, read and modify
.comp
files. It contains the basic description of a component, most notably its inputs, outputs, parameters (static and non-static).The Component Generator is able to create the template for a component, based on a
.comp
file or a basic description (number of parameters, static parameters, number of inputs and outputs…).
include:: component_dev.rst