topology2: remove audio_format

We need to use input_audio_format and output_audio_format.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
This commit is contained in:
Pierre-Louis Bossart 2024-07-24 16:55:20 +02:00 committed by Liam Girdwood
parent 2e94170d50
commit ea0e4b51f2
8 changed files with 44 additions and 258 deletions

View File

@ -1,237 +0,0 @@
## \struct audio_format
## \brief Class definition for audio format object
##
## audio_format objects can be instantiated as:
##
## Object.Base.audio_format."0" {
## in_rate 48000
## in_sample_container_size 16
## in_valid_bit_depth 16
## in_interleaving_style "interleaved"
## out_rate 48000
## out_sample_container_size 16
## out_valid_bit_depth 16
## out_interleaving_style "interleaved"
## }
##
Class.Base."audio_format" {
DefineAttribute."instance" {
}
## input sampling rate
DefineAttribute."in_rate" {
# Token set reference name
token_ref "cavs_audio_format.word"
}
# #input bit depth
DefineAttribute."in_bit_depth" {
# Token set reference name
token_ref "cavs_audio_format.word"
}
## input valid bit depth
DefineAttribute."in_valid_bit_depth" {
# Token set reference name
token_ref "cavs_audio_format.word"
}
## input channel count
DefineAttribute."in_channels" {
# Token set reference name
token_ref "cavs_audio_format.word"
constraints {
min 1
max 8
}
}
## input channel map
DefineAttribute."in_ch_map" {
# Token set reference name
token_ref "cavs_audio_format.word"
}
## input channel config
DefineAttribute."in_ch_cfg" {
# Token set reference name
token_ref "cavs_audio_format.word"
}
## input interleaving style
DefineAttribute."in_interleaving_style" {
type "string"
# Token set reference name
token_ref "cavs_audio_format.word"
constraints {
!valid_values [
"interleaved"
"non-interleaved"
]
!tuple_values [
0
1
]
}
}
## input format config
DefineAttribute."in_fmt_cfg" {
# Token set reference name
token_ref "cavs_audio_format.word"
}
## output sampling rate
DefineAttribute."out_rate" {
# Token set reference name
token_ref "cavs_audio_format.word"
}
## Input sample_type.
## Valid values for sample type are defined in common_definitions.conf.
DefineAttribute."in_sample_type" {
type string
# Token set reference name
token_ref "cavs_audio_format.word"
constraints {
!valid_values [
$SAMPLE_TYPE_MSB_INTEGER
$SAMPLE_TYPE_LSB_INTEGER
$SAMPLE_TYPE_SIGNED_INTEGER
$SAMPLE_TYPE_UNSIGNED_INTEGER
$SAMPLE_TYPE_FLOAT
]
}
}
## output bit depth
DefineAttribute."out_bit_depth" {
# Token set reference name
token_ref "cavs_audio_format.word"
}
## output valid bit depth
DefineAttribute."out_valid_bit_depth" {
# Token set reference name
token_ref "cavs_audio_format.word"
}
## output channel count
DefineAttribute."out_channels" {
# Token set reference name
token_ref "cavs_audio_format.word"
constraints {
min 1
max 8
}
}
## output channel map
DefineAttribute."out_ch_map" {
# Token set reference name
token_ref "cavs_audio_format.word"
}
## output channel config
DefineAttribute."out_ch_cfg" {
# Token set reference name
token_ref "cavs_audio_format.word"
}
## output interleaving style
DefineAttribute."out_interleaving_style" {
type "string"
# Token set reference name
token_ref "cavs_audio_format.word"
constraints {
!valid_values [
"interleaved"
"non-interleaved"
]
!tuple_values [
0
1
]
}
}
## output format config
DefineAttribute."out_fmt_cfg" {
# Token set reference name
token_ref "cavs_audio_format.word"
}
#
## input buffer size
#
DefineAttribute."ibs" {
# Token set reference name and type
token_ref "cavs_audio_format.word"
}
#
## output buffer size
#
DefineAttribute."obs" {
# Token set reference name and type
token_ref "cavs_audio_format.word"
}
## Output sample_type.
## Valid values for sample type are defined in common_definitions.conf.
DefineAttribute."out_sample_type" {
type string
# Token set reference name
token_ref "cavs_audio_format.word"
constraints {
!valid_values [
$SAMPLE_TYPE_MSB_INTEGER
$SAMPLE_TYPE_LSB_INTEGER
$SAMPLE_TYPE_SIGNED_INTEGER
$SAMPLE_TYPE_UNSIGNED_INTEGER
$SAMPLE_TYPE_FLOAT
]
}
}
attributes {
!constructor [
"instance"
]
#
# audio_format objects instantiated within the same alsaconf node must have unique
# instance attribute values
#
unique "instance"
}
in_rate 48000
in_bit_depth 16
in_valid_bit_depth 16
in_channels 2
in_interleaving_style "interleaved"
in_sample_type $SAMPLE_TYPE_LSB_INTEGER
out_rate 48000
out_bit_depth 16
out_valid_bit_depth 16
out_channels 2
out_interleaving_style "interleaved"
out_sample_type $SAMPLE_TYPE_LSB_INTEGER
in_ch_cfg $CHANNEL_CONFIG_STEREO
in_ch_map $CHANNEL_MAP_STEREO
out_ch_cfg $CHANNEL_CONFIG_STEREO
out_ch_map $CHANNEL_MAP_STEREO
# math expression for computing input/output fmt_cfg
in_fmt_cfg "$[($in_channels | ($in_valid_bit_depth * 256)) | ($in_sample_type * 65536)]"
out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256)) | ($out_sample_type * 65536)]"
# math expression for computing input/put buffer sizes
# for 11.025 22.05, 44.1, 88.2 and 176.4khz, we need to round it to ceiling value
ibs "$[($in_channels * ($[($in_rate + 999)] / 1000)) * ($in_bit_depth / 8)]"
obs "$[($out_channels * ($[($out_rate + 999)] / 1000)) * ($out_bit_depth / 8)]"
}

