Commit Graph

8642 Commits

Author SHA1 Message Date
Guennadi Liakhovetski bbf81b8d24 git: remove "module" from .gitignore
We now have a "module" directory under
src/audio/module_adapter/module so it shouldn't be ignored by git any
more.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-05-06 15:46:03 +01:00
Pin-chih Lin 141da0793f scripts: update xtensa core name and version for renoir
Update xtensa core to RI-2019.1 for AMD platform Renoir

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2022-05-06 13:20:50 +01:00
Kai Vehmanen 9c9ad34464 zephyr: move Zephyr IDC implementation to zephyr_idc.c
SOF uses IDC (Intra DSP Communication) protocol to orchestrate
work across multiple DSP cores.

The interface in sof/drivers/idc.h defines the protocol and
also provides a high-level interface for drivers. On Zephyr,
the SOF IDC protocol is used, but the actual communication
is implemented on top of Zephyr P4WQ workqueue interface,
instead of directly calling into drivers.

Move the Zephyr implementation from src/schedule/ into
src/idc/ which is more suitable place for this code.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-05-06 10:21:00 +01:00
Jaska Uimonen 1e9dd8cc7d dai: add op to fetch dai fifo depth
Add function to fetch dai fifo depth from driver platform data, as for
some reason it is missing. Update all drivers that are actually using
it.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2022-05-06 10:15:01 +01:00
Ranjani Sridharan 16fd76668a module_adapter: Add support for SET_VALUE/GET_VALUE control commands
In preparation for modifying the volume component to use the new
module API, add support for SET_VALUE/GET_VALUE control commands.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-05-06 10:12:39 +01:00
Ranjani Sridharan 88ef648585 module_adapter: Add set/get_large_config ops
Define the set_large_config and get_large_config ops for the module
adapter component. These are mandatory ops needed to make the module
adapter compatible with IPC4.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-05-06 10:12:39 +01:00
Ranjani Sridharan 1e9d9c6f31 module_adapter: Adapt the create op for different comp types
Module adapter can be used by components with types other than
SOF_COMP_MODULE_ADAPTER. So modify the create op to handle components
by type.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-05-06 10:12:39 +01:00
Ranjani Sridharan bb842d36ad module_interface: modify the get_configuration API
Remove the const qualification for the data pointer and pass the pointer
for the data_offset_size. The data_offset_size will need to be read and
updated after copying the config data.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-05-06 10:12:39 +01:00
Ranjani Sridharan f9a26e7ea2 module_adapter: delete module_adapter.h
And move the MAX_BLOB_SIZE macro to generic.h

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-05-06 10:12:39 +01:00
Ranjani Sridharan 2751ea8b31 module_adapter: KConfig: rename menu option
Rename the menu option to "Processing modules"

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-05-06 10:12:39 +01:00
Ranjani Sridharan 533b2ba832 module_adapter: Introduce a new macro module_get_private_data()
Introduce a new macro to access the module's private data and use it.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-05-06 10:12:39 +01:00
Ranjani Sridharan e101aadcd1 module_adapter: drop the comp_get_module_data() macro
Change all functions to accept a pointer to struct processing_module
as a parameter and use mod->priv to access the module data.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-05-06 10:12:39 +01:00
Seppo Ingalsuo da603aefd4 Audio: EQ IIR: Convert assert to normal fail
This patch changes the assert to check of IIR processing function
and fail with -EINVAL if function is not set.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-05-06 10:11:43 +01:00
Seppo Ingalsuo 068ba4b230 Audio: EQ FIR: Convert assert to normal fail
This patch changes the assert to check of FIR processing function
and fail with -EINVAL if function is not set.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-05-06 10:11:43 +01:00
Pin-chih Lin dac8754449 perf_cnt: add the tracing of window-based average calculation
The average number of cpu cycles/ticks spent could be provided per 1024
scheduled tasks by the performance counter. It would be more accurate for
MCPS measurement than the peak number. Even so, the tracing macro will log
both of them to provide more insights.

