Commit Graph

11696 Commits

Author SHA1 Message Date
Guennadi Liakhovetski bd5c24b282 lib-manager: fork a copy for LLEXT support
This forks a slightly earlier version of library loading code for
upcoming LLEXT support.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-01-26 17:56:14 +02:00
Guennadi Liakhovetski ab29f8db82 llext: add a new module type
We need to be able to distinguish LLEXT loadable dynamically linkable
modules at run-time. Add a new type for them. Compatibility is
preserved.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-01-26 17:56:14 +02:00
Guennadi Liakhovetski 88793e3288 chain DMA: remove redundant code
No need to re-calculate cdma_comp in ipc4_process_chain_dma(), keep
using the already calculated value.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-01-26 15:43:24 +00:00
Jaroslaw Stelter 17b3b01de9 lnl: conf: Enable Library authentication on LNL
This enables library authentication on LNL platforms.

Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
2024-01-26 14:08:58 +00:00
Jaroslaw Stelter 6bc4e9d444 mtl: conf: Enable library authentication on MTL
This enables library authentication on MTL platforms.

Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
2024-01-26 14:08:58 +00:00
Jaroslaw Stelter f9fda66821 library_manager: auth: Add library authentication mechanizm
This patch adds usage of authentication API to check
library signature. If feature enabled it will block loading of
library without valid signature.

Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
2024-01-26 14:08:58 +00:00
Jaroslaw Stelter 1819200cb8 platform: ace: Add authentication interface
For ACE platforms library authentication could be done using external
entity - rom_ext. This module reside in L3 memory space and provides
verification functionality. Following code expose that API to SOF.

Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
2024-01-26 14:08:58 +00:00
Seppo Ingalsuo 8209572a46 Audio: IGO_NR: Fix build fail variable size data structure
This change avoids error, seen with testbench build for
MTL platform with "scripts/rebuild-testbench.sh -p mtl":

sof/src/include/sof/audio/igo_nr/igo_nr_comp.h:29:27:
error: field 'config' with variable sized type
'struct sof_igo_nr_config' not at the end of a struct or class
is a GNU extension [-Werror,-Wgnu-variable-sized-type-not-at-end]

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-01-26 13:38:14 +00:00
Bard Liao 897cee1e18 fixup! topology2: Use SAMPLE_TYPE_MSB_INTEGER for ALH copier
Some ALH DAI copier missed SAMPLE_TYPE_MSB_INTEGER setting.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2024-01-26 13:37:28 +00:00
Kai Vehmanen 8238d63f35 west.yml: update zephyr to 9852e8e15bc8
Total of 287 commits with no known impact to SOF to builds.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-01-26 10:56:33 +02:00
Maciej Strozek eea7b51fd6 topology2: cavs-cs42l43: Add topology for cs42l43/cs35l56 on MTL
The layout is configured as:
    - Link0: CS42L43 Jack and mics
    - Link2: 2x CS35L56 Speaker (amps 3 and 4, right)
    - Link3: 2x CS35L56 Speaker (amps 1 and 2, left)

Signed-off-by: Maciej Strozek <mstrozek@opensource.cirrus.com>
2024-01-26 01:10:26 +02:00
Rander Wang 08cf3d2232 Revert "ipc4: relax the IPC timeout checks and be nicer to other threads"
When a stream is triggered to start, host kernel first sendis trigger
start ipc message to fw and then start host dma for this stream.
Ipc_wait_for_compound_msg is used to wait for all pipelines in the
stream to be complete and need to be done fast since it blocks host
to start hda dma. The reverted commit adds a 10 ms delay and results
to host copier xrun warning for it can't get data from host dma.

   And this commit also makes a negative effect for stream_start_offset
calculation which is for the difference between dai gateway and
host gateway. We calculate it in host start function but host dma is
started 10ms later, so there will be at least 10ms data error.

