This hasn't been required since Zephyr commit 91902c5fd4db ("cmake: add
sparse support to the new SCA infrastructure")
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
This is required to investigate build failures. Because of the way the
build is split, a failure in one component can become totally drown in
the long build logs of another component.
Example: with -j2 the `parser_ep` build failure below is completely
drown by the long (and successful!) build logs of `sof_ep`:
```
./scripts/rebuild-testbench.sh -j 1 -p tgl
sof/tools/testbench/build_xt_testbench/sof_parser/build/include/alsa/
sound/asoc.h:196: error: expected specifier-qualifier-list before ‘__le32’
```
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
The original code confuses static code analyzers since it was
relying on the fact that we have the 2x input and 1x output pin
config in adjacent position in smart_amp_data struct similarly
to the extended module configuration.
While it works, it is not a good practice.
Split the copy of input and output pin formats to make the code
obvious and less error prone.
Fixes: andrula-song@ bcc1407 ("smart_amp_test: Split the module
config and blob receiving for IPC4")
Signed-off-by: Andrula Song <andrula.song@intel.com>
Path to rimage and private key had been failing to be used while
provided in form of relative path using dots.
Changed how rimage is discovered in the scripts:
* rimage is searched for using find_program with paths and hints provided
* changed RIMAGE_COMMAND to RIMAGE_INSTALL_DIR so end-user may specify
directory where rimage executable is placed. It will be used by
find_program.
* If RIMAGE_INSTALL_DIR is not provided, find_program will try to
search for rimage in the directory where SOF project installs it
(west_dir/build-rimage).
* Updated README.md with instructions on how to build:
- simplified configure and build commands
- updated explanations on how to use RIMAGE_INSTALL_DIR
- added information on how to use toolchain file
* private key path was parsed incorrectly when provided windows path
style using backslashes. It was passed to rimage as is resulting in the
invalid path as the last slash was made by rimage as forward slash.
Added path normalization what fixed the problem.
Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
Problem: DMA domain thread can be preempted during a pipeline_copy()
operation. This leads to buffer->walking being set to true which, in
turn, leads to TRIGGER STOP in EDF thread (which has a higher
priority than the DMA domain and can preempt it) not being able
to stop all components in a pipeline.
This is evident in the following logs:
INFO ipc: new cmd 0x60050000
INFO starting pipeline trigger operation: 0x92c10aa0
INFO executing trigger 0 on pipe 0x92c10aa0, registrable: 0
INFO Starting first walk
INFO pipeline_comp_trigger(), current->comp.id = 17, dir = 0,
pipeline: 0x92c10aa0, registrable: 0
INFO component type: 1
ERROR BUFFER WALKING SKIP
INFO ended pipeline trigger operation returned: 0
INFO ipc: new cmd 0x60030000
INFO pipeline_comp_reset(), current->comp.id = 17, dir = 0
INFO component type: 1
ERROR BUFFER WALKING SKIP
Note: "BUFFER WALKING SKIP" error message is caused by a comp_err added
to the following section of pipeline_for_each_comp():
if (buffer->walking) {
comp_err(current. "BUFFER WALKING SKIP");
continue;
}
Most likely this has always been a problem with the DMA domain but
it was less likely to happen with only a single pipeline task at a
time (the only tested case). The problem was discovered when testing
the mixer component.
This commit solves this problem by simply changing the DMA domain's
thread priority to a value in the cooperative range. This way it won't
be preempted by the EDF thread.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
This implies the following changes:
1) domain_task_cancel() shall no longer receive the number
of tasks, but, instead, will receive the task to be cancelled.
2) zephyr_dma_domain_task_cancel() will do k_sem_give() if the
sched_comp associated with the given task is != COMP_STATE_ACTIVE.
3) SEM_LIMIT is changed to CONFIG_DMA_DOMAIN_SEM_LIMIT and can
be configured.
The reasoning for the changes are the following:
1) and 2): In the case of mixers, domain_task_cancel()'s
num_tasks is not a reliable way to determine if the DMA
IRQs got cut off. Let's consider the following scenario:
We have a mixer with 1 non-registrable pipeline task and
1 registrable pipeline task. Upon TRIGGER_STOP we'd have
the following flow (i.MX boards):
a) SAI_STOP => DMA IRQs get cut off.
b) Cancel non-registrable pipeline task.
c) Cancel registrable pipeline task.
During b) and c), domain_task_cancel() would get the following
arguments:
b) domain_task_cancel(sch, 1)
c) domain_task_cancel(sch, 1)
This is because the non-registrable pipeline task wasn't
dequeued before c) so, even though the DMA IRQs got cut
off during a), zephyr_dma_domain_task_cancel() does not give
resources to the semaphore so what happens is zephyr_ll_run()
will no longer execute and the pipeline tasks remain queued.
3) Since the semaphore can accumulate more than 1 resource
at a given time (and since it's safe to make SEM_LIMIT depend
on the load of the system), SEM_LIMIT was changed into a config.
This allows the user to change SEM_LIMIT based on the system
load. For example, if there's 2 non-registrable pipeline tasks
and 1 registrable pipeline task (same scheduling component),
an appropriate value for SEM_LIMIT should be 3 (since the
semaphore can be given at most 3 resources during the task
cancellation process). Of course, making SEM_LIMIT depend on
the system load is the worst case but this way we can make sure
that the cancelled tasks get dequeued properly.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Because DMA IRQs are not registered for non-registrable tasks,
register_dma_irq() will return 0 and not set data. This leads to
zephyr_dma_domain_register() returning -EINVAL for said tasks which
is not right.
This commit fixes this problem by returning early in the case
of non-registrable tasks. This means register_dma_irq() will not
even be attempted for such tasks.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Let's try to fix the error below spotted in
https://github.com/thesofproject/sof/actions/runs/4981366388
I have no idea why this worked before and not anymore but if this makes
apt happy then we're happy.
```
libstdc++-12-dev:i386 :
Depends: libstdc++6:i386 (>= 12.1.0-2ubuntu1~22.04) but it is not
going to be installed
Depends: libc6-dev:i386 (>= 2.13-0ubuntu6) but it is not installable
```
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
These headers include alsa/sound/asoc.h and some versions of the
headers have this conditional include of types.h:
#if defined(__linux__)
#include <linux/types.h>
#endif
To ensure types __le64, __le32, __le16, __u8 are defined explicitly
include types.h becore including asoc.h.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This update is needed to include Zephyr specific patches required for
building SOF on i.MX platforms with Xtensa toolchain.
Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
For the functions platform_interrupt_clear and platform_interrupt_set,
the existing definitions based on arch_interrupt_* do not compile with
the xt-clang 2023 toolchain for imx. Use the Zephyr wrapper
implementations for those for now.
Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
This define is used by the new 2023 xt-clang toolchain and, while there
are a few definitions (identical to this one) in various implementations
such as newlib, none of them is in use when building SOF with Zephyr
and XtensaTools.
Add this define so that the toolchain provided headers work correctly.
Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
In preparation for removing the endpoint DAI device for multi endpoint
copiers, replace the DAI device new/free ops with dai_zephyr_new() and
dai_zephyr_free().
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
In preparation for removing the creation of endpoint DAI devices,
replace the call to the endpoint device's reset op with
dai_zephyr_reset().
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
In preparation removing the creating of DAI devices for multiple
endpoint DAIs, replace the call to the endpoint device's free op with
dai_zephyr_free().
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Use the dai_zephyr_config_prepare() and dai_zephyr_prepare() instead in
preparation for removing the endpoint devices and buffers for the multi
endpoint DAI copiers.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
It is OK to set the comp state to prepare before calling
dai_zephyr_config_prepare() as it only checks if the state is ACTIVE
before processing.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
In preparation for removing the endpoint device and buffers for multiple
endpoint DAI copiers, use dai_zephyr_params() instead of calling the DAI
drv params ops.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Multiple endpoints are only applicable for DAI copiers. So move the
params update for this case into the SOF_COMP_DAI case.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Building a Docker image takes several hours. To reduce costs and save
time we don't want to maintain a different Docker image for the
stable-v2.2 branch. Restore toolchains that were accidentally removed
from the Dockerfile because this will unnecessarily paint red every PR
submitted to the stable-v2.2 branch, example:
https://github.com/thesofproject/sof/actions/runs/4867162042/jobs/8679468096
If we want to stop supporting something then let's keep things simple
and remove it only where it actually gets in the way and where it
actually becomes a problem. No need to search and scrub every reference
to it from the face of the planet and accidentally make our life harder
on release branches, create pointless git conflicts and _increase_
maintenance costs when trying to reduce them!
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
We import hal_xtensa indirectly through zephyr/west.yml.
When overriding the Zephyr revision in sof/west.yml to test the Zephyr
main branch "zmain", we must also update the version of hal_xtensa
specified in zephyr/west.yml. Stop doing a manual, single repo git fetch
and use a submanifest to perform this correctly. This is exactly why
submanifests/ were added in the first place.
These fixes the imx8m compilation error spotted and discussed
in (unrelated) #7579 following the IMX rename in
https://github.com/zephyrproject-rtos/zephyr/pull/57084 and
https://github.com/zephyrproject-rtos/zephyr/pull/57795
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
When calculating the out_sample value,
the AE_SLAI32S function is used,
which rounds the result to the value 1/(-1),
resulting in a rectangular signal.
Signed-off-by: Kwasowiec, Fabiola <fabiola.kwasowiec@intel.com>
there is no interface for ipcgtw position, also no variables to
track for ipcgtw position, since ipcgtw device was removed,
ipcgtw position support have to be removed from copier.
Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
Those standard interface are no longer needed by copier, since
copier already can call with zephyr prefix function to have same
functionality, so removed those code.
Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
After all ipcgtw expose new interface to copier, copier does not
depend on ipcgtw device anymore, remove it to align with host and
dai optimization.
Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
copier use zephyr prefixed function calling instead of through
ops driver to implement params and reset functionality.
Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
Split the ipcgtw_params() function and add a new helper,
ipcgtw_zephyr_params() that can also be invoked from the copier device.
Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
Split the ipcgtw_reset() function and add a new helper,
ipcgtw_zephyr_reset() that can also be invoked from the copier device.
Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
for ipcgtw case, there is nothing to do for it, except for set
ipcgtw device state, so directly set state for prepare and trigger
instead of through ops driver, this part of code will be removed
since ipcgtw device will be removed eventually.
Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
Expose the ipcgtw_zephyr_new()/free() functions and use them for
creating/freeing the endpoint device. This is preparation to
replace the endpoint device with the copier device and eventually
remove the endpoint device itself.
Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
Split the ipcgtw_free() function to add a helper function,
ipcgtw_zephyr_free() in preparation for this to be called
from both a ipcgtw device and copier device.
Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
Split the ipcgtw_new() function to add a helper function,
ipcgtw_zephyr_new() in preparation for this to be called from both
a ipcgtw device and copier device.
Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
DAI copiers now support multiple sinks. So revert the temporary
workaround in the cavs-nocodec topology.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Add support for single endpoint DAI copiers with multiple sinks by copying
from the DMA to all the sink buffers in a loop while using the right PCM
converter function. Modify the signature of dai_zephyr_copy() to pass the
array of converter functions to be used while copying from the DMA.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Add a new DMA copy function, dma_buffer_copy_from_no_consume(), that can
be used to copy from the DMA buffer to the sink without modifying the
read pointer in the DMA buffer. This will be used when the DMA data
needs to be copied to multiple sink buffers. The DMA buffer pointer
should be updated at the end of all copies in this case.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
If DMA transaction is ongoing when RX is enabled, this can lead
to stuck communication between DMA and SSP (DMA service request
not seen by the DMA).
To avoid this, flush the RX fifo before enabling SSP RX.
Link: https://github.com/thesofproject/sof/issues/7548
Suggested-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Initial commit with set of cmake and linker scripts to build loadable
modules binary.
Things yet TODO:
add all necessary Dev Kit header files to include dir,
replace dummy example with somewhat useful module example.
Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
When the DMA buffer is reallocated pass the alignment argument to honor
the buffer address alignment that was used originally. Update the
buffer_set_size() to pass the requested alignment and all its users.
This is particularly needed in the case of host and DAI DMA buffers that
query the buffer address alignment from the DMA driver while allocating
the DMA buffers.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>