From 802f36a599983d5b8eff50dfa8771f4d8570ccf0 Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Tue, 1 Dec 2026 11:47:19 +0000 Subject: [PATCH 1/8] west: manifest: add Google Resonance Audio, Eigen, and PFFFT Add upstream remotes and west projects for resonance-audio, eigen, and pffft under modules/audio/resonance-audio so the Google Resonance Audio spatializer can be built as a Zephyr/SOF LLEXT or built-in module. Signed-off-by: Liam Girdwood --- west.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/west.yml b/west.yml index dc2952b891fb..3b0070fba1a9 100644 --- a/west.yml +++ b/west.yml @@ -7,6 +7,12 @@ manifest: remote: thesofproject remotes: + - name: resonance-audio-upstream + url-base: https://github.com/resonance-audio + - name: libeigen + url-base: https://gitlab.com/libeigen + - name: jpommier + url-base: https://bitbucket.org/jpommier - name: thesofproject url-base: https://github.com/thesofproject - name: zephyrproject @@ -59,6 +65,25 @@ manifest: path: modules/audio/rnnoise revision: 5bd733d7a950715774582dda49aeff0e8f71ccc2 + # Google Resonance Audio spatializer + Eigen3 + PFFFT + - name: resonance-audio + remote: resonance-audio-upstream + repo-path: resonance-audio + path: modules/audio/resonance-audio + revision: 4556a46afd4ffae092aa281bfd072eb0279d3a29 + + - name: eigen + remote: libeigen + repo-path: eigen + path: modules/audio/resonance-audio/third_party/eigen + revision: 3147391d946bb4b6c68edd901f2add6ac1f31f8c + + - name: pffft + remote: jpommier + repo-path: pffft + path: modules/audio/resonance-audio/third_party/pffft + revision: 67a4a6a113179ab4ac398298f46fce8dd60498dc + # FFmpeg (libavcodec) source for the ffmpeg_dec module. Cross-built by # src/audio/ffmpeg_dec/ffmpeg.cmake, enabling only the Kconfig-selected # decoders. SOF fork branch sof-hifi (release/7.1 + av_tx table-size cap that drops From 03e1758b0a3474050b1828315d701e0c52b4e31c Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Tue, 1 Dec 2026 11:47:19 +0000 Subject: [PATCH 2/8] scripts: llext_link_helper: promote defined STB_WEAK symbols to STB_GLOBAL Zephyr llext_load/llext_link only index and relocate STB_GLOBAL and STB_LOCAL symbols, leaving defined STB_WEAK symbols (such as C++ templates and vtables) unpatched at 0. Promote defined STB_WEAK STT_OBJECT and STT_FUNC symbols to STB_GLOBAL in ET_REL objects so LLEXT resolves them properly. Signed-off-by: Liam Girdwood --- scripts/llext_link_helper.py | 45 ++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/scripts/llext_link_helper.py b/scripts/llext_link_helper.py index 727234654334..e3b4f9c2dd51 100755 --- a/scripts/llext_link_helper.py +++ b/scripts/llext_link_helper.py @@ -203,6 +203,50 @@ def prune_xtensa_relocs(path): print(f'llext_link_helper.py: dropped {dropped} of {total} relocations not needing ' 'run-time processing') +def promote_defined_weak_syms(path): + # Zephyr llext_load/llext_link only index and relocate STB_GLOBAL and + # STB_LOCAL symbols, leaving STB_WEAK relocations (e.g. C++ templates + # and vtables) unpatched at 0. Promote defined STB_WEAK FUNC/OBJECT + # symbols to STB_GLOBAL so LLEXT resolves them against ext->sym_tab. + SYM_SIZE = 16 + STB_GLOBAL = 1 + STB_WEAK = 2 + STT_OBJECT = 1 + STT_FUNC = 2 + SHN_UNDEF = 0 + SHN_LORESERVE = 0xff00 + + with open(path, 'rb') as f: + elf = ELFFile(f) + if elf['e_type'] != 'ET_REL': + return + symtab = None + for section in elf.iter_sections(): + if section['sh_type'] == 'SHT_SYMTAB' and section['sh_entsize'] == SYM_SIZE: + symtab = section + break + if symtab is None: + return + sh_offset = symtab['sh_offset'] + raw = bytearray(symtab.data()) + + promoted = 0 + for off in range(0, len(raw), SYM_SIZE): + st_info = raw[off + 12] + st_shndx, = struct.unpack_from('> 4 + stype = st_info & 0xf + if (bind == STB_WEAK and stype in (STT_OBJECT, STT_FUNC) and + SHN_UNDEF < st_shndx < SHN_LORESERVE): + raw[off + 12] = (STB_GLOBAL << 4) | stype + promoted += 1 + + if promoted: + with open(path, 'r+b') as f: + f.seek(sh_offset) + f.write(raw) + print(f'llext_link_helper.py: promoted {promoted} defined STB_WEAK symbols to STB_GLOBAL') + def main(): global args @@ -380,6 +424,7 @@ def main(): if '-r' in params: prune_xtensa_relocs(f'{args.file}.tmp') + promote_defined_weak_syms(f'{args.file}.tmp') copy_command = [args.copy] From 36815f6f48e872172509e93408edd42026b82396 Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Tue, 1 Dec 2026 11:47:19 +0000 Subject: [PATCH 3/8] uuid-registry: register Google Resonance Audio UUID Register UUID 12f51e05-61d9-4a96-939eca72c615d89b for the resonance_audio spatializer module. Signed-off-by: Liam Girdwood --- uuid-registry.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/uuid-registry.txt b/uuid-registry.txt index 982da93b4c6d..0335cee28423 100644 --- a/uuid-registry.txt +++ b/uuid-registry.txt @@ -203,6 +203,7 @@ a62de1af-5964-4e2e-b1677fdc97279a29 template 37c196ae-3532-4282-8a78dd9d50cc7123 testbench 08aeb4ff-7f68-4c71-86c3c842b4262898 tester c51dc642-a2e1-48df-a490e2748cb6363e tflmcly +12f51e05-61d9-4a96-939eca72c615d89b resonance_audio 04e3f894-2c5c-4f2e-8dc1694eeaab53fa tone e93326d8-0d14-4bf0-bcb9e063d3d80136 twb_sched 42f8060c-832f-4dbf-b24751e961997b34 up_down_mixer From 137fa2bac3cbcf0474df99191c94f6a2d0507bce Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Tue, 1 Dec 2026 11:47:19 +0000 Subject: [PATCH 4/8] tools: rimage: register RESAUD module manifest for PTL and WCL Include resonance_audio.toml in the PTL and WCL rimage manifests when CONFIG_COMP_RESONANCE_AUDIO or LLEXT_FORCE_ALL_MODULAR is enabled. Signed-off-by: Liam Girdwood --- tools/rimage/config/ptl.toml.h | 4 ++++ tools/rimage/config/wcl.toml.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/tools/rimage/config/ptl.toml.h b/tools/rimage/config/ptl.toml.h index cfa07c7c8806..ec40b07ae12b 100644 --- a/tools/rimage/config/ptl.toml.h +++ b/tools/rimage/config/ptl.toml.h @@ -205,6 +205,10 @@ index = __COUNTER__ #include