Skip to content

audio: mfcc: fix the loadable module build - #11551

Draft
lgirdwood wants to merge 3 commits into
thesofproject:mainfrom
lgirdwood:topic/mfcc-llext-fix
Draft

lgirdwood wants to merge 3 commits into
thesofproject:mainfrom
lgirdwood:topic/mfcc-llext-fix

Conversation

@lgirdwood

Copy link
Copy Markdown
Member

MFCC is built as a loadable module in app/configs/{mtl,lnl}/modules.conf (the LLEXT CI job), but the module can't be linked at load time. On current main it has 19 undefined symbols that the base firmware doesn't provide:

  • mfcc_get_config, mfcc_set_config, mfcc_ipc_notification_init, mfcc_send_vad_notification, mfcc_vad_init and mfcc_vad_update: the module build doesn't include mfcc_ipc4.c and mfcc_vad.c.
  • 13 FFT, matrix, DCT, auditory and window functions: they are built into the base firmware but not exported.

Changes:

  • The module now builds the same sources as the built-in component.
  • The math functions the module calls are exported: the 13 above, plus psy_hz_to_mel() and psy_mel_to_hz(), which mfcc_vad.c calls.
  • base_fw now also advertises the bespoke capture codec when MFCC is a module. Only CONFIG_COMP_MFCC_MODULE is defined then, so it wasn't advertised before.

Checked with the LLEXT CI build (xtensa-build-zephyr.py --overlay=app/configs/<platform>/modules.conf, -Werror) for MTL and LNL. After this series, every undefined symbol of mfcc.llext is exported by zephyr.elf on both platforms (compared with nm). Not tested on hardware.

checkpatch prefers IS_ENABLED() over CONFIG_FOO || CONFIG_FOO_MODULE. That's a Linux convention: Zephyr's IS_ENABLED(CONFIG_COMP_MFCC) is false when MFCC is =m.

🤖 Generated with Claude Code

lrgirdwo and others added 3 commits November 26, 2026 20:40
The LLEXT module build missed mfcc_vad.c and mfcc_ipc4.c, so the module
had unresolved references to the VAD and IPC4 configuration functions.
Build the same sources as the built-in component.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The FFT, matrix, DCT, auditory and window libraries are always built
into the base firmware, so when MFCC is built as a loadable module it
can't resolve the functions it calls from them. Export those functions.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Only CONFIG_COMP_MFCC_MODULE is defined when MFCC is built as a
loadable module, so the bespoke capture codec wasn't advertised. Check
for both, also where the FFmpeg encoders add the same codec when MFCC
doesn't.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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