diff --git a/src/audio/mfcc/llext/CMakeLists.txt b/src/audio/mfcc/llext/CMakeLists.txt index 688342751d75..ca3e68c02a1f 100644 --- a/src/audio/mfcc/llext/CMakeLists.txt +++ b/src/audio/mfcc/llext/CMakeLists.txt @@ -1,12 +1,20 @@ # Copyright (c) 2024 Intel Corporation. # SPDX-License-Identifier: Apache-2.0 +set(MFCC_LLEXT_SOURCES + ../mfcc.c + ../mfcc_setup.c + ../mfcc_common.c + ../mfcc_generic.c + ../mfcc_hifi3.c + ../mfcc_hifi4.c + ../mfcc_vad.c +) +if(CONFIG_IPC_MAJOR_4) + list(APPEND MFCC_LLEXT_SOURCES ../mfcc_ipc4.c) +endif() + sof_llext_build("mfcc" - SOURCES ../mfcc.c - ../mfcc_setup.c - ../mfcc_common.c - ../mfcc_generic.c - ../mfcc_hifi3.c - ../mfcc_hifi4.c + SOURCES ${MFCC_LLEXT_SOURCES} LIB openmodules ) diff --git a/src/kernel/audio/base_fw.c b/src/kernel/audio/base_fw.c index 16115d332d6e..37743e7db241 100644 --- a/src/kernel/audio/base_fw.c +++ b/src/kernel/audio/base_fw.c @@ -116,7 +116,7 @@ static void get_codec_info(struct sof_tlv **tuple) add_codec_info_item(&codec_info, SND_AUDIOCODEC_VORBIS, SOF_IPC_STREAM_PLAYBACK); #endif -#ifdef CONFIG_COMP_MFCC +#if defined(CONFIG_COMP_MFCC) || defined(CONFIG_COMP_MFCC_MODULE) add_codec_info_item(&codec_info, SND_AUDIOCODEC_BESPOKE, SOF_IPC_STREAM_CAPTURE); #endif @@ -235,7 +235,8 @@ static void get_codec_info(struct sof_tlv **tuple) #if (defined(CONFIG_FFMPEG_ENC_SBC) || defined(CONFIG_FFMPEG_ENC_G722) || \ defined(CONFIG_FFMPEG_ENC_APTX) || defined(CONFIG_FFMPEG_ENC_APTX_HD) || \ defined(CONFIG_FFMPEG_ENC_G726) || defined(CONFIG_FFMPEG_ENC_ALAW) || \ - defined(CONFIG_FFMPEG_ENC_MULAW)) && !defined(CONFIG_COMP_MFCC) + defined(CONFIG_FFMPEG_ENC_MULAW)) && \ + !defined(CONFIG_COMP_MFCC) && !defined(CONFIG_COMP_MFCC_MODULE) /* Also advertise BESPOKE capture for kernels with older SND_AUDIOCODEC_MAX. */ add_codec_info_item(&codec_info, SND_AUDIOCODEC_BESPOKE, SOF_IPC_STREAM_CAPTURE); #endif diff --git a/src/math/auditory/auditory.c b/src/math/auditory/auditory.c index 0abd10de9308..84d699d81e79 100644 --- a/src/math/auditory/auditory.c +++ b/src/math/auditory/auditory.c @@ -16,6 +16,7 @@ #include #include #include +#include LOG_MODULE_REGISTER(math_auditory, CONFIG_SOF_LOG_LEVEL); @@ -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 2218629d1278..23723b354a5a 100644 --- a/src/math/auditory/mel_filterbank_32.c +++ b/src/math/auditory/mel_filterbank_32.c @@ -11,6 +11,7 @@ #include #include #include +#include static inline uint32_t mel_sqrt32(uint32_t num) { @@ -137,3 +138,4 @@ void psy_apply_mel_filterbank_32(struct psy_mel_filterbank *fb, struct icomplex3 { 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..2e43d3574118 100644 --- a/src/math/dct.c +++ b/src/math/dct.c @@ -12,6 +12,7 @@ #include #include #include +#include #define PI_Q29 Q_CONVERT_FLOAT(3.1415926536, 29) #define TWO_PI_Q24 Q_CONVERT_FLOAT(6.2831853072, 24) @@ -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..7773b09e8c6f 100644 --- a/src/math/fft/fft_32.c +++ b/src/math/fft/fft_32.c @@ -13,6 +13,7 @@ #ifdef FFT_GENERIC #include +#include /** * \brief Execute the 32-bits Fast Fourier Transform (FFT) or Inverse FFT (IFFT) @@ -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..7babd529939f 100644 --- a/src/math/fft/fft_32_hifi3.c +++ b/src/math/fft/fft_32_hifi3.c @@ -12,6 +12,7 @@ #ifdef FFT_HIFI3 #include #include +#include void fft_execute_32(struct fft_plan *plan, bool ifft) { @@ -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 94c315537e3a..208805ab37bf 100644 --- a/src/math/fft/fft_common.c +++ b/src/math/fft/fft_common.c @@ -13,6 +13,7 @@ #include #include #include +#include #include "fft_common.h" LOG_MODULE_REGISTER(math_fft, CONFIG_SOF_LOG_LEVEL); @@ -104,6 +105,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) { @@ -113,3 +115,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..469e118d8b79 100644 --- a/src/math/matrix.c +++ b/src/math/matrix.c @@ -7,6 +7,7 @@ #include #include #include +#include int mat_multiply(struct mat_matrix_16b *a, struct mat_matrix_16b *b, struct mat_matrix_16b *c) { @@ -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/window.c b/src/math/window.c index 39739ef24be3..8e21dc29d638 100644 --- a/src/math/window.c +++ b/src/math/window.c @@ -11,6 +11,7 @@ #include #include #include +#include #define WIN_ONE_Q15 INT16_MAX #define WIN_ONE_Q31 INT32_MAX @@ -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);