This reverts commit 909a3277f1.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2024-01-25 19:51:27 +02:00
Pierre-Louis Bossart 6a2eba11dd topology2: enable HDMI for all MTL topologies
Remove the temporary workaround and add HDMI on all MeteorLake
products. If this breaks stuff, well we need to fix hit ASAP.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2024-01-25 18:09:29 +02:00
Kai Vehmanen c3da4e3d62 module_adapter: fix double-free of base_cfg_ext data
Fix handling of input_pins free. Module reset can be called multiple times,
so move the resource release to module_adapter_free().

Fixes: 7046004384 ("module_adapter_ipc4: Save and pre-parse base_cfg_ext data")
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-01-25 18:02:54 +02:00
Marc Herbert ff9343aa4a logger: convert: Fix compile time error with newer toolchain
Using Compiler version: aarch64-poky-linux-gcc (GCC) 13.2.0
we get the following error:

tools/logger/convert.c: In function 'convert':
tools/logger/convert.c:357:34: error: '%*s' directive output between 4294967264 and 4294967284 bytes exceeds 'INT_MAX' [-Werror=format-overflow=]
|   357 |                 fprintf(out_fd, "%*s(us)%*s  ", -ts_width, " TIMESTAMP", ts_width, "DELTA");
|       |                                  ^~~                       ~~~~~~~~~~~~
| In file included from /opt/builds/OBNand/build/tmp/work/armv8a-poky-linux/sof-tools/2.8.0/recipe-sysroot/usr/include/stdio.h:964,
|                  from /opt/builds/OBNand/build/tmp/work/armv8a-poky-linux/sof-tools/2.8.0/git/tools/logger/convert.h:13,
|                  from /opt/builds/OBNand/build/tmp/work/armv8a-poky-linux/sof-tools/2.8.0/git/tools/logger/convert.c:21:
| In function 'fprintf',

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-01-25 10:35:10 +02:00
Peter Ujfalusi c27eda7edb topology2: production: cav2.5: Add sof-adl-rt711-l0-rt1316-l13-rt714-l2
The sof-adl-rt711-l0-rt1316-l13-rt714-l2 similar to
sof-adl-rt711-l0-rt1308-l12-rt715-l3 with the SDW DMIC on different link.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2024-01-24 16:46:01 +00:00
Peter Ujfalusi 10e87fd8f1 topology2: production: cav2.5: Add sof-adl-rt711-l0-rt1308-l12-rt715-l3
The sof-adl-rt711-l0-rt1308-l12-rt715-l3 is identical configuration as
sof-tgl-rt711-rt1308-rt715

At the same time update the comments for better organization.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2024-01-24 16:46:01 +00:00
Peter Ujfalusi d0232e7286 topology2: production: cav2.5: Remove NHLT blob from SDW DMIC topologies
NHLT blob is not needed in for DMIC on SDW bus.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2024-01-24 16:46:01 +00:00
Peter Ujfalusi b05eded22d topology2: Tidy up the production target name as topology2_prod
The target name for the production should have been more precise as it
ended up:
ninja -C tools/build_tools/ help
topology2_dev: phony
...
topology2_dev_sof-tgl-nocodec: phony
topology2_dev_sof-tgl-nocodec-crossover-2way: phony
...
topology2_prod: phony
...
topology2_sof-hda-generic: phony
topology2_sof-hda-generic-2ch: phony
...

Change it to be consistent:
topology2_dev: phony
...
topology2_dev_sof-tgl-nocodec: phony
topology2_dev_sof-tgl-nocodec-crossover-2way: phony
...
topology2_prod: phony
...
topology2_prod_sof-hda-generic: phony
topology2_prod_sof-hda-generic-2ch: phony
...

No functional change.

Suggested-by: Marc Herbert <marc.herbert@intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2024-01-24 15:13:11 +00:00
Adrian Warecki fec50da244 lib_manager: Add libcode modules support
A loadable library can contain a several modules marked as lib_code. This
modules contains code shared by a multiple modules.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2024-01-24 14:05:24 +00:00
Adrian Warecki 6cf723fc7d lib_manager: Update module load flow
The previous code have several issues:
* Did not support empty data segment.