View File

@ -15,7 +15,8 @@
# Where N is the unique pipeline ID within the same alsaconf node.
#
<include/common/audio_format.conf>
<include/common/input_audio_format.conf>
<include/common/output_audio_format.conf>
<include/components/dai-copier.conf>
<include/components/pipeline.conf>
<include/components/kpb.conf>

View File

@ -17,7 +17,8 @@
<include/components/dai-copier.conf>
<include/components/pipeline.conf>
<include/common/audio_format.conf>
<include/common/input_audio_format.conf>
<include/common/output_audio_format.conf>
<include/components/google-rtc-aec.conf>
<include/controls/bytes.conf>

View File

@ -13,7 +13,6 @@
# Where N is the unique pipeline ID within the same alsaconf node.
#
<include/common/audio_format.conf>
<include/components/alh-dai-copier.conf>
<include/components/gain.conf>
<include/components/mixout.conf>

View File

@ -14,7 +14,8 @@
# Where N is the unique pipeline ID within the same alsaconf node.
#
<include/common/audio_format.conf>
<include/common/input_audio_format.conf>
<include/common/output_audio_format.conf>
<include/components/dai-copier.conf>
<include/components/gain.conf>
<include/components/mixout.conf>
@ -54,10 +55,14 @@ Class.Pipeline."mixout-gain-eqiir-dts-dai-copier-playback" {
num_input_pins 1
# copier only supports one format based on mixin/mixout requirements: 32-bit 48KHz 2ch
Object.Base.audio_format [
Object.Base.input_audio_format [
{
in_bit_depth 32
in_valid_bit_depth 32
}
]
Object.Base.output_audio_format [
{
out_bit_depth 32
out_valid_bit_depth 32
}
@ -68,10 +73,14 @@ Class.Pipeline."mixout-gain-eqiir-dts-dai-copier-playback" {
num_output_audio_formats 1
# 32-bit 48KHz 2ch
Object.Base.audio_format [
Object.Base.input_audio_format [
{
in_bit_depth 32
in_valid_bit_depth 32
}
]
Object.Base.output_audio_format [
{
out_bit_depth 32
out_valid_bit_depth 32
}
@ -81,12 +90,18 @@ Class.Pipeline."mixout-gain-eqiir-dts-dai-copier-playback" {
num_input_audio_formats 1
num_output_audio_formats 1
Object.Base.audio_format.1 {
in_bit_depth 32
in_valid_bit_depth 32
out_bit_depth 32
out_valid_bit_depth 32
}
Object.Base.input_audio_format [
{
in_bit_depth 32
in_valid_bit_depth 32
}
]
Object.Base.output_audio_format [
{
out_bit_depth 32
out_valid_bit_depth 32
}
]
Object.Control.bytes."1" {
<include/components/eqiir/flat.conf>
@ -96,12 +111,18 @@ Class.Pipeline."mixout-gain-eqiir-dts-dai-copier-playback" {
num_input_audio_formats 1
num_output_audio_formats 1
Object.Base.audio_format.1 {
in_bit_depth 32
in_valid_bit_depth 32
out_bit_depth 32
out_valid_bit_depth 32
}
Object.Base.input_audio_format [
{
in_bit_depth 32
in_valid_bit_depth 32
}
]
Object.Base.output_audio_format [
{
out_bit_depth 32
out_valid_bit_depth 32
}
]
}
pipeline."1" {

View File

@ -14,7 +14,8 @@
# Where N is the unique pipeline ID within the same alsaconf node.
#
<include/common/audio_format.conf>
<include/common/input_audio_format.conf>
<include/common/output_audio_format.conf>
<include/components/host-copier.conf>
<include/components/mixout.conf>
<include/components/pipeline.conf>

View File

@ -15,7 +15,6 @@
#
<include/common/input_audio_format.conf>
<include/common/output_audio_format.conf>
<include/common/audio_format.conf>
<include/components/host-copier.conf>
<include/components/gain.conf>
<include/components/mixin.conf>

View File

@ -15,7 +15,8 @@
# Where N is the unique pipeline ID within the same alsaconf node.
#
<include/common/audio_format.conf>
<include/common/input_audio_format.conf>
<include/common/output_audio_format.conf>
<include/components/host-copier.conf>
<include/components/gain.conf>
<include/components/pipeline.conf>