Commit Graph

7763 Commits

Author SHA1 Message Date
Ranjani Sridharan efc0a1478b codec_adapter: simplify deep_buffer_bytes calculation
Remove the default buff_periods and the check for period_bytes !=
in_buff_size. buff_periods will evaluate to 2 if period_bytes and
in_buff_size are equal.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-02 10:24:27 +00:00
Adrian Warecki 3056ce3005 copier: Added important comment about field position in structure
config must be the first field in copier_data structure, because function
ipc4_create_buffer casts components private data as ipc4_base_module_cfg.

Signed-off-by: Adrian Warecki <adrianx.warecki@intel.com>
2022-02-02 10:08:57 +00:00
Adrian Warecki a892e0f66c audio_stream: Buffer manipulation asserts
Added asserts witch helped me debug the code.

Signed-off-by: Adrian Warecki <adrianx.warecki@intel.com>
2022-02-02 10:08:57 +00:00
Ranjani Sridharan 499b4f554c module_interface: Add the set/get_processing_mode API's
These will be used to set/get the processing mode for the modules.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-02 10:00:17 +00:00
Ranjani Sridharan a992ce7f4c codec_adapter: Introduce new enum for processing modes
This will be used to set the processing mode for the modules.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-02 10:00:17 +00:00
Ranjani Sridharan 91893750f7 module_interface: remove the apply_config op
The set_configuration op replaces this one.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-02 10:00:17 +00:00
Ranjani Sridharan b231a60b08 codec_adapter: Use the set_configuration op in codec_adapter_set_params
Use the new set_configuration op in codec_adapter_set_params().

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-02 10:00:17 +00:00
Ranjani Sridharan 367e305abc codec_adapter: waves: Define set_configuration
Define the set_configuration op in the module interface.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-02 10:00:17 +00:00
Ranjani Sridharan 4a032f29bc codec_adapter: dts: Define set_configuration
Define the set_configuration op in the module interface.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-02 10:00:17 +00:00
Ranjani Sridharan c6892be67e codec_adapter: cadence: Define set_configuration
Define the set_configuration op in the module interface.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-02 10:00:17 +00:00
Ranjani Sridharan 3f95f6a600 module_interface: Add a common helper for set_configuration
This will be used to assemble all the fragments of the configuration
data and load it.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-02 10:00:17 +00:00
Ranjani Sridharan 80ef5bb5e0 module_interface: Introduce get_configuration and set_configuration ops
These ops will be used to set or retrieve the module configuration.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-02 10:00:17 +00:00
Ranjani Sridharan 2f83e49095 module_interface: Introduce enum for config fragment position
This will be used to classify the fragments when sending/retrieving
configuration data.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-02 10:00:17 +00:00
Ranjani Sridharan 78a448605e codec_adapter: modify the signature of module_free_memory()
To pass struct processing_module pointer.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-02 10:00:17 +00:00
Ranjani Sridharan 70158f93d3 codec_adapter: modify the signature of module_allocate_memory()
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 3f2f149b9c codec_adapter: waves: modify the signatures of a couple of functions
Modify the signatures of waves_effect_allocate() and
waves_effect_buffers() to pass the pointer to struct processing_module
as input.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-02 10:00:17 +00:00
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