Skip to content
Closed
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
1 change: 1 addition & 0 deletions src/arch/host/configs/library_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ CONFIG_COMP_MULTIBAND_DRC=y
CONFIG_COMP_MUX=y
CONFIG_COMP_RTNR=y
CONFIG_COMP_SEL=y
CONFIG_COMP_SOUND_DOSE=y
CONFIG_COMP_SRC=y
CONFIG_COMP_SRC_IPC4_FULL_MATRIX=y
CONFIG_COMP_STUBS=y
Expand Down
55 changes: 32 additions & 23 deletions src/audio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,18 @@ if(NOT CONFIG_COMP_MODULE_SHARED_LIBRARY_BUILD)
add_subdirectory(pcm_converter)
add_subdirectory(pipeline)

if(CONFIG_COMP_BASEFW_IPC4 AND NOT CONFIG_LIBRARY)
add_local_sources(sof base_fw.c)
endif()
add_local_sources_ifdef(CONFIG_IPC4_BASE_FW_INTEL sof base_fw_intel.c)

# directories and files included conditionally (alphabetical order)
if(CONFIG_COMP_ARIA)
add_subdirectory(aria)
endif()
if(CONFIG_COMP_ASRC)
add_subdirectory(asrc)
endif()
if(CONFIG_COMP_BASEFW_IPC4 AND NOT CONFIG_LIBRARY)
add_local_sources(sof base_fw.c)
endif()
add_local_sources_ifdef(CONFIG_IPC4_BASE_FW_INTEL sof base_fw_intel.c)
if(CONFIG_COMP_CHAIN_DMA)
add_local_sources(sof chain_dma.c)
endif()
if(CONFIG_COMP_COPIER)
add_subdirectory(copier)
endif()
Expand All @@ -52,19 +50,17 @@ if(NOT CONFIG_COMP_MODULE_SHARED_LIBRARY_BUILD)
if(CONFIG_COMP_IIR)
add_subdirectory(eq_iir)
endif()
if(CONFIG_COMP_KPB AND NOT CONFIG_LIBRARY_STATIC)
add_local_sources(sof
kpb.c
)
if(CONFIG_COMP_LEVEL_MULTIPLIER)
add_subdirectory(level_multiplier)
endif()
if(CONFIG_COMP_MFCC)
add_subdirectory(mfcc)
endif()
if(CONFIG_COMP_MIXER)
add_subdirectory(mixer)
add_subdirectory(mixer)
endif()
if(CONFIG_COMP_MIXIN_MIXOUT)
add_subdirectory(mixin_mixout)
add_subdirectory(mixin_mixout)
endif()
if(CONFIG_COMP_MODULE_ADAPTER)
add_subdirectory(module_adapter)
Expand All @@ -84,45 +80,58 @@ if(NOT CONFIG_COMP_MODULE_SHARED_LIBRARY_BUILD)
if(CONFIG_COMP_SMART_AMP)
add_subdirectory(smart_amp)
endif()
if(CONFIG_COMP_SOUND_DOSE)
add_subdirectory(sound_dose)
endif()
if(CONFIG_COMP_SRC)
add_subdirectory(src)
endif()
if(CONFIG_COMP_TDFB)
add_subdirectory(tdfb)
endif()
if(CONFIG_COMP_TONE)
add_local_sources(sof
tone.c
)
if(CONFIG_COMP_TEMPLATE_COMP)
add_subdirectory(template_comp)
endif()
if(CONFIG_COMP_TENSORFLOW)
add_subdirectory(tensorflow)
endif()
if(CONFIG_COMP_UP_DOWN_MIXER)
add_subdirectory(up_down_mixer)
endif()
if(CONFIG_COMP_VOLUME)
add_subdirectory(volume)
endif()
if(CONFIG_COMP_TENSORFLOW)
add_subdirectory(tensorflow)
endif()
if(CONFIG_DTS_CODEC)
add_subdirectory(codec)
endif()
# end of directories and files included conditionally (alphabetical order)

add_subdirectory(google)
add_subdirectory(nxp)

if(CONFIG_COMP_CHAIN_DMA)
add_local_sources(sof chain_dma.c)
endif()
if(CONFIG_COMP_KPB AND NOT CONFIG_LIBRARY_STATIC)
add_local_sources(sof
kpb.c
)
endif()
if(CONFIG_INTEL_ADSP_MIC_PRIVACY)
add_subdirectory(mic_privacy_manager)
endif()
if(CONFIG_COMP_TONE)
add_local_sources(sof
tone.c
)
endif()
if(CONFIG_ZEPHYR_NATIVE_DRIVERS)
list(APPEND base_files host-zephyr.c)
sof_list_append_ifdef(CONFIG_COMP_DAI base_files dai-zephyr.c)
else()
list(APPEND base_files host-legacy.c)
sof_list_append_ifdef(CONFIG_COMP_DAI base_files dai-legacy.c)
endif()
if(CONFIG_COMP_TEMPLATE_COMP)
add_subdirectory(template_comp)
endif()
endif()

