This folder contains a lot of useful scripts that can speed up development for routine tasks or simplify execution of complex tasks.
SOF has several build targets depending on whether you are building firmware, tooling, documentation or topologies. This directory has a helper for each.
Firmware can either be built using west commands directly or by the xtensa-build-zephyr.py script. This script wraps up the west commands and can build using either the Zephyr SDK compiler or the Cadence xtensa compiler for xtensa targets.
Please run the script with --help to see all options.
E.g to build SOF for Intel Pantherlake:
- Enable the python virtual environment for west. This should be in your SOF workspace installation directory. Default is
~/work/sof(only needs run once).
source ~/work/sof/.venv/bin/activate- Now run the build script. Note: most build errors are a result of ingredients being out of sync with the west manifest. Please run
west updateand rebuild before fixing/reporting build errors.
./scripts/xtensa-build-zephyr.py -p ptlThis script can be used to locally reproduce the exact build steps and environment of specific CI validation tests.
./scripts/test-repro-build.sh --helpTooling and topology can be built together using one script. To build all topologies please run:
./scripts/build-tools.shOptions for build-tools.sh:
-c: Rebuildctl/tool-l: Rebuildlogger/tool-p: Rebuildprobes/tool-T: Rebuild ALLtopology/targets-X: Rebuild topology1 only-Y: Rebuild topology2 only-t: Rebuild test topologies-A: Clone and rebuild the local ALSA git version foralsa-libandalsa-utilswith latest non-distro features.-C: No build, only CMake re-configuration. Shows CMake targets.
Warning: building tools is incremental by default. To build from scratch delete the tools/build_tools directory or use -C.
If you want to pull down and explicitly recompile only the associated ALSA libraries from their public alsa-lib GitHub upstream independently of SOF topologies:
./scripts/build-alsa-tools.shTestbench is a host application that is used to run SOF processing modules on developers PC. This allows for module development using regular host based tooling.
This script cleans and rebuilds the host test application binary. Ensure you supply the correct target platform wrapper or fuzzing backend.
Usage Options:
-p <platform>: Build testbench binary forxt-runfor selected platform (e.g.-p tgl). When omitted, performs aBUILD_TYPE=native, compile-only check.-f: Build testbench via a compiler provided by a fuzzer (default path:.../AFL/afl-gcc).-j: Number of parallel make jobs (defaults tonproc).
Starts the testing sequences. This invokes specific components to ensure basic inputs process without segfaults.
./scripts/host-testbench.shAutomated verifier for executing firmware builds under QEMU emulation.
Usage:
./scripts/qemu-check.sh [platform(s)]- Supported platforms are:
imx8,imx8x,imx8m. - Runs all supported platforms by default if none are provided.
There is some SDK support in this directory for speeding up or simplifying tasks with multiple steps.
A new module can be created by running the SDK Create Module script. This python helper copies the SOF template audio module and renames all strings, Cmakefiles, and Kconfigs automatically. It also correctly registers a new DSP UUID and TOML entries.
Please run:
./scripts/sdk-create-module.py new_module_nameThe docker container provided in docker_build sets up a build environment for building Sound Open Firmware. A working docker installation is needed to run the docker build container.
Note: In order to run docker as non sudo/root user please run:
sudo usermod -aG docker your-user-nameThen logout and login again.
Quick Start:
First, build the docker container. This step needs to be done initially and when the toolchain or ALSA dependencies are updated.
cd scripts/docker_build
./docker-build.shAfter the container is built, it can be used to run the scripts.
To build for tigerlake:
./scripts/docker-run.sh ./scripts/xtensa-build-all.sh -l tglor (this command may prompt for a password during rimage installation inside the container)
./scripts/docker-run.sh ./scripts/xtensa-build-all.sh tglTo rebuild the topology and logger:
./scripts/docker-run.sh ./scripts/build-tools.shAn incremental sof.git build:
./scripts/docker-run.sh makeOr enter a shell:
./scripts/docker-run.sh bash