This is enabled by CONFIG_PERFORMANCE_COUNTERS_RUN_AVERAGE, which depends
on CONFIG_PERFORMANCE_COUNTERS.

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2022-05-05 21:52:13 +01:00
Pin-chih Lin dbb63071b1 component: fix comp_perf_info unsigned format
Use %u instead of %d in printf for uint32_t variable.

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2022-05-05 21:52:13 +01:00
Guennadi Liakhovetski bd4f0e1ac4 coherence: convert buffer and audio-stream APIs to use __sparse_cache
To properly use buffer-locking functions many buffer and
audio-stream API functions have to use the __sparse_cache annotation too.
Note, that we don't convert comp_update_buffer_consume() and
comp_update_buffer_produce() yet. They will be converted together
with all the buffer API users to also move buffer acquisition out of
those functions into the caller scope.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-05-05 21:47:09 +01:00
Guennadi Liakhovetski 559266e7e9 common: add an attribute-preserving version of container_of()
With some compiler versions container_of() loses any type attributes
which then leads to compilation issues. Add an attribute-preserving
version of the macro.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-05-05 21:47:09 +01:00
Guennadi Liakhovetski a85dbaf592 sparse: add __sparse_cache annotations to buffer locking functions
buffer_acquire() and buffer_release() convert between cached and
uncached addresses. Add the sparse __sparse_cache annotation to them to
track down any API misuses.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-05-05 21:47:09 +01:00
Guennadi Liakhovetski aba5f9ae37 sparse: use __sparse_cache for cache-uncache conversion functions
cache_to_uncache() and uncache_to_cache() functions take a cached
memory alias or return one respectively. Add the __sparse_cache annotation
to them.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-05-05 21:47:09 +01:00
Guennadi Liakhovetski e7da88d439 coherent: use sparse annotations
Add the '__sparse_cache' annotation to coherent API functions.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-05-05 21:47:09 +01:00
Guennadi Liakhovetski 8f7f94aebb sparse: make dcache_{writeback,invalidate} functions use __sparse_cache
Data-cache flushing functions can only be used on cached aliases.
Using them on uncached aliases generates exceptions. At the moment we
have to cast all uses of those functions to use the __sparse_cache sparse
attribute. We should convert respective variables to the correct tyoe
one by one.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-05-05 21:47:09 +01:00
Guennadi Liakhovetski 5dffea9013 sparse: add attributes for cached memory
We want to separate access to memory via cached and uncached aliases.
To enforce this use sparse's address-space attributes.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-05-05 21:47:09 +01:00
Guennadi Liakhovetski 601628695a sparse: fix all errors
Fix errors, reported by sparse. Some of them really seem to be sparse
limitations, since they don't show up in normal builds, e.g. the
missing __GLIBC_USE definition or some __builtin_* support.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-05-05 21:47:09 +01:00
Balakishorepati a92355b499 drivers: amd: renoir: fix for Bo noise during stream start
Flush i2s fifo buffers before stream start.
Re-arrange host buffer DMA operations.

Signed-off-by: Balakishorepati <balaKishore.pati@amd.com>
2022-05-05 21:30:00 +01:00
Ranjani Sridharan b4591ca8f4 codec_adapter: rename it to module_adapter and fix all includes
No functional changes.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-05-04 16:01:23 +01:00
Ranjani Sridharan 173a781551 codec_adapter: rename the codec folder to module
and fix all the includes accordingly. No functional changes.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-05-04 16:01:23 +01:00
Ranjani Sridharan 8b570dc276 codec_adapter: rename codec_adapter.c to module_adapter.c
No functional changes.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-05-04 16:01:23 +01:00
Ranjani Sridharan 06029a2e24 codec_adapter: move CODEC_GET_API_ID definition
to cadence.h. It isn't used elsewhere.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-05-04 16:01:23 +01:00
Ranjani Sridharan d779624a9b codec_adapter: rename DECLARE_CODEC_ADAPTER and comp_driver
to DECLARE_MODULE_ADAPTER and comp_driver to comp_module_adapter.
Also rename SOF_COMP_MODULE_ADAPTER to SOF_COM_MODULE_ADAPTER.
No functional changes.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-05-04 16:01:23 +01:00
Ranjani Sridharan 1531638cbf codec_adapter: rename references to codec_adapter
to module_adapter. No functional changes.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-05-04 16:01:23 +01:00
Ranjani Sridharan a98425c667 codec_adapter: rename codec_adapter.h
To module_adapter.h. No functional changes.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-05-04 16:01:23 +01:00
Ranjani Sridharan 437ed18172 codec_adapter: rename codec_adapter_free()
to module_adapter_free(). No functional changes.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-05-04 16:01:23 +01:00
Ranjani Sridharan 98756546e1 codec_adapter: rename codec_adapter_reset()
to module_adapter_reset(). No functional changes.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-05-04 16:01:23 +01:00
Ranjani Sridharan 0759e154cf codec_adapter: rename codec_adapter_trigger()
to module_adapter_trigger(). No functional changes.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-05-04 16:01:23 +01:00
Ranjani Sridharan 0d5aa7d402 codec_adapter: rename codec_adapter_cmd()
to module_adapter_cmd(). No functional changes.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-05-04 16:01:23 +01:00
Ranjani Sridharan 0ba5c29a87 codec_adapter: rename codec_adapter_ctrl_set_data()
to module_adapter_ctrl_set_data(). No functional changes.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-05-04 16:01:23 +01:00
Ranjani Sridharan 4f45c44cab codec_adapter: rename codec_adapter_set_params()
to module_adapter_set_params(). No functional changes.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-05-04 16:01:23 +01:00
Ranjani Sridharan 2def0b7157 codec_adapter: rename codec_adapter_copy()
to module_adapter_copy(). No functional changes.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-05-04 16:01:23 +01:00
Ranjani Sridharan 67ab80466a codec_adapter: rename codec_adapter_params()
to module_adapter_params(). No functional change.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-05-04 16:01:23 +01:00
Ranjani Sridharan 3fc308a6bc codec_adapter: rename codec_adapter_prepare()
to module_adapter_prepare(). No functional changes.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-05-04 16:01:23 +01:00
Ranjani Sridharan 3d71fa793c codec_adapter: rename codec_adapter_new
to module_adapter_new(). Also, rename ipc_codec_adapter to
ipc_module_adaptermodule. No functional changes.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-05-04 16:01:23 +01:00
Ranjani Sridharan b9fffdc0dd codec_adapter: Fix doxygen comment for file
No functional change.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-05-04 16:01:23 +01:00
Rander Wang fc06efb6bc ipc4: use uuid to find copier module
Fix a capture issue on windows. Currently we use SOF_COMP_HOST
or SOF_COMP_DAI for copier with host or dai included. But There
are some functions process copier as host or dai since its type
is that type. This will result to unexpected error.

