Commit Graph

12407 Commits

Author SHA1 Message Date
Guennadi Liakhovetski cfc84f4473 lib_manager: fix a memory leak
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>
2024-05-14 14:37:44 +01:00
Guennadi Liakhovetski a306792a68 llext: add missing symbol exports
Export additional symbols, needed for modules like eq_iir and
mixin-mixout.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-05-14 14:37:44 +01:00
Guennadi Liakhovetski f86ad4fa20 eq-iir: convert to a loadable module
Build eq-iir as a loadable llext module.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-05-14 14:37:44 +01:00
Guennadi Liakhovetski 753e363f0f mixin-mixout: make modular
Convert mixin-mixout to a loadable llext module.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-05-14 14:37:44 +01:00
Guennadi Liakhovetski 89d90ae0af build: remove a redundant call to 'str()'
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>
2024-05-14 14:37:44 +01:00
Guennadi Liakhovetski 05e69e1bb9 llext: update to use add_llext_target()
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>
2024-05-14 14:37:44 +01:00
Guennadi Liakhovetski 30386bae13 llext: add and use macros for easier LLEXT conversion
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>
2024-05-14 14:37:44 +01:00
Guennadi Liakhovetski c34cdaf376 compile: replace 'typeof' with '__typeof__' globally
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>
2024-05-14 14:37:44 +01:00
Damian Nikodem 529a4c6246 audio: base_fw_intel: refactor memory power management register access
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>
2024-05-13 15:29:38 +01:00
Marcin Szkudlinski 618bdbdb40 dp: remove unused code from dp_queue
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>
2024-05-13 12:05:03 +03:00
Marcin Szkudlinski 4240869c09 dp: use shadow dp_queue from comp_buffer
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>
2024-05-13 12:05:03 +03:00
Marcin Szkudlinski 6e769c417d dp: using of a dp_queue as a shadow of comp_buffer
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>
2024-05-13 12:05:03 +03:00
Marcin Szkudlinski e117e9a004 mod: mark sink/src api as private in audio_stream
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>
2024-05-13 12:05:03 +03:00
Seppo Ingalsuo 374d2d668d Audio: SRC: Use valid_bit_depth to select processing function
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>
2024-05-09 10:50:25 +01:00
Tomasz Lissowski 7f6d1c6c7e cadence: disable deep buffering of encoder output
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>
2024-05-09 10:49:09 +01:00
Tomasz Lissowski 4f3e4f98ac cadence: add support for mp3 encoder
This adds support for Cadence MP3 Encoder module.

Signed-off-by: Tomasz Lissowski <tomasz.lissowski@intel.com>
2024-05-09 10:49:09 +01:00
Guennadi Liakhovetski 0431d2d3b3 toml: (cosmetic) unify indentation
Reduce indentation to match other files.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-05-09 10:47:34 +01:00
Guennadi Liakhovetski 9c3a3e9f33 lnl: convert to modular toml
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>
2024-05-09 10:47:34 +01:00
Seppo Ingalsuo a81a235ae6 Tools: Topology2: Intel: Add 16 and 24 bit DMIC DAI copier format option
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>
2024-05-09 11:19:12 +03:00
Marc Herbert 8a78394a13 .github: llext: unhardcode mtl/module_overlay.conf
Ready to add LNL or other back

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-05-09 11:16:51 +03:00
Marc Herbert afc769f3c9 llext_link_helper.py: use a raw string for '\.so$' regex
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>
2024-05-09 11:16:51 +03:00
Marc Herbert 59bc4e26ba fuzz.sh: fix ZEPHYR_BASE comment
Explain why and when ZEPHYR_BASE is useful. Zero code change.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-05-09 11:16:51 +03:00
Kai Vehmanen d533d4290e topology2: common_definitions: improve SAMPLE_TYPE documentation
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>
2024-05-09 11:14:12 +03:00
Andy Ross e7f76eec4d platform/posix: Unbreak fuzzer support
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>
2024-05-09 11:13:15 +03:00
Bard Liao 4a761f6d60 Topology2: add mtl rt713 rt1318 rt1713 support
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>
2024-05-08 09:56:31 +01:00
Kai Vehmanen 81348f09d3 audio: fix indentation in audio/Kconfig
Use tabs for indentation consistently.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-05-08 09:41:28 +01:00
Kai Vehmanen b10ec85ebd audio: base_fw: do not use platform interface for vendor extensions
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>
2024-05-08 09:41:28 +01:00
Kai Vehmanen 0ea0d62feb west.yml: update Zephyr to d3c9a986ec30
Contains following commits affecting SOF build targets:

