Add Doxygen comments to describe the parameters and functionality of
the crossover_s32_default function. This helps in understanding the
function's flow and the purpose of each section.
Signed-off-by: Shriram Shastry <malladi.sastry@intel.com>
Optimize the function by pre-initializing active sinks and adjusting loops
for better performance and readability.
Signed-off-by: Shriram Shastry <malladi.sastry@intel.com>
We should be using the trusted max size passed in via the framework
rather than the scratch memory we are passing into the host.
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
Check to make sure we actually have enough space to copy the config, if
we don't we will assert and crash when we could have handled this
gracefully.
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
The comp_* macros will print the function name from where they are called,
there is no need to print them twice.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
The 'nothing to copy' without context does not help in debugging, print
out the number of frames on src and sink side to give some context.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
The comp_* macros will print the function name from where they are called,
there is no need to print them twice.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
If 0 is a error then override it so the outer function doesn't think we ran
successfully and then hit a null ptr after we freed everything.
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
Without this change turning the performance measurements off, by setting
CONFIG_SOF_TELEMETRY_PERFORMANCE_MEASUREMENTS=n, causes a number of
"undefined reference to" linker errors.
Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Extract -DCONFIG_* definitions hardcoded inside the script and move them
to a new .conf file where they belong.
This is a first, baby-step towards addressing the more general lack of
.config control described in #9386
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
The rate_min and rate_max no more work with IPC4 topologies. The
SSP2 PCM host pipeline contains a sample rate converter so it can
support multiple rates. With attempt to play (or capture) with
other than 48 kHz the error is printed and resulting playback has
wrong pitch:
Warning: rate is not accurate (requested = 44100Hz, got = 48000Hz)
please, try the plug plugin
Use of rates with list of all rates in topology fixes the issue.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The comp_err() trace in mfcc_init() causes an error:
sof/src/audio/mfcc/mfcc.c: In function 'mfcc_init':
sof/src/include/sof/audio/component.h:160:20:
error: format '%u' expects argument of type 'unsigned int',
but argument 4 has type 'size_t' {aka 'long unsigned int'}
[-Werror=format=]
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Now that validate_config has been deleted we can clean up some of the
error handling logic here.
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
empty TODO for 4 years, no point in keeping it around. Also if you are
doing validation after trusting the data enough to do a memcpy you have
already lost.
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
- Added detailed function documentation.
- Changed from if-else checks to bitwise operations for efficiency:
- Shifted left by 24 bits to prepare for saturation.
- Shifted right by 24 bits to sign-extend the value.
- Extracted the 8-bit value using AE_MOVAD32_L.
- No performance degradation observed.
This check-in refines the sat_int8 function by improving its logic
and documentation to ensure a more efficient and accurate 32-bit to
8-bit conversion process.
Signed-off-by: Shriram Shastry <malladi.sastry@intel.com>
- Added detailed function documentation.
- Changed from AE_SAT16X4(x, x) to a more descriptive process:
- Moved the 32-bit value to ae_int32x2 type for accurate input
handling.
- Used AE_SAT16X4 to saturate and pack values.
- Extracted the first 16-bit value with AE_MOVAD16_0.
- No performance degradation observed.
This check-in enhances the sat_int16 function by improving its logic
and documentation to ensure more accurate 32-bit to 16-bit conversion.
Signed-off-by: Shriram Shastry <malladi.sastry@intel.com>
- Added detailed function documentation.
- Changed from AE_SRAI32(AE_SLAI32S(x, 8), 8) to AE_SAT24S for
more accurate 24-bit saturation.
- Used ae_f32x2 type to ensure correct input handling.
- No performance degradation observed.
This check-in enhances the sat_int24 function by improving its logic
and documentation to ensure more accurate 32-bit to 24-bit conversion.
Signed-off-by: Shriram Shastry <malladi.sastry@intel.com>
- Enhanced function documentation.
- Replaced AE_SLAI64 with AE_SLAI64S for better saturation control.
- Added intermediary shift left by 32 bits with saturation.
- Final shift right by 32 bits for accurate rounding and conversion.
- No performance degradation observed.
This check-in ensures more accurate and reliable results by using more
appropriate intrinsic functions and thorough step-by-step operations.
Signed-off-by: Shriram Shastry <malladi.sastry@intel.com>
- Changed year to 2024 and added author information.
- Updated the license identifier to BSD-3-Clause.
Signed-off-by: Shriram Shastry <malladi.sastry@intel.com>
Normally, the type of enums is "unsigned int" or "int". GCC has
the "-fshort-enums" option, which instructs the compiler to
use the smallest data type that can hold all the values in
the enum (i.e: char, short, int or their unsigned variants).
According to the GCC documentation, "-fshort-enums" may be
default on some targets. This seems to be the case for
"arm-zephyr-eabi-gcc", which is used to build Zephyr on
ARM platforms.
On Linux, this is not the case (tested with "aarch64-linux-gnu-gcc"),
which means enums such as "enum sof_comp_type" will end up having
different sizes on Linux and SOF. Since "enum sof_comp_type" is used in
IPC-related structures such as "struct sof_ipc_comp", this means
the fields of the structures will end up being placed at different
offsets. This, in turn, leads to SOF not being able to properly
interpret data passed from Linux.
With this in mind, replace "enum sof_comp_type" from
"struct sof_ipc_comp" and "enum ipc4_stream_type" from
"struct ipc4_pin_props" with "uint32_t".
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Move definitions of functions exposed by system_service to the modules
directory so that loadable modules can use them.
Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
Move logging priority definitions used by iadk modules to the modules
directory so other types of loadable modules can use them. Propose
a function to convert log priority used by loadable modules to log level
used by sof.
Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
In test topologies the MFCC data can be packed to 1, 2, or 4
channels stream. This change fixes the shown time scale for
audio features 3D plot.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch updates the setup_mfcc.m Octave script to produce
configuration blob for topology version 2 builds.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch adds build of topologies
- sof-hda-generic-cavs25-2ch-mfcc.tplg
- sof-hda-generic-cavs25-4ch-mfcc.tplg
- sof-hda-generic-ace1-2ch-mfcc.tplg
- sof-hda-generic-ace1-4ch-mfcc.tplg
The MFCC is connected to 16 kHz DMIC1 DAI. The MFCC bitstream
is passed to capture PCM. The DMIC1 pipeline style is copied
from DMIC0:
DAI copier -> IIR -> gain -> module_copier -> MFCC -> host copier
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The same dai-copier-eqiir-gain-module-copier-capture pipeline can
be used for both DMIC0 and DMIC1, with different IIR setting,
so the blob definition is moved to dmic-generic.conf where the
pipeline is instantiated.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
It has not been possible to build the component earlier for Zephyr
IPC4 systems. This patch makes the next fixes:
- Add SOF_MODULE_INIT() and include of rtos/init.h
- For unit test fix the init function to
sys_comp_module_mfcc_interface_init()
- To Zephyr/CMakeLists.txt add the needed math library sources
- Add .toml files for rimage for IPC4 systems
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
OVERLAY_CONFIG was deprecated in Zephyr 3.4 commit
https://github.com/zephyrproject-rtos/zephyr/commits/3a345682ba81
Also enhance example and demonstrate the syntax to pass multiple files.
This finishes the work started by commit 6cd34c89a1
("xtensa-build-zephyr.py: use EXTRA_CONF_FILE instead of OVERLAY_CONFIG")
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
To prepare for the introduction of another ARM imx platform,
make the code snippet invoking `wait_for_interrupt` xtensa-specific.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Modify the class definitions for the mixout-gain-efx-dai-copier-playback
and the mixout-gain-efx-mbdrc-dai-copier-playback pipelines to use the
SubreeCopy feature to extend the mixout-gain-eqiir-eqfir pipeline class
definition.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Add a new pipeline, mixout-gain-eqiir-eqfir, that uses the new alsa-utils
topology feature to allow extending existing pipeline definitions. This
new class extends the base class mixout-gain-dai-copier-playback class
by adding the eqiir & eqfir widgets along with the new routes.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Modify the route description to an array in preparation for allowing
class extensions to define new classes where existing routes will be
merged with the new routes in the sub classes.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Defines for normal src and src_lite were not separated correctly. Added new
variables so those values can be different depending on the type of src
being used. Those are assigned in prepare function in a new src.c file,
similarly to src_lite.c
Signed-off-by: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com>
Renaming src.c, as this filename will have a different purpose. File
src_common.c will contain common functions for all src types.
Signed-off-by: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com>
Fix issue where 32kHz to 16kHz conversion would give incorrect frequency
signal. src_polyphase_init function was using wrong coefficient matrix
while checking for equal frequencies resulting in no conversion.
Signed-off-by: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com>
The imx-related macro logic from `interrupt_get_irq` can be
simplified. Now that `CONFIG_IMX93_A55` selects `CONFIG_IMX`,
`interrupt_get_irq` should return the INTID for all imx platforms
except for imx8m, which is yet to be transitioned to zephyr
native drivers.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
i.MX93 is an IMX platform so its config (i.e: `CONFIG_IMX93_A55`)
should also select `CONFIG_IMX`.
Additionally, xtensa-based imx platforms have the heap
placed in the ".heap_mem" section, while arm-based imx
platforms have the heap placed inside the .bss section.
As such, fix the macro-based logic inside `zephyr/lib/alloc.c`
to account for this.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
On 64-bit platforms, size_t may be 64-bit. As such, change
the "%u" format to "%zu" as done in commit faf725aba0
("Use %zu format for printing size_t variables").
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
`CONFIG_COMPILER_WORKAROUND_CACHE_ATTR` is only applicable to
xtensa-based platforms. As such, add dependency on `CONFIG_XTENSA`.
Additionally, `CONFIG_IMX` should be selected by all imx platforms.
Since not all imx platforms are xtensa-based, make sure
`COMPILER_WORKAROUND_CACHE_ATTR` is selected only for those platforms.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>