-
Notifications
You must be signed in to change notification settings - Fork 350
Scripts: Updates to scripts using sof-testbench4 simulation #10545
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Scripts: Updates to scripts using sof-testbench4 simulation #10545
Conversation
This change adds option --mem_model to xt-run command. It should give better realistic MCPS and cycles numbers for processing with the more accurate memory model. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This change does input rate changing with -r and to change both input and output rate, need to specify both -r and -R. With this change it's easy to test e.g. performance of 44100 to 48000 SRC with "-r 44100". Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The SRC perf numbers are unrealistic low when tested with 48 kHz input. This change adds a test list for components with 44.1 kHz input and 48 kHz output. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch adds dolby-dax (mock), level_multiplier, micsel, sound_dose, stft_process and template_comp into profiled list. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch changes the blobs in playback and capture DRC test topologies to speaker and microphone defaults. It improves test coverage of DRC since the previously used "enabled" blob does very little processing for the audio signal. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch adds Dolby DAX (stub version), level_multiplier, micsel, sound_dose to scripts/host-testbench.sh. Running this quick test for sane output and memory violations with Valgrind helps to avoid regressions in the modules. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Updates sof-testbench4-related configuration and scripts to use a new DRC default preset and to expand profiling/testing coverage for additional components.
Changes:
- Add a new DRC preset selector (
default_speaker_mic) for bench capture/playback control configs and set it as the default in bench target CMake parameters. - Extend sof-testbench helper/build scripts with separate output-rate option handling and updated xt-run invocation flags.
- Expand profiling and host test coverage to include additional components/modules.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/topology/topology2/include/bench/drc_controls_playback.conf | Adds a new DRC preset key for playback that maps to a speaker-oriented DRC config. |
| tools/topology/topology2/include/bench/drc_controls_capture.conf | Adds a new DRC preset key for capture that maps to a DMIC-oriented DRC config. |
| tools/topology/topology2/development/tplg-targets-bench.cmake | Switches bench default DRC params to the new default_speaker_mic selector. |
| scripts/sof-testbench-helper.sh | Adds -R handling and updates xt-run calls to include --mem_model. |
| scripts/sof-testbench-build-profile.sh | Splits module profiling lists and adds an extra profiling loop at 44.1k. |
| scripts/host-testbench.sh | Adds host testbench coverage for additional components. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "BENCH_DCBLOCK_PARAMS=default" | ||
| "BENCH_DOLBY-DAX_PARAMS=default" | ||
| "BENCH_DRC_PARAMS=enabled" | ||
| "BENCH_DRC_PARAMS=default_speaker_mic" |
Copilot
AI
Feb 12, 2026
There was a problem hiding this comment.
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.
| "BENCH_DRC_PARAMS=default_speaker_mic" | |
| "BENCH_DRC_PARAMS=default_io" |
There was a problem hiding this comment.
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.
| } | ||
|
|
||
| MODULES_S32="asrc dcblock drc drc_multiband eqfir eqiir gain src tdfb" | ||
| MODULES_S32_44K_48K="asrc src" |
Copilot
AI
Feb 12, 2026
There was a problem hiding this comment.
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.
| 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 |
Copilot
AI
Feb 12, 2026
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
| MODULES_S32="asrc dcblock drc drc_multiband eqfir eqiir gain src tdfb" | ||
| MODULES_S32_44K_48K="asrc src" | ||
| MODULES_S32="dcblock drc drc_multiband dolby-dax eqfir eqiir gain level_multiplier micsel \ | ||
| sound_dose stft_process_1536_240_ template_comp tdfb" |
Copilot
AI
Feb 12, 2026
There was a problem hiding this comment.
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.
| sound_dose stft_process_1536_240_ template_comp tdfb" | |
| sound_dose stft_process_1536_240 template_comp tdfb" |
There was a problem hiding this comment.
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.
| 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 |
Copilot
AI
Feb 12, 2026
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, makes sense
| r) | ||
| RATE_IN=${OPTARG} | ||
| ;; | ||
| R) | ||
| RATE_OUT=${OPTARG} | ||
| ;; |
Copilot
AI
Feb 12, 2026
There was a problem hiding this comment.
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.
| "$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" |
Copilot
AI
Feb 12, 2026
There was a problem hiding this comment.
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).
No description provided.