### Common files (also used in shared library build)
Expand Down
76 changes: 27 additions & 49 deletions src/audio/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

menu "Audio components"

rsource "volume/Kconfig"
rsource "aria/Kconfig"

config COMP_BASEFW_IPC4
bool "BASEFW component"
default y
Expand All @@ -20,8 +17,6 @@ config IPC4_BASE_FW_INTEL
This implements a set of additional IPC4 properties that
extend the base spec.

rsource "copier/Kconfig"

config HOST_DMA_RELOAD_DELAY_ENABLE
bool "Delay reloading DMA for host interfaces"
default y
Expand Down Expand Up @@ -79,8 +74,6 @@ config MODULE_MAX_CONNECTIONS
Specifies the maximum number of sink and source connections a module
may have to other modules.

rsource "up_down_mixer/Kconfig"

config COMP_BLOB
bool "Large IPC data as compound message blobs"
default y
Expand All @@ -96,19 +89,13 @@ config MODULE_MAX_BLOB_SIZE
Specify the maximum size of IPC4 module blob data that can be
appended to each message.

rsource "src/Kconfig"

config COMP_STUBS
bool "Build all selected third-party (3P) components with stubs"
default n
help
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.

rsource "eq_fir/Kconfig"

rsource "eq_iir/Kconfig"

config COMP_TONE
bool "Tone component"
default n
Expand All @@ -117,12 +104,6 @@ config COMP_TONE
Select for Tone component.
Warning: This component is deprecated and will be removed from SOF v2.8.

rsource "mixer/Kconfig"

rsource "mixin_mixout/Kconfig"

rsource "mux/Kconfig"

config COMP_KPB
bool "KPB component"
default y
Expand All @@ -139,28 +120,6 @@ config KPB_FORCE_COPY_TYPE_NORMAL

endif # COMP_KPB

rsource "google/Kconfig"

rsource "nxp/Kconfig"

rsource "selector/Kconfig"

rsource "crossover/Kconfig"

rsource "drc/Kconfig"

rsource "multiband_drc/Kconfig"

rsource "dcblock/Kconfig"

rsource "smart_amp/Kconfig"

rsource "asrc/Kconfig"

rsource "tdfb/Kconfig"

rsource "tensorflow/Kconfig"

config COMP_MODULE_ADAPTER
bool "Module adapter"
default y
Expand All @@ -172,17 +131,36 @@ config COMP_MODULE_ADAPTER
"src\include\sof\audio\module_adapter\interfaces.h". It is possible to link several
different codecs and use them in parallel.

rsource "module_adapter/Kconfig"

# --- Kconfig Sources (alphabetical order) ---
rsource "aria/Kconfig"
rsource "asrc/Kconfig"
rsource "codec/Kconfig"
rsource "copier/Kconfig"
rsource "crossover/Kconfig"
rsource "dcblock/Kconfig"
rsource "drc/Kconfig"
rsource "eq_fir/Kconfig"
rsource "eq_iir/Kconfig"
rsource "google/Kconfig"
rsource "igo_nr/Kconfig"

rsource "rtnr/Kconfig"

rsource "mfcc/Kconfig"

rsource "codec/Kconfig"

rsource "mixer/Kconfig"
rsource "mixin_mixout/Kconfig"
rsource "module_adapter/Kconfig"
rsource "multiband_drc/Kconfig"
rsource "mux/Kconfig"
rsource "nxp/Kconfig"
rsource "rtnr/Kconfig"
rsource "selector/Kconfig"
rsource "smart_amp/Kconfig"
rsource "sound_dose/Kconfig"
rsource "src/Kconfig"
rsource "tdfb/Kconfig"
rsource "template_comp/Kconfig"
rsource "tensorflow/Kconfig"
rsource "up_down_mixer/Kconfig"
rsource "volume/Kconfig"
# --- End Kconfig Sources (alphabetical order) ---

endmenu # "Audio components"

