Commit Graph

9358 Commits

Author SHA1 Message Date
Ranjani Sridharan bf7aa04890 mixout: Convert component to use the module adapter
Convert the mixout module to use the module adapter. The
bind/unbind/get_attribute ops in the mixout module have been moved to the
module_adapter ops and is functionally the same as with the comp_drv
ops.

The struct mixout_data struct has been simplified to contain 2 fields as
the source info table has been moved to struct processing_module and
rename the consumed_yet_not_produced_frames field in struct mixout_data
to pending_frames.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-12-20 16:44:26 +00:00
Ranjani Sridharan 847f9fe580 ipc4: handler: initialize hw_params
Initialize the hw_params to 0 before passing it to the individual
components in the pipeline.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-12-20 16:44:26 +00:00
Ranjani Sridharan e0458032e2 module_adapter: Fix trigger op for IPC4
The check for status counts for modules with multiple sources is only
applicable for IPC3.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-12-20 16:44:26 +00:00
Ranjani Sridharan fbb82566d2 module_adapter: Fix module_adapter_reset()
When module_reset() returns a non-zero value, print an error if needed
and return immediately.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-12-20 16:44:26 +00:00
Ranjani Sridharan ee969eb1b3 module_adapter: Add bind/unbind ops for IPC4
Define the bind/unbind comp driver ops for the module_adapter which will
be used to update the source device pointers in the source_info table.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-12-20 16:44:26 +00:00
Ranjani Sridharan 133eecb132 module_adapter: Add APIs for coherent module source info access
Add module_source_info_acquire/release() for coherent access to the
module's source_info data.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-12-20 16:44:26 +00:00
Ranjani Sridharan 213d61081d module_adapter: Introduce struct module_source_info
Introduce struct module_source_info that will be used to keep track of
all the source modules that are bound to a module. Also, add a new
field, source_info in struct processing_module to save the source
information for each module.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-12-20 16:44:26 +00:00
Marc Herbert 9b2453e236 xtensa-build-zephyr.py: compress sof-info files in parallel
On my system this brings the install_platform() duration down from about
3 seconds to less than 1 second.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-12-20 15:44:20 +00:00
Seppo Ingalsuo 9f74088c7c Tools: Topology1: Add to development topologies DRC for UP2 board
This patch adds to development topologies build of minimal topologies
sof-apl-pcm512x-drc.tplg and sof-apl-pcm512x-mdrc.tplg for testing.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-12-20 15:42:59 +00:00
Kwasowiec, Fabiola 1f374f8840 module_adapter: return success when component state is equal to requested state
When dev->state == requested_state in comp_set_state then
COMP_STATUS_STATE_ALREADY_SET (status 1) is returned.
Then the pipeline trigger is aborted and status 1 is returned
to the pipeline_task_cmd function (status 1 in this function means
PPL_STATUS_PATH_STOP). Finally, the status of the pipeline
does not change and the IPC response returns success.
which causes errors with subsequent changes in the pipeline state
(INVALID_IPC_REQUEST)

Signed-off-by: Kwasowiec, Fabiola <fabiola.kwasowiec@intel.com>
2022-12-20 14:18:36 +00:00
Jaroslaw Stelter 9091635f10 iadk modules: Add variable initialization
This patch adds initialization of module_size_ variable
in SystemAgent() creator.

Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
2022-12-20 15:27:49 +02:00
Jaroslaw Stelter 4cc849d34b library_manager: Fix dma_ext initialization issue
In the lib_manager_dma_deinit() function proper checks
for dma_ext structure fields must be added to avoid
calling dma api with uninitialized parameters.

Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
2022-12-20 15:27:49 +02:00
Guennadi Liakhovetski b516172a41 probe: simplify ipc4_get_buffer()
Use a local variable in ipc4_get_buffer() to simplify it and remove
redundant code.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-12-20 14:01:54 +02:00
Guennadi Liakhovetski 40e6c1ddc0 ipc: ipc4: fix an uninitialised variable
This is a theoretical case of an invalid pipeline status, handle it
correctly.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-12-20 14:01:54 +02:00
Guennadi Liakhovetski 10251c5037 data-blob: fix a NULL dereference
If the main context variable is NULL, it cannot be used to print an
error message. Since this actually should never happen, use an
assertion similar to other similar cases in the file.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-12-20 14:01:54 +02:00
Guennadi Liakhovetski aff99b209f copier: fix a potentially uninitialised warning
The create_dai() function can return an uninitialised value. Fix it
by reducing the scope of the variable.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-12-20 14:01:54 +02:00
Kai Vehmanen 4bec5b292c logger: exit with error if calloc fails
In user-space tools, memory allocations can reasonably be expected to
always succeed. Make this assumption explicit by adding error handling
after calloc.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-12-20 11:47:01 +02:00
Kai Vehmanen 4d64893b86 sof-logger: exit with error if malloc fails
In user-space tools, memory allocations can reasonably be expected to
always succeed. Make this assumption explicit by adding error handling
after malloc.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-12-20 11:45:34 +02:00
Kwasowiec, Fabiola 19416908dd selector: remove return error when input buffer is 0
A pipeline that contains a selector cannot be run before the pipeline
that is connected to the selector because an error is returned.
The order of the run pipelines should not matter for functionality.

