Skip to content
Open
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
12 changes: 12 additions & 0 deletions scripts/host-testbench.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,16 @@ test_component asrc 32 32 48000 "$FullTest"
# test with template component
test_component template_comp 32 32 48000 "$FullTest"

# test with Dolby DAX with stub
test_component dolby-dax 32 32 48000 "$FullTest"

# test with level_multiplier
test_component level_multiplier 32 32 48000 "$FullTest"

# test with micsel
test_component micsel 32 32 48000 "$FullTest"

# test with sound_dose
test_component sound_dose 32 32 48000 "$FullTest"

echo "All tests are done!"
11 changes: 10 additions & 1 deletion scripts/sof-testbench-build-profile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ usage() {
echo
}

MODULES_S32="asrc dcblock drc drc_multiband eqfir eqiir gain src tdfb"
MODULES_S32_44K_48K="asrc src"
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable name MODULES_S32_44K_48K implies these modules should be profiled at both 44.1k and 48k, but the loop only runs at 44100. Either rename the variable to match the implemented behavior (e.g., MODULES_S32_44K) or add a second run at 48000 to align with the name.

Copilot uses AI. Check for mistakes.
MODULES_S32="dcblock drc drc_multiband dolby-dax eqfir eqiir gain level_multiplier micsel \
sound_dose stft_process_1536_240_ template_comp tdfb"
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The module name stft_process_1536_240_ has a trailing underscore, which is likely unintended and can cause the profiling invocation (-m) to fail if it doesn’t exactly match the component/module name expected by the testbench/topology. If the real module name does not include the trailing _, remove it here.

Suggested change
sound_dose stft_process_1536_240_ template_comp tdfb"
sound_dose stft_process_1536_240 template_comp tdfb"

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The topology name it uses is sof-hda-benchmark-stft_process_1536_240_32.tplg. And the simple append of test word length to component name, that now includes FFT size 1536 and hop 240, has the underscore. It's ugly but this is how it is now with test scripts.

MODULES_S24="aria"

if [ -z "${SOF_WORKSPACE}" ]; then
Expand Down Expand Up @@ -61,6 +63,13 @@ $HELPER -x -t development/sof-hda-benchmark-generic.tplg -n 1,2,3 \
-p "$PDIR/profile-$PLATFORM-benchmark.txt" > "$PDIR/log-$PLATFORM-benchmark.txt"

# Profile modules
for mod in $MODULES_S32_44K_48K
do
echo "Profiling $mod ..."
$HELPER -r 44100 -x -m "$mod" \
-p "$PDIR/profile-$PLATFORM-$mod.txt" > "$PDIR/log-$PLATFORM-$mod.txt"
done
Comment on lines +66 to +71
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable name MODULES_S32_44K_48K implies these modules should be profiled at both 44.1k and 48k, but the loop only runs at 44100. Either rename the variable to match the implemented behavior (e.g., MODULES_S32_44K) or add a second run at 48000 to align with the name.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The input is 44.1 kHz and output is 48 kHz, so the test really runs at both rates.


for mod in $MODULES_S32
do
echo "Profiling $mod ..."
Expand Down
8 changes: 5 additions & 3 deletions scripts/sof-testbench-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ PROFILE=false
TPLG0=
VALGRIND=

while getopts "b:c:hi:km:n:o:p:r:t:vx" opt; do
while getopts "b:c:hi:km:n:o:p:r:R:t:vx" opt; do
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A new -R option is introduced for output rate. Make sure the script’s help/usage text documents -R (and clarifies the distinction between -r input rate and -R output rate), otherwise users will not discover the new option from -h.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, makes sense

case "${opt}" in
b)
BITS=${OPTARG}
Expand Down Expand Up @@ -89,6 +89,8 @@ while getopts "b:c:hi:km:n:o:p:r:t:vx" opt; do
;;
r)
RATE_IN=${OPTARG}
;;
R)
RATE_OUT=${OPTARG}
;;
Comment on lines 90 to 95
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A new -R option is introduced for output rate. Make sure the script’s help/usage text documents -R (and clarifies the distinction between -r input rate and -R output rate), otherwise users will not discover the new option from -h.

Copilot uses AI. Check for mistakes.
t)
Expand Down Expand Up @@ -147,10 +149,10 @@ if [[ "$XTRUN" == true ]]; then
echo " input: $INFILE1, output: $OUTFILE1, trace: $TRACEFILE, profile: $PROFILETXT"
source "$XTB4_SETUP"
if [[ $PROFILE == true ]]; then
"$XTENSA_PATH"/xt-run --profile="$PROFILEOUT" "$XTB4" $OPTS 2> "$TRACEFILE"
"$XTENSA_PATH"/xt-run --mem_model --profile="$PROFILEOUT" "$XTB4" $OPTS 2> "$TRACEFILE"
"$XTENSA_PATH"/xt-gprof "$XTB4" "$PROFILEOUT" > "$PROFILETXT"
else
"$XTENSA_PATH"/xt-run "$XTB4" $OPTS 2> "$TRACEFILE"
"$XTENSA_PATH"/xt-run --mem_model "$XTB4" $OPTS 2> "$TRACEFILE"
Comment on lines +152 to +155
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--mem_model is now always passed to xt-run. If this script is expected to work across multiple Xtensa toolchain versions/environments, consider making this flag configurable (env var or script option) or add a small compatibility fallback when xt-run doesn’t recognize --mem_model (e.g., retry without the flag).

Copilot uses AI. Check for mistakes.
fi
else
if [ ! -x "$TB4" ]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ set(component_parameters
"BENCH_ASRC_PARAMS=default"
"BENCH_DCBLOCK_PARAMS=default"
"BENCH_DOLBY-DAX_PARAMS=default"
"BENCH_DRC_PARAMS=enabled"
"BENCH_DRC_PARAMS=default_speaker_mic"
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The selector name default_speaker_mic is ambiguous: in capture it maps to a DMIC default, while in playback it maps to a speaker default. Consider renaming to something that reflects this indirection (e.g., default_io), or using explicit names (default_speaker / default_dmic) to make the behavior clearer for anyone reading the bench parameter defaults.

Suggested change
"BENCH_DRC_PARAMS=default_speaker_mic"
"BENCH_DRC_PARAMS=default_io"

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cmake scripts and topologies system has limitations and currently this is the way to apply with a keyword the blob for playback and capture that is in this case different. Default_io in my opinion is less descriptive than my proposal.

"BENCH_DRC_MULTIBAND_PARAMS=default"
"BENCH_EQIIR_PARAMS=loudness"
"BENCH_EQFIR_PARAMS=loudness"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"default" "include/components/drc/default.conf"
"enabled" "include/components/drc/enabled.conf"
"passthrough" "include/components/drc/passthrough.conf"
"default_speaker_mic" "include/components/drc/dmic_default.conf"
}
}
mixer."1" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"default" "include/components/drc/default.conf"
"enabled" "include/components/drc/enabled.conf"
"passthrough" "include/components/drc/passthrough.conf"
"default_speaker_mic" "include/components/drc/speaker_default.conf"
}
}
mixer."1" {
Expand Down