Commit Graph

9342 Commits

Author SHA1 Message Date
Libin Yang 2584500c35 topology2: add dmic-wov.conf
The dmic-wov.conf file implements the WOV feature. The connection is

DMIC ------> KPB ------------------------------> host_copier
              |                                    ^
              |                                    |
              |----> micsel ----> wov ------> virtual_widget

The DMIC and KPB is on DAI ppl.
The host_copier is on Host ppl.
The micsel, wov and virtual is on wov ppl.

The connection between host_copier and virtual_widget is a
virtual connection. The virtual_widget doesn't exist in the FW.

Signed-off-by: Libin Yang <libin.yang@intel.com>
2022-12-22 09:58:44 +00:00
Libin Yang ef37adc288 topology2: add dai-kpb-be pipeline
dai-kpb-be pipeline contains a copier DAI component and a kpb component.

Signed-off-by: Libin Yang <libin.yang@intel.com>
2022-12-22 09:58:44 +00:00
Libin Yang 62075a44e3 topology2: add wov-detect pipeline
wov-detect pipeline contains a micsel component, a wov component
and a virtual component. micsel component accepts 2 channels audio data and
output 1 channel audio data to the wov component. wov's keyword is a clap.
The virtual component is only used by the driver, and the FW will not
know that there is a virtual component in the pipeline. The virtual
component is used to connect the pipeline to a host copier pipeline
as per drivers requirement.

Signed-off-by: Libin Yang <libin.yang@intel.com>
2022-12-22 09:58:44 +00:00
Libin Yang 884322bfb9 topology2: add wov support
Add the wov module support. The keyword of the wov is the sound
of clap.

Signed-off-by: Libin Yang <libin.yang@intel.com>
2022-12-22 09:58:44 +00:00
Libin Yang a1a458efc5 topology2: add kpb support
Add the kpb component support. kpb component is used to transfer
the data to the proper pipeline based on the WOV component events.

Signed-off-by: Libin Yang <libin.yang@intel.com>
2022-12-22 09:58:44 +00:00
Libin Yang b554075d7e topology2: add micsel support
Add the audio channel selection component support.
In case 1 output channel is selected, the component provides
the selected channel on output. In case 2 or 4 channels are selected on
output, the component works in a passthrough mode.

Signed-off-by: Libin Yang <libin.yang@intel.com>
2022-12-22 09:58:44 +00:00
Libin Yang fbfdd6936f topology2: move payload_with_output_fmt into process token set
The token payload_with_output_fmt is process module specific,
so set it as a process module token.