Signed-off-by: Kwasowiec, Fabiola <fabiola.kwasowiec@intel.com>
2022-12-19 20:23:00 +02:00
Serhiy Katsyuba e06e1f0a44 ipc4: copier: remove redundant assignment
Removes variable cd->converter[i] assigning to self. This
fixes error reported by static code analyzer.

Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
2022-12-19 17:26:07 +00:00
Marc Herbert 4ac3e3ff44 xtensa-build-zephyr.py: don't leave the install of an old build behind
In theory a failure from this script should immediately stop the show
and no one should then use the staging directory.

In practice we cannot make sure, especially not with shell scripts. So
make sure no previous build of a requested platform is left behind.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-12-19 17:25:28 +00:00
Guennadi Liakhovetski 3b9bc16400 lib-manager: fix cache annotations
lib-manager allocated memory for library modules with a cached alias
and explicitly synchronises cache in it (apparently superfluously).
Add cache address space annotations as needed.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-12-19 17:21:53 +00:00
Guennadi Liakhovetski fcd6e9541d alloc: fix argument for cache alias conversion
z_soc_uncached_ptr() takes a cached alias as argument.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-12-19 17:21:53 +00:00
Guennadi Liakhovetski eb0c038e96 selector: make frame formats explicitly cached
audio_stream_fmt_conversion() takes cached aliases of frame formats,
fix selector respectively.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-12-19 17:21:53 +00:00
Guennadi Liakhovetski 6cdc29472a mixin-mixout: fix address space attribution
src_info, as returned by find_mixout_source_info(), is a part of
mixed_data_info which is explicitly cached. Annotate src_info to be
the same.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-12-19 17:21:53 +00:00
Guennadi Liakhovetski 6c4b4ec843 ace: fix cache-uncache conversion macros for sparse
cache_to_uncache() and uncache_to_cache() must be inline functions
with proper argument annotations. Fix ACE definitions by alanogy with
cAVS.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-12-19 17:21:53 +00:00
Guennadi Liakhovetski 66a556062a ace: remove "volatile" from cached addresses
Cached addresses aren't used to access the hardware in mailbox.h,
they don't need to be volatile.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-12-19 17:21:53 +00:00
Marc Herbert 2ea4bc0ec4 .github/pull-request.yml: upgrade checkout v2 -> v3
This upgrade was already performed for other jobs in commit
f71eb15818 (".github/workflows: upgrade actions/checkout@v2 -> v3")
and everything went fine. Finish the job and get rid of the last
warnings in the daily tests (example:
https://github.com/thesofproject/sof/actions/runs/3709176785)

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-12-19 16:44:36 +00:00
Pin-chih Lin b581aa52e9 topology: add waves-integrated tplg file for RT1019 codec
Add topology case {WAVES + RT1019 CODEC}

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2022-12-19 16:41:32 +00:00
Seppo Ingalsuo 8d166a432f Audio: Copier: Add missing DMIC DAI index mapping to create_dai()
The dai_index needs to be mapped similarly as in kernel. The SSP
type was handled correctly in the function but not DMIC.

Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-12-19 14:28:32 +00:00
Chao Song 764ce675ee smart_amp_test: add ipc4 support for smart amp test
Smart amp test module read config from ipc msg and convert ipc4 settings
to ipc3. It is a dummy module used for smart amplifier validation.

Signed-off-by: Chao Song <chao.song@linux.intel.com>
Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-12-19 13:26:19 +02:00
Rander Wang 5ac79eae01 mutex: add mutex support in XTOS
It uses spin lock to support mutex.

Suggested-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Suggested-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-12-19 13:26:19 +02:00
Rander Wang 7ca9152120 smart_amp_test: fix a typo
Use smart_amp_verify_params

Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-12-19 13:26:19 +02:00
Marc Herbert e6f72dee82 zephyr/docker-build.sh: upgrade CMake to 3.21 or above
CMake 3.21 changed the order object files are passed the linker. This
breaks build reproducibility.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-12-16 15:19:44 -08:00
Marc Herbert 424da2cd9d zephyr/docker: pass http[s]_proxy variables to the container
Support downloads from within the container.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-12-16 15:19:44 -08:00
Marc Herbert d652d1cd16 .github/zephyr: re-add TGL IPC3 build for now
Partial revert of commit 687c6f305e (".github: workflow: removed
legacy RTOS platforms from Zephyr build") that was a bit too
"enthousiastic".

When someone breaks the Zephyr+IPC3 build we'd like to: 1. notice, 2.
tell whether it's Intel-specific, IMX-specific or not specific.

This is a one-line change and unlike testing, building is "free".
It can be removed in a second when/if that becomes a burden.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-12-16 15:44:00 +02:00
Marc Herbert 03c078935d .github/zephyr: use a single job for both tgl and tgl-h
The list is getting too long and the "checks" box in the Github User
Interface is small.

Fixes commit 543acc124d (".github/workflows: add tgl-h IPC4 build")

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-12-16 15:44:00 +02:00
Seppo Ingalsuo a8aa7c30d6 Audio: SRC: Delete unused function parameter fir_delay_length
It is not used so it can be deleted. There is no measurable
performance impact from this change.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-12-16 15:41:53 +02:00
Seppo Ingalsuo 8f802378e5 Audio: SRC: Refine input and output blocks count calculation
As a small improvement for 2-stage converters like 44.1 to 48 kHz
the s1_blk_in and s2_blk_out can be calculated once after the if
statement.

There is no measurable MCPS improvement from this change.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-12-16 15:41:53 +02:00
Seppo Ingalsuo 7b8cef02d4 Audio: SRC: Optimize generic C fir data pointer wrap
There is no need for the if statement since the pointer data
always wraps at this code location if the next loop is executed.
Next FIR calculate will start with new data pointer value, so
potentially wrong pointer value when n2 equals zero does not matter.

This patch saves in CML gcc build 2%, or 2.0 MCPS from 46.2 to 45.3
MCPS in stereo 44.1 kHz to 48 kHz conversion.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-12-16 15:41:53 +02:00
Tinghan Shen 1f9dbcad22 platform: mt8188: Fix build error
Add back the mailbox_sw_reg_write inline function
to fix build error of mt8188.

sof/src/platform/mt8188/include/platform/platform.h: In function ‘platform_panic’:
sof/src/platform/mt8188/include/platform/platform.h:69: warning: implicit declaration of function ‘mailbox_sw_reg_write’

Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>
2022-12-16 15:41:04 +02:00
Andrula Song f6fca6fc7e Audio: Implement a HiFi3 version audio_stream_copy
Since Xtensa provides intrinsics for multi-way load/store
and using those instructions can reduce more cycles than
the function we using now, so there is a HiFi3 audio_stream
_copy implementation.

Signed-off-by: Andrula Song <xiaoyuan.song@intel.com>
2022-12-16 13:46:40 +02:00
Ajye Huang cdcbdae705 topology: sof-adl-nau8825: add variant with nau8318 amplifier
Adding support for nau8318 Amplifier.

sof-adl-nau8318-nau8825:
    nau8825 headphone connects SSP0 link.
    nau8318 Amp speakers connects SSP1 link.
    bluetooth offload uses SSP2 link.

Signed-off-by: Ajye Huang <ajye_huang@compal.corp-partner.google.com>
2022-12-16 13:44:30 +02:00
Marc Herbert 906508bd79 xtensa-build-zephyr.py: checksum deterministic configs.c
.config is not deterministic because it has absolute paths in comments
and its order seems hard to predict. configs.c has the same information
generated in a determistic way.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-12-16 13:42:08 +02:00
Marc Herbert bc394916d0 xtensa-build-zephyr.py: switch type of InstFile() names to pathlib
Make sure any forward slashes in strings are immediately converted to
OS-dependent directory separators.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-12-16 13:42:08 +02:00
Adrian Warecki 13c36f3207 module adapter: volume: Validation of channels count
The module operates on arrays whose size is based
on SOF_IPC_MAX_CHANNELS. Added check if the number
of channels given in the configuration does not exceed
the number of maximum supported channels.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2022-12-16 13:40:39 +02:00
Bard Liao 080363ece9 topology2: add sdw spk feedback pcm
This commit create a PCM that can pass amplifier feedback to user space.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2022-12-16 12:56:53 +02:00
Ranjani Sridharan 41a16145fc mixer: convert the mixer comp to use the module interface
Convert the mixer component and the mock tests to use the module
interface

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-12-15 20:44:20 +02:00
Ranjani Sridharan 98e9d3f0f6 module_adapter: Add support for modules with multiple sources
Add support for modules with multiple sources such as the mixer.
Expand the scope of the simple_copy flag in struct processing_module to
include components that have multiple input buffers but only a single
output buffer and do not need any deep-buffering.

Make changes to the prepare, copy and trigger callbacks in the
module_adapter ops to add support for handling multiple input buffers.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-12-15 20:44:20 +02:00
Ranjani Sridharan 6e7f31c141 module_adapter: Add a no_pause field for modules
Add a new field, no_pause in struct processing_module which will be set
by modules that do not support pause, ex: mixer.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-12-15 20:44:20 +02:00