Repository navigation
Conversation
Compile external WebRTC static libraries (AECm, NS, RNNoise, libfvad) with -fno-pic -fno-pie -mlongcalls -mtext-section-literals -DNDEBUG when building relocatable Xtensa LLEXTs. Without these flags, GCC emits R_XTENSA_PLT internal relocations that the Zephyr LLEXT loader cannot resolve against static archive symbols. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Zephyr sets LL_EXTENSION_BUILD rather than LLEXT_MODULE when compiling relocatable LLEXT sources; check both macros in the WebRTC shim files and in webrtc_vad-fvad.c's webrtc_vad_set_active_mod() declaration so active_vad_mod, malloc/free wrappers, and non-userspace BSS placement match the build mode. Also remove the unused <rtos/panic.h> include and k_panic() call from webrtc_aec-shims.c. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Provide __attribute__((weak)) soft-float logf, log10f, expf, cosf, sinf, and atanf shims compiled unconditionally so both relocatable LLEXT and monolithic builds (e.g. CAVS 2.5 where CONFIG_LIBRARY_MANAGER=n) link without an external libm or duplicate symbol collisions. Implement log2f and exp2f via range reduction into [sqrt(2)/2, sqrt(2)] and [-0.5, 0.5] so inputs across the full positive domain stay accurate and continuous. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
When CONFIG_USERSPACE is enabled, webrtc_vad runs in a user thread and invokes notifier_event() on VAD state changes. Instead of exporting raw notifier_event() directly to LLEXT/userspace (where host_notify state is not partitioned for user access), expose notifier_event() via a Zephyr __syscall wrapper. In z_vrfy_notifier_event(), restrict userspace delivery to NOTIFIER_ID_VAD on the local core only, verify the exact int payload size, and copy the VAD state into kernel stack storage via k_usermode_from_copy() before invoking z_impl_notifier_event(). Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Drop 'LIB openmodules' from all six WebRTC module LLEXT builds (webrtc_aec, webrtc_agc, webrtc_hpf, webrtc_ns, webrtc_ns2, webrtc_vad) so each builds and signs as an individual <mod>.llext with its <UUID>.bin symlink instead of being bundled inside sof-<plat>-openmodules.ri. Each standalone module keeps sequential module_size VMA advancement so multiple WebRTC stages (e.g. HPF -> AEC -> NS/NS2 -> AGC -> VAD) can load and run concurrently in the same capture pipeline (total 0xbc000 on PTL relocatable). Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Convert all six WebRTC audio processing modules from
LIB openmodules(bundled insidesof-<plat>-openmodules.ri) into individual standalone.llextmodules with dedicated<UUID>.binsymlinks:webrtc_aec.llext(e5da7b5b-133a-ba46-b517651d6300bb83)webrtc_agc.llext(0af7b529-9dc7-4bee-a8b159e8fbe414f3)webrtc_hpf.llext(6dfb1bea-d858-4ef7-92abcf5b4ee48159)webrtc_ns.llext(0fc8faef-945f-004b-8d5f315047f1136a)webrtc_ns2.llext(eacfacdc-2a87-c942-97e894c917a740db)webrtc_vad.llext(c790b11d-5d14-e54e-be36ba4ad732cc14)Sequential
module_sizeVMA advancement is preserved so multiple WebRTC stages (e.g. HPF -> AEC -> NS/NS2 -> AGC -> VAD) can load and run concurrently in a single capture pipeline.Dependencies
topic/webrtc-pr2): includes its four LLEXT runtime/toolchain prerequisites (-fno-pic -fno-pie -mlongcalls -mtext-section-literalsfor external WebRTC archives,LL_EXTENSION_BUILDshim macro handling, weak soft-float math shims forwebrtc_ns/webrtc_ns2, and the validatednotifier_eventZephyr syscall needed bywebrtc_vadandwebrtc_ns2underCONFIG_USERSPACE=y). These prerequisite commits can be dropped on rebase once topology2: add WebRTC HPF/AGC capture chaining, HDA AEC, and PTL targets #11426 merges.Verification
CONFIG_LLEXT_TYPE_ELF_RELOCATABLE=y):webrtc_aec.llextloaded standalone fromsof-ipc4-lib/ptl/community/e5da7b5b-....bin, initialized theaecmbackend in DP userspace withheap_bytes_requirement 262144, and captured192044bytes cleanly viaarecord.intel_adsp/ace30/ptl,CONFIG_COMP_BT_CODEC=nlocally):CONFIG_LLEXT_TYPE_ELF_RELOCATABLE=y(webrtc_overlay.conf): all 6 standalone.llexts built and signed cleanly withrimage(module_size=0xbc000, fits default0x100000library region), zero missing imports againstllext_const_symbol_area.CONFIG_LLEXT_TYPE_ELF_SHAREDLIB=y(webrtc_overlay.conf): all 6 standalone.llexts built and signed cleanly withrimage(module_size=0x131000), zero missing.dyn-symsagainstllext_const_symbol_area.webrtc_aecFloat backend (CONFIG_WEBRTC_AEC_BACKEND_FLOAT=y,=m): built and signed cleanly with zero missing exports.webrtc_stubs_overlay.conf(=m+STUB=y) and all 6 built-in (=ywith float AEC): built cleanly.Related