]> git.alsa-project.org Git - alsa-utils.git/commit
topology: add simple topology plugin mechanism
authorJaska Uimonen <jaska.uimonen@linux.intel.com>
Tue, 14 Dec 2021 15:11:51 +0000 (17:11 +0200)
committerJaroslav Kysela <perex@perex.cz>
Tue, 3 May 2022 11:23:36 +0000 (13:23 +0200)
commit44d3e8aa44fc12f95bfeef0e3a1051e8f77047b5
treef355754ec77bc3b78f65431d071b54df8c3c46be
parent8403967669eaa9405a43d430b4ac7e5f0ea1b75e
topology: add simple topology plugin mechanism

Add a simple plugin interface for processing the topology tree. There
can be cases where parts of the topology need to be translated from the
original format into something else. For example one could calculate
some kind of filter coefficients from filter parameters or some other
binary interface parameters from plain text topology tokens.

Mechanism is similar as in alsa-plugins and in the plugin there should
be only 1 function exported of the form:

int _snd_topology_##pluginname##_process (snd_config_t *input, snd_config_t *output)

Input and output parameters are snd_config tree before and after topology2
pre-processing. So the plugin can modify both if needed. There are cases
where the plugin may need to get information from input tree, but make
modifications to the output.

The plugins to be used can be defined in command line with:

alsatplg -DPREPROCESS_PLUGINS="foobar" -c topology.conf -p -o topology.tplg

Multiple plugins should be separated by ":".

Plugins to be used can also be defined with "Define" clause inside the
topology file (but command line takes precedence):

Define {
       PREPROCESS_PLUGINS "foobar"
}

Link: https://github.com/alsa-project/alsa-utils/pull/129
Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
topology/pre-process-external.h [new file with mode: 0644]
topology/pre-processor.c
topology/pre-processor.h