]> git.alsa-project.org Git - alsa-utils.git/commit
topology: pre-processor: Add support for CombineArrays
authorRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Wed, 24 May 2023 01:13:35 +0000 (18:13 -0700)
committerJaroslav Kysela <perex@perex.cz>
Tue, 1 Aug 2023 07:40:51 +0000 (09:40 +0200)
commit9d058fff2756dd0d0db7383ecdefb2f63dcd672a
tree620ebb9250acdc4e261c240220589d4bc92df242
parentd6a71bfbde9e1710743d3a446c6ea3b41c45234e
topology: pre-processor: Add support for CombineArrays

Introduce a new keyword, "CombineArrays" to instantiate multiple nodes
of the type specified. For example:

CombineArrays.Object.Base.input_audio_format [
{
in_rate [
8000
16000
48000
]
in_bit_depth [
32
]
in_valid_bit_depth [
24
32
]
}
]

This would be expanded into 6 objects with the rate, bit_depth and
valid_bit_depth combinations of the arrays of values above.

Object.Base.input_audio_format [
{
in_rate 8000
in_bit_depth 32
in_valid_bit_depth 32
}
{
in_rate 16000
in_bit_depth 32
in_valid_bit_depth 32
}
{
in_rate 48000
in_bit_depth 32
in_valid_bit_depth 32
}
{
in_rate 8000
in_bit_depth 32
in_valid_bit_depth 24
}
{
in_rate 16000
in_bit_depth 32
in_valid_bit_depth 24
}
{
in_rate 48000
in_bit_depth 32
in_valid_bit_depth 24
}
]

The CombineArrays definition is an array so that multiple combinations can
be specified in order to deal with only valid combinations. For example,
16-bit bit_depth is only valid with 16-bit valid_bit_depth. So if we
also want to add those combinations with the multiple rates, the
definition would look like:

CombineArrays.Object.Base.input_audio_format [
        {
                in_rate [
                        8000
                        16000
                        48000
                ]
                in_bit_depth [
                        32
                ]
                in_valid_bit_depth [
                        24
                        32
                ]
        }
        {
                in_rate [
                        8000
                        16000
                        48000
                ]
                in_bit_depth [
                        16
                ]
                in_valid_bit_depth [
                        16
                ]
        }
]

Fixes: https://github.com/alsa-project/alsa-utils/pull/216
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
topology/pre-processor.c