Signed-off-by: Chao Song <chao.song@linux.intel.com>
Signed-off-by: Libin Yang <libin.yang@intel.com>
2022-12-22 09:58:44 +00:00
Guennadi Liakhovetski 8dfb2c8f4e mixin-mixout: fix address space mismatch
Fix address space conflicts caused by bf7aa04890 ("mixout: Convert
component to use the module adapter")

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-12-22 09:54:18 +00:00
Guennadi Liakhovetski 2f6a6bb4c6 module-adapter: fix address space mismatch
Fix address space mismatch, caused by 133eecb132 ("module_adapter: Add
APIs for coherent module source info access").

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-12-22 09:54:18 +00:00
Guennadi Liakhovetski 0144741651 coherent: allocate memory in coherent_init()
Allocating objects, intended for use with the coherent API must use
specific flags and align allocation size on a cache-line size
boundary. To rid users of these details integrate allocation and
freeing into coherent_init*() and coherent_free*() respectively.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-12-22 09:13:48 +00:00
Andrey Borisovich 80af480ecc soc: ace: fix IPC D3 power state entry
This patch fixes D3 issue - now platform enters and wakes up from
D3 correctly on first iteration. This had been achieved using Zephyr
cpu function call that redirects D3 flow to power down assembly code
sending IPC response to host just before powering down.

Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2022-12-22 09:43:35 +02:00
Tomasz Leman 8368a6c9f4 west.yml: upgrade zephyr to 720787f75a
Zepych update: total of 73 commits.

Changes include adding power domains to DMA interfaces and allowing to
skip context save during d3.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2022-12-21 18:20:36 +02:00
Adrian Bonislawski 7c623256cb library_manager: fix dma_deinit order
Fixes commit f90f5f9a14
dma ptr should be checked before dma->z_dev

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2022-12-21 14:42:24 +00:00
Arsen Eloglian f0a14a3f41 platform: ace: dma: update buffer period count
Fix dma buffer period count with proper value.

Signed-off-by: Arsen Eloglian <ArsenX.Eloglian@intel.com>
2022-12-21 13:54:44 +00:00
Tomasz Leman 3f05c792c3 zephyr: ipc: refactor of pg prevent
Preventing d0i3 state during IPC processing in case if a host previously
allowed for power state transitions. Transition can occur only in the
Idle thread and this lock acts as a safeguard in case of the remaining
threads to be non active (e.g. waiting for a semaphore).

The advantage of this solution is that we do not risk bypassing the
prevent. PM state lock (get and put) require that their calls be
balanced. One more put or get will result with hard to debug error. For
example we can end up with permanent prevent on power gating.

Original code introduced here: ae4e037b0

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2022-12-21 13:35:08 +00:00
Pin-chih Lin 5270e631c3 dts: handle zero config size case in set_configuration
The generic module_set_configuration function returns 0 early when
the coming config size is 0. In aspect of DTS module, receiving 0
from module_set_configuration call means either config is obtained
succesfully or no config (size is 0). The present code doesn't
handle the latter case.

This commit handles the case in DTS module by early return.

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2022-12-21 13:31:09 +00:00
Pin-chih Lin fc497eb448 topology: remove default param config from DTS control
In DTS module m4 file, the default control bytes used to have a
12-byte redundant param {0x0000, 0x000c, 0x0000}, the param id is
0 (the first 4-byte).

For DTS SDK version >= 1.0.8, error is reported while getting the
param with id=0.

This commit removes the redundant param from default control bytes.

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2022-12-21 13:31:09 +00:00
Kai Vehmanen 1a7a36a84c sof-logger: ensure NULL string is not passed to printf/fprintf
Due to allocation failures, or invalid content in dictionary,
"params" entries in "struct proc_ldc_entry" may be NULL.

In print_entry_params(), the NULL entries may be passed
as arguments to fprintf(). While e.g. glibc handles these without
error, this is not guaranteed behaviour and may result in segfault
on some platforms.

Fix the issue by aborting program if allocation fails and
explicitly handling the cases when asprintf_entry_text returns
NULL.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-12-21 13:03:44 +00:00
Gongjun Song 89b1f5054a topology1: add sof-rpl-rt711-l0-rt1318-l12
Add sof-rpl-rt711-l0-rt1318-l12. This tplg doesn't include any
local MICs.

Signed-off-by: Gongjun Song <gongjun.song@intel.com>
2022-12-21 12:12:04 +00:00
Gongjun Song 0144769229 topology1: add sof-rpl-rt711-l2-rt1316-l01
Add sof-rpl-rt711-l2-rt1316-l01. This tplg doesn't include any
local MICs.

Signed-off-by: Gongjun Song <gongjun.song@intel.com>
2022-12-21 12:12:04 +00:00
Tomasz Leman fa0456e5a8 audio: dai-zephyr/host-zephyr: stop dma only once
Until now, one dma channel could be stopped multiple times without any
problems. From commit af6d827b64 on zephyr it is required that the start
and stop calls be perfectly balanced.

Zephyr device power manager stores an internal counter. Counter is
incremented if device is used and decremented on device release. In this
case when we call dma_start() and dma_stop().

If dma_stop() is called more times than dma_start() power manager will
reaport a error -EALREADY.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2022-12-21 12:06:35 +00:00
Andrey Borisovich 7531094050 .github/workflows: zephyr workflow windows-build uploads artifacts
Github allows to store build artifacts for 90 days after the build.
Somebody might want to examine the output of the build, now can
easily download everything that job produces.
In example, compile_commands.json file contains all compilation
commands in verbose that are not visible in the build log
by default.

Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
2022-12-21 11:46:28 +00:00
Andrey Borisovich f51f296572 .github/workflows: added concurrency group to Zephyr workflow
Recently new feature had been introduced to Github actions
"concurrency" that allows to define a name for a group of workflows
that will cause old workflow to stop if the new one had been created
and the group name matches.
This improves usage of resources in SOF project by cancelling
running workflows when pushes to pull requests are done frequently
before old jobs are completed.

Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
2022-12-21 11:46:28 +00:00
Andrey Borisovich 30c43c6dff .github/workflows: renamed Zephyr workflow "build" job to "build-linux"
Zephyr workflow had been added new build-windows job.
It makes sense to rename old "build" job yo "build-linux"
for consistency.

Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
2022-12-21 11:46:28 +00:00
Andrey Borisovich df1ba22230 .github/workflows: added Windows CI job to Zephyr workflow
Added new job to Zephyr workflow running on windows-latest.

Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
2022-12-21 11:46:28 +00:00
Andrey Borisovich b34cb8bfbb xtensa-build-zephyr.py: change install tree print to ASCII style
During testing of Windows CI workflow on windows-latest turned out
that github action console has issues rendering python
anytree.RenderTree graph with default style of
anytree.render.ContStyle (continuous vertical and horizontal lines).
Tests on local machines in cmd, pwershell and msys shells
proves, that all shells can render the graph (while powershell
does not do this correctly and graph is malformed).
Changing graph style to ASCII resolves the issue with Github actions.

Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
2022-12-21 11:46:28 +00:00
Guennadi Liakhovetski 96686cfcde ipc: ipc4: do not access memory beyond object boudaries
With IPC4 only two 32-bit values are copied from the host in the
common part, anything beyond that must be copied separately. Those
two values are stored in a global msg_data.msg_in object. Therefore
always when reading from it only up to 8 bytes should be read. In
most cases it is also the case, because the target object has the
same size, but in case of SOF_IPC4_MOD_INIT_INSTANCE this isn't the
case, there special care must be taken.

Also remove a redundant NULL check where NULL cannot appear.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-12-21 10:13:00 +00:00
Guennadi Liakhovetski 84b2dd2ae9 logger: check localtime() return value
localtime() can return NULL in error cases. Check the return value
before dereferencing it.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-12-21 10:13:00 +00:00
Guennadi Liakhovetski d5e97949a2 selector: avoid array overflow
Check source and sink channels to avoid accessing beyond array
boundaries.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-12-21 10:13:00 +00:00
Guennadi Liakhovetski 24062b456e volume: fix a potentially uninitialised array
Make sure there's at least one channel in the volume configuration.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-12-21 10:13:00 +00:00
Guennadi Liakhovetski 0b295ebe96 copier: avoid array overflow
Fix a case of a possible array overflow, detected by static code
analysis.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-12-21 10:13:00 +00:00
Marc Herbert 2dfaee6a7d logger: convert.c: move global_config->logs_header to the heap
Finish the job that commit 5b29dae9c8 ("logger: Create global
convert_config variable to avoid spaghetti code.") started but did not
complete, leaving a confusing mix of globals and locals.

This confuses some static analyzer complaining that stack values are
being returned, see #6858 and #6738. This is a false positive because
convert's() stack lifespan is practically the same as a global but let's
simplify things anyway.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-12-21 09:36:27 +00:00
Marc Herbert 327a26bf8a logger: make "global_config" truly global
Finish the job that commit 5b29dae9c8 ("logger: Create global
convert_config variable to avoid spaghetti code.") started but did not
finish, leaving behind a supposedly "global" variable that is actually a
confusing global pointer to a struct local to the main() function.

This confuses some static analyzer complaining that stack values are
being returned, see #6858 and #6738. This is a false positive
because the main()'s stack lifespan is the same as a global but let's
simplify things anyway.

Also stop using 'extern' in .c files, use a proper .h file instead.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-12-21 09:36:27 +00:00
Kai Vehmanen 80adcdf36a sof-logger: print error if -u uart option is given with no infile
sof-logger -u 115200 -d /lib/firmware/sof-foo.ldc

Leads to silent failure as a NULL is passed to open(). Add
explicit error handling for this case.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-12-20 19:37:17 +02:00
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