Commit Graph

7897 Commits

Author SHA1 Message Date
Ranjani Sridharan 40f2e2f7e4 codec_adapter: dts: change the memory allocation context
To pass the pointer to struct processing_module.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-02 10:00:17 +00:00
Ranjani Sridharan 4df1382692 codec_adapter: cadence: modify the signature of init_memory_tables()
To pass the struct processing_module pointer as input.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-02 10:00:17 +00:00
Ranjani Sridharan 0943b4da2d module_interface: Change the signature of free API
As part of the 3rd part module API changes, change the signature of the
free op in the module interface API to pass the pointer to struct
processing_module instead of comp_dev. Also. modify the signature of the
module_free_all_memory() to pass struct processing_module pointer as
input.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-02 10:00:17 +00:00
Ranjani Sridharan f0efa20421 module_interface: Change the signature of reset API
As part of the 3rd part module API changes, change the signature of the
reset op in the module interface API to pass the pointer to struct
processing_module instead of comp_dev.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-02 10:00:17 +00:00
Ranjani Sridharan 438b310403 module_interface: Change the signature of prepare API
As part of the 3rd part module API changes, change the signature of the
prepare op in the module interface API to pass the pointer to struct
processing_module instead of comp_dev.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-02 10:00:17 +00:00
Ranjani Sridharan 90ecd4f137 module_interface: Change the signature of init API
As part of the 3rd part module API changes, change the signature of the
init op in the module interface API to pass the pointer to struct
processing_module instead of comp_dev.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-02 10:00:17 +00:00
Ranjani Sridharan bb305328d6 codec_adapter: Add pointer to comp_dev in struct processing_module
Add a pointer to comp_dev in struct processing_module. This is a
temporary change that is needed for trace messages in the module
implementation. This should be removed when the trace API is updated to
not need the dev pointer.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-02 10:00:17 +00:00
Kai Vehmanen 414089aa44 zephyr: implement arch_cpu_disable_core()
Add implementation of secondary core disable with a call
to SOF runtime-PM framework.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-02-01 15:25:48 +00:00
Liam Girdwood 620142bdcc cmakefile: audio: enable vectorisation
Enable autovectorisation for audio processing modules for GCC on x86.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-01-31 16:16:27 +00:00
Liam Girdwood 42f70ecffe testbench: log any errors freeing components.
let the user know if we fail to free a buffer, component or pipeline.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-01-31 16:16:27 +00:00
Liam Girdwood fb46b5cbae ipc: common: log any failure when freeing compdev
Let the user know if we have any failures freeing a compdev.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-01-31 16:16:27 +00:00
Liam Girdwood c22b862c28 testbench: library: make C library malloc info a debug output
The malloc output is useful for debug only otherwise it can add more
noise to the trace output.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-01-31 16:16:27 +00:00
Liam Girdwood 28761ec8ab testbench: add support for virtual cores as threads
This is the first step in running a full DSP topology on multiple testbench
"virtual" cores. Testbench will use threads to virtualise a emulate a core
allowing topologies with more than one core to run simultaneously.

This patch makes the following changes.

1) Adds and passes a topology testbench context to all APIs instead of
   relying on some globals.

2) Splits the testbench up into small functions that have a single purpose.

3) Creates a thread for each pipeline which in turn share a virtual core.

4) Adds the command line options to enable testing different cores and
   pipelines.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-01-31 16:16:27 +00:00
Liam Girdwood 7ee22be700 testbench: file: Add support for stopping testbench on file size/copies
Allow the testbench to stop on a file size or number of file(pipeline)
copies.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-01-31 16:16:27 +00:00
Liam Girdwood 0f245bf151 testbench: split pipeline logic up into actions.
Split pipeline functionality into smaller action to support more
complex use cases. Provide more useful logging.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-01-31 16:16:27 +00:00
Liam Girdwood 7d4fca9802 testbench: only enable EDF scheduler once.
EDF enabled twice with testbench. Fix it.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-01-31 16:16:27 +00:00
Liam Girdwood 9ed4557460 testbench: don't enable system agent.
SA is not used with testbench so disable it.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-01-31 16:16:27 +00:00
Liam Girdwood e4b04290d4 testbench: fix help formatting and indentation.
Easier to read now and comprehend.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-01-31 16:16:27 +00:00
Liam Girdwood 69eca98dbd library: testbench: support both LL and EDF scheduler types.
Don't hard code the scheduler type for EDF.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-01-31 16:16:27 +00:00
Liam Girdwood 4af91f2c04 library: testbench: Add LL scheduler emulation
Add LL scheduler emulation for testbench pipelines. Each core is
implemented as a thread.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-01-31 16:16:27 +00:00
Liam Girdwood 885f2c41d7 library: testbench: cosmetic: move external functions to end of file.
No need to declare static functions now.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-01-31 16:16:27 +00:00
Liam Girdwood 8133a92f80 testbench: make the trace output more meaningful.
This removes the "unknown" string and replaces with file and line.
Function is already in msg.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-01-31 16:16:27 +00:00
Liam Girdwood 36452f444b testbench: increase the testbench mailbox size to support larger tplgs
Testbench should be able to support ALL DSP based topologies.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-01-31 16:16:27 +00:00
Zhang Peng bcbab9e1c7 topology: Add sof-imx8ulp-9x9-btsco.m4 for imx8ulp
sof-imx8ulp-9x9-btsco.m4 is used to generate the topology
file used on imx8ulp 9x9 board.

