Skip to content

Commit 215e666

Browse files
committed
Tools: Topology: Add test topology for sound dose component
The build topologies are - sof-hda-benchmark-sound_dose32.tplg - sof-mtl-sdw-benchmark-sound_dose32-sdw0.tplg - sof-mtl-sdw-benchmark-sound_dose32-simplejack.tplg The controls are for example initialized to - sensitivity 100 dB, 0 dBFS equals 100 dBSPL (a worst case loudness) - volume 0 dB, assumes codec gain for headphones is set to max - gain 0 dB, user's music playback is not attenuated Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
1 parent 841ef97 commit 215e666

15 files changed

+276
-0
lines changed

tools/topology/topology2/cavs-benchmark-hda.conf

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
<mixout.conf>
4545
<multiband_drc.conf>
4646
<rtnr.conf>
47+
<sound_dose.conf>
4748
<src.conf>
4849
<src_lite.conf>
4950
<tdfb.conf>
@@ -834,6 +835,22 @@ IncludeByKey.BENCH_CONFIG {
834835
<include/bench/rtnr_s32.conf>
835836
}
836837

838+
#
839+
# Sound Dose component
840+
#
841+
842+
"sound_dose16" {
843+
<include/bench/sound_dose_s16.conf>
844+
}
845+
846+
"sound_dose24" {
847+
<include/bench/sound_dose_s24.conf>
848+
}
849+
850+
"sound_dose32" {
851+
<include/bench/sound_dose_s32.conf>
852+
}
853+
837854
#
838855
# SRC component
839856
#

tools/topology/topology2/cavs-benchmark-sdw.conf

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
<micsel.conf>
4343
<multiband_drc.conf>
4444
<rtnr.conf>
45+
<sound_dose.conf>
4546
<src.conf>
4647
<src_lite.conf>
4748
<tdfb.conf>
@@ -474,6 +475,22 @@ IncludeByKey.BENCH_CONFIG {
474475
<include/bench/rtnr_s32.conf>
475476
}
476477

478+
#
479+
# Sound Dose component
480+
#
481+
482+
"sound_dose16" {
483+
<include/bench/sound_dose_s16.conf>
484+
}
485+
486+
"sound_dose24" {
487+
<include/bench/sound_dose_s24.conf>
488+
}
489+
490+
"sound_dose32" {
491+
<include/bench/sound_dose_s32.conf>
492+
}
493+
477494
#
478495
# SRC component
479496
#

