Commit Graph

12610 Commits

Author SHA1 Message Date
Shuming Fan d2cf7c3cc8 topology2: add rt713 and rt1318 support on LNL machine
SDW link0: rt713
SDW link1: rt1318
And 2ch PCH-attached DMICs.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
2024-10-10 14:38:38 +03:00
Kai Vehmanen a6fa27617b ipc: remove unnecessary inclusion of dma-trace.h
dma-trace.h is only needed to implement the IPC3 sof-logger
DMA trace and the definitions are not needed for IPC4 or
dma-copy.c implementation.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-10-10 14:37:30 +03:00
Kai Vehmanen 18c574c7f3 rtos: add Zephyr implementation of sof/lib/memory.h
Implement sof/lib/memory.h for Zephyr build and do not rely on
the xtos version for Zephyr builds.

Link: https://github.com/thesofproject/sof/issues/9015
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-10-10 14:24:30 +03:00
Iuliana Prodan f508492d47 drivers: imx: sdma: Initialize channel status
When probing SDMA driver initialize channel status to INIT,
otherwise we have an invalid state when trying to use the channel.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2024-10-09 16:48:56 +03:00
Kai Vehmanen ec8cf20575 audio: remove unnecessary inclusion of lib/memory.h
Remove unnecessary incluce statements for lib/memory.h in large number
of files in audio. Some are pure bad copy and paste, while in some
cases the module has in the past used SHARED_DATA macro, but this has
been since been removed. The SHARED_DATA use might be removed later,
so add a comment to files where lib/memory.h is only included for
this one macro.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-10-09 16:05:53 +03:00
Seppo Ingalsuo 95373db418 Arch: host: Cleanup mixer vs. mixin/mixout component build
The build of mixin/mixout didn't work for static library IPC4
testbench build because Kconfig for mixer has
"depends on IPC_MAJOR_3". Therefore the if(CONFIG_COMP_MIXER)
with IPC version dependent sources was never true. It's replaced
with normal component build handling for CONFIG_COMP_MIXER and
CONFIG_COMP_MIXIN_MIXOUT.

The confusing looking "set(mixer_src ..." from begin of
CMakeLists.txt is moved to end where shared libraries of audio
modules are built.

The default configuration of SOF plugin is changed to
CONFIG_COMP_MIXIN_MIXOUT=y to make sure the correct mixer
is built for it.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-10-09 11:46:40 +03:00
Adrian Warecki eaddf533f9 regions_mm: Determine size of the mapped memory region before unmapping
The memory block allocated by the allocator may be larger than a requested
one. If the allocated block size exceeds the memory page size, only enough
pages are mapped to satisfy the request. Thanks to this optimization, it
don't map memory pages that will not be used. When freeing memory,
the allocator knows only size of the allocated block. Information about the
number of pages actually mapped isn't stored anywhere.

Before unmapping memory, determine the number of mapped pages to avoid
error when trying to unmap unmapped memory.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2024-10-08 18:19:48 +03:00
Adrian Warecki 4570e53f00 regions_mm: Invalidate cache when freeing memory
Platforms based on xtensa have a non-coherent cache between cores. Before
releasing a memory block, it is necessary to invalidate the cache. This
memory block can be allocated by another core and performing cache
writeback by the previous owner will destroy current content of the main
memory.

Invalidate cache when freeing allocated memory block.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2024-10-08 18:19:48 +03:00
Jyri Sarha af55b454a1 tools: debug_stream.py: Use cavstool.debug_slot_offset_by_type()
The new cavstool.debug_slot_offset_by_type() opens an opportunity to
improve debug_stream.py usability a bit. If the debugfs file is not
found, then try to find the correct debug slot the correct slot using
cavstool direct access and debug_slot_offset_by_type().

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
2024-10-07 22:22:55 +03:00
Jyri Sarha fe7c3dfd31 debug: debug_stream_slot: A simple typo fix to a logging message
A simple typo fix to a logging message.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
2024-10-07 22:22:55 +03:00
Jyri Sarha d52941b1ed app: add new debug_stream_overlay.conf
Add overlay to build debug_stream protocol over a debug window slot,
make room for the slot, and send thread info data through it.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
2024-10-07 22:22:55 +03:00
Jyri Sarha 0ac1f771fb tools: debug_stream.py: Access debug slot directly using cavstool.py
Access debug slot directly using cavstool.py, by specifying the debug
slot number where the debug_stream data is transferred.