* It assumed that certain types of segments would be at fixed indexes,
  without taking into account their flags/types.

* Incorrect handling of mapping error. If the virtual address cannot be
  mapped because is already in use, the error handler will unmap this
  address.

* If there is an error loading one of the modules marked as lib_code,
  previously loaded modules are not unloaded.

This commit fixes the above issues.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2024-01-24 14:05:24 +00:00
Dobrowolski, PawelX a0827526b7 loading module: fix native module interface register
In SOF we have a two type loadable modules, IADK and native whose are
sharing the same registering mechanism but for C++/C needs IADK is using
adapter which translates methods for SOF needs.
Native loadable module is not using any additional adapters and returns
pointer for API used in built-in modules and loadable.

Signed-off-by: Dobrowolski, PawelX <pawelx.dobrowolski@intel.com>
2024-01-24 13:57:22 +01:00
Andrula Song 10f0e387c9 Audio: ARIA: Add HiFi5 implementation
Add HiFi5 implementation of aria algorithm functions, compared with
HiFi3 version, can reduce about 10% cycles.

Signed-off-by: Andrula Song <andrula.song@intel.com>
2024-01-24 12:21:49 +00:00
Pierre-Louis Bossart 6c4dad63d1 chain_dma: fix tentative memory leak
A code analysis shows a tentative missing ipc_msg_fre() leading to a
memory leak.

This problem was found with a code analysis - the actual code with
XRUN_NOTIFICATIONS_ENABLE was NOT tested.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2024-01-24 12:21:00 +00:00
Pierre-Louis Bossart c00299767a chain_dma: fix obvious typo in CONFIG_XRUN_NOTIFICATIONS_ENABLE
CONFIG_IPC4_XRUN_NOTIFICATIONS_ENABLE does not exist, replace by valid
Kconfig.

This is just a search and replace patch, it's quite likely this
Kconfig option is bit-rot quality level since it was NEVER compiled
in.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2024-01-24 12:21:00 +00:00
Pierre-Louis Bossart 5e66632b11 ipc4: helper: fix memory leak with CHAIN_DMA
The CHAIN_DMA code relies on the component code unfortunately without
a symmetry between memory allocation and release.

ipc4_chain_manager_create() relies on the ipc4_add_comp_dev() helper,
which internally allocate 20 bytes for an icd item included in a list.

ipc4_chain_dma_state() directly releases the component, without
removing the icd item from the list.

This slow memory leak, combined with alignment requirements, gradually
prevents a DMA buffer from being allocated.

This patch adds a search in the list and frees the item. With this
modification the CHAIN_DMA stress tests can loop forever.

Closes: https://github.com/thesofproject/sof/issues/8751
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2024-01-24 12:21:00 +00:00
Baofeng Tian ac76b3e136 Trace: move META specific header to posix folder
Move META preproc header file to posix folder.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2024-01-23 19:43:02 +02:00
Baofeng Tian 13aac8cf66 sof: remove META usage in sof source code
Except for trace file, there is no usage for META in sof
source code, posix and xtos are all aligned with zephyr definiton.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2024-01-23 19:43:02 +02:00
Baofeng Tian 5d969bb3c9 zephyr: fix a typo in string header file
fix it from 20222 to 2022

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2024-01-23 19:43:02 +02:00
Baofeng Tian e4445d781f test: cmocka: further remove unused META related definitions
Those definitions are not referred in cmocka anymore, remove it.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2024-01-23 19:43:02 +02:00
Marc Herbert d324af52bd xtensa-build-zephyr.py: add new --no-deployable-build
Everyone should use deployable builds by default.  Don't switch the
default behavior yet but add a --no-deployable-build option in case
anyone is stuck.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-01-23 14:16:28 +02:00
Peter Ujfalusi 65e4c1f8b5 topology2: Merge avs-tplg and sof-ace-tplg under production directory
Merge the avs-tplg and sof-ace-tplg under a common production directory.