Expand Down
12 changes: 12 additions & 0 deletions src/audio/eq_iir/tune/sof_eq_plot.m
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,17 @@ function sof_eq_plot(eq, fn)
eq.f, eq.iir_eq_db + offs_iir, '--',...
eq.f, eq.fir_eq_db + offs_fir, '--');
legend('Target', 'Combined', 'IIR', 'FIR', 'Location', 'NorthWest');
eq.diff_db = eq.tot_eq_db + offs_tot - eq.err_db_s;
end
if eq.enable_fir && eq.enable_iir == 0
semilogx(eq.f, eq.err_db_s, eq.f, eq.fir_eq_db + offs_fir);
legend('Target', 'FIR', 'Location', 'NorthWest');
eq.diff_db = eq.fir_eq_db + offs_fir - eq.err_db_s;
end
if eq.enable_fir == 0 && eq.enable_iir
semilogx(eq.f, eq.err_db_s, eq.f, eq.iir_eq_db + offs_iir);
legend('Target', 'IIR', 'Location', 'NorthWest');
eq.diff_db = eq.iir_eq_db + offs_iir - eq.err_db_s;
end
grid on;
ax=axis; axis([eq.p_fmin eq.p_fmax min(max(ax(3:4), -40), 40)]);
Expand All @@ -91,6 +94,15 @@ function sof_eq_plot(eq, fn)
tstr = sprintf('Filter target vs. achieved response: %s', eq.name);
title(tstr);

fh=figure(fn); fn = fn+1;
semilogx(eq.f, eq.diff_db)
grid on;
ax=axis; axis([eq.p_fmin eq.p_fmax -5 5]);
xlabel('Frequency (Hz)');
ylabel('Magnitude (dB)');
tstr = sprintf('Response difference mean abs %.4f dB: %s', mean(abs(eq.diff_db)), eq.name);
title(tstr);

%% FIR filter
if length(eq.b_fir) > 1
% Response
Expand Down
19 changes: 15 additions & 4 deletions src/audio/eq_iir/tune/sof_export_c_eq_uint32t.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function sof_export_c_eq_uint32t(fn, blob8, vn, justeq)
function sof_export_c_eq_uint32t(fn, blob8, vn, justeq, howto)

% sof_export_c_eq_uint32t(fn, blob8, vn)
%
Expand All @@ -8,10 +8,11 @@ function sof_export_c_eq_uint32t(fn, blob8, vn, justeq)
% blob8 - blob data from EQ design
% vn - variable name
% justeq - export just the EQ wihtout ABI headers for direct use in FW
% howto - add a comment how the header file was created

% SPDX-License-Identifier: BSD-3-Clause
%
% Copyright (c) 2021, Intel Corporation. All rights reserved.
% Copyright (c) 2021-2025, Intel Corporation.

% Write blob
fh = fopen(fn, 'w');
Expand All @@ -23,10 +24,20 @@ function sof_export_c_eq_uint32t(fn, blob8, vn, justeq)
year = datestr(now, 'yyyy');
fprintf(fh, '/* SPDX-License-Identifier: BSD-3-Clause\n');
fprintf(fh, ' *\n');
fprintf(fh, ' * Copyright(c) %s Intel Corporation. All rights reserved.\n', year);
fprintf(fh, ' * Copyright(c) %s Intel Corporation.\n', year);
fprintf(fh, ' */\n');
fprintf(fh, '\n');

if nargin == 5
fprintf(fh, '/* Created %s with command:\n', datestr(now, 'yyyy-mm-dd'));
fprintf(fh, ' * %s\n */\n\n', howto);
end

fprintf(fh, '#include <stdint.h>\n\n');

% Drop 8 bytes TLV header
blob8 = blob8(9:end);

% Pad blob length to multiple of four bytes
n_orig = length(blob8);
n_new = ceil(n_orig/4);
Expand All @@ -53,7 +64,7 @@ function sof_export_c_eq_uint32t(fn, blob8, vn, justeq)
numbers_remain = n_new - numbers_in_line * full_lines;

n = 1;
fprintf(fh, 'uint32_t %s[%d] = {\n', vn, n_new);
fprintf(fh, 'static const uint32_t %s[%d] = {\n', vn, n_new);
for i = 1:full_lines
fprintf(fh, '\t');
for j = 1:numbers_in_line
Expand Down
10 changes: 10 additions & 0 deletions src/audio/sound_dose/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# SPDX-License-Identifier: BSD-3-Clause

if(CONFIG_COMP_SOUND_DOSE STREQUAL "m")
add_subdirectory(llext ${PROJECT_BINARY_DIR}/sound_dose_llext)
add_dependencies(app sound_dose)
else()
add_local_sources(sof sound_dose.c)
add_local_sources(sof sound_dose-generic.c)
add_local_sources(sof sound_dose-ipc4.c)
endif()
15 changes: 15 additions & 0 deletions src/audio/sound_dose/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# SPDX-License-Identifier: BSD-3-Clause

config COMP_SOUND_DOSE
tristate "Sound Dose module"
default m if LIBRARY_DEFAULT_MODULAR
depends on COMP_MODULE_ADAPTER
depends on IPC_MAJOR_4
select MATH_IIR
select MATH_IIR_DF1
select MATH_EXP
help
Select this for Sound Dose SOF module. The purpose is
to calculate for audio playback MEL values (momentary
sound exposure level) to provide to user space the data
to compute the sound dose CSD as defined in EN 50332-3.
Loading
Loading