Adds one command line parameter for selecting the debug slot directly
and adds an alternative mainloop for polling the slot through
cavstool.py direct access.

The commit also adds quite a few data consistency checks and error
handling improvements as with the direct memory access its much more
likely to get inconsistent data when the DSP is booting up, and code
needs to be robust enough not to crash in such a situation. Also the
logging messages about those checks failing has been lowered so that
they are not too noisy.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
2024-10-07 22:22:55 +03:00
Seppo Ingalsuo 3b9ec6064c Tools: Topology2: Fix test topologies for Aria component
The only accepted format for aria is S24_4LE while it was assumed
to be S32_LE. This change enables Aria topologies to be loaded again
after commit 1cc7a4c5b1 ("aria: change to S24_LE format processing").

There was also a mistake with capture pipeline index  that caused
failure with capture. Same pipeline 3 index was used in both playback
and capture direction.

The impacted topologies are sof-hda-benchmark-aria24.tplg and
sof-hda-benchmark-generic.tplg.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-10-07 19:45:23 +03:00
Seppo Ingalsuo 046ef11cdc Tools: Topology2: Add to benchmark topologies equalizers more options
There is currently no default.conf, so the default is set to
passthrough.conf.

This patch also changes IIR topology build default response to
"loudness" for better higher workload and easier to measure
when checking that it's correct. This prepares for process_test.m
components verification with ipc4 testbench.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-10-07 19:45:23 +03:00
Ievgen Ganakov 9cdef9fc13 copier: dmic: enable gain for dmic dai
Enable gain for DMIC interface. Configure gain feature with
parameters received in DMIC BLOB.

Add support for runtime DMIC gain parameters update using
DMA Control IPC.

Signed-off-by: Ievgen Ganakov <ievgen.ganakov@intel.com>
2024-10-04 14:28:56 +02:00
Ievgen Ganakov 8dda5acaf7 ipc4: dmic: add dmic blob
Define common IPC4 Dmic blob structures

Signed-off-by: Ievgen Ganakov <ievgen.ganakov@intel.com>
2024-10-04 14:28:56 +02:00
Laurentiu Mihalcea b107e40976 build: add support for building SOF on imx95
This means modifying 'xtensa-build-zephyr.py' to allow
building the new platform and adding a new toml file for
the platform.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-10-04 11:14:58 +03:00
Laurentiu Mihalcea beb1e68e79 app: boards: add DTS and config overlay for imx95
Add DTS and configuration overlay for the imx95 platform.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-10-04 11:14:58 +03:00
Laurentiu Mihalcea 191cf6f908 tools: topolgy1: add topology for imx95
Add topology for the imx95 platform.
The pipeline is:

   HOST ----> VOLUME (optional, may be passthrough)  ----> DAI

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-10-04 11:14:58 +03:00
Laurentiu Mihalcea 46cd6b4d5c west.yml: pull in CMSIS module
This module is required by the Cortex-M architecture so
update west.yml to pull in this module as well.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-10-04 11:14:58 +03:00
Laurentiu Mihalcea 46ffc159f9 lib: dma: add entries for imx95's EDMA2 and HOST_DMA
Add entries for imx95's EDMA2 and HOST_DMA.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-10-04 11:14:58 +03:00
Laurentiu Mihalcea a65f19e5a6 zephyr: CMakeLists.txt: include required sources for imx95
Include required sources for the imx95 platform.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-10-04 11:14:58 +03:00
Laurentiu Mihalcea 4d374ece70 include: drivers: mu.h: select MU version 2 for imx95
The imx95 platform uses MU version 2. As such, select
the appropriate version.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-10-04 11:14:58 +03:00
Laurentiu Mihalcea 53e1f0e269 platform: Kconfig: add configuration for imx95
Add configuration option for the new imx95 platform.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-10-04 11:14:58 +03:00
Laurentiu Mihalcea cb8e500bf1 platform: add imx95 platform
Add platform files for NXP's imx95.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-10-04 11:14:58 +03:00
Seppo Ingalsuo 38ec7baba8 Tools: Tplg_parser: Fix handling of tokens found count
This change fixes for testbench support for topologies where
widgets have more than one format. Without this change if not
all e.g. count = 8 tokens are found but e.g. count = 7 the
tokens are applied to the format array but the index (offset)
to next format (of num_sets) is not advanced. So the first
entry will be written again for all found formats. The found
tokens count can be less than 8 if the optional
SOF_TKN_CAVS_AUDIO_FORMAT_INPUT_PIN_INDEX or
SOF_TKN_CAVS_AUDIO_FORMAT_OUTPUT_PIN_INDEX are not set.

