This is to allow CI to test a simple multicore playback case on
MTL/TGL/ADL: SSP0 playback on core 0 and SSP2 playback on core 1.
Capture uses core 0 only atm. More multicore usage will be
introduced later.
Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
This handler was missing its type check and would follow comp_dev
union fields on components that might be buffers or pipelines, leading
to crashes downstream.
Found via fuzzing.
Signed-off-by: Andy Ross <andyross@google.com>
These list heads in the comp_dev struct are not uniformly initialized
(grepping the source, the list_init() calls for these fields seem to
be spread around the source tree in individual components). Fuzzing
is seeing nulls here, presumably because it's possible to reach
ipc_comp_free() in "unintended lifecycle" circumstances where they
weren't initialized. Check the fields before crashing.
Signed-off-by: Andy Ross <andyross@google.com>
This function is called based on external commands, and with an
arbitrary component ID that may not actually be a pipeline. Check the
type before following garbage pointers and passing them down into call
trees.
Found via fuzzing.
Signed-off-by: Andy Ross <andyross@google.com>
The config block for the component gets provided externally and is
copied directly in using a byte count likewise provided by the host.
The use of memcpy_s() prevents overruns, but the error that was
detected was being reported via assert(). To fuzzing, that assertion
is a fatal error, when clearly this needs to be a runtime failure as
it's due to external input and not a local code bug.
Signed-off-by: Andy Ross <andyross@google.com>
Those function are both needed in legacy and zephyr part, simply
with zephyr prefix is not suitable, rename it with common prefix.
Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
Host and gateway case already have common function to handle
trigger and reset, add this wrap to align dai with host.
Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
peak meter value
Add kconfig to select the period of reporting peak meter value.
The default value is reporting peak meter every 10 ms.
Signed-off-by: Andrula Song <andrula.song@intel.com>
We need to enable CONFIG_DEBUG_COREDUMP_MEMORY_DUMP_MIN according to
comments in coredump_core.c: When dumping minimum information, the
current thread struct and stack need to be dumped so debugger can
examine them.
Signed-off-by: Rander Wang <rander.wang@intel.com>
Follow the k_sys_fatal_error_handler implementation in fatal.c in
zephyr framework. Without this halt, our k_sys_fatal_error_handler
will be called copules time and result to many useless IPC messages
to host.
Signed-off-by: Rander Wang <rander.wang@intel.com>
The fprintf() command prints only "#!/bin/sh". For some reason
this has been ignored by interpreter but as clear error it is
better to fix.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The changes to scripts/host-testbench.sh and earlier to process_test.m
have unintentionally dropped valgrind run from test.
This patch enables valgrind for process_test.m runs and fixes
issue in test run octave side function to silently ignore
error about failed shell command. Normally test fail when there
is no data or incorrect data, but a valgrind failure with correct
test output was passed.
Valgrind output becomes visible if testbench run trace stderr
redirection to file is disabled. If not done valgrind error would
stop the test but the analysis would not be printed to console.
Fixes: 6b744bcc63 ("host-testbench.sh: use process_test.m for 8 components")
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Add this function in copier_dai source file, in order to
keep same usage, there is no need to inline this function,
althrough it is short.
Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
Rename "DMIC" PCM name to "DMIC Raw" in the generic dmic topology fragment.
The PCM is on the DMIC patch without any processing beyond gain and IIR EQ,
thus the "Raw" extension.
Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Rename cavs-nocodec capture PCMs. The current PCM names are confusing. These
should be better names for them. The former
"ssp-capture" is now "Port0 2nd Capture",
"DMIC0 Raw" is now "DMIC SFX1", and
"DMIC0 Raw 2" is now "DMIC SFX2".
The PCMs in question have extra gains in the path to simulate processing.
Also the mixer name is changed to compensate for the matching "Capture"
substring in the end of the PCM name, that is part of the mixer name,
to avoid "Capture Capture" tautology.
Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Yet another permutation. This needs to be back-ported to 2.2 releases
Closes: https://github.com/thesofproject/linux/issues/4399
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Zephyr has hardcoded this to 'y' because it saves CI some disk space
when compiling hundreds of different zephyr/tests/, each in a separate
build directory. But when compiling just one "sof/app" it saves
practically no space, breaks the incremental build and can make it more
difficult to troubleshoot some build issues. So, reset it to the default
value.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
We used to provide the `default_rimage_key` in two places:
1) as a default `RIMAGE_KEY` attribute (newer `otc_private_key_3k`)
2) as an explicit `else` clause that was never run because of 1) (older
`otc_private_key`)
Remove the redundant `else` clause in 2); it became dead code. This
simplifies the code and makes the script ready for the day when the key
argument will be optional for rimage (more about this in
https://github.com/zephyrproject-rtos/zephyr/pull/58356)
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Fixes commit a769d3941d ("xtensa-build-zephyr.py: stop calling west
sign, rely on west build")
Before that commit, `xtensa-build-zephyr.py` used to invoke `west sign`
directly and in the same current directory. This allowed relative key
paths to just work. Now that `west sign` is indirectly invoked by `west
build`, there is no possible way to make relative key paths work. So we
must resolve them before using them.
Fixes#7718
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
When all components of a pipeline are scheduled on the same core, use
the pipeline's core_id attribute to set the core_id for all the
components in it. Also, remove the default core_id in class definitions
so that it doesn't take priority over the value passed from the pipeline
object.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
When the host component detects use of deep buffering it decreases
frequency of dma reloading. The number of processed data is summed up in
the partial_size variable and they are acknowledged in larger packets.
However, the size of processed data was not subtracted from the number of
available data, which could lead to a buffer underrun/overrun.
Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
Do not treat as error if the chain dma is asked to be destroyed if it has
not been created yet.
The kernel might send such a request under special circumstances:
the PCM is opened, configured but never started/triggered then just closed,
freed.
This is the same way how pipelines are handled, but in case of pipelines
we use the pipe state.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
This patch enables running example_drc.m script with Matlab.
The endifs are changed to end. And mixed usage of endfunction
and end is corrected to just end. The unnecessary
semicolons from function declarations are deleted.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch changes a bit structure of example_drc to export
conveniently several different blobs. The changed script
exports configurations blobs for disabled and enabled mode.
Two functions for IPC4 and topology2 compatibility are
generalized from EQ to common directory. The EQ and other
tools will be updated to later to use the common get_abi()
and tplg2_write() functions.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
A problem was observed with launching capture with dmic. Sometimes the host
starts reading data too late, so that the capture buffer becomes full.
In this case, the dma descriptors are not reloaded. This leads to stopping
the dma. When the host starts reading and reads the accumulated data the
stream is already stopped. With this patch, the descriptors are always
reloaded and the stream will not be stopped. A glitch may occur but it is
better than no data at all.
Fixes#7506.
Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
Current implementation use double for loop, copying separately every
sample between circular and linear buffers. This solution is extremely
slow and for some formats consumes even more than 10 MCPS just for data
preparation.
Replacing for-loops with generic wrapped copy functions.
Signed-off-by: Przemyslaw Blaszkowski <przemyslaw.blaszkowski@intel.com>
Change function name from: dai_zephyr_get_hw_params to
dai_common_get_hw_params, due to this name also exist in
dai-legacy.c, need align both legacy and zephyr part to avoid
misunderstanding.
Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
COMP_ATTR_VDMA_INDEX is a copier internal usage case, no other
module used, so remove and replace it with direct assign. At the
same time, this keep get_attribute align with module adapter format.
Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
inside dai-zephyr/legacy, there is no need to call
comp_dai_get_hw_params, dai_zephyr_get_hw_params can be directly
called without wrap, remove the dpendency in dai-zephyr/legacy.
Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>