We want to re-use the code, used to synchronise caches when linking
and unlinking buffers, move it to two new functions.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Since module-specific prepare API will be called every time on prepare
of module_adapter (stream start trigger), the reset API should
free all memory that was allocated during the prepare API.
Signed-off-by: barry.jan <barry.jan@waves.com>
Make stripped ELF files compiled by XCC identical across different
machines.
Some Xtensa compilers (ab?)use the .ident / .comment
section and append the typically absolute and not
reproducible /path/to/the.c file after the usual
compiler ID.
https://sourceware.org/binutils/docs/as/Ident.html
strip --strip-all does not remove the .comment section.
Remove ourselves like some gcc test scripts do:
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=c7046906c3ae
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Total of 440 commits, including following related to
intel_adsp/sparse/dmic/xtensa:
603cc2704579 dma: Add max block count attribute
2c162449eb4c xtensa: linker: Fix#52539 by updating the linker scripts
2dd4cbc75592 dts: xtensa: intel: update cavs25_tgph to match cavs25
Link: https://github.com/thesofproject/sof/issues/6710
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Current ipc_comp_connect() connects the source first, then calls comp_bind
and only then connects the sink. This leads to errors with modules that
assume sink to be connected at bind. This is a valid assumption, so fix
the order in ipc_comp_connect().
Signed-off-by: Kwasowiec, Fabiola <fabiola.kwasowiec@intel.com>
mixout-gain-dai-copier-playback.2 pipeline id has been changed to 1.
Need to change mixout.2.1 to mixout.1.1 as well.
Fixes: f0a010052b ("topology2: cavs-sdw: group route and pipeline index")
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
dma_buffer is not yet created when ipc_dai_data_config() is called.
Accessing dma_buffer->stream leads to crash.
Anyway, there is no need to set
dd->dma_buffer->stream.frame_fmt = SOF_IPC_FRAME_S32_LE
as this is done just after ipc_dai_data_config() in dai_params()
by calling buffer_set_params().
Somewhat similar fix for IPC3 was done some time ago: 0ba90d8e2a.
Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
Data cache on Xtensa can be prefetched speculatively. In a sequence:
modify cached
modify uncached
modify cached
it isn't enough to writeback-invalidate caches after the first line.
Cache can be prefetched immediately before the second like,
preserving an outdated version of the data and then using it in line
3. The correct sequence is:
modify cached
writeback cache
modify uncached
invalidate cache
modify cached
Adjust buffer linking and unlinking accordingly.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Objects, used with the coherent API must be allocated to align to a
cache line boundary at the end. Since heap allocations always begin
on a cache line boundary, we just need to align the size to an
integer number of cache line sizes. Otherwise the header from the
next heap allocation can reside in the same cache line and therefore
be overwritten with stale data.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
The processing function can at times return a nonfatal error.
Such errors should not be treated as hard errors.
This commit changes it so that they are instead treated as a warning.
Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
Remove option to immediately send IPC in ipc_send_msg().
In current implementation, secondary core can directly write IPC mailbox
and registers. It may lead to conflict with IPC's that are being send
from queue on primary core.
All IPC responses and notifications should be queued on primary core to
synchronize two types of DSP to host messages between cores.
Changing flow only for IPC4/Zephyr. Leaving XTOS path unchanged.
Signed-off-by: Przemyslaw Blaszkowski <przemyslaw.blaszkowski@intel.com>
--pristine makes no difference for github but it's a good for anyone
trying to reproduce results and copying the command.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Changes in the GoogleRtcAudioProcessing component to
--Allow sample rate and number of channels to explicitly be specified.
--Update the memory management.
--Allow parameters to be passed.
--Allow more than mono to be processed
--Allow parameters to be specified from Kconfig
Signed-off-by: Per Åhgren <peah@google.com>
At present codes of rtnr and google-rtc-audio-processing, a
reconfigure() function is called per copy() routine to dynamically
update config blob in COMP_STATE_ACTIVE state. The logic has no
problem in practice.
However, if there are cases that config blob is always empty or
arrived late, hundreds of warning message lines per second will be
produced by comp_get_data_blob() called from reconfigure(),
restlessly complaining that data blob is not set.
This commit adds a pre-check for early-return under such cases to skip
comp_get_data_blob() calls with warn messages.
Signed-off-by: Pin-chih Lin <johnylin@googele.com>
Larger stack context stack size is required for RTNR and
GOOGLE_RTC_AUDIO integration on Intel platforms.
Signed-off-by: Pin-chih Lin <johnylin@google.com>
Add Speaker PCM to cavs-sdw topology. We need to set NUM_SDW_AMPS=1 in
CMakeLists.txt if there is only one amplifier in the device and set
NUM_SDW_AMPS=2 if there are two amplifiers.
Set SDW_DMIC=1 if there is a SDW DMIC, like rt714 in the device.
The 2nd ALH copier stream name should be the same as the 1st ALH
copier, and no need to connect to the route.
The 2nd ALH copier data will be set to the 1st ALH copier's gateway config
in the aggregated mode.
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
A topology may be constructed by some .conf files. We may use a
duplicated route index or pipeline index by accident. This commit
suggests a rule to assign route and pipeline index.
We have a consistent pcm id. For example,
Jack out: 0
Jack in: 1
Speaker: 2
Microphone: 4
We can use a simple formula to assign the route and pipeline index
for each pcm.
The formula this commit suppests is pcm id * 10 ~ pcm id * 10 + 9.
That is 0 ~ 9 for pcm 0, 10 ~ 19 for pcm 1, and so on.
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
This reverts commit ce28e09bd3.
This fixes Zephyr's git describe command and build reproducibility.
I tried fairly hard various git fetch options like --shallow-exclude
and --shallow-since but they did not save that much download (200MB at
best), required some hardcoding and most importantly they make complete
clones shallow again when invoked unconditionally. Not worth the
effort, build reproducibility is more important.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
At first llp slot is released by dai_dma_free for dai_free in
ipc4 path. Now dai_dma_free is removed from dai_free, so add
another function dai_release_llp_slot to free llp slot in
dai_free.
Signed-off-by: Rander Wang <rander.wang@intel.com>
Current llp slot is allocated based on virtual index
in node id which is incorrect since different dai may
use the same virtual index. Now find the first unused
llp slot and assign it to stream and save the slot info
to avoid querying it for each update
Signed-off-by: Rander Wang <rander.wang@intel.com>
Not all ipc_comp_dev structs contain a comp_dev pointer, it's unioned
based on the "type" field. Since the object ID is part of an IPC
command and under the control of external software, and since there
can be valid non-stream components stored in the list, we need to
check this type before accessing the invalid data belonging to the
other union types.
Signed-off-by: Andy Ross <andyross@google.com>
It's possible to reach dma_trace_on() from IPC handlers based on host
state before DMA trace has been initialized (found this via fuzzing,
so the precise circumstances are a little opaque). When that happens,
the schedule_task() call ends up putting a delayed work queue item
into the Zephyr queue which has a NULL callback. This eventually
blows up later when the timeout expires.
Check for initialization state before doing anything.
Signed-off-by: Andy Ross <andyross@google.com>
Command format errors during fuzzing are reported for virtually all
commands, and the resulting flood of logging becomes a severe
performance penalty (i.e. we get a lot less fuzzing done per CPU
cycle).
Signed-off-by: Andy Ross <andyross@google.com>
This extends the ideas in CONFIG_LIBRARY=y to implement SOF as an
application for the Zephyr native_posix architecture. These are host
x86 or x86_64 binaries that include a full OS build, which can be used
(via mocked drivers) for testing against host validation environments
like ASAN/MSAN.
The mechanism uses the existing "host" architecture used by
CONFIG_LIBRARY, but adds a new platform layer named "posix", populated
entirely with stubs.
No driver integration is provided in this patch. The resulting
executable builds correctly, but has no devices and won't do anything.
Signed-off-by: Andy Ross <andyross@google.com>
This file needs the clk.h APIs, so include the header. Don't include
the Xtensa cache.h, as it's unused (and not supposed to be, zephyr.c
is portable code). Use the proper interrupt en/disable APIs instead
of the SOC-level calls they wrap.
Signed-off-by: Andy Ross <andyross@google.com>
The timer.h header references k_cycle_get_64(), which is defined in
kernel.h. Was previously hidden by a transitive include somewhere.
Signed-off-by: Andy Ross <andyross@google.com>
This was calling clk APIs without the header. Discovered when
native_posix exposed a previous transitive include.
Signed-off-by: Andy Ross <andyross@google.com>