Skip to content

sim/alsa: Use bundled codec headers.#19541

Merged
xiaoxiang781216 merged 1 commit into
apache:masterfrom
casaroli:fix/sim-alsa-bundled-codec-includes
Jul 26, 2026
Merged

sim/alsa: Use bundled codec headers.#19541
xiaoxiang781216 merged 1 commit into
apache:masterfrom
casaroli:fix/sim-alsa-bundled-codec-includes

Conversation

@casaroli

Copy link
Copy Markdown
Contributor

Summary

Fix CMake header integration for the sim:alsa audio offload codec implementation.

sim_offload.c uses LAME and libmad from the checked-out nuttx-apps tree, but the arch CMake target did not receive their include directories. It also included LAME as <lame/lame.h>, while the bundled public header is lame/include/lame.h. The build consequently depended on host-installed codec development headers and failed when they were absent.

This change uses <lame.h> and exposes the bundled LAME and libmad include directories only when CONFIG_SIM_SOUND_ALSA=y.

Companion Apps PR: apache/nuttx-apps#3666

The companion PR adds the LAME vector translation units that are required at link time when LAME enables x86 SSE2/AVX2 runtime dispatch. Both PRs are required for a complete CMake sim:alsa fix.

Impact

  • New feature: No.
  • User adaptation: No.
  • Build impact: Yes. Makes the CMake sim:alsa target use bundled LAME/libmad headers instead of relying on host codec header installation.
  • Hardware impact: No. The change is limited to the simulator ALSA configuration.
  • Documentation impact: No.
  • Security impact: No.
  • Compatibility impact: No. It corrects the include path for the bundled Apps codecs.
  • Dependency: audioutils/lame: Add CMake vector sources. nuttx-apps#3666

Testing

Verified locally with the companion Apps branch.

  • Build host: Fedora Linux 44, x86_64, GCC 16.1.1.
  • Target: sim:alsa, CMake/Ninja, CONFIG_SIM_M32=y.

Before this change, compilation stopped in sim_offload.c:

fatal error: lame/lame.h: No such file or directory

After this change, with the companion Apps change applied:

cmake -B build -DBOARD_CONFIG=sim:alsa -DNXTMPDIR=OFF -GNinja
cmake --build build -j4

completed successfully and produced nuttx.tgz.

Additional verification:

./tools/checkpatch.sh -f arch/sim/src/sim/sim_offload.c
./tools/checkpatch.sh -f arch/sim/src/sim/CMakeLists.txt
git diff --check

All checks completed successfully.

No hardware runtime test applies to this host simulator build.

PR verification self-check

  • This PR introduces one focused functional change.
  • All required PR description fields are completed.
  • The commit has a descriptive topic/body, Signed-off-by, and Assisted-by trailer.
  • The modified files pass checkpatch.sh and git diff --check.
  • This PR is ready for review.

Expose the bundled LAME and libmad headers to the sim:alsa arch target and include LAME through its installed public header name. This lets the CMake build compile sim_offload.c without relying on host codec development packages.

Assisted-by: Zed:GPT-5.6 Terra
Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
@casaroli
casaroli requested a review from jerpelea as a code owner July 26, 2026 08:00
@github-actions github-actions Bot added Arch: simulator Issues related to the SIMulator Size: XS The size of the change in this PR is very small labels Jul 26, 2026
@github-actions

Copy link
Copy Markdown

MemBrowse Memory Report

No memory changes detected for:

@xiaoxiang781216
xiaoxiang781216 merged commit 3b1aea4 into apache:master Jul 26, 2026
49 of 51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Arch: simulator Issues related to the SIMulator Size: XS The size of the change in this PR is very small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants