diff --git a/.github/workflows/testbench.yml b/.github/workflows/testbench.yml index 82e26470ff17..03f02f505f8c 100644 --- a/.github/workflows/testbench.yml +++ b/.github/workflows/testbench.yml @@ -47,6 +47,19 @@ jobs: with: path: sof + # MFCC with PCAN needs the TFLM microfrontend sources next to sof/, + # use the revision pinned in the west submanifest. + - name: Checkout TFLM microfrontend + run: | + rev=$(awk '/name: tflite-micro/ {f=1} f && /revision:/ {print $2; exit}' \ + sof/submanifests/tflm.yml) + git init tflite-micro + cd tflite-micro + git remote add origin https://github.com/tensorflow/tflite-micro + git sparse-checkout set tensorflow/lite/experimental/microfrontend/lib + git fetch --depth 1 --filter=blob:none origin "$rev" + git checkout FETCH_HEAD + # note: libasound-dev needed for testbench build which still # requires system ALSA headers to be present - name: apt get diff --git a/posix/include/rtos/kernel.h b/posix/include/rtos/kernel.h index 9fa3962a3589..0b30f1628115 100644 --- a/posix/include/rtos/kernel.h +++ b/posix/include/rtos/kernel.h @@ -36,6 +36,11 @@ static inline bool thread_is_userspace(struct k_thread *thread) return false; } +static inline bool k_is_in_isr(void) +{ + return false; +} + static inline void k_sleep(k_timeout_t timeout) { wait_delay(timeout.ticks); diff --git a/src/audio/CMakeLists.txt b/src/audio/CMakeLists.txt index cf9b8edd584b..f6e91d322876 100644 --- a/src/audio/CMakeLists.txt +++ b/src/audio/CMakeLists.txt @@ -113,12 +113,12 @@ if(NOT CONFIG_COMP_MODULE_SHARED_LIBRARY_BUILD) if(CONFIG_COMP_VOLUME) add_subdirectory(volume) endif() - if(CONFIG_COMP_WOV_ARBITER) - add_subdirectory(wov_arbiter) - endif() if(CONFIG_DTS_CODEC) add_subdirectory(codec) endif() + if(CONFIG_COMP_WOV_ARBITER) + add_subdirectory(wov_arbiter) + endif() # end of directories and files included conditionally (alphabetical order) add_subdirectory(google) diff --git a/src/audio/ecns/ecns.c b/src/audio/ecns/ecns.c index bc61d4c17f27..722b0e0eb364 100644 --- a/src/audio/ecns/ecns.c +++ b/src/audio/ecns/ecns.c @@ -1170,7 +1170,9 @@ static int ecns_get_large_config(struct comp_dev *dev, static const struct comp_driver ecns_drv = { .type = SOF_COMP_NONE, .uid = SOF_RT_UUID(ecns_uuid), +#if !CONFIG_ZEPHYR_LOG .tctx = &ecns_tr, +#endif .ops = { .create = ecns_new, .free = ecns_free, diff --git a/src/audio/kpb.c b/src/audio/kpb.c index ed75ff59cb53..085a3e062615 100644 --- a/src/audio/kpb.c +++ b/src/audio/kpb.c @@ -387,9 +387,9 @@ static int kpb_bind(struct comp_dev *dev, const struct bind_info *bind_data) sink_buf_id = buf_get_id(sink); if (sink_buf_id == buf_id) { - struct comp_dev *sc = comp_buffer_get_sink_component(sink); comp_dbg(dev, "kpb_bind: buf_id=%d sink_comp=0x%x -> %s", - buf_id, sc ? dev_comp_id(sc) : 0, sink_buf_id == 0 ? "sel_sink" : "host_sink"); + buf_id, dev_comp_id(comp_buffer_get_sink_component(sink)), + sink_buf_id == 0 ? "sel_sink" : "host_sink"); if (sink_buf_id == 0) kpb->sel_sink = sink; else @@ -920,6 +920,10 @@ static int kpb_prepare(struct comp_dev *dev) #endif /* CONFIG_AMS */ if (ret < 0) { +#ifndef CONFIG_AMS + notifier_unregister(dev, NULL, NOTIFIER_ID_KPB_CLIENT_EVT); + notifier_unregister(dev, NULL, NOTIFIER_ID_WOV_CTRL); +#endif kpb_free_history_buffer(kpb->hd.c_hb); kpb->hd.c_hb = NULL; return -ENOMEM; @@ -975,8 +979,6 @@ static int kpb_prepare(struct comp_dev *dev) * NOTE! We assume here that channel selector component device * is connected to the KPB sinks as well as host device. */ - struct comp_buffer *sink; - comp_dev_for_each_consumer(dev, sink) { enum sof_comp_type type; @@ -1165,6 +1167,11 @@ static int kpb_reset(struct comp_dev *dev) kpb_reset_history_buffer(kpb->hd.c_hb); } +#ifndef CONFIG_AMS + /* Unregister KPB from notifications */ + notifier_unregister(dev, NULL, NOTIFIER_ID_KPB_CLIENT_EVT); + notifier_unregister(dev, NULL, NOTIFIER_ID_WOV_CTRL); +#endif /* Finally KPB is ready after reset */ kpb_change_state(kpb, KPB_STATE_PREPARING); @@ -1465,7 +1472,7 @@ static int kpb_copy(struct comp_dev *dev) struct comp_dev *wov_comp = sink ? comp_buffer_get_sink_component(sink) : NULL; if (wov_comp) { - comp_dbg(dev, "kpb_copy: produced=%u bytes, triggering wov=0x%x", + comp_dbg(dev, "kpb_copy: produced=%zu bytes, triggering wov=0x%x", copy_bytes, dev_comp_id(wov_comp)); comp_copy(wov_comp); } else { diff --git a/src/audio/mfcc/llext/CMakeLists.txt b/src/audio/mfcc/llext/CMakeLists.txt index 0032f469c1ef..5799e5cdb416 100644 --- a/src/audio/mfcc/llext/CMakeLists.txt +++ b/src/audio/mfcc/llext/CMakeLists.txt @@ -8,6 +8,8 @@ sof_llext_build("mfcc" ../mfcc_generic.c ../mfcc_hifi3.c ../mfcc_hifi4.c + ../mfcc_vad.c ../mfcc_agc8.c + ../mfcc_ipc4.c LIB openmodules ) diff --git a/src/audio/mfcc/mfcc_agc8.c b/src/audio/mfcc/mfcc_agc8.c index 854977372111..90f1b19dc936 100644 --- a/src/audio/mfcc/mfcc_agc8.c +++ b/src/audio/mfcc/mfcc_agc8.c @@ -36,7 +36,7 @@ void mfcc_agc8_process(struct mfcc_agc8 *agc, const int32_t *mel, int8_t *out, i { int32_t peak = mel[0]; int32_t gain; - int32_t v; + int64_t v; int i; for (i = 1; i < n; i++) { @@ -45,14 +45,14 @@ void mfcc_agc8_process(struct mfcc_agc8 *agc, const int32_t *mel, int8_t *out, i } /* Attack: instantly keep the hop peak at or below +1.0 */ - if (agc->gain > MFCC_AGC8_CLIP_MAX_Q23 - peak) + if (agc->gain > (int64_t)MFCC_AGC8_CLIP_MAX_Q23 - peak) agc->gain = MFCC_AGC8_CLIP_MAX_Q23 - peak; if (agc->gain < agc->floor) agc->gain = agc->floor; gain = agc->gain; for (i = 0; i < n; i++) { - v = mel[i] + gain; + v = (int64_t)mel[i] + gain; if (v > MFCC_AGC8_CLIP_MAX_Q23) v = MFCC_AGC8_CLIP_MAX_Q23; else if (v < MFCC_AGC8_CLIP_MIN_Q23) diff --git a/src/audio/module_adapter/module_adapter.c b/src/audio/module_adapter/module_adapter.c index 1c68d50d052e..0426d5d23f33 100644 --- a/src/audio/module_adapter/module_adapter.c +++ b/src/audio/module_adapter/module_adapter.c @@ -522,14 +522,24 @@ int module_adapter_prepare(struct comp_dev *dev) * Hence check for NULL. */ sink = comp_dev_get_first_data_consumer(dev); - if (!sink && !list_is_empty(&dev->bsink_list) && mod->max_sinks) { + if (!sink && !IS_PROCESSING_MODE_SINK_SOURCE(mod) && !list_is_empty(&dev->bsink_list) && mod->max_sinks) { comp_err(dev, "no sink present on period size calculation"); return -EINVAL; } + /* A sinkless module still needs at least one source. */ + if (!sink && !comp_dev_get_first_data_producer(dev)) { + comp_err(dev, "no source or sink buffer connected"); + return -EINVAL; + } + if (sink) { mod->period_bytes = audio_stream_period_bytes(&sink->stream, dev->frames); comp_dbg(dev, "got period_bytes = %u", mod->period_bytes); + } else if (IS_PROCESSING_MODE_RAW_DATA(mod)) { + /* raw data buffering is sized from the sink period */ + comp_err(dev, "raw data module has no sink"); + return -EINVAL; } /* no more to do for sink/source mode */ diff --git a/src/audio/wov_arbiter/wov_arbiter.c b/src/audio/wov_arbiter/wov_arbiter.c index 975421040d28..429692d3fda4 100644 --- a/src/audio/wov_arbiter/wov_arbiter.c +++ b/src/audio/wov_arbiter/wov_arbiter.c @@ -783,7 +783,9 @@ static int wov_arb_get_large_config(struct comp_dev *dev, static const struct comp_driver wov_arbiter_drv = { .type = SOF_COMP_KEYWORD_DETECT, .uid = SOF_RT_UUID(wov_arbiter_uuid), +#if !CONFIG_ZEPHYR_LOG .tctx = &wov_arbiter_tr, +#endif .ops = { .create = wov_arb_new, .free = wov_arb_free, diff --git a/src/include/ipc4/kpb.h b/src/include/ipc4/kpb.h index aa33f0909994..a50ea7383a10 100644 --- a/src/include/ipc4/kpb.h +++ b/src/include/ipc4/kpb.h @@ -24,7 +24,7 @@ struct ipc4_kpb_module_cfg { enum ipc4_kpb_module_config_params { /*! Configure the module ID's which would be part of the Fast mode tasks */ KP_BUF_CFG_FM_MODULE = 1, - /*! Set history ring-buffer duration; 0 = use CONFIG_KPB_MAX_BUFF_TIME */ + /*! Set history ring-buffer duration in milliseconds; 0 = use CONFIG_KPB_MAX_BUFF_TIME */ KP_BUF_CFG_BUFF_TIME_MS = 2, /* Mic selector for client - sets microphone id for real time sink mic selector * IPC4-compatible ID - please do not change the number diff --git a/src/include/sof/audio/kpb.h b/src/include/sof/audio/kpb.h index bfbd4ab2a332..4e561e6ce990 100644 --- a/src/include/sof/audio/kpb.h +++ b/src/include/sof/audio/kpb.h @@ -37,7 +37,12 @@ struct comp_dev *get_wov_detector_comp(uint32_t ppl_id); #define KPB_MAX_BUFFER_SIZE(sw, channels_number) ((KPB_SAMPLNG_FREQUENCY / 1000) * \ (KPB_SAMPLE_CONTAINER_SIZE(sw) / 8) * KPB_MAX_BUFF_TIME * \ (channels_number)) +#ifdef CONFIG_KPB_MAX_NO_OF_CLIENTS #define KPB_MAX_NO_OF_CLIENTS CONFIG_KPB_MAX_NO_OF_CLIENTS +#else +/* header is also included by detectors in builds without KPB */ +#define KPB_MAX_NO_OF_CLIENTS 4 +#endif #define KPB_MAX_SINK_CNT (1 + KPB_MAX_NO_OF_CLIENTS) #define KPB_NO_OF_HISTORY_BUFFERS 2 /**< no of internal buffers */ #define KPB_ALLOCATION_STEP 0x100 diff --git a/src/include/sof/audio/wov_arbiter.h b/src/include/sof/audio/wov_arbiter.h index 0dff468fd275..b6565a42c0c7 100644 --- a/src/include/sof/audio/wov_arbiter.h +++ b/src/include/sof/audio/wov_arbiter.h @@ -12,9 +12,9 @@ /* Sentinel: no slot is currently draining. */ #define WOV_ARB_NO_ACTIVE 0xff -/** Host enum control IDs exposed by the WoV arbiter topology. */ -#define WOV_ARB_ACTIVE_SLOT_CONTROL_ID 1 -#define WOV_ARB_CALL_STATE_CONTROL_ID 2 +/** Host enum control IDs, the kernel numbers enums of a widget from 0. */ +#define WOV_ARB_ACTIVE_SLOT_CONTROL_ID 0 +#define WOV_ARB_CALL_STATE_CONTROL_ID 1 /** Values of the host WoV call-state enum control. */ #define WOV_ARB_CALL_STATE_LISTENING 0 diff --git a/src/include/sof/lib/notifier.h b/src/include/sof/lib/notifier.h index b4e5530f48ed..09aa020bed59 100644 --- a/src/include/sof/lib/notifier.h +++ b/src/include/sof/lib/notifier.h @@ -59,6 +59,7 @@ struct notify_data { enum notify_id type; uint32_t data_size; void *data; + bool pending; /* set by sender, cleared by target core after callbacks */ }; #ifdef CLK_SSP diff --git a/src/include/sof/math/pcan.h b/src/include/sof/math/pcan.h index 4320210da89a..a326502470cd 100644 --- a/src/include/sof/math/pcan.h +++ b/src/include/sof/math/pcan.h @@ -91,6 +91,10 @@ static inline uint32_t pcan_shrink(uint32_t x) * * \param strength Exponent alpha in Q1.15. * \param offset Additive offset delta in Q8.7. + * \param gain_bits Number of fractional bits in the returned gain. + * \param input_bits Number of fractional bits in the input energy x. + * \param x Smoothed noise energy estimate. + * \return Gain value with gain_bits fractional bits. */ int16_t pcan_gain_lookup_function(int32_t strength, int32_t offset, int32_t gain_bits, int32_t input_bits, uint32_t x); @@ -100,6 +104,10 @@ int16_t pcan_gain_lookup_function(int32_t strength, int32_t offset, int32_t gain * * \param strength Exponent alpha in Q1.15. * \param offset Additive offset delta in Q8.7. + * \param gain_bits Number of fractional bits in the gain values. + * \param input_bits Number of fractional bits in the input energy. + * \param gain_lut Output table of PCAN_LUT_SIZE entries. + * \return 0 on success, -EINVAL if gain_lut is NULL. */ int pcan_compute_lut(int32_t strength, int32_t offset, int32_t gain_bits, int32_t input_bits, int16_t *gain_lut); diff --git a/src/ipc/ipc-helper.c b/src/ipc/ipc-helper.c index 50219fb1b8b0..593a78c54a5a 100644 --- a/src/ipc/ipc-helper.c +++ b/src/ipc/ipc-helper.c @@ -311,9 +311,24 @@ __cold int ipc_comp_free(struct ipc *ipc, uint32_t comp_id) /* check state: if not ready, stop and reset to release resources before freeing */ if (icd->cd->state != COMP_STATE_READY) { - if (icd->cd->state == COMP_STATE_ACTIVE) + struct pipeline *p = icd->cd->pipeline; + int ret; + + if (icd->cd->state == COMP_STATE_ACTIVE) { + /* the pipeline task would otherwise keep running on freed components */ + if (p && p->status == COMP_STATE_ACTIVE && cpu_is_me(p->core)) { + pipeline_schedule_cancel(p); + p->status = COMP_STATE_PAUSED; + } comp_trigger(icd->cd, COMP_TRIGGER_STOP); - comp_reset(icd->cd); + } + + ret = comp_reset(icd->cd); + if (ret) { + tr_err(&ipc_tr, "comp id: 0x%x reset failed %d, cannot be freed", + comp_id, ret); + return ret < 0 ? ret : -EBUSY; + } comp_set_state(icd->cd, COMP_TRIGGER_RESET); } diff --git a/src/ipc/ipc4/handler-kernel.c b/src/ipc/ipc4/handler-kernel.c index 8ec1974ec254..63e5e57f0596 100644 --- a/src/ipc/ipc4/handler-kernel.c +++ b/src/ipc/ipc4/handler-kernel.c @@ -330,12 +330,14 @@ __cold static int ipc4_module_process_d0ix(struct ipc4_message_request *ipc4) * prevent_power_gating is set on the way back to D0i0 and clear when the * host allows the DSP to power gate, i.e. when the host is going to sleep. */ - struct d0ix_state_notif notif = { - .entering = !d0ix.extension.r.prevent_power_gating, - }; + /* never modified, remote cores may read them after a blocking IDC timeout */ + static struct d0ix_state_notif notif_enter = { .entering = true }; + static struct d0ix_state_notif notif_exit = { .entering = false }; + struct d0ix_state_notif *notif = d0ix.extension.r.prevent_power_gating ? + ¬if_exit : ¬if_enter; notifier_event(NULL, NOTIFIER_ID_D0IX_STATE, NOTIFIER_TARGET_CORE_ALL_MASK, - ¬if, sizeof(notif)); + notif, sizeof(*notif)); return 0; } diff --git a/src/lib/notifier.c b/src/lib/notifier.c index cc15c6cd7a23..13151ac55778 100644 --- a/src/lib/notifier.c +++ b/src/lib/notifier.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -18,6 +19,7 @@ #include #include #include +#include #include LOG_MODULE_REGISTER(notifier, CONFIG_SOF_LOG_LEVEL); @@ -27,6 +29,7 @@ SOF_DEFINE_REG_UUID(notifier); DECLARE_TR_CTX(nt_tr, SOF_UUID(notifier_uuid), LOG_LEVEL_INFO); static struct notify_data notify_data_shared[CONFIG_CORE_COUNT]; +static struct k_spinlock notify_data_lock; struct callback_handle { void *receiver; @@ -155,6 +158,7 @@ void notifier_notify_remote(void) notify_data->data); } + notify_data->pending = false; } void notifier_event(const void *caller, enum notify_id type, uint32_t core_mask, @@ -162,6 +166,8 @@ void notifier_event(const void *caller, enum notify_id type, uint32_t core_mask, { struct notify_data *notify_data; struct idc_msg notify_msg = { IDC_MSG_NOTIFY, IDC_MSG_NOTIFY_EXT }; + k_spinlock_key_t key; + int ret; int i; /* notify selected targets */ @@ -172,6 +178,17 @@ void notifier_event(const void *caller, enum notify_id type, uint32_t core_mask, } else if (cpu_is_core_enabled(i)) { notify_msg.core = i; notify_data = notify_data_get() + i; + + /* previous event to this core is still queued, don't overwrite it */ + key = k_spin_lock(¬ify_data_lock); + if (notify_data->pending) { + k_spin_unlock(¬ify_data_lock, key); + tr_err(&nt_tr, "core %d busy, event %d dropped", i, type); + continue; + } + notify_data->pending = true; + k_spin_unlock(¬ify_data_lock, key); + notify_data->caller = caller; notify_data->type = type; @@ -186,8 +203,16 @@ void notifier_event(const void *caller, enum notify_id type, uint32_t core_mask, /* Wait for completion: back-to-back events to the same core would * otherwise reuse a queued IDC work item and overwrite notify_data. + * Blocking is not allowed in ISR context. */ - idc_send_msg(¬ify_msg, IDC_BLOCKING); + ret = idc_send_msg(¬ify_msg, k_is_in_isr() ? + IDC_NON_BLOCKING : IDC_BLOCKING); + if (ret < 0) { + tr_err(&nt_tr, "event %d to core %d failed %d", type, i, ret); + /* on timeout the work stays queued and clears pending */ + if (ret == -EACCES) + notify_data->pending = false; + } } } } @@ -211,8 +236,10 @@ __cold void init_system_notify(struct sof *sof) for (i = NOTIFIER_ID_CPU_FREQ; i < NOTIFIER_ID_COUNT; i++) list_init(&(*notify)->list[i]); - if (cpu_get_id() == PLATFORM_PRIMARY_CORE_ID) + if (cpu_get_id() == PLATFORM_PRIMARY_CORE_ID) { + k_spinlock_init(¬ify_data_lock); sof->notify_data = notify_data_shared; + } } void free_system_notify(void) diff --git a/src/math/Kconfig b/src/math/Kconfig index 934a6a9776e6..b55a6b0b34ce 100644 --- a/src/math/Kconfig +++ b/src/math/Kconfig @@ -279,6 +279,7 @@ config MATH_16BIT_MEL_FILTERBANK config MATH_32BIT_MEL_FILTERBANK bool "icomplex32 data support" default n + select SQRT_FIXED help This option enables function psy_apply_mel_filterbank_32(). It takes as input an array of icomplex32 diff --git a/src/math/auditory/auditory.c b/src/math/auditory/auditory.c index 0abd10de9308..8359bbdff760 100644 --- a/src/math/auditory/auditory.c +++ b/src/math/auditory/auditory.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -62,6 +63,7 @@ int16_t psy_hz_to_mel(int16_t hz) mel = Q_MULTSR_32X32((int64_t)log, LOG_MULT_HZMEL_Q20, 26, 20, 2); return mel; } +EXPORT_SYMBOL(psy_hz_to_mel); /** * Convert Mel to Hz @@ -88,6 +90,7 @@ int16_t psy_mel_to_hz(int16_t mel) hz = Q_MULTSR_32X32((int64_t)exp, 700, 20, 0, 0); return hz; } +EXPORT_SYMBOL(psy_mel_to_hz); int mod_psy_get_mel_filterbank(struct processing_module *mod, struct psy_mel_filterbank *fb) { @@ -239,6 +242,7 @@ int mod_psy_get_mel_filterbank(struct processing_module *mod, struct psy_mel_fil fb->scratch_data2, sizeof(int16_t) * fb->data_length); return 0; } +EXPORT_SYMBOL(mod_psy_get_mel_filterbank); int mod_psy_free_mel_filterbank(struct processing_module *mod, struct psy_mel_filterbank *mel_fb) { diff --git a/src/math/auditory/mel_filterbank_32.c b/src/math/auditory/mel_filterbank_32.c index c496973f64a1..ed7b2fec5e58 100644 --- a/src/math/auditory/mel_filterbank_32.c +++ b/src/math/auditory/mel_filterbank_32.c @@ -10,6 +10,7 @@ #include #include #include +#include #include static inline uint32_t mel_sqrt32(uint32_t num) @@ -127,9 +128,11 @@ void psy_apply_mel_filterbank_with_linear_32(struct psy_mel_filterbank *fb, stru } } } +EXPORT_SYMBOL(psy_apply_mel_filterbank_with_linear_32); void psy_apply_mel_filterbank_32(struct psy_mel_filterbank *fb, struct icomplex32 *fft_out, int32_t *power_spectra, int32_t *mel_log, int bitshift) { psy_apply_mel_filterbank_with_linear_32(fb, fft_out, power_spectra, mel_log, NULL, bitshift); } +EXPORT_SYMBOL(psy_apply_mel_filterbank_32); diff --git a/src/math/dct.c b/src/math/dct.c index e4bbe5623dd8..0b5d5b96704f 100644 --- a/src/math/dct.c +++ b/src/math/dct.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -78,6 +79,7 @@ int mod_dct_initialize_16(struct processing_module *mod, struct dct_plan_16 *dct return 0; } +EXPORT_SYMBOL(mod_dct_initialize_16); int mod_dct_free_16(struct processing_module *mod, struct dct_plan_16 *dct) { diff --git a/src/math/fft/fft_32.c b/src/math/fft/fft_32.c index a6f8b2aa1ab3..fa68879317ba 100644 --- a/src/math/fft/fft_32.c +++ b/src/math/fft/fft_32.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #ifdef FFT_GENERIC @@ -93,5 +94,6 @@ void fft_execute_32(struct fft_plan *plan, bool ifft) } } } +EXPORT_SYMBOL(fft_execute_32); #endif /* FFT_GENERIC */ diff --git a/src/math/fft/fft_32_hifi3.c b/src/math/fft/fft_32_hifi3.c index 1d00dacd1b7f..a078187e1742 100644 --- a/src/math/fft/fft_32_hifi3.c +++ b/src/math/fft/fft_32_hifi3.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #ifdef FFT_HIFI3 @@ -156,4 +157,5 @@ void fft_execute_32(struct fft_plan *plan, bool ifft) } } } +EXPORT_SYMBOL(fft_execute_32); #endif diff --git a/src/math/fft/fft_common.c b/src/math/fft/fft_common.c index 589571881443..715bb9736815 100644 --- a/src/math/fft/fft_common.c +++ b/src/math/fft/fft_common.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include "fft_common.h" @@ -103,6 +104,7 @@ struct fft_plan *mod_fft_plan_new(struct processing_module *mod, void *inb, fft_plan_init_bit_reverse(plan->bit_reverse_idx, plan->size, plan->len); return plan; } +EXPORT_SYMBOL(mod_fft_plan_new); void mod_fft_plan_free(struct processing_module *mod, struct fft_plan *plan) { @@ -112,3 +114,4 @@ void mod_fft_plan_free(struct processing_module *mod, struct fft_plan *plan) mod_free(mod, plan->bit_reverse_idx); mod_free(mod, plan); } +EXPORT_SYMBOL(mod_fft_plan_free); diff --git a/src/math/matrix.c b/src/math/matrix.c index e4c4c1ecbfff..f3d08a71f2d1 100644 --- a/src/math/matrix.c +++ b/src/math/matrix.c @@ -5,6 +5,7 @@ // Author: Seppo Ingalsuo #include +#include #include #include @@ -57,6 +58,7 @@ int mat_multiply(struct mat_matrix_16b *a, struct mat_matrix_16b *b, struct mat_ } return 0; } +EXPORT_SYMBOL(mat_multiply); int mat_multiply_elementwise(struct mat_matrix_16b *a, struct mat_matrix_16b *b, struct mat_matrix_16b *c) @@ -94,3 +96,4 @@ int mat_multiply_elementwise(struct mat_matrix_16b *a, struct mat_matrix_16b *b, return 0; } +EXPORT_SYMBOL(mat_multiply_elementwise); diff --git a/src/math/pcan/pcan.c b/src/math/pcan/pcan.c index e212a83e51fe..e7b1f7f4eb0f 100644 --- a/src/math/pcan/pcan.c +++ b/src/math/pcan/pcan.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -197,6 +198,7 @@ int pcan_populate_state(const struct pcan_config *config, struct pcan_state *sta return 0; } +EXPORT_SYMBOL(pcan_populate_state); void pcan_free_state(struct pcan_state *state) { @@ -232,3 +234,8 @@ void pcan_log_scale(struct pcan_state *state, uint32_t *signal) for (i = state->num_channels - 1; i >= 0; --i) signal[i] = scaled[i]; } +EXPORT_SYMBOL(pcan_log_scale); + +/* the TFLM microfrontend sources can't carry SOF symbol exports */ +EXPORT_SYMBOL(NoiseReductionApply); +EXPORT_SYMBOL(PcanGainControlApply); diff --git a/src/math/window.c b/src/math/window.c index 39739ef24be3..d43db99cc790 100644 --- a/src/math/window.c +++ b/src/math/window.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include @@ -41,6 +42,7 @@ void win_rectangular_16b(int16_t *win, int length) for (i = 0; i < length; i++) win[i] = WIN_ONE_Q15; } +EXPORT_SYMBOL(win_rectangular_16b); void win_rectangular_32b(int32_t *win, int length) { @@ -76,6 +78,7 @@ void win_blackman_16b(int16_t win[], int length, int16_t a0) win[n] = sat_int16(val); } } +EXPORT_SYMBOL(win_blackman_16b); void win_blackman_32b(int32_t win[], int length, int32_t a0) { @@ -118,6 +121,7 @@ void win_hann_16b(int16_t win[], int length) win[n] = sat_int16(val); } } +EXPORT_SYMBOL(win_hann_16b); void win_hann_32b(int32_t win[], int length) { @@ -152,6 +156,7 @@ void win_hamming_16b(int16_t win[], int length) win[n] = sat_int16(Q_SHIFT_RND(val, 30, 15)); } } +EXPORT_SYMBOL(win_hamming_16b); void win_hamming_32b(int32_t win[], int length) { @@ -195,3 +200,4 @@ void win_povey_16b(int16_t win[], int length) win[n] = sat_int16(Q_SHIFT_RND(x4, 20, 15)); } } +EXPORT_SYMBOL(win_povey_16b); diff --git a/tools/topology/topology2/cavs-nocodec-wov.conf b/tools/topology/topology2/cavs-nocodec-wov.conf index 6a595bb0969b..ea4c20d7916d 100644 --- a/tools/topology/topology2/cavs-nocodec-wov.conf +++ b/tools/topology/topology2/cavs-nocodec-wov.conf @@ -590,7 +590,7 @@ Object.Pipeline."custom-capture" [ input_pin_binding_name "kpb.116.1" } Object.Base.input_pin_binding.2 { - input_pin_binding_name "mww.111.1" + input_pin_binding_name "mww.$WOV_SLOT0_PIPELINE_ID.1" } Object.Base.input_audio_format [ diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt index a790edf262f1..4bdd98be94c7 100644 --- a/zephyr/CMakeLists.txt +++ b/zephyr/CMakeLists.txt @@ -674,7 +674,7 @@ if (NOT CONFIG_COMPILER_INLINE_FUNCTION_OPTION) target_compile_options(SOF INTERFACE -fno-inline-functions) endif() -if (ARCH STREQUAL "xtensa") +if (CONFIG_XTENSA) target_compile_options(SOF INTERFACE -mlongcalls) zephyr_compile_options(-mtext-section-literals) endif()