6205f82d4f60 intel_adsp: adsp_memory: update mtl memory definitions
6fe16960fd1f intel_adsp: adsp_memory: update lnl memory definitions
2176ca9f9bdc intel_adsp: adsp_memory: update cAVS 2.5 memory definitions

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-05-07 12:51:19 +03:00
Guennadi Liakhovetski a090f5151e llext: use xtensa-build-zephyr.py in GitHub CI
Switch the GitHub CI workflow to use xtensa-build-zephyr.py

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-05-07 10:51:34 +03:00
Guennadi Liakhovetski 6ead80fa55 deployable build: install LLEXT modules into the tree
Install loadable LLEXT modules into the deployment tree and
create symbolic links for them.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-05-07 10:51:34 +03:00
Guennadi Liakhovetski 6790c449ab smart_amp_test: use the correct loading type
Set "load_type" to 2 in TOML configuration, when building for LLEXT.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-05-07 10:51:34 +03:00
Guennadi Liakhovetski 0543783d3c smart-amp-test: add toml preprocessing when modular
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>
2024-05-07 10:51:34 +03:00
Guennadi Liakhovetski 9a2d1a6f05 module: support multi-module builds
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>
2024-05-07 10:51:34 +03:00
Guennadi Liakhovetski 40f4b25d9a smart-amp: add a UUID file creation
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>
2024-05-07 10:51:34 +03:00
Guennadi Liakhovetski 7cb5ef0ad2 llext: catch only the expected exception
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>
2024-05-07 10:51:34 +03:00
Guennadi Liakhovetski 7457e7da23 llext: (cosmetic) use a macro instead of a constant
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>
2024-05-07 10:51:34 +03:00
Marc Herbert a64e2817b6 xtensa-build-zephyr.py: remove obsolete and misleading comment
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>
2024-05-06 17:34:48 +01:00
Seppo Ingalsuo 07c9043516 Tools: Topology2: Use for LNL own platform configuration lnl.conf
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>
2024-05-06 12:33:41 +03:00
Seppo Ingalsuo 03dbc7ba2c Tools: Tune: EQ: Normalize IIR and FIR separately
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>
2024-05-03 21:02:34 +03:00
Marc Herbert a2338e5103 rembrandt_defconfig: remove duplicate CONFIG_COMP_DCBLOCK=n
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>
2024-05-03 15:01:53 +03:00
Marc Herbert 7cbaa00cd2 installer: same default platforms as xtensa-build-all.sh
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>
2024-05-03 15:01:53 +03:00
Marc Herbert 5ffa1cdc17 installer: drop harmless but misleading target_of_imx
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>
2024-05-03 15:01:53 +03:00
Marc Herbert ff92658ce2 installer: fix staging error message when no firmware was built
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>
2024-05-03 15:01:53 +03:00
Marc Herbert b9f331c8a6 .github/tools: add missing -GNinja when building ALSA plugin
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>
2024-05-03 15:01:53 +03:00
Grzegorz Bernat 25423f5b6b Audio: basefw: Implement ipc4 modules info get
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>
2024-05-02 15:14:54 +03:00
Grzegorz Bernat d7681434e9 ipc: Change ipc4 message max size
Maximym ipc4 message size changed to 4kB.
This is the size of a page.

Signed-off-by: Grzegorz Bernat <grzegorzx.bernat@intel.com>
2024-05-02 15:14:54 +03:00
Marc Herbert bb31696aa6 dma-trace.c: lower log level of dropped logs and stop recursion
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>
2024-04-30 15:23:25 +01:00
Yong Zhi 18ab8c2468 topology2: cavs-rt5682: expose spk core_id for overriding
Port from nocodec topology for multi-core validation.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2024-04-30 13:17:42 +03:00
Seppo Ingalsuo e8fcaf6958 Tools: Tune: Crossover: Cleanup blob files paths
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>
2024-04-29 14:07:25 +01:00
Seppo Ingalsuo 70449a3d70 Tools: Tune: EQ: Cleanup produced blob files structure
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>
2024-04-29 14:07:25 +01:00