As fix the offset should be advanced when one or more of tokens
is found from topology. The total is incremented by count for
the loop end condition check.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-10-03 15:48:18 +01:00
Mac Chiang 17eed9db68 topology2: update flags for alignment
Enable bluetooth offload for power saving since the SKU
has the cnvi module enabled.

Add deepbuffer pipeline support on I2S Speaker playback.
Note: The headset deepbuffer has enabled in I2S/HD-A/SDW conf.

Signed-off-by: Mac Chiang <mac.chiang@intel.com>
2024-10-03 15:46:53 +01:00
Mac Chiang 4a42e3a318 topology2: remove BT_NAME string assignment as it's default value.
The default string for BT_NAME has set to "SSP2-BT" in bt-default.conf.

Signed-off-by: Mac Chiang <mac.chiang@intel.com>
2024-10-03 15:46:53 +01:00
Seppo Ingalsuo 77dec14d91 Audio: Copier: Remove not necessary header for testbench build
The include of dai-zephyr.h causes IPC4 testbench build to
fail due to further include of Zephyr headers. Since the
copier_generic.c build is not needing it, it can be removed.

The HiFi build version copier_hifi.c is already without
this include.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-10-03 17:44:57 +03:00
Seppo Ingalsuo 10c1cd72d1 Lib: Add to dai-legacy.h struct copier_gain_params for testbench
The new copier gain feature needs this structure. The added
member is copied directly from dai-zephyr.h. Testbench IPC4
is using legacy DAI definitions instead of Zephyr DAI to avoid
to include a lot of difficult dependencies. Build of testbench
fails if dai-legacy.h does not contain this.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-10-03 17:44:57 +03:00
Laurentiu Mihalcea 8c053e6415 west.yml: update Zephyr to 155f3f3ba688
Includes the following changes potentially relevant to SOF:

155f3f3ba688 west_commands: sign: add imx95 to target list
01754956de29 boards: nxp: imx95_evk: add rimage support for m7 ddr variant
848907c0f81d soc: imx: imx95: enable cache management for M7
f3e870dfa5d4 boards: nxp: imx95_evk: add edma and sai nodes

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-10-03 12:13:26 +01:00
Marcin Szkudlinski f9b1a1deea buf: use buffer sink API in components
This commit makes all components use API for accessing
the previous/next component

pipeline code, like module adapter or ipc helpers was
omitted intentionally

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2024-10-02 15:02:12 +01:00
Marcin Szkudlinski 40eac5da3d buf: use buffer source API in components
This commit makes all components use API for accessing
the previous/next component

pipeline code, like module adapter or ipc helpers was
omitted intentionally

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2024-10-02 15:02:12 +01:00
Marcin Szkudlinski 684cbb978d buf: a helper for checking state of component added
A typical action for a component is to check if a
prev/next component exists and is ready to provide/consume data:

if (buf->sink && buf->sink.state == STATE_....)

In pipeline 2.0 it should be done by a state
of sink/src API, but for now a helper for the operation
is provided by this commit.

In case the component does not exists, a special state
COMP_STATE_NOT_EXIST is introduced

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2024-10-02 15:02:12 +01:00
Marcin Szkudlinski 3c672d2681 buf: provide API to access sink/source components
An API for accessing components providing and
consuming data from the buffer added

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2024-10-02 15:02:12 +01:00
Marcin Szkudlinski 7142931d19 comp: remove unused parameter from comp_get_state
param req_dev Requesting component was unused

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2024-10-02 15:02:12 +01:00
Curtis Malainey 52e944036d fuzz: add support for 64 bit builds
This is needed for MSAN

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2024-10-02 14:41:32 +01:00
Curtis Malainey a9481c67c3 fuzz: fix size type
Fix silent overflow in the fuzzer. 255 is clearly << 65536 so that means
we are not able to exercise the full buffer. But upon further inspection
its clear that numbers are a minimum truncated if not rolling over based
on the code in the size_t to uint8_t conversions.

This was validated by converting the type temporarily to signed and
observing the fuzzer using a negative index.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2024-10-02 14:40:25 +01:00
Curtis Malainey 0ba94ef8f5 oss-fuzz: delete outdated files
All fuzzing infra has moved to the posix platform. The corpus is not
being deployed, and is soon to be modified anyways. Its also missing
IPC4 in the corpus.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2024-10-02 14:40:25 +01:00
Ranjani Sridharan addc349d6a ipc4: helper: Remove hardcoded UUID map for CONFIG_LIBRARY
Always append the UUID to the end of the module init IPC data and use
that to look up the component driver instead of using the hardcoded UUID
map. This will make it easier to support new processing elements with
the plugin/testbench. Also, modify the get/set_large_config handlers to
use the component driver set in the dev instead of looking it up again.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2024-10-02 15:03:56 +03:00
Peter Ujfalusi 6949112cce tools: mtrace-reader.py: Add option to mark chunk starts in output
Sometimes it can help to see how the chunks arrive from firmware when
comparing logs with the kernel for example.

The --mark-chunks flag will add a marker for each new chunk that is printed
with a running number and the size of the given chunk, for example:

--- Chunk #604 start (size: 652) ---
[    0.000000] <inf> init: print_version_banner: FW ABI 0x301d001 DBG ABI 0x5003000 tags SOF:v2.5-stable-branch-2772-g76e650e56598-dirty zephyr:v3.7.0-2127-ge7c84756087f src hash 0x4ff3fd64 (ref hash 0x4ff3fd64)
*** Booting Zephyr OS build v3.7.0-2127-ge7c84756087f ***
[    0.000000] <inf> main: sof_app_main: SOF on intel_adsp
[    0.000000] <inf> main: sof_app_main: SOF initialized
[    0.000000] <inf> ipc: ipc_cmd: rx   : 0x44000000|0x31400008
[11896.403666] <inf> ipc: ipc_cmd: tx-reply     : 0x64000000|0x31400008
[11896.404076] <inf> ipc: ipc_cmd: rx   : 0x44000000|0x3060004c
[11896.404093] <inf> ipc: ipc_cmd: tx-reply     : 0x64000000|0x3060004c
--- Chunk #605 start (size: 196) ---

[11896.969658] <inf> ipc: ipc_cmd: rx   : 0x11000005|0x0
[11896.969671] <inf> pipe: pipeline_new: pipeline new pipe_id 0 priority 0
[11896.969685] <inf> ipc: ipc_cmd: tx-reply     : 0xb1000000|0x0

--- Chunk #606 start (size: 2236) ---

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2024-10-01 20:39:11 +03:00
Tomasz Leman a1a5b1d4a0 ipc4: base_fw: Enable scheduler info retrieval for secondary cores
This commit addresses the limitation in the schedulers_info_get function
where scheduler information could only be retrieved for the primary
core. The updated implementation now validates the core_id against the
number of configured cores (CONFIG_CORE_COUNT) and initiates an IPC
process on the requested core if it is not the current core.

Changes include:
- Adding a check to ensure the core_id is within the valid range.
- Calling ipc4_process_on_core to handle IPC processing on secondary
  cores.
- Returning appropriate IPC4 error codes based on the result of
  ipc4_process_on_core.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2024-10-01 20:33:16 +03:00
Guennadi Liakhovetski a2cbd744db Revert "ipc3: override type field once comp_driver found"
This reverts commit b53573a15c. This
commit broke cmocka unit tests.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-10-01 10:21:16 -07:00
Ievgen Ganakov b6f6f6aee4 copier: dai: apply gain feature
Add gain configuration and apply gain processing in copier dai.

Signed-off-by: Ievgen Ganakov <ievgen.ganakov@intel.com>
2024-10-01 14:08:09 +01:00
Ievgen Ganakov 0c9094bcc5 copier: gain: add dma control ipc handling
Add methods to update gain coefficients in runtime by handling
DMA CONTROL IPC message being sent to specific dai device based
on provided node id.
Check for unity gain flag.

Signed-off-by: Ievgen Ganakov <ievgen.ganakov@intel.com>
2024-10-01 14:08:09 +01:00
Ievgen Ganakov 6993617c25 copier: gain: add processing functions
Add HIFI and generic versions of gain processing for
32-bit and 16-bit container size.

Signed-off-by: Ievgen Ganakov <ievgen.ganakov@intel.com>
2024-10-01 14:08:09 +01:00
Ievgen Ganakov d64be92617 copier: gain: add basic configuration
Prepare infrastructure for copier gain feature. Add basic configuration
scenario.

Signed-off-by: Ievgen Ganakov <ievgen.ganakov@intel.com>
2024-10-01 14:08:09 +01:00
Tomasz Leman c3b845adb8 ipc4: base_fw: Consistently use IPC4 status codes
This patch addresses the issue of inconsistent error code usage in the
base_fw.c file, where a mix of POSIX and IPC4 error codes was previously
present.

The IPC4 error codes are now used consistently throughout the file,
ensuring that the error handling is aligned with the IPC4 protocol
expectations. The changes include replacing POSIX error codes such as 0,
-EINVAL, and -ENOMEM with their corresponding IPC4 status codes
IPC4_SUCCESS, IPC4_ERROR_INVALID_PARAM, and IPC4_OUT_OF_MEMORY,
respectively. This standardization helps to avoid confusion and
potential bugs that can arise from the mixed usage of different error
code conventions.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2024-10-01 14:05:05 +01:00
Seppo Ingalsuo 421a6dff03 Audio: Mux: Handle correctly mux/demux mode
Since with module adapter the component type from init IPC
is no more SOF_COMP_MUX or SOF_COMP_DEMUX but
SOF_COMP_MODULE_ADAPTER, the mux mode check needs to be change.
The type is set in init() based on which init function was
used.

All checks for dev->ipc_config.type are changed to check of
cd->comp_type. The set of type in mux_ipc4.c is removed.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-10-01 13:56:16 +01:00
Seppo Ingalsuo 64bd786088 Test: Cmocka: Set component type to SOF_COMP_MODULE_ADAPTER
The change done in commit b53573a15c
("ipc3: override type field once comp_driver found") expects
the component type via init IPC to be the same as module
register sets (SOF_COMP_MODULE_ADAPTER).

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-10-01 13:56:16 +01:00