Replace the generic copier with host-copier in the class definition and
the instances.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Replace the generic copier with host-copier in the class definition and
the instances.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Replace the generic copier with host-copier in the class definition and
the instances.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Replace the generic copier with host-copier object in the pipeline class
definition and all its instances.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
With the work done for zephyr DMA domain we got a lot of insights
about how scheduler works.
So add myself and Laurentiu as codeowners.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
This replaces and simplifies commit a823958a8d ("xtensa-build-zephyr:
pass sof build version to rimage") with a constant 1.
That commit was submitted to avoid a test failure in a broken, internal
test looking for an SOF_BUILD value... hardcoded to 1! (internal FW issue
257, test TestLoadFwExtended::()::test_00_01_load_fw_and_check_version")
The final goal is for this script to stop extracting anything from
`generated/sof_versions.h` so rimage can be configured _before_ the build
has started. Other commits will deal with other parts of sof_versions.h
SOF_BUILD can be replaced by a constant because it has always been one
when building with Zephyr. The optional BLD_COUNTERS feature - disabled
by default in XTOS since commit 9f8cce1522 ("Disable __TIME__ and the
non-reproducible build counter by default") for build reproducibility
reasons - has never worked with Zephyr for the following reasons:
- The sof_add_build_counter_rule() invocation is located in the
top-level sof/CMakeLists.txt file which has never been used by the
Zephyr build.
- sof_add_build_counter_rule() registers a POST_BUILD command for the
top-level "sof" CMake target but there is no "sof" build target in the
Zephyr build.
- Variables like VERSION_BUILD_COUNTER_CMAKE_PATH are not defined in the
Zephyr build for some unknown reason.
- Probably others.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
No need to handle this differently as multi-endpoint DAIs no longer
create endpoint devices/buffers too.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
These are not used anymore for the multi-endpoint DAI copiers, so remove
the creation/freeing of endpoint devices/buffers.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Modify copier_set_alh_multi_gtw_channel_map() to save the channel map and
channel count for each gateway. Since the endpoint buffer is not used for
DAI copiers, there is no need to set the channel map in this case.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Use dai_zephyr_trigger() instead. Remove the state modification in
dai_zephyr_trigger() and handle it in the copier_comp_trigger().
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Currently copying from the multiple endpoint buffer to the DMA involves
2 copies, first from the multi_endpoint_buffer to the endpoint_buffer
and then from the endpoint_buffer to the DMA buffer. Remove the
intermediate buffer copy so that demux and copy can be performed directly
from the multi_endpoint_buffer to the DMA buffer. Similarly, for the
capture case, remove the intermediate copy to the endpoint buffer from
the DMA buffer.
Add a couple of fields in struct copier_data to save the channel map and
channel count for multiple endpoint DAIs. Also remove the
copy_single_channel field as this is set directly in the process
callback in the dai_data now.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Introduce helper functions for multiple endpoint DAI copiers to demux
and copy the channels into the respective DMA buffers.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Use the params channels directly instead of using the local_buffer to
get the channel count. This is in preparation for optimizing the
multiple endpoint DAIs where the local_buffer will not be used.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Modify the channel_copy_func to align it with other processing function
signatures.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Add a helper function to set the channel map for the endpoint buffer.
This is in preparation to remove the endpoint buffer and save the
channel map to be set directly in the DMA buffer.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
The BCLK was incorrect for the loopback (LBM) configuration
for BT A2DP (48kHz 2ch 16bit), leading to incorrect playback/capture
speed.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Add sof-tgl-rt712 support. rt712 is a multi function codec which
shpports headset, amp, and dmic functions.
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
There's nothing to be done in zephyr_dma_domain_unregister() for tasks
which are not marked as registrable. Because of this there's no point in
checking if the task is registrable during unregister_dma_irq().
Instead, this check should be done at the beginning of
zephyr_dma_domain_unregister().
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
In the case of non-registrable pipeline tasks,
zephyr_dma_domain_register() will return before register_dma_irq() is
called so there's no point in checking if the pipeline task is
registrable in register_dma_irq(). This commit removes this unnecessary
additional check.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
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>