Commit Graph

6992 Commits

Author SHA1 Message Date
Baofeng Tian d2fccbdf33 audio: copier: move copier generic header file to copier folder
This header file is referred by external modules, add relative
path for external module usage.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-11-03 18:56:13 +02:00
Baofeng Tian dbd89a62f7 Audio: copier: move copier related header to copier folder
These headers mostly only used by copier itself, move to
copier folder will make this folder cover all related code.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-11-03 18:56:13 +02:00
Jaska Uimonen d8fe013291 dai-zephyr: refactor dai params
Refactor dai params into more feasible functions and remove duplicate
code. No functional change.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
Signed-off-by: Rander Wang <rander.wang@intel.com>
2023-11-03 18:28:26 +02:00
Adrian Bonislawski 1c2a2e37ee platform: ace: watchdog: fix num cpus
This will fix num cpus and use runtime data to work
properly on diffrent HW configs

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2023-11-03 18:27:53 +02:00
Rander Wang 195fed7866 mailbox: use uncached address to write sw regs
mailbox_sw_regs_write is used by dai to update llp node. In multi-core
test, the updated llp node is invisable to other cores although
dcache_writeback_region is used on both cavs & ace platforms. Now use
uncached address to write memory directly which is aligned with other
mailbox access functions.

Validated on cavs & ace platforms.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2023-11-03 16:17:08 +00:00
Marc Herbert f485a88e8f Remove samples/smart_amp_test dependency on CAVS || ACE
Fixes commit f06da576cf ("smart_amp: add smart amplifier test
component") which added its COMP_TEST_SMART_AMP ancestor.

This code can compile without any hardware dependency;
`git show  ___ | grep include` does not show any.

This is useful for fuzzing etc.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-11-02 12:49:08 +02:00
Marc Herbert fd57885599 samples/Kconfig: fix dependency on top-level CONFIG_SAMPLES
Don't be creative with weird "visible if" syntax.  Simply don't include
sub-Kconfig when the top-level option is disabled.

This removes "backdoors" like:

  -DCONFIG_SAMPLE_SMART_AMP=y -DCONFIG_SAMPLES=n

"In Rome, do as the Romans do"

Fixes commit 03b80eaf44 ("audio: move test components into the
src/samples/audio dir")

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-11-02 12:49:08 +02:00
Marcin Szkudlinski f76d9828aa idc: bugfix - exit code was not passed to the caller
When executing a blocking operation on a remote core
it is expected that an exit code of the operation is
passed to the caller as if the operation was on the
same core

In fact, a result of message passing was returned,
so in most cases result was success, no matter what
operation result was

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2023-11-02 12:46:35 +02:00
Pin-chih Lin d4d0a0ca13 smart_amp: fix code and re-enable it on stub builds
Removes the misplaced code in smart_amp.c for the fix, then
re-enables CONFIG_COMP_SMART_AMP on building stub images.

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2023-11-01 20:43:46 +02:00
Seppo Ingalsuo 369dac1a22 Trace: Rename UNUSED() macro to SOF_TRACE_UNUSED()
The xt-clang RI-2022.10 compiler headers define UNUSED. The
rename of the macro for trace fixes in testbench build this
error:

  In file included sof/tools/tplg_parser/pga.c:17:
  In file included sof/tools/tplg_parser/
  ../../src/include/sof/lib/uuid.h:11:
  In file included sof/tools/tplg_parser/
  ../../src/include/sof/common.h:105:
  /home/singalsu/work/current/sof/sof/tools/tplg_parser/
  ../../src/include/sof/trace/preproc.h:162:9: error:
  'UNUSED' macro redefined [-Werror,-Wmacro-redefined]
  #define UNUSED(arg1, ...) do { META_RECURSE(
  xtensa/XtDevTools/install/tools/RI-2022.10-linux/XtensaTools/
  xtensa-elf/include/xtensa/xtensa-types.h:60:9:
  note: previous definition is here
  #define UNUSED(x)       ((void)(x))

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-10-30 20:34:38 +02:00
Trevor Wu 4b0cb077f7 platform: mtk: fix memory allocation problem
Because the size of struct comp_buffer has increased, the current heap
layout for the basic use case is not enough.

Some use cases are experiencing out of memory issues,
c0 memory  src/lib/alloc.c:765  ERROR failed to alloc 0x180 bytes zone
0x4 caps 0x1 flags 0x0

To fix this issue, we increase the number of 512-byte heap blocks to 32.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
2023-10-27 13:57:02 +03:00
Trevor Wu 4624b3d7bd audio: module adapter: fix redefinition problem
When I was using xtensa to build mt8188 platform, I encountered an error:
'redefinition of i'. To fix the problem, I removed the declaration in
the for loop.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
2023-10-27 13:57:02 +03:00
Fabiola Kwasowiec 90fef5afd2 src_lite: add module
Addition of SRC Lite module,
which only supports a subset of conversions
supported by the SRC module.

Purpose of SRC Lite module is memory optimization.
Code of SRC Lite is drastically reduced and requires
significantly less memory. When needed one of
defined conversions, driver can choose SRC Lite
module instead of SRC module to optimize memory utilization.

48 -> 16kHz
44.1 -> 16 kHz
32 -> 16 kHz
44.1 -> 48

Signed-off-by: Fabiola Kwasowiec <fabiola.kwasowiec@intel.com>
2023-10-26 17:08:29 +03:00
Andrula Song 5cc8a6dc14 Audio: Fix the default alignment setting
Set the default alignment value after buffer format is set
in audio_stream_set_params instead of in audio_stream_init
where the buffer format hasn't been set yet.

Signed-off-by: Andrula Song <andrula.song@intel.com>
2023-10-26 16:24:14 +03:00
Jaroslaw Stelter 338e87f7e1 mtl: Fix KD topology tests failure
KD topology tests fail on MTL due to insufficient size of
heap memory. During creation of KD topologies with
4ch audio format, FW fails on memory allocation.
The patch increases HEAPMEM size.

Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
2023-10-25 16:49:09 +01:00
Jaroslaw Stelter 8be15f5469 lnl: Fix KD topology tests failure
KD topology tests fail on LNL due to insufficient size of
heap memory. During creation of KD topologies with
4ch audio format, FW fails on memory allocation.
The patch increases HEAPMEM size.

Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
2023-10-25 16:49:09 +01:00
Baofeng Tian 0ef4dfe15a Audio: aria: move aria header to aria module folder
There are two headers for aria, below action is taken:
1. move header file from include path to module path.
2. combine two headers to one header file.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-10-25 15:56:49 +01:00
Serhiy Katsyuba 88b609ed07 ipc4: Add cross-core binding support
Implements binding of two pipelines from different cores so stream could
travel cross-core.

Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
2023-10-25 10:57:53 +03:00
Daniel Baluta f6c8706cfe drivers: imx: micfil: Change loglevel to info
There is no need to print an error at the beginning of a function.
The usual behavior should be to print an info.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2023-10-25 09:31:49 +02:00
Seppo Ingalsuo 3d040c7243 Tools: Testbench: Add Google RTC with mockup to testbench
This patch allows to load and run it in testbench.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-10-23 15:19:23 -07:00
Seppo Ingalsuo fc95621cd8 Audio: Google RTC audio processing: Mix all channels in mockup
With this change e.g. in all 2ch case all output channels are
mixed with matching microphone and reference channels. It helps
with testing to hear and see that the mockup works.

The mix is done for matching microphone, reference and output
channels indices. With e.g. less reference channels, the remaining
output channels are passed directly from microphone.

The mixed samples are saturated to avoid nasty sounding overflows.

Signed-off-by: Lionel Koenig <lionelk@google.com>
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-10-23 15:19:23 -07:00
Seppo Ingalsuo 763ed6d02b Audio: Convert Google RTC audio processing to module API
This patch converts the component to module API. The changes are:
- google_rtc_audio_processing_params() is changed to update
  sources and sink params from IPC4 init IPC. It's not used for
  IPC3 where module adapter handles params().
- The commands handling is fixed to handle via module adapter
  the IPC3 and IPC4 commands.
- The google_rtc_audio_processing_init() is updated to simpler
  module adapter client way.
- The google_rtc_audio_processing_prepare() is updated to set
  buffers parameters for IPC4 and find sources buffers for
  microphone and reference by index instead of buffer pointer.
  That simplifies the processing function with module adapter.
- The google_rtc_audio_processing_process() is updated from copy()
  to module adapter client way.
- google_rtc_audio_processing_get_attribute() is removed
- As overall change dev handle is changed to mod handle in nearly
  all functions.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-10-23 15:19:23 -07:00
Baofeng Tian 9e0f7eecec audio: eq_iir: create generic/ipc3/ipc4 source files for eq_iir
Create generic ipc3 ipc4 source files and move related code
into these source files.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-10-20 14:57:24 +01:00
Baofeng Tian 0153f9f2fa audio: eq_iir: public common functions for ipc3 and ipc4
this is preparation for later ipc3 and ipc4 code split out
from eq_iir.c, these common functions will be used both by
ipc3 and ipc4.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-10-20 14:57:24 +01:00
Baofeng Tian c1ba0949f7 audio: eq_iir: move iir structure definition to header file
this structure is common for both ipc3 and ipc4, move it
to header file.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-10-20 14:57:24 +01:00
Baofeng Tian 9a9fa5d6fb audio: eq_iir: move iir header file to its own directory
move header file from include path to its directory path.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-10-20 14:57:24 +01:00
Ranjani Sridharan d03dcda88f audio: aria: Add set_large_config op
This patch is needed to make the module work with linux and avoid
firmware crash. This patch sets the attenuation parameters with the
bytes control since the setup parameters can't be passed in init()
as in Windows OS.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-10-20 12:35:53 +03:00
SaiSurya Ch 51a44aadb6 Enable PLL clock for the platform ACP_6_3
Enable PLL clock for the platform ACP_6_3.

Signed-off-by: SaiSurya Ch <saisurya.chakkaveeravenkatanaga@amd.com>
2023-10-19 20:47:38 +03:00
SaiSurya Ch 5e583c4c8a Add cascaded interrupt in the platform ACP_6_3
Add cascaded interrupt in the platform ACP_6_3.

Signed-off-by: SaiSurya Ch <saisurya.chakkaveeravenkatanaga@amd.com>
2023-10-19 20:47:38 +03:00
SaiSurya Ch 354029acbd Update clock switching sequence and return EBUSY for IPC when Host busy
- Update clock switching and clock frequency sequence.
- Return EBUSY for IPC when Host busy with previous ipc.

Signed-off-by: SaiSurya Ch <saisurya.chakkaveeravenkatanaga@amd.com>
2023-10-19 20:47:38 +03:00
SaiSurya Ch 8fab6f2236 platform: Add ACP_6_3 platform support
Add ACP_6_3 platform support

Signed-off-by: SaiSurya Ch <saisurya.chakkaveeravenkatanaga@amd.com>
2023-10-19 20:47:38 +03:00
SaiSurya Ch 2e5703d7d7 amd: acp_6_3: add build support for ACP_6_3
Add build support to enable ACP_6_3 platform.

Signed-off-by: SaiSurya Ch <saisurya.chakkaveeravenkatanaga@amd.com>
2023-10-19 20:47:38 +03:00
SaiSurya Ch 2c4d02df1e src: arch: xtensa: configs: add ACP_6_3 defconfig
Add defconfig for ACP_6_3 platform.

Signed-off-by: SaiSurya Ch <saisurya.chakkaveeravenkatanaga@amd.com>
2023-10-19 20:47:38 +03:00
Anas Nashif 82e05a6d61 platform: INTEL_HDA does not exist in the kconfig namespace
INTEL_HDA was removed in 59028ad3d1

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-10-19 17:09:17 +03:00
Jaroslaw Stelter ec3ca41b60 DP: fix DP thread priority
After enabling deadline calculation DP threads began to lose priority
in relation to logger thread which currently is set to the same priority
but has zeroed deadline.
Since processing should be not disturbed by logging operations, the
ZEPHYR_DP_THREAD_PRIORITY must be set to lower value than logger.

Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
2023-10-18 16:30:38 +03:00
Baofeng Tian 19c26ea9f4 audio: volume: add config for peak volume
Add config to control peak volume code need build or not.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-10-18 13:23:09 +03:00
Baofeng Tian 8fc405d119 audio: volume: reduce ramp volume calculation
Will first check whether have same target volume, if same,
then only calculate one channel and copy to other channels.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-10-18 13:23:09 +03:00
Baofeng Tian 1012cea3d6 audio: volume: remove one space in volume code
remove space to align with coding standard.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-10-18 13:23:09 +03:00
Daniel Baluta 8eeaf5aea5 drivers: imx: Select HAVE_SDMA_FIRMWARE when using MICFIL
MICFIL needs multi-fifo SDMA script so select HAVE_SDMA_FIRMWARE.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2023-10-17 15:38:25 +01:00
Daniel Baluta 93c63bd340 drivers: sdma: Add sdma script code in header file
For ease of use add sdma script code directly in the sdma
header file.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2023-10-17 15:38:25 +01:00
Daniel Baluta 8819667b07 drivers: imx: Select DONE bit from software
With multi-fifo we need to enable done bit from software
as we have multiple fifos.

For this we make use of sw_done_sel configurations bits and
write proper bits into SDMA_DONE0 register.

For more information see `SDMA DONE0 Configuration
(SDMAARMx_DONE0_CONFIG)` SDMA register from i.MX8 reference manual.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2023-10-16 12:47:50 +02:00
Daniel Baluta 4c7b69b1c4 drivers: sdma: Set watermark level for PDM
In order to enable PDM we need to use Multi-fifo support
and mcu_2_sai RAM script.

This script defines watermark level as follows:

r7 = Watermark
    bit0~11: watermark level(wml*fifo_number)
    bit15~12: to do-fifo number
    bit16~19: fifo offset
    bit27~24: sw done selector
    bit28~31: # audio channels in one frame, 0: 1 channel,1: 2 channels
    bit23: sw done enabled

Configuration parameters should come from DAI (PDM in our specific case)
but there is no easy way to forward such information so we just make
use of some default configuration, 4 fifos, 1 channel per fifo, sw done
enabled.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2023-10-16 12:47:50 +02:00
Daniel Baluta 5f0d6222e7 platform: imx8m: dai: Set FIFO depth for PDM
On i.MX8MP PDM fifo has 32 entries (each with 4 bytes).

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2023-10-16 12:47:50 +02:00
Daniel Baluta fb1d4f80b5 drivers: imx: sdma: Enable multi-fifo script for micfil
MICFIL can support up to 8 channels. In order for this to work
we need to use multi-fifo script.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2023-10-16 12:47:50 +02:00
Daniel Baluta 52c4da5c95 drivers: imx: sdma: Introduce new SDMA channel type
Based on this we select proper firmware in order to
support multi-fifo.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2023-10-16 12:47:50 +02:00
Marcin Szkudlinski 868711c579 dp: start DP tick fixup
This is fixup for 689e8e999f

Incorrect list pointer has been used

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2023-10-13 14:52:19 +03:00
Iuliana Prodan bb8d6baf45 Revert "module_adapter: avoid module init crash in case of ipc data invalid"
This reverts 'commit e847c8b270 ("module_adapter: avoid module
init crash in case of ipc data invalid")'.

No data is not an invalid case for mixer, for example.

Fixes: #8265
Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2023-10-13 09:13:40 +02:00
Marcin Szkudlinski 689e8e999f dp: LL tick source start/stop fix
as DP uses LL as a tick source, it starts an empty LL task
to ensure that an instance of LL is running
This applies to mostly to secondary cores, but is may happen
that there's no LL instance started on primary

This commit fixes 2 problems
 - LL tick source was stated once for every DP module
 - LL tick source wasn't stopped when there were no DP
   modules running anymore

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2023-10-10 21:05:21 +03:00
Baofeng Tian d24abbc6ae audio: volume: move volume related config to component config
volume related config are missed to move during volume move out
from module adapter, move volume kconfig from module adapter folder
to volume folder with a specific volume kconfig file.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-10-10 20:58:12 +03:00
Baofeng Tian a83df49446 audio: volume: enable linear ramp for ipc4 volume
previously, linear ramp is only applicable for ipc3, however,
linear is also applicable for chrome/linux with ipc4, so remove
this ipc3 restriction.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-10-10 15:56:08 +03:00