Skip to content

topology: Import SOF topologies (topology1, topology2, test/topology) and standalone build/install tooling - #1

Merged
lgirdwood merged 1 commit into
mainfrom
initial-topology-import
Nov 8, 2026
Merged

lgirdwood merged 1 commit into
mainfrom
initial-topology-import

Conversation

@lgirdwood

Copy link
Copy Markdown
Member

Summary

Imports the Sound Open Firmware (SOF) ALSA topology definitions (topology1, topology2, and test/topology) from thesofproject/sof into sof-topologies, alongside standalone CMake build, installation, packaging, binary validation tooling, and dual-repo synchronization scripts to support a seamless CI transition.

Included Components

  1. Core Topology Sources:

    • topology1/: Legacy m4-based IPC3 topologies (i.MX8, i.MX8MP, i.MX8ULP, i.MX93, i.MX95, MediaTek MT8186/8188/8195/8196/8365, AMD ACP, CAVS nocodec) and topology1/get_abi.sh.
    • topology2/: Class-based alsatplg -p IPC4 & IPC3 topologies (Intel CAVS 2.5, ACE 1.x/2.x/3.x/4.x, HDA generic, SDCA generic, i.MX8, CHT, and sof-testbench4 development/benchmark graphs) and topology2/get_abi.sh.
    • test/topology/: Automated component, SSP, and DMIC test topology matrix (tplg-build.sh).
    • include/kernel/abi.h: Standalone SOF ABI version header (overridable via -DSOF_ABI_HEADER=/path/to/abi.h).
    • Note: Octave/MATLAB tuning scripts (tools/tune/ and src/audio/*/tune/) remain in sof alongside the audio modules.
  2. Standalone Build, Install & Packaging (CMakeLists.txt & cmake/alsatplg.cmake):

    • Top-level CMake options: BUILD_TOPOLOGY1, BUILD_TOPOLOGY2, BUILD_DEV_TOPOLOGIES, BUILD_TEST_TOPOLOGIES, TPLG_SEQUENTIAL_BUILD, SOF_TPLG_VERSION_SUFFIX, SOF_TPLG_INSTALL_VENDOR_DIR.
    • Automatic discovery of alsatplg (-DALSATPLG_CMD, $ALSATPLG, ${SOF_WORKSPACE}/tools/bin/alsatplg, ../tools/bin/alsatplg, or PATH) with relocatable LD_LIBRARY_PATH and ALSA_TOPOLOGY_PLUGIN_DIR configuration for NHLT and pre-processor plugins.
    • Standard cmake --install component rules (ipc3-prod, ipc4-prod, dev) installing sof-tplg, sof-ipc4-tplg, and the sof-ace-tplg symlink, plus CPack tarball packaging (sof-topology-<abi>-Linux.tar.gz).
  3. Scripts & Dual-Repo CI Transition Tooling (scripts/ & tools/):

    • scripts/build-topology.sh: CLI build driver supporting -T (all), -1/-X (topology1), -2/-Y (topology2), -t (test topologies), -s (sequential), -A (build local alsa-lib/alsa-utils), -L (compatibility symlinks into ../sof/tools/build_tools/topology), -i <dir> (install), and -p (package).
    • scripts/build-alsa-tools.sh: Clones and builds pinned thesofproject/alsa-lib and thesofproject/alsa-utils.
    • scripts/install-topology.sh: Deploys .tplg binaries to /lib/firmware/intel (--dest), an offline/NFS rootfs (--rootfs), a versioned sof-bin release directory (--sof-bin ... --version ...), or directly to a DUT over SSH (--ssh root@<dut>).
    • scripts/sync-from-sof.sh: Synchronizes topology sources (--pull, --push, --check) between sof and sof-topologies while CI systems transition.
    • tools/validate-tplg.py, tools/tplgtool2.py, and tools/pretty-macro.sh: Wired into ctest --test-dir build and .github/workflows/topology.yml.

Verification

  • Built all 185 topology1 and 595 topology2 targets via ./scripts/build-topology.sh -T.
  • Ran ctest --test-dir build --output-on-failure (4/4 validation suites passed across all 94 IPC3 production, 253 IPC4 production, and 248 development .tplg binaries).
  • Verified cmake --install, ./scripts/install-topology.sh, ./scripts/build-topology.sh -p, and ./scripts/sync-from-sof.sh --check.

@lgirdwood
lgirdwood marked this pull request as ready for review November 8, 2026 14:16
… and standalone build/install tooling

Migrate ALSA topology sources (topology1, topology2, and test/topology) from the sof repository into sof-topologies along with standalone CMake build, installation, CPack packaging, validation tooling, and dual-repo synchronization support.

Key changes:
- topology1/, topology2/, test/topology/:
  - Import all v1 M4-based IPC3 topologies, v2 alsaconf class-based IPC4 & IPC3 topologies, and component/SSP/DMIC test topology generators from sof.
  - Decouple ABI manifest generation (topology1/get_abi.sh and topology2/get_abi.sh) using an in-tree include/kernel/abi.h header with optional -DSOF_ABI_HEADER override.
- CMakeLists.txt & cmake/alsatplg.cmake:
  - Add top-level standalone CMake project (SOF_TOPOLOGY) with BUILD_TOPOLOGY1, BUILD_TOPOLOGY2, BUILD_DEV_TOPOLOGIES, BUILD_TEST_TOPOLOGIES, and TPLG_SEQUENTIAL_BUILD options.
  - Automatically resolve alsatplg, LD_LIBRARY_PATH, and ALSA_TOPOLOGY_PLUGIN_DIR so NHLT and pre-processor plugins are relocatable across workspaces.
  - Add standard cmake --install rules (ipc3-prod, ipc4-prod, and dev components with sof-ace-tplg symlink creation) and CPack TGZ archive generation.
- scripts/:
  - Add scripts/build-topology.sh (-T, -1/-X, -2/-Y, -t, -s, -A, -C, -L compatibility link mode, -i install, -p package).
  - Add scripts/build-alsa-tools.sh to clone and build pinned alsa-lib and alsa-utils.
  - Add scripts/install-topology.sh supporting local /lib/firmware, offline/NFS rootfs (--rootfs), versioned sof-bin release trees (--sof-bin --version), and remote SSH DUT deployment (--ssh).
  - Add scripts/sync-from-sof.sh (--pull, --push, --check) to keep sof and sof-topologies synchronized during the CI transition period while leaving Octave module tuning scripts in sof.
- tools/ & CI:
  - Add tools/validate-tplg.py, tools/tplgtool2.py, and tools/pretty-macro.sh wired into CTest (4 validation suites verifying binary block headers, manifests, symlinks, and PCM parsing).
  - Add .github/workflows/topology.yml GitHub Actions workflow.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
@lgirdwood
lgirdwood force-pushed the initial-topology-import branch from 91c1f26 to d7319ac Compare November 8, 2026 14:18
@lgirdwood
lgirdwood merged commit bae2c3c into main Nov 8, 2026
2 checks passed
@lgirdwood
lgirdwood deleted the initial-topology-import branch November 8, 2026 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants