alsa-utils/topology
Ranjani Sridharan 9d058fff27 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>
2023-08-01 09:40:51 +02:00
..
nhlt topology: plugins: nhlt: set dmic stereo mode only in hw version 1 2023-08-01 09:34:19 +02:00
alsatplg.rst alsatplg: add decode command 2020-02-09 20:52:30 +01:00
Makefile.am topology: add missing pre-process-external.h to Makefile.am 2022-05-03 14:06:13 +02:00
pre-process-class.c alsatplg: use standard include/asoundlib.h instead direct headers 2021-09-03 08:49:03 +02:00
pre-process-dai.c alsatplg: use standard include/asoundlib.h instead direct headers 2021-09-03 08:49:03 +02:00
pre-process-dapm.c topology: pre-processor: Move the call to expand variables 2021-12-19 20:32:38 +01:00
pre-process-external.h topology: add simple topology plugin mechanism 2022-05-03 13:23:36 +02:00
pre-process-object.c topology: pre-process-object: Expand definitions within strings 2023-02-06 15:49:14 +01:00
pre-processor.c topology: pre-processor: Add support for CombineArrays 2023-08-01 09:40:51 +02:00
pre-processor.h topology: add simple topology plugin mechanism 2022-05-03 13:23:36 +02:00
topology.c topology: fix the comment for improved -D option 2022-01-28 09:29:34 +01:00
topology.h topology: rename function free_pre_preprocessor to free_pre_processor 2022-01-27 15:02:02 +01:00