Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions tools/topology/topology2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,22 @@ Topology v2 introduces an object-oriented pre-processing layer directly into the
Building topologies requires `alsatplg` version 1.2.7 or later. The version check is
enforced in `CMakeLists.txt` at configure time.

### HDA benchmarks

The generic HDA benchmark (`BENCH_CONFIG=benchmark,HDA_CONFIG=benchmark`)
provides its own DAI pipelines. The default component-benchmark DAI gateways
are only instantiated with `HDA_CONFIG=none` to avoid duplicate widget names
and overlapping pipeline IDs.

The MFCC and MFCC-mel HDA benchmarks use 16 kHz throughout, including the HDA
link. Their copiers convert sample formats, not sample rates. Use 16 kHz when
running these benchmarks; MFCC output carries feature data, not listenable
audio.

The HDA mix topology uses a 40 Hz capture high-pass at both 48 kHz and
96 kHz. At 96 kHz it reuses the 20 Hz / 48 kHz coefficients, which have
the same normalized cutoff.

## Key Advantages

- **Object-Oriented Syntax**: Topology v2 allows for the definition of classes (`Class.Widget`, `Class.Pipeline`) and object instantiation, making the topology files much easier to read, maintain, and extend.
Expand Down
179 changes: 100 additions & 79 deletions tools/topology/topology2/cavs-benchmark-hda.conf
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,15 @@ IncludeByKey.PLATFORM {
"ptl" "platform/intel/ptl.conf"
}

IncludeByKey.BENCH_CONFIG {
"^mfcc(mel)?(16|24|32)$" {
Define {
HDA_ANALOG_CAPTURE_RATE 16000
HDA_ANALOG_PLAYBACK_RATE 16000
}
}
}

Object.Widget.virtual [
{
name 'codec0_in'
Expand Down Expand Up @@ -213,102 +222,114 @@ Object.PCM.pcm [
}
]

Object.Pipeline {
io-gateway [
{
index $BENCH_PLAYBACK_DAI_PIPELINE
direction playback
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_pins 1
num_input_audio_formats 1
num_output_audio_formats 1
IncludeByKey.BENCH_MODULE_FORMAT {
"s16" {
Object.Base.input_audio_format [
{
in_bit_depth 16
in_valid_bit_depth 16
IncludeByKey.HDA_CONFIG {
"none" {
Object.Pipeline {
io-gateway [
{
index $BENCH_PLAYBACK_DAI_PIPELINE
direction playback
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_pins 1
num_input_audio_formats 1
num_output_audio_formats 1
IncludeByKey.BENCH_MODULE_FORMAT {
"s16" {
Object.Base.input_audio_format [
{
in_rate $HDA_ANALOG_PLAYBACK_RATE
in_bit_depth 16
in_valid_bit_depth 16
}
]
}
]
}
"s24" {
Object.Base.input_audio_format [
"s24" {
Object.Base.input_audio_format [
{
in_rate $HDA_ANALOG_PLAYBACK_RATE
in_bit_depth 32
in_valid_bit_depth 24
}
]
}
"s32" {
Object.Base.input_audio_format [
{
in_rate $HDA_ANALOG_PLAYBACK_RATE
in_bit_depth 32
in_valid_bit_depth 32
}
]
}
}
Object.Base.output_audio_format [
{
in_bit_depth 32
in_valid_bit_depth 24
out_rate $HDA_ANALOG_PLAYBACK_RATE
out_bit_depth 32
out_valid_bit_depth 32
}
]
}
"s32" {
}
]
io-gateway-capture [
{
index $BENCH_CAPTURE_DAI_PIPELINE
direction capture
Object.Widget.dai-copier.1 {
dai_type "HDA"
type "dai_out"
copier_type "HDA"
stream_name $HDA_ANALOG_DAI_NAME
node_type $HDA_LINK_INPUT_CLASS
num_output_pins 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_bit_depth 32
out_valid_bit_depth 32
}
]
}
}
]
io-gateway-capture [
{
index $BENCH_CAPTURE_DAI_PIPELINE
direction capture
Object.Widget.dai-copier.1 {
dai_type "HDA"
type "dai_out"
copier_type "HDA"
stream_name $HDA_ANALOG_DAI_NAME
node_type $HDA_LINK_INPUT_CLASS
num_output_pins 1
num_input_audio_formats 1
num_output_audio_formats 1
Object.Base.input_audio_format [
{
in_bit_depth 32
in_valid_bit_depth 32
}
]
IncludeByKey.BENCH_MODULE_FORMAT {
"s16" {
Object.Base.output_audio_format [
{
out_bit_depth 16
out_valid_bit_depth 16
IncludeByKey.BENCH_MODULE_FORMAT {
"s16" {
Object.Base.output_audio_format [
{
out_rate $HDA_ANALOG_CAPTURE_RATE
out_bit_depth 16
out_valid_bit_depth 16
}
]
}
]
}
"s24" {
Object.Base.output_audio_format [
{
out_bit_depth 32
out_valid_bit_depth 24
"s24" {
Object.Base.output_audio_format [
{
out_rate $HDA_ANALOG_CAPTURE_RATE
out_bit_depth 32
out_valid_bit_depth 24
}
]
}
]
}
"s32" {
Object.Base.output_audio_format [
{
out_bit_depth 32
out_valid_bit_depth 32
"s32" {
Object.Base.output_audio_format [
{
out_rate $HDA_ANALOG_CAPTURE_RATE
out_bit_depth 32
out_valid_bit_depth 32
}
]
}
]
}
}
}
}
]
}
]
}
}

IncludeByKey.BENCH_CONFIG {
Expand Down
Loading
Loading