tools/topology/topology2/development/tplg-targets-bench.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ set(components
1919
"level_multiplier"
2020
"micsel"
2121
"rtnr"
22+
"sound_dose"
2223
"src"
2324
"src_lite"
2425
"tdfb"
@@ -37,6 +38,7 @@ set(component_parameters
3738
"BENCH_LEVEL_MULTIPLIER_PARAMS=default"
3839
"BENCH_MICSEL_PARAMS=passthrough"
3940
"BENCH_RTNR_PARAMS=default"
41+
"BENCH_SOUND_DOSE_PARAMS=default"
4042
"BENCH_SRC_PARAMS=default"
4143
"BENCH_SRC_LITE_PARAMS=default"
4244
"BENCH_TDFB_PARAMS=default"
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Created initially with script "./bench_comp_generate.sh sound_dose"
2+
# may need edits to modify controls
3+
Object.Control {
4+
# Un-comment the supported controls in SOUND_DOSE
5+
bytes."1" {
6+
name '$ANALOG_CAPTURE_PCM Sound Dose setup bytes'
7+
max 44
8+
IncludeByKey.BENCH_SOUND_DOSE_PARAMS {
9+
"default" "include/components/sound_dose/setup_sens_100db.conf"
10+
}
11+
}
12+
bytes."2" {
13+
name '$ANALOG_CAPTURE_PCM Sound Dose volume bytes'
14+
max 44
15+
<include/components/sound_dose/setup_vol_0db.conf>
16+
}
17+
bytes."3" {
18+
name '$ANALOG_CAPTURE_PCM Sound Dose gain bytes'
19+
max 44
20+
<include/components/sound_dose/setup_gain_0db.conf>
21+
}
22+
bytes."4" {
23+
name '$ANALOG_CAPTURE_PCM Sound Dose data bytes'
24+
max 256
25+
<include/components/sound_dose/setup_data_init.conf>
26+
}
27+
#mixer."1" {
28+
# name '$ANALOG_CAPTURE_PCM SOUND_DOSE switch or volume'
29+
#}
30+
#enum."1" {
31+
# name '$ANALOG_CAPTURE_PCM SOUND_DOSE enum'
32+
#}
33+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Created initially with script "./bench_comp_generate.sh sound_dose"
2+
# may need edits to modify controls
3+
Object.Control {
4+
# Un-comment the supported controls in SOUND_DOSE
5+
bytes."1" {
6+
name '$ANALOG_PLAYBACK_PCM Sound Dose setup bytes'
7+
max 44
8+
IncludeByKey.BENCH_SOUND_DOSE_PARAMS {
9+
"default" "include/components/sound_dose/setup_sens_100db.conf"
10+
}
11+
}
12+
bytes."2" {
13+
name '$ANALOG_PLAYBACK_PCM Sound Dose volume bytes'
14+
max 44
15+
<include/components/sound_dose/setup_vol_0db.conf>
16+
}
17+
bytes."3" {
18+
name '$ANALOG_PLAYBACK_PCM Sound Dose gain bytes'
19+
max 44
20+
<include/components/sound_dose/setup_gain_0db.conf>
21+
}
22+
bytes."4" {
23+
name '$ANALOG_PLAYBACK_PCM Sound Dose data bytes'
24+
max 256
25+
<include/components/sound_dose/setup_data_init.conf>
26+
}
27+
#mixer."1" {
28+
# name '$ANALOG_PLAYBACK_PCM SOUND_DOSE switch or volume'
29+
#}
30+
#enum."1" {
31+
# name '$ANALOG_PLAYBACK_PCM SOUND_DOSE enum'
32+
#}
33+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Created with script "./bench_comp_generate.sh sound_dose"
2+
Object.Base.route [
3+
{
4+
sink '$BENCH_PLAYBACK_DAI_COPIER'
5+
source 'sound_dose.$BENCH_PLAYBACK_HOST_PIPELINE.1'
6+
}
7+
{
8+
sink 'sound_dose.$BENCH_PLAYBACK_HOST_PIPELINE.1'
9+
source 'host-copier.0.playback'
10+
}
11+
{
12+
source '$BENCH_CAPTURE_DAI_COPIER'
13+
sink 'sound_dose.$BENCH_CAPTURE_HOST_PIPELINE.2'
14+
}
15+
{
16+
source 'sound_dose.$BENCH_CAPTURE_HOST_PIPELINE.2'
17+
sink 'host-copier.0.capture'
18+
}
19+
]
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Created with script "./bench_comp_generate.sh sound_dose"
2+
Object.Widget.sound_dose.1 {
3+
index $BENCH_PLAYBACK_HOST_PIPELINE
4+
<include/bench/one_input_output_format_s16.conf>
5+
<include/bench/sound_dose_controls_playback.conf>
6+
}
7+
Object.Widget.sound_dose.2 {
8+
index $BENCH_CAPTURE_HOST_PIPELINE
9+
<include/bench/one_input_output_format_s16.conf>
10+
<include/bench/sound_dose_controls_capture.conf>
11+
}
12+
<include/bench/host_gateway_pipelines_s16.conf>
13+
<include/bench/sound_dose_route.conf>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Created with script "./bench_comp_generate.sh sound_dose"
2+
Object.Widget.sound_dose.1 {
3+
index $BENCH_PLAYBACK_HOST_PIPELINE
4+
<include/bench/one_input_output_format_s24.conf>
5+
<include/bench/sound_dose_controls_playback.conf>
6+
}
7+
Object.Widget.sound_dose.2 {
8+
index $BENCH_CAPTURE_HOST_PIPELINE
9+
<include/bench/one_input_output_format_s24.conf>
10+
<include/bench/sound_dose_controls_capture.conf>
11+
}
12+
<include/bench/host_gateway_pipelines_s24.conf>
13+
<include/bench/sound_dose_route.conf>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Created with script "./bench_comp_generate.sh sound_dose"
2+
Object.Widget.sound_dose.1 {
3+
index $BENCH_PLAYBACK_HOST_PIPELINE
4+
<include/bench/one_input_output_format_s32.conf>
5+
<include/bench/sound_dose_controls_playback.conf>
6+
}
7+
Object.Widget.sound_dose.2 {
8+
index $BENCH_CAPTURE_HOST_PIPELINE
9+
<include/bench/one_input_output_format_s32.conf>
10+
<include/bench/sound_dose_controls_capture.conf>
11+
}
12+
<include/bench/host_gateway_pipelines_s32.conf>
13+
<include/bench/sound_dose_route.conf>
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
#
2+
#
3+
# A Sound Dose component. All attributes defined herein are namespaced
4+
# by alsatplg to "Object.Widget.sound_dose.attribute_name"
5+
#
6+
# Usage: this component can be used by declaring in the parent object. i.e.
7+
#
8+
# Object.Widget.sound_dose."N" {
9+
# index 1
10+
# }
11+
# }
12+
13+
#
14+
# Where M is pipeline ID and N is a unique integer in the parent object.
15+
16+
Class.Widget."sound_dose" {
17+
#
18+
# Pipeline ID
19+
#
20+
DefineAttribute."index" {
21+
type "integer"
22+
}
23+
24+
#
25+
# Unique instance for Sound Dose widget
26+
#
27+
DefineAttribute."instance" {
28+
type "integer"
29+
}
30+
31+
# Include common widget attributes definition
32+
<include/components/widget-common.conf>
33+
34+
attributes {
35+
!constructor [
36+
"index"
37+
"instance"
38+
]
39+
!mandatory [
40+
"num_input_pins"
41+
"num_output_pins"
42+
"num_input_audio_formats"
43+
"num_output_audio_formats"
44+
]
45+
46+
!immutable [
47+
"uuid"
48+
"type"
49+
]
50+
!deprecated [
51+
"preload_count"
52+
]
53+
unique "instance"
54+
}
55+
56+
#
57+
# Default attributes for sound_dose
58+
#
59+
60+
# uuid a43f9d7c-ea75-44d5-942d967991a33809
61+
62+
uuid "7c:9d:3f:a4:75:ea:d5:44:94:2d:96:79:91:a3:38:09"
63+
type "effect"
64+
no_pm "true"
65+
num_input_pins 1
66+
num_output_pins 1
67+
}

0 commit comments

Comments
 (0)