Skip to content

Commit

Permalink
Tools: Topology2: Fix test topologies for Aria component
Browse files Browse the repository at this point in the history
The only accepted format for aria is S24_4LE while it was assumed
to be S32_LE. This change enables Aria topologies to be loaded again
after commit 1cc7a4c ("aria: change to S24_LE format processing").

There was also a mistake with capture pipeline index  that caused
failure with capture. Same pipeline 3 index was used in both playback
and capture direction.

The impacted topologies are sof-hda-benchmark-aria24.tplg and
sof-hda-benchmark-generic.tplg.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
  • Loading branch information
singalsu authored and kv2019i committed Oct 7, 2024
1 parent 046ef11 commit 3b9ec60
Show file tree
Hide file tree
Showing 3 changed files with 210 additions and 17 deletions.
213 changes: 203 additions & 10 deletions tools/topology/topology2/cavs-benchmark-hda.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Define {
ANALOG_PLAYBACK_PCM 'Analog Playback'
ANALOG_CAPTURE_PCM 'Analog Capture'
HDA_ANALOG_DAI_NAME 'Analog'
HDA_ANALOG_CAPTURE_RATE 48000
HDA_ANALOG_PLAYBACK_RATE 48000
}

Object.Dai.HDA [
Expand Down Expand Up @@ -54,11 +56,45 @@ IncludeByKey.BENCH_CONFIG {
{
index 3

Object.Widget.mixout.1 {
num_input_audio_formats 1
num_output_audio_formats 1
Object.Base.input_audio_format [
{
in_rate $HDA_ANALOG_PLAYBACK_RATE
in_bit_depth 32
in_valid_bit_depth 24
}
]
Object.Base.output_audio_format [
{
out_rate $HDA_ANALOG_PLAYBACK_RATE
out_bit_depth 32
out_valid_bit_depth 24
}
]
}
Object.Widget.dai-copier.1 {
node_type $HDA_LINK_OUTPUT_CLASS
stream_name $HDA_ANALOG_DAI_NAME
dai_type "HDA"
copier_type "HDA"
num_input_audio_formats 1
num_output_audio_formats 1
Object.Base.input_audio_format [
{
in_rate $HDA_ANALOG_PLAYBACK_RATE
in_bit_depth 32
in_valid_bit_depth 24
}
]
Object.Base.output_audio_format [
{
out_rate $HDA_ANALOG_PLAYBACK_RATE
out_bit_depth 32
out_valid_bit_depth 32
}
]
}
}
]
Expand All @@ -67,31 +103,84 @@ IncludeByKey.BENCH_CONFIG {
{
index 2

Object.Widget.mixin.1 {
num_input_audio_formats 1
num_output_audio_formats 1
Object.Base.input_audio_format [
{
in_rate $HDA_ANALOG_PLAYBACK_RATE
in_bit_depth 32
in_valid_bit_depth 24
}
]
Object.Base.output_audio_format [
{
out_rate $HDA_ANALOG_PLAYBACK_RATE
out_bit_depth 32
out_valid_bit_depth 24
}
]
}
Object.Widget.gain.1 {
num_input_audio_formats 1
num_output_audio_formats 1
Object.Base.input_audio_format [
{
in_rate $HDA_ANALOG_PLAYBACK_RATE
in_bit_depth 32
in_valid_bit_depth 24
}
]
Object.Base.output_audio_format [
{
out_rate $HDA_ANALOG_PLAYBACK_RATE
out_bit_depth 32
out_valid_bit_depth 24
}
]
Object.Control.mixer.1 {
name 'Post Mixer $ANALOG_PLAYBACK_PCM Volume'
}
}
Object.Widget.aria.1 {
num_input_audio_formats 1
num_output_audio_formats 1
# 32-bit 48KHz 2ch
Object.Base.input_audio_format [
{
in_rate $HDA_ANALOG_PLAYBACK_RATE
in_bit_depth 32
in_valid_bit_depth 32
in_valid_bit_depth 24
}
]
Object.Base.output_audio_format [
{
out_rate $HDA_ANALOG_PLAYBACK_RATE
out_bit_depth 32
out_valid_bit_depth 32
out_valid_bit_depth 24
}
]
Object.Control.bytes."1" {
name "SSP2 Aria Control"
name '$ANALOG_PLAYBACK_PCM ARIA bytes'
}
}
Object.Widget.mixout.1 {
num_input_audio_formats 1
num_output_audio_formats 1
Object.Base.input_audio_format [
{
in_rate $HDA_ANALOG_PLAYBACK_RATE
in_bit_depth 32
in_valid_bit_depth 24
}
]
Object.Base.output_audio_format [
{
out_rate $HDA_ANALOG_PLAYBACK_RATE
out_bit_depth 32
out_valid_bit_depth 24
}
]
}
}
]

Expand All @@ -102,29 +191,115 @@ IncludeByKey.BENCH_CONFIG {
Object.Widget.host-copier.1 {
stream_name $ANALOG_PLAYBACK_PCM
pcm_id 0
num_input_audio_formats 3
num_output_audio_formats 1
Object.Base.input_audio_format [
{
in_rate $HDA_ANALOG_PLAYBACK_RATE
in_bit_depth 16
in_valid_bit_depth 16
}
{
in_rate $HDA_ANALOG_PLAYBACK_RATE
in_bit_depth 32
in_valid_bit_depth 24
}
{
in_rate $HDA_ANALOG_PLAYBACK_RATE
in_bit_depth 32
in_valid_bit_depth 32
}
]
Object.Base.output_audio_format [
{
out_rate $HDA_ANALOG_PLAYBACK_RATE
out_bit_depth 32
out_valid_bit_depth 24
}
]
}

Object.Widget.gain.1 {
num_input_audio_formats 1
num_output_audio_formats 1
Object.Base.input_audio_format [
{
in_rate $HDA_ANALOG_PLAYBACK_RATE
in_bit_depth 32
in_valid_bit_depth 24
}
]
Object.Base.output_audio_format [
{
out_rate $HDA_ANALOG_PLAYBACK_RATE
out_bit_depth 32
out_valid_bit_depth 24
}
]
Object.Control.mixer.1 {
name 'Pre Mixer $ANALOG_PLAYBACK_PCM Volume'
}
}
Object.Widget.mixin.1 {
num_input_audio_formats 1
num_output_audio_formats 1
Object.Base.input_audio_format [
{
in_rate $HDA_ANALOG_PLAYBACK_RATE
in_bit_depth 32
in_valid_bit_depth 24
}
]
Object.Base.output_audio_format [
{
out_rate $HDA_ANALOG_PLAYBACK_RATE
out_bit_depth 32
out_valid_bit_depth 24
}
]
}
}
]