This patch uses uuid to find copier with gateway support so that
it can be identified in ipc4 framework.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-05-03 14:54:42 +01:00
Vamshi Krishna c8fe1927c0 topology1: change audio format to 24 bit for rt1019
with changes we have - 3.072MHz bclk, 32-bit slot-width,
24-bit data-width.
rt1019 in auto mode is compatible with rt1015p driver.
By keeping the SSP configuration same as rt1015 will have fewer
configuration.

Signed-off-by: Vamshi Krishna <vamshi.krishna.gopal@intel.com>
2022-05-03 14:53:49 +01:00
Ming Jen Tai 4789d623a9 Add RTNR to MT8195 topology
This commit adds RTNR to MT8195 with MAX98390 topology.

Signed-off-by: Ming Jen Tai <mingjen_tai@realtek.com>
2022-05-03 14:53:07 +01:00
Ming Jen Tai 2e6bfbec1c RTNR: Decouple switch-enable control from params blob
This PR is based on https://github.com/thesofproject/sof/pull/5616

It decouples the switch-typed control for enabling/disabling from the
control bytes.

Previously, control blobs should be sent from userspace to to toggle
RTNR on/off.
With this PR, RTNR can be toggled by setting the UCM switch value.

cset "name='RTNR10.0 rtnr_enable_10' off"
cset "name='RTNR10.0 rtnr_enable_10' on"

or from command line

amixer -c0 cset name='RTNR10.0 rtnr_enable_10' 1
amixer -c0 cget name='RTNR10.0 rtnr_enable_10' 0

Signed-off-by: Pin-chih Lin <johnylin@google.com>
Signed-off-by: Ming Jen Tai <mingjen_tai@realtek.com>

merge copy_func
2022-05-03 14:52:35 +01:00
Balakishorepati 985ea1ec0f drivers: amd: renoir: add remove call back function
Add remove callback function for SP and BT dai
drivers in dai ops.

This callbacks definition will resolve the firmware
NULL pointer access during remove sequence from sof core.

Signed-off-by: Balakishorepati <balaKishore.pati@amd.com>
2022-05-03 11:20:00 +01:00
Li-Yu Yu 5cfc37040b sof-ctl: Fix -Wformat,-Wsometimes-uninitialized
* Use %z specifier for size types to avoid format
  specifier warnings on arm32
* in ctl_dump(), size_t n may be used uninitialized
  if ctl_data->out_fd > 0 and !ctl_data->binary.

Signed-off-by: Li-Yu Yu <aaronyu@google.com>
2022-04-29 12:42:55 +01:00
Seppo Ingalsuo 0d5e731b19 Audio: SRC: Add IPC4 full conversions matrix to SRC comp and tools
This patch adds the Kconfig option COMP_SRC_IPC4_FULL_MATRIX and
adds handling to src.c. Testbench build was changed to use this
largest matrix.

The coefficients were generated with script src_ipc4_int32.m. The
new sample rates were added to test script src_test.m.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-04-29 12:42:38 +01:00