Signed-off-by: Zhang Peng <peng.zhang_8@nxp.com>
2022-01-31 11:16:23 +00:00
Zhang Peng 56010471eb drivers: edma: Set dmamux interruption according to hardware
SOF use sai6 on imx8ulp 9x9 board, use sai5 on imx8ulp board.
Modify for compatible with different imx8ulp boards.

Signed-off-by: Zhang Peng <peng.zhang_8@nxp.com>
2022-01-31 11:16:23 +00:00
Zhang Peng baefbd6b67 include: edma: Add IMX8ULP_DMAMUX2_SAI6 Tx and Rx
Add resource IMX8ULP_DMAMUX2_SAI6 tx and rx for sai6.

Signed-off-by: Zhang Peng <peng.zhang_8@nxp.com>
2022-01-31 11:16:23 +00:00
Zhang Peng 026d276922 drivers: imx: sai: Calculate chan_idx on imx8ulp
Now SOF has sai5 and sai6 on imx8ulp, then need choose
proper chan_idx according to hardware.

Signed-off-by: Zhang Peng <peng.zhang_8@nxp.com>
2022-01-31 11:16:23 +00:00
Zhang Peng 87d1079787 imx8ulp: dai: Add resource sai6
DSP connects to sai5 on the normal imx8ulp board(15x15). But on the
imx8ulp 9x9 board, DSP connects to sai6, add resource sai6, preparing
to bring up sof on the imx8ulp 9x9 board.

Signed-off-by: Zhang Peng <peng.zhang_8@nxp.com>
2022-01-31 11:16:23 +00:00
Zhang Peng c520dbbaa5 drivers: edma: Add EDMA_HS_GET/SET_DMAMUX_CFG
Add EDMA_HS_GET/SET_DMAMUX_CFG macros to get/set dmamux rx/tx irq.
This is for preparing support different imx8ulp board.

Modify on imx8 platform to suit this change.

Signed-off-by: Zhang Peng <peng.zhang_8@nxp.com>
2022-01-31 11:16:23 +00:00
Marc Herbert 2cbca2f20e Use typeof() to make ASSUME_ALIGNED() type safe
Use gcc typeof() to cast the output of ASSUME_ALIGNED() back into the
type of its argument. This lets the compiler report type mismatches.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-01-31 11:12:54 +00:00
Marc Herbert bd54434a2f Do not pass array arguments to the ASSUME_ALIGNED() macro
Do not pass array arguments to ASSUME_ALIGNED() macro, pass a pointer
instead.

Then it is possible to make ASSUME_ALIGNED type safe.

When using -g0, gcc outputs are exactly the same before vs after this
commit.

Note it is still not possible to make the `cdata->data->data`
abomination type-safe because it is nesting non-standard zero-length
members. However that is a different issue; not ASSUME_ALIGNED's
problem. ASSUME_ALIGNED is apparently needed for some "normal" C code
too.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-01-31 11:12:54 +00:00
Marc Herbert f30892d966 Revert "zephyr: (cosmetic) make a needlessly global variable static"
This reverts commit 079ce95b98.

As explained in the comment that it modified, predicted in the #5159
discussion and reproduced in test #5290 /
https://github.com/thesofproject/sof/runs/4988844402, this commit broke
'CONFIG_TRACE=n'. Simple reproduction steps:

 $ rm -rf zephyrproject/build-apl

 $ echo 'CONFIG_TRACE=n' >> \
    boards/xtensa/intel_adsp_cavs15/intel_adsp_cavs15_defconfig

 $ sof/scripts/xtensa-build-zephyr.sh [ -p /path/to/zephyrproject ]  apl

fw abi main version:	3.20.1
fw abi dbg version:	5.3.0
warning: can't find section .static_log_entries in zephyr/zephyr.elf
error: section .static_log_entries can't be found
error: unable to write dictionaries, -22

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-01-31 11:02:23 +00:00
Ranjani Sridharan 40d2f66883 codec_adapter: cadence: demote error message to warning when return code is not fatal
When the return code is non-fatal, demote the message to a warning.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-28 07:54:44 +02:00
Ranjani Sridharan 151c48138e codec_adapter: cadence: clear init_done flag at reset
Clear the init_done flag at reset to fix the problem with failure with a
subsequent playback.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-28 07:54:44 +02:00
Ranjani Sridharan 7c4a319384 codec_adapter: cadence: Use rfree to free codec data
Codec data is not allocated with module_allocate_memory(). So use rfree()
to free it.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-28 07:54:44 +02:00
Krzysztof Frydryk dcb9aeb308 SRC: add HiFi4 specific implementation
Add separate SRC implementation for hifi4.