host-gateway-capture [
{
index 3
index 4
Object.Widget.host-copier.1 {
stream_name $ANALOG_CAPTURE_PCM
pcm_id 0
num_input_audio_formats 1
num_output_audio_formats 3
Object.Base.input_audio_format [
{
in_rate $HDA_ANALOG_CAPTURE_RATE
in_bit_depth 32
in_valid_bit_depth 32
}
]
Object.Base.output_audio_format [
{
out_rate $HDA_ANALOG_CAPTURE_RATE
out_bit_depth 16
out_valid_bit_depth 16
}
{
out_rate $HDA_ANALOG_CAPTURE_RATE
out_bit_depth 32
out_valid_bit_depth 24
}
{
out_rate $HDA_ANALOG_CAPTURE_RATE
out_bit_depth 32
out_valid_bit_depth 32
}
]
}
}
]

highpass-capture-be [
{
index 4
index 5
direction capture

Object.Widget.dai-copier."1" {
Expand All @@ -138,18 +313,36 @@ IncludeByKey.BENCH_CONFIG {
num_output_audio_formats 1
Object.Base.input_audio_format [
{
in_rate $HDA_ANALOG_CAPTURE_RATE
in_bit_depth 32
in_valid_bit_depth 32
}
]
Object.Base.output_audio_format [
{
out_rate $HDA_ANALOG_CAPTURE_RATE
out_bit_depth 32
out_valid_bit_depth 32
}
]
}
Object.Widget.eqiir.1 {
num_input_audio_formats 1
num_output_audio_formats 1
Object.Base.input_audio_format [
{
in_rate $HDA_ANALOG_CAPTURE_RATE
in_bit_depth 32
in_valid_bit_depth 32
}
]
Object.Base.output_audio_format [
{
out_rate $HDA_ANALOG_CAPTURE_RATE
out_bit_depth 32
out_valid_bit_depth 32
}
]
Object.Control.bytes."1" {
name '$ANALOG_CAPTURE_PCM IIR Eq'
}
Expand All @@ -174,10 +367,10 @@ IncludeByKey.BENCH_CONFIG {
}
{
source 'dai-copier.HDA.$HDA_ANALOG_DAI_NAME.capture'
sink 'eqiir.4.1'
sink 'eqiir.5.1'
}
{
source 'eqiir.4.1'
source 'eqiir.5.1'
sink 'host-copier.0.capture'
}
{
Expand All @@ -191,8 +384,8 @@ IncludeByKey.BENCH_CONFIG {
# Aria component
#

"aria32" {
<include/bench/aria_s32.conf>
"aria24" {
<include/bench/aria_s24.conf>
}

#
Expand Down
8 changes: 4 additions & 4 deletions tools/topology/topology2/development/tplg-targets-bench.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ set(component_parameters
"BENCH_TDFB_PARAMS=default"
)

set(components_s32
set(components_s24
"aria"
)

set(component_parameters_s32
set(component_parameters_s24
"BENCH_ARIA_PARAMS=default"
)

Expand All @@ -55,8 +55,8 @@ foreach(sf ${sampleformats})
endforeach()

# Add components with single format
set (sf "32")
foreach(comp bench_param IN ZIP_LISTS components_s32 component_parameters_s32)
set (sf "24")
foreach(comp bench_param IN ZIP_LISTS components_s24 component_parameters_s24)
set(item "sof-hda-generic\;sof-hda-benchmark-${comp}${sf}\;HDA_CONFIG=benchmark,BENCH_CONFIG=${comp}${sf},${bench_param}")
#message(STATUS "Item=" ${item})
list(APPEND TPLGS "${item}")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Created with script "./bench_comp_generate.sh aria"
Object.Widget.aria.1 {
index 1
<include/bench/one_input_output_format_s32.conf>
<include/bench/one_input_output_format_s24.conf>
<include/bench/aria_controls_playback.conf>
}
Object.Widget.aria.2 {
index 3
<include/bench/one_input_output_format_s32.conf>
<include/bench/one_input_output_format_s24.conf>
<include/bench/aria_controls_capture.conf>
}
<include/bench/host_io_gateway_pipelines_s32.conf>
<include/bench/host_io_gateway_pipelines_s24.conf>
<include/bench/aria_hda_route.conf>

0 comments on commit 3b9ec60

Please sign in to comment.