If module_adapter_new() fails in lib_manager_module_create(),
lib_manager_free_module() must be called to free allocated resources.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Export additional symbols, needed for modules like eq_iir and
mixin-mixout.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
west.configuration.get() already returns a string, no need to call
'str()' on it again.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Zephyr now provides a convenient cmake API for LLEXT modules, update
SOF to use it by defining common cmake functions.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Add 3 macros to simplify LLEXT module implementation and use them in
mixin-mixout and eq_iir. Only two of them can be used in
smart_amp_test_ipc4.c so far, because it's also used for LMDK-style
module building.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
When compiled with '-std=c99' or newer 'typeof' is unavailable and
'__typeof__' should be used instead [1].
[1] https://gcc.gnu.org/onlinedocs/gcc/Alternate-Keywords.html
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
This commit refactors the memory power management register access to use
the HPSRAM_REGS and LPSRAM_REGS macros instead of direct io_reg_read calls.
Signed-off-by: Damian Nikodem <damian.nikodem@intel.com>
Dp queues are no longer kept as a list of objects,
remove unused list maintenance code and data
Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
Instead of creating dp_queue in module adapter, use shadow
buffering provided by comp_bufer
It simplifies the code and makes it more race-resistant
Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
Connection between LL and DP component is implemented bu using
double buffering - between comp_buffer and DP component there's
additional "shadow" dp_queue
Currently shadow buffers are created in module adapter in "prepare"
handler and freed in "reset" handler. It may lead to races when there
are bind/unbind operation between a components in separate pipelienes,
especially when one of the pipelines is already running
The commit makes shadow dp_queue to be a part of comp_buffer. When
shadow is created, it replaces source or sink interface of audio_stream
allowing the module connected to it using all properties of dp_queue,
like lockless cross-core connection.
Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
as agreed some time ago, parts of structures
that should not be modified or accessed directly
("private") should be marked with _ prefix
https://github.com/thesofproject/sof/issues/8100
Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
The check of cd->ipc_config.base.audio_fmt.depth results to
select S32_LE format processing function for SRC when the format
is S24_LE. The check need to be done for valid_bit_depth instead.
The S32_LE function appears to work but any sample that exceeds
the range -2^23 .. +2^23-1 is overflow for S24_le. Also the use
of S24_LE processing core will improve the signal-to-noise ratio.
Reported-by: Tomasz Leman <tomasz.m.leman@intel.com>
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Suppress the existing 'deep buffering' feature in the case of Cadence
encoders. This prevents the encoder output stream from being expanded
with (inappropriate) all-zeros leading data.
Signed-off-by: Tomasz Lissowski <tomasz.lissowski@intel.com>
Convert LNL to a modular TOML layout. Many modules have different
configurations for different platforms. In this version we put them
all in respective TOML files directly. If desired, they can be later
extracted into per-platform files. This can be done on a per-module
basis, in which case individual commits will be small.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
This patch allows the kernel to choose 16 bit format if the DMIC
NHLT is missing the recommended 32 bit mode blob. The 24 bits is
also in theory possible so it is added for completeness.
The DAI copier is converting the output format for internal pipelines
into S32_LE format, so the other operation is not impacted. For systems
with 32 bit DMIC NHLT there is no impact.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Always use a "raw string" for regular expressions, otherwise the
backslash is used to start Unicode escape sequences.
Fixes hopefully harmless error:
```
scripts/llext_link_helper.py:38: SyntaxWarning: invalid escape sequence '\.'
p = re.compile('(^lib|\.so$)')
```
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Clarify documentation of SAMPLE_TYPE_MSB_INTEGER sample type
value and fix documentation of SAMPLE_TYPE_LSB_INTEGER. These
definitions are often confused with integer endianness, which is
not related. Clarify this better.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Upstream Zephyr moved the LLVM fuzzer entry point out of the arch
layer and made it an app responsibility, so we broke. Add back the
support here that got removed.
Fixes#9101
Signed-off-by: Andy Ross <andyross@google.com>
Two configurations for sof-mtl-rt713-l0-rt1318-l12-rt1713-l3 and
sof-mtl-rt713-l0-rt1318-l1-rt1713-l3.
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
In commit 14c4e86757 ("audio: base_fw: add platform layer to IPC4
hw_config data"), the platform specific code was moved to platform
layer.
This commit implements a lighter weight abstraction for the moved
code. Instead of using the platform layer, the Intel specific vendor
code is added directly in base_fw_intel.c and guarded by a Kconfig.
All other IPC4 build targets will use an empty implementation.
This avoids the need to add a platform definition for all IPC4 targets.
The common implementation in base_fw.c is sufficient to cover all
mandatory functionality required e.g. by the upstream SOF Linux driver's
IPC4 implementation.
The interfaces are renamed to refer to "vendor" instead of "platform",
to avoid any confusion with the platform layer with the new
implementation.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Install loadable LLEXT modules into the deployment tree and
create symbolic links for them.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
When building smart-amp-test as a module, we also need to
preprocess its TOML configuration file. Add it to cmake.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
To be able to build and sign multiple modules within one build we
need to unify name generation. For signing we invoke something like
west sign -i smart_amp_test
which means, that the west sign utility must be able to locate the
module binary directory and recognise files in it using only that
input file name. It will then create signed llext images inside those
binary directories too, so that deployment scripts can find and
recognise them there. We unify the naming as
${MODULE}_llext - for the binary directory,
${MODULE}.so - ELF file for signing in that directory
${MODULE}.llext - final signed extension
llext.uuid - a file with a list of UUIDs, provided by this extension
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
When installing modular components we need to create UUID-based soft
links. Create a separate file with a list of UUIDs to assist in that.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
When an ELF section isn't found .get_section_by_name() raises an
AttributeError exception, catch it specitically instead of catching
any exception.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
0x8000 is the manifest .text offset, use an existing macro instead of
open-coding it.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Pure comment fix, zero code change.
Fixes miss in commit f55338a985 ("Switch Zephyr build to new
sof/tools/rimage location")
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
The new lnl.conf is copy of mtl.conf but DMIC_DRIVER_VERSION needs
to be increased by one for a small registers change.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This allows more freedom to scale the equalizers. Common criteria
resulted with safe scaling to unnecessarily silent result or
risk for audible clipping in the equalizer.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Fixed redefinition warning spotted by chance while testing various CMake
combinations.
Fixes commit 07d401af9d ("drivers:amd:four channel dmic
configurations") which added the duplicate.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Commit a4c8d4ef79 ("Intel: remove XTOS support") stopped building
anything by default.
All Intel firmware in this branch is now Zephyr-based. So this Makefile
is NOT used anymore for sof-bin releases. However it is still useful as
a single command, fully parallelized and much faster alternative to
build everything at once in just a few seconds.
See source comment for more.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
No one needs a imx -> imx8 symbolic link.
Fixes misguided search/replace from commit a4c8d4ef79 ("Intel: remove
XTOS support")
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Commit a4c8d4ef79 ("Intel: remove XTOS support") stopped
installer/GNUmakefile from building all XTOS firmware by default:
nothing unless either SIGNED_list or UNSIGNED_list is passed on the
command line. This didn't break CI which sets one of these parameters.
But it resulted in a cryptic "test -e staging/sof" failure and lack of
error message when trying to build by default.
Add a one-line, explicit check. The comment doubles as an error message.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Fixes initial commit fb229b9cc1 (".github/tools.tml: add build of SOF
ALSA plugin")
Github free runners don't have that many cores but let's build in
parallel and use them all.
Perhaps even more useful: let's give people who copy the build steps
from this file a much faster build.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Add support to handle IPC4_MODULES_INFO_GET message.
This make it possible to get information about the current loaded modules.
Signed-off-by: Grzegorz Bernat <grzegorzx.bernat@intel.com>
Dropping logs is bad but it should not be fatal in itself.
This ERROR is one of the last remaining errors in stable-v2.2, see
https://github.com/thesofproject/sof-test/pull/1075#issuecomment-2049051006
Also switch to the "etrace": drop the dubious recursion and stop using
the DMA trace when it's already saturated.
Disclaimer: this was (successfully) tested only on stable-v2.2, see #9036
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
This patch moves blobs for crossover component into
sub-directory "crossover" to clean up clutter from
ctl/ipc3 and ipc4 level.
The patch also adds export of blobs for IPC4 mode that
was missing.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
To remove clutter from upper level this patch changes
generated files naming from e.g. "ipc4/eq_fir_loudness.blob" to
"ipc4/eq_fir/loudness.blob". It helps to find the blob files
from directory that has same name as the target component.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>