Signed-off-by: Krzysztof Frydryk <krzysztofx.frydryk@intel.com>
2022-01-27 17:20:12 +00:00
Krzysztof Frydryk 3f23539d95 SRC: add IPC4 support
Add IPC4 handling of SRC module

Signed-off-by: Krzysztof Frydryk <krzysztofx.frydryk@intel.com>
2022-01-27 17:20:12 +00:00
Chao Song 6c4faa1b90 topology2: use different SSP MCLK for different platforms
Different platform uses different SSP MCLK frequency,
this patch applies different MCLK for different platform
for cavs-nocodec topology.

The MCLK frequencies are aligned with topology1.

Signed-off-by: Chao Song <chao.song@linux.intel.com>
2022-01-27 13:52:14 +00:00
Rander Wang 0b14760389 ipc4: add pcm conversion function for new format pattern
In nocodec ipc4 test we have a new format
conversion : 32 bits container 16 bits valid sample bit
to itself. Just copy the source buffer to sink buffer.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-01-27 13:44:42 +00:00
Andrula Song 3eaf974081 audio: volume: optimize volume component with HIFI3
Processing continuous data. Asking a 8-byte aligned memory
to store volume gain 4 times, using 2-way or 4-way pipeline
operations of xtensa intrinsics. This method can reduce about
40% MCPS than the original one.

Signed-off-by: Andrula Song <xiaoyuan.song@intel.com>
2022-01-27 12:01:27 +00:00
Rander Wang f0fd4e1a45 ipc4: fix index issue for alh on windows
The node id in copier config is built with group id
and codec id, we need to convert it to sof dai id.

Validated on windows

Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-01-27 09:58:39 +00:00
Marc Herbert 0bf7b73dc8 cmake: move ALSA_CONFIG_DIR from .sh file to topology/CMakeLists.txt
Fixes incremental builds of topology2 that were missing ALSA_CONFIG_DIR.

This was making it impossible to troubleshoot alsatplg issues like #5249.
Now incremental builds fail or pass the same as builds from scratch.

Fixes commit 308a24a92b ("topology2: Add build support")

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-01-26 10:14:15 -08:00
Marc Herbert a351d02b6d cmake: simplify add_alsatplg2_command() macro
alsatplg accepts empty definitions -D "" so let's simplify
commit cb80023b22 ("topology2: fix build issues with no command line
definitions"); 10 lines shorter. The less CMake code the better.

Zero change, the build directory is bit for bit identical after this
commit.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-01-26 10:14:15 -08:00
Marc Herbert 361fbf4504 zephyr/cmake: remove obsolete cmake 3.12 version test
Zephyr requires CMake 3.21 and SOF requires 3.13, see
commit a0acad3414 ("CMake: require version 3.13")

Fixes commit 4b2edf8eed ("zephyr: wrapper: complete zephyr support for
working audio")

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-01-26 10:14:15 -08:00
Seppo Ingalsuo d155401343 Tools: Testbench: Fix long line
The line with multiband_drc library was too long for
checkpatch.pl check.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-01-26 14:36:07 +00:00
Seppo Ingalsuo cd3795d694 Tools: Testbench: Add more errors handling code
This patch adds to defaults of switch statements error prints
and error values returns to properly error non-supported
things.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-01-26 14:36:07 +00:00
Seppo Ingalsuo 4869b09717 Tools: Testbench: Copy in file max dev->frames amount of frames
This patch limits file read from reading more than e.g. 48 frames
at time when scheduled every 1 ms for 48 kHz audio. It helps
the testbench to execute copy() operations similarly as in real
firmware and not process multiple periods of data in the same
pipeline copy. Some components contain internal limiting for data
processing amount but most do not.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-01-26 14:36:07 +00:00
Seppo Ingalsuo 594853d389 Tools: Testbench: Use in prepare() frame_fmt from stream
The file component new() sets function to s32. It's better to
initialize to default function that just errors if called.

The stream pointer is retrieved from buffer. There is no need to
apply twice list_first_item() function. The sample width is set
with get_sample_bytes(). The switch case for frame_fmt is changed
to use stream. It avoids an error to use 16 bit file write to
consume data from 32 bit buffer. This happens because ipc value is
from topology while stream format is from command line override. Only
the text file output becomes incorrect.

The comp_data struct contained unnecessary fields such as period_bytes,
frame_bytes, and frame_fmt.

The patch also contains some switch-case code cleanup for more compact
code and look.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-01-26 14:36:07 +00:00
Seppo Ingalsuo b502424819 Tools: Testbench: Improve binary file read and write performance
This patch replaces the sample by sample fread() and fwrite()
operations with max length block reads and writes without
circular wrap. Both binary and text format read and write
functions are replaced with more compact versions.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-01-26 14:36:07 +00:00
Li-Yu Yu 46da7bd9d1 topology1: mt8195: Add topology with DTS
Add CMake build definition for
sof-mt8195-mt6359-rt1019-rt5682-dts.tplg.

Signed-off-by: Li-Yu Yu <aaronyu@google.com>
2022-01-26 14:12:53 +00:00