Skip to content

Commit

Permalink
topology2: sdw-jack-generic: Replace audio_format objects
Browse files Browse the repository at this point in the history
Use input_output_format/output_audio_format explicitly. Additionally,
this patch introduces the used of the CombineArrays feature in the
topology2 compiler to generate multiple audio format objects from the
attribute array combinations.

Signed-off-by: Ranjani Sridharan <[email protected]>
  • Loading branch information
ranj063 committed Oct 12, 2023
1 parent 4fde44b commit bf46333
Showing 1 changed file with 102 additions and 61 deletions.
163 changes: 102 additions & 61 deletions tools/topology/topology2/platform/intel/sdw-jack-generic.conf
Original file line number Diff line number Diff line change
Expand Up @@ -186,56 +186,85 @@ Object.Pipeline.host-gateway-capture [
Object.Widget.host-copier.1 {
stream_name "Passthrough Capture 0"
pcm_id 1
num_input_audio_formats 9
num_input_audio_formats 3
num_output_audio_formats 9
Object.Base.audio_format.1 {
# 32/32 -> 16/16 bits conversion is done here
in_bit_depth 32
in_valid_bit_depth 32
}
# 32-bit 48KHz 1ch
Object.Base.input_audio_format.7 {
in_channels 1
in_bit_depth 32
in_valid_bit_depth 32
in_ch_cfg $CHANNEL_CONFIG_MONO
in_ch_map $CHANNEL_MAP_MONO
}
Object.Base.output_audio_format.7 {
out_bit_depth 32
out_valid_bit_depth 32
out_channels 1
out_ch_cfg $CHANNEL_CONFIG_MONO
out_ch_map $CHANNEL_MAP_MONO
}
# 24-bit 48KHz 1ch
Object.Base.input_audio_format.8 {
in_channels 1
in_bit_depth 32
in_valid_bit_depth 32
in_ch_cfg $CHANNEL_CONFIG_MONO
in_ch_map $CHANNEL_MAP_MONO
}
Object.Base.output_audio_format.8 {
out_bit_depth 32
out_valid_bit_depth 24
out_channels 1
out_ch_cfg $CHANNEL_CONFIG_MONO
out_ch_map $CHANNEL_MAP_MONO
}
# 16-bit 48KHz 1ch
Object.Base.input_audio_format.9 {
in_channels 1
in_bit_depth 32
in_valid_bit_depth 32
in_ch_cfg $CHANNEL_CONFIG_MONO
in_ch_map $CHANNEL_MAP_MONO
}
Object.Base.output_audio_format.9 {
out_channels 1
out_ch_cfg $CHANNEL_CONFIG_MONO
out_ch_map $CHANNEL_MAP_MONO
}
Object.Base.input_audio_format [
# 32-bit 48KHz 2ch
{
in_bit_depth 32
in_valid_bit_depth 32
}
# 32-bit 48KHz 4ch
{
in_bit_depth 32
in_valid_bit_depth 32
in_channels 4
in_ch_cfg $CHANNEL_CONFIG_3_POINT_1
in_ch_map $CHANNEL_MAP_3_POINT_1
}
# 32-bit 48KHz 1ch
{
in_channels 1
in_bit_depth 32
in_valid_bit_depth 32
in_ch_cfg $CHANNEL_CONFIG_MONO
in_ch_map $CHANNEL_MAP_MONO
}
]

CombineArrays.Object.Base.output_audio_format [
# array of 2ch formats with range of out valid bit depths
{
out_bit_depth [ 32 ]
out_valid_bit_depth [
24
32
]
}
# array of 4ch formats with range of out valid bit depths
{
out_bit_depth [ 32 ]
out_valid_bit_depth [
24
32
]
out_channels [ 4 ]
out_ch_cfg [ $CHANNEL_CONFIG_3_POINT_1 ]
out_ch_map [ $CHANNEL_MAP_3_POINT_1 ]
}
# array of 1ch formats with range of out valid bit depths
{
out_bit_depth [ 32 ]
out_valid_bit_depth [
24
32
]
out_channels [ 1 ]
out_ch_cfg [ $CHANNEL_CONFIG_MONO ]
out_ch_map [ $CHANNEL_MAP_MONO ]
}
# 16-bit 2ch
{
out_bit_depth [ 16 ]
out_valid_bit_depth [ 16 ]
}
# 16-bit 4ch
{
out_bit_depth [ 16 ]
out_valid_bit_depth [ 16 ]
out_channels [ 4 ]
out_ch_cfg [ $CHANNEL_CONFIG_3_POINT_1 ]
out_ch_map [ $CHANNEL_MAP_3_POINT_1 ]
}
# 16-bit 1ch
{
out_channels [ 1 ]
out_bit_depth [ 16 ]
out_valid_bit_depth [ 16 ]
out_ch_cfg [ $CHANNEL_CONFIG_MONO ]
out_ch_map [ $CHANNEL_MAP_MONO ]
}
]
}
}
]
Expand All @@ -253,12 +282,18 @@ Object.Widget {
num_output_audio_formats 1
num_output_pins 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
}
]
Output.Base.output_audio_format [
{
out_bit_depth 32
out_valid_bit_depth 32
}
]
}
]

Expand All @@ -279,12 +314,18 @@ IncludeByKey.PASSTHROUGH {
num_input_audio_formats 1
num_output_audio_formats 1
index 11
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
}
]
Ooutput.Base.output_audio_format [
{
out_bit_depth 32
out_valid_bit_depth 32
}
]

Object.Control.bytes."1" {
<include/components/eqiir/highpass_40hz_0db_48khz.conf>
Expand Down

0 comments on commit bf46333

Please sign in to comment.