After a successful build CMake will copy the topology files to a target
directory from where they can be copied to DUT/release:

$ tree tools/build_tools/topology/topology2/target
tools/build_tools/topology/topology2/target
├── development
│   ├── cavs-sdw-hdmi.tplg
│   ├── cavs-sdw-src-gain-mixin.tplg
        ...
│   ├── sof-tgl-nocodec-rtcaec.tplg
│   └── sof-tgl-nocodec.tplg
├── sof-ace-tplg -> sof-ipc4-tplg
└── sof-ipc4-tplg
    ├── sof-adl-rt711-4ch.tplg
    ├── sof-adl-rt711-l0-rt1316-l12-rt714-l3.tplg
        ...
    ├── sof-tgl-rt712.tplg
    └── sof-tgl-rt715-rt711-rt1308-mono.tplg

The sof-hda-generic-2/4ch.tplg will be generated without embedded NHLT as
it is not used under normal circumstance.
Two flavor of the generic topology is generated for CAVS2.5 and ACE1/2 with
included NHLT binary in case it is used by existing users, but it is
unlikely.

As noted in the documentation, on the deployed system a symlink is needed
for ACE1/2 platforms for backwards compatibility:
sof-ace-tplg -> sof-ipc4-tplg

Link: https://github.com/thesofproject/sof-docs/blob/master/getting_started/intel_debug/introduction.rst#2-topology-file
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2024-01-22 10:38:49 +08:00
Damian Nikodem 16b53b423c audio: host: reload DMA buffer on non-zero partial_size
This patch ensures that the DMA buffer is reloaded when
partial_size is non-zero, even if copy_bytes is zero.
This condition typically occurs at the end of a stream,
where the last data chunk does not meet the condition
for reload DMA buffer, leaving a non-zero partial_size.

Signed-off-by: Damian Nikodem <damian.nikodem@intel.com>
2024-01-18 16:44:42 +00:00
Seppo Ingalsuo 7b5475b0af Tools: Rimage: Config: Add IGO NR component for TGL, MTL, LNL platforms
This patch enables to load the component in the changed platforms.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-01-18 16:39:29 +00:00
Seppo Ingalsuo 47425524dc Audio: IGO_NR: Convert to source sink API
The source sink API is needed for DP (data processing) scheduler
that is needed for 16 ms schedule rate.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-01-18 16:39:29 +00:00
Seppo Ingalsuo d47385b384 Tools: Testbench: Build IGO_NR with stub for testbench
This allows to build and load IGO NR stub version to testbench.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-01-18 16:39:29 +00:00
Seppo Ingalsuo 0bf04e018b Audio: IGO_NR: Set in stub handle size to prevent init error
Function igo_nr_init() expects a nonzero value for rballoc()
size so this can't be left zero. The value is just something
for stub usage that felt suitable for an unknown.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-01-18 16:39:29 +00:00
Seppo Ingalsuo de35a6f05b Audio: IGO_NR: Convert to module adapter
This patch converts this component to module adapter API.
- New() becomes simpler init()
- Params() is handled in module adapter, in init()
  "mod->verify_params_flags = BUFF_PARAMS_RATE;" replaces
  igo_nr_verify_params().
- Rates check in params() is placed to separate function
  igo_nr_check_params() to be called from prepare().
- cmd() handler is changed to module adapter client style with
  igo_nr_set_config() and igo_nr_get_config().
- igo_nr_process() and igo_nr_copy() are merged to module API
  style igo_nr_process() function.
- igo_nr_prepare() sets source and sink align constraints for
  processing.
- igo_nr_trigger() is removed, handled by module adapter.
- Changes to support IPC4.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-01-18 16:39:29 +00:00
Seppo Ingalsuo 14237ed126 Tools: Rimage: Add RTNR component to TGL, MTL, and LNL platforms
This patch allows load of RTNR component with these platforms.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-01-17 13:19:40 +00:00
Seppo Ingalsuo 2f71ce04f2 Audio: RTNR stub: Add audio_stream_copy() to stub functions
This change avoids with stub library version annoying playback
sound from non-updated sink buffer when the processing ALSA
switch control is enabled. The audio is passed through from
source to sink.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-01-17 13:19:40 +00:00
Seppo Ingalsuo 491b29f7bb Audio: RTNR stub: Avoid error in rtnr_init() with null pointer
The init code checks for NULL and errors, so need to return
from RTKMA_API_Context_Create() a valid allocated address. The
free is added to RTKMA_API_Context_Free().

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-01-17 13:19:40 +00:00
Seppo Ingalsuo ac900459b3 Tools: Testbench: Add build of RTNR component to testbench
This patch enables RTNR (with stubs) to be built and loaded
to testbench.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-01-17 13:19:40 +00:00
Seppo Ingalsuo 8124dfb17b Audio: RTNR: Avoid build fail with library stub functions
The "sof," as local sources list is not correct. It causes
build fail with x86 testbench when CONFIG_COMP_RTNR_STUB
is set.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-01-17 13:19:40 +00:00
Seppo Ingalsuo 296af86f4c Audio: RTNR: Convert to module API
This patch updates the RTNR component to module adapter API
and IPC4.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-01-17 13:19:40 +00:00
Yong Zhi 40f6de58da sof_ri_info: fix imr size for cnl
Fix the typo for 8MB imr size.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2024-01-17 11:57:45 +02:00
Yonatan Schachter 0a3b816c03 common.h: Guard definition of IS_ALIGNED for Zephyr builds
common.h defines the IS_ALIGNED macro, which conflicts with
a Zephyr macro of the same name. Add guards to define it only
if it is not already defined by Zephyr.

Signed-off-by: Yonatan Schachter <yonatan.schachter@gmail.com>
2024-01-16 21:18:12 +02:00
Marc Herbert f4ce8b537b xtensa-build-zephyr.py: fail on --deployable-build + older options
From experience, no one scrolls up and looks at warnings that are not in
the current screen.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-01-15 15:33:25 +02:00
Marc Herbert e24ccd2c19 xtensa-build-zephyr.py: fix --help text for --fw-naming=AVS
Better late than never... zero functional change.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-01-15 15:33:25 +02:00
Daniel Baluta c4bfdc6a7d audio: dai-zephyr: Fix unused variable warning
Move sink_list under CONFIG_IPC_MAJOR_4 in order to avoid the following variable unused warning:

$ sof/src/audio/dai-zephyr.c: In function 'dai_dma_cb':
$ sof_dir/sof/src/audio/dai-zephyr.c:259:35: warning: unused variable 'sink_list' [-Wunused-variable]
  259 |                 struct list_item *sink_list;
      |                                   ^~~~~~~~~

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2024-01-15 14:28:09 +02:00
Marc Herbert c8eb21621a xtensa-build-zephyr.py: show symbolic links at the end
Not sure why I thought it would be complicated; I should have done this
much sooner.

Before:

```
build-sof-staging
|-- sof
|   +-- intel
|       +-- sof-ipc4
|           |-- adl
|           |   +-- community
|           |       +-- sof-adl.ri
|           |-- adl-n
|           |   +-- community
|           |       +-- sof-adl-n.ri
|           |-- arl
|           |   +-- community
|           |       +-- sof-arl.ri

```

After:

```
build-sof-staging
|-- sof
|   +-- intel
|       +-- sof-ipc4
|           |-- adl
|           |   +-- community
|           |       +-- sof-adl.ri  -> ../../tgl/community/sof-tgl.ri
|           |-- adl-n
|           |   +-- community
|           |       +-- sof-adl-n.ri  -> ../../tgl/community/sof-tgl.ri
|           |-- arl
|           |   +-- community
|           |       +-- sof-arl.ri  -> ../../mtl/community/sof-mtl.ri

```

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-01-15 13:27:56 +02:00