Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions scripts/host-testbench.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
# stop on most errors
set -e

# Prevent snap or desktop environment from breaking octave
unset GTK_PATH

function filesize() {
du -b "$1" | awk '{print $1}'
}
Expand Down
4 changes: 2 additions & 2 deletions scripts/llext_link_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ def main():
command.extend(['-o', f'{args.file}.tmp'])
command.extend(params)

subprocess.run(command)
subprocess.run(command, check=True)

if '-r' in params:
prune_xtensa_relocs(f'{args.file}.tmp')
Expand All @@ -395,7 +395,7 @@ def main():
copy_command.extend(['--set-section-alignment', f'{s_name}={s_align}'])

copy_command.extend([f'{args.file}.tmp', f'{args.output}'])
subprocess.run(copy_command)
subprocess.run(copy_command, check=True)

if __name__ == "__main__":
main()
73 changes: 73 additions & 0 deletions scripts/mww_shim_flatten.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2026 Intel Corporation. All rights reserved.

"""Flatten -ffunction-sections naming in the microwakeword libc shim objects.

The shim is assembled by extracting prebuilt members out of the toolchain's
libc.a/libm.a. Those members were compiled without -mlongcalls, so their calls
to the libgcc soft-float helpers (__addsf3, __mulsf3, __adddf3, ...) are plain
CALL8 instructions with a +/-512KB reach.

Zephyr's Xtensa linker script places plain `.text` (where libgcc's helpers live)
via `*(.literal .text)`, i.e. at the very front of the .text output section, and
per-function `.text.*` via the later `*(.literal.* .text.*)` rule, i.e. at the
very back. On a large image (ptl) the two ends are more than 512KB apart and the
link fails with:

dangerous relocation: call8: call target out of range: __addsf3

Renaming the shim's `.text.<fn>`/`.literal.<fn>` back to plain `.text`/`.literal`
puts these few functions in the same early cluster as libgcc, so the calls stay
in range. Order within a single `*(...)` wildcard follows input order, so each
object's `.literal` still precedes its `.text` and l32r reach is unaffected.
"""

import pathlib
import struct
import subprocess
import sys


def section_names(path):
"""Return the section names of a 32-bit little-endian ELF object."""
data = path.read_bytes()
if data[:4] != b'\x7fELF' or data[4] != 1 or data[5] != 1:
return []

e_shoff, = struct.unpack_from('<I', data, 0x20)
e_shentsize, e_shnum, e_shstrndx = struct.unpack_from('<HHH', data, 0x2e)
if not e_shoff or not e_shnum:
return []

strtab_off, = struct.unpack_from('<I', data, e_shoff + e_shstrndx * e_shentsize + 0x10)

names = []
for i in range(e_shnum):
sh_name, = struct.unpack_from('<I', data, e_shoff + i * e_shentsize)
start = strtab_off + sh_name
end = data.index(b'\0', start)
names.append(data[start:end].decode())
return names


def main():
if len(sys.argv) != 3:
sys.exit(f'usage: {sys.argv[0]} <objcopy> <dir>')

objcopy, directory = sys.argv[1], pathlib.Path(sys.argv[2])

for obj in sorted(directory.glob('*.o')):
args = []
for name in section_names(obj):
for prefix in ('.text.', '.literal.'):
if name.startswith(prefix):
args += ['--rename-section',
f'{name}={prefix.rstrip(".")}']
break
if args:
subprocess.run([objcopy] + args + [str(obj)], check=True)


if __name__ == '__main__':
main()
75 changes: 0 additions & 75 deletions scripts/tensorflow-clone.sh

This file was deleted.

6 changes: 6 additions & 0 deletions src/audio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ endif()
if(CONFIG_COMP_MFCC)
add_subdirectory(mfcc)
endif()
if(CONFIG_COMP_MWW)
add_subdirectory(microwakeword)
endif()
if(CONFIG_COMP_MIXER)
add_subdirectory(mixer)
endif()
Expand Down Expand Up @@ -122,6 +125,9 @@ endif()
if(CONFIG_COMP_WEBRTC_HPF)
add_subdirectory(webrtc_hpf)
endif()
if(CONFIG_COMP_WOV_ARBITER)
add_subdirectory(wov_arbiter)
endif()
if(CONFIG_DTS_CODEC)
add_subdirectory(codec)
endif()
Expand Down
26 changes: 26 additions & 0 deletions src/audio/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,17 @@ config COMP_STUBS
Select to force all 3P blocks to link against stubs rather than their libraries. This
should only be used in testing environments like fuzzers or CI.

config COMP_WOV_ARBITER
bool "WOV arbiter component"
depends on COMP_KPB
depends on IPC_MAJOR_4
help
Select to build the WOV (Wake-on-Voice) arbiter. The arbiter sits
between multiple KPB host-drain outputs and a single host PCM copier.
When a keyword is detected by one of the WOV detectors the arbiter
routes that KPB's drain stream to the host and instructs the remaining
detectors to pause.

config COMP_KPB
bool "KPB component"
default y
Expand All @@ -174,6 +185,20 @@ config KPB_NOTIFIER
This transport can be enabled independently of the Async Messaging
Service (AMS), including together with AMS.

config KPB_MAX_NO_OF_CLIENTS
int "Maximum number of KPB clients"
default 4
help
Maximum number of simultaneous KPB drain clients (host + WOV detectors).
Increase if more than 4 clients need concurrent KPB access.

config KPB_MAX_BUFF_TIME
int "KPB history buffer time (ms)"
default 6000 if XCHAL_HW_VERSION_MAJOR >= 300
default 2100
help
KPB history ring-buffer length in milliseconds.

config KPB_FORCE_COPY_TYPE_NORMAL
bool "KPB force copy type normal"
default y
Expand Down Expand Up @@ -208,6 +233,7 @@ rsource "ffmpeg_dec/Kconfig"
rsource "google/Kconfig"
rsource "igo_nr/Kconfig"
rsource "mfcc/Kconfig"
rsource "microwakeword/Kconfig"
rsource "mixer/Kconfig"
rsource "mixin_mixout/Kconfig"
rsource "module_adapter/Kconfig"
Expand Down
Loading
Loading