When trigger.aborted is set, pipeline_trigger_run() also returns
PPL_STATUS_PATH_STOP. So the current test for trigger.aborted in
pipeline_task_cmd() after pipeline_trigger_run() is a left-over from
an earlier implementation and is never entered with the current flow.
In the current implementation, a typical playback topology like
[pipeline A] PCM -> ... - [pipeline B] mixer -> ... -> DAI
when a pause is triggered mixer will stop its propagation, set
trigger.aborted on pipeline B to true and return
PPL_STATUS_PATH_STOP. pipeline_task_cmd() is still running in the
context of pipeline A, so it will detect PPL_STATUS_PATH_STOP, check
that trigger.aborted is not set and terminate the task. Then the
scheduler will run the task for pipeline B, that one will verify,
that trigger.host == NULL, then find the trigger.aborted to be true
and will keep the task running.
In a topology, where the PCM, the mixer and the DAI all belong to the
same pipeline, when PAUSE is triggered, the whole pipeline should be
left running which is what this patch achieves by checkint
trigger.aborted when PPL_STATUS_PATH_STOP is returned by
pipeline_trigger_run().
BugLink: https://github.com/thesofproject/sof/issues/5257
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
It appears in the conversion of the IPC API the copy in the smart amp
code was missed and as a result the component loses its ID which results
in the graph being broken and a crash on trigger.
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
Existing xtensa-build-zephyr.py failed to copy sof logger
executable to staging directory due to missing '.exe' file extension.
This fixes the script.
Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
This reverts commit f50b6fe0ad.
I discovered the hard way that this change causes alsatplg version
1.2.2 (the default version in the current LTS Ubuntu) to corrupt just
a few bytes in .tplg output in an incredibly discrete and
time-consuming way: no error message at build time and same file size.
See example at https://github.com/thesofproject/sof/pull/5162.
We could/should just require a minimum alsatplg version at the CMake
level but at this moment we don't even know which minimum version is
needed and we would also need to take some time to test a few alsatplg
versions. If version 1.2.2 would just fail with an decent error
message that can be searched and discussed then everything would be
fine but silent corruption is really not OK.
So users of recent versions will unfortunately have to live with the
huge number of warnings for now.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Do not free the dmatb so that the trace code can continue collecting
information continuously in it's buffer.
We also have another memory leak (when CONFIG_DMA_GW is set) which can be
handled this way:
Every time the dma_trace_start() is called we allocate a new dma_sg. This
is fine when the dma_trace_start() is only called once right after the
DSP finished booting, but multiple calls would eventually going to lead to
OOM.
Move the dma_sg allocation at the same place where the dmatb is allocated
to make it persistent as well.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
dma_sg_alloc() is called with SOF_MEM_ZONE_SYS which can not be freed up.
dma config or start error skip the free as it is not going to work anyways.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
When the dtrace is disabled (via the SOF_IPC_TRACE_DMA_FREE IPC message) we
need to also free up the allocated dma_sg_elem_array to avoid leaking
memory on the next dtrace start.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Do not attempt to allocate the dtrace buffer again if it has been already
allocated.
This only possible if we are re-configuring the dtrace which implies that
we also must have the DMA channel.
In such case, skip the allocation and do a re-init of the buffer after the
DMA channel has been stopped.
Reported-by: Keyon Jie <yang.jie@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
We need to free up the allocated SG in case of a failure after a successful
ipc_process_host_buffer() call, which does the allocation.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
We should stop the task before the dtrace channel is stopped when we
need to re-configure it.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Move the tag printing out from dma_trace_enable() to
dma_trace_buffer_init()
to be close proximity of the buffer allocation for easier reading.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Printing the error via dtrace is not going to work when the memory for
the dtrace is not allocated.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
dma_trace_buffer_init() can only fail if the rballoc fails so there is no
need to call dma_trace_buffer_free() as the buffer has not been allocated
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
The default fade type is SOF_VOLUME_LINEAR if fade
type is not set and this results unexpected ramp operation
and fw panic
Signed-off-by: Rander Wang <rander.wang@intel.com>
ipc4 volume need to be clamped into correct range, or
real volume will be different with target volume and
result to unexpected ramp operation with fw panic.
Implement two functions to do conversion between ipc4
and ipc3 since they will be used by more functions.
Signed-off-by: Rander Wang <rander.wang@intel.com>
Code has compilation issues when SRC_HIFI4 flag is enabled
src/audio/src/src_hifi4.c:356: warning: implicit declaration of function ‘MIN’
Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
Created new script with similar functionality to allow SOF + Zephyr
builds on both Windows and Linux operating systems.
Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
Building with GCC on Windows using MSYS caused errors related to
macros redefinition in compile_attributes.h due to GCC using its
standard headers. Added #ifndef guards.
Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
Windows users building with MSYS2 need to provide additional include
path to the POSIX standard headers to build sof-logger with GCC.
Added this include directory when environmental variable
MSYS_INSTALL_DIR is set.
Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
Newer gcc compilers 9.1+ issue a W-char-subscripts warning when argument
type passed to isspace is not explicitly int. Added cast to int.
Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
We only want the mixin/mixout based HDA and passthrough HDMI topologies.
Delete everything else.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
The codec adapter component only uses a single config now. So remove the
runtime config kcontrol as the same kcontrol can be used for runtime
config as well.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
During pipeline reset all components remains in previous state. This
cause issue at pipeline deletion. This patch allowed to propagate state
transition to all pipeline components.
Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
When both module instances are parts of the same pipeline Unbind IPC
would be ignored by FW since FW does not support changing internal
topology of pipeline during run-time. The only way to change pipeline
topology is to delete the whole pipeline and create it in modified form.
Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
We cannot have one single pipeline going from the host copier to the DAI
copier. So split the passthrough pipeline into host and DAI pipelines.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Add gain widgets before and after the mixers in all the
mixin/mixout-based pipelines. Change the cavs-mixin-mixout-hda.conf
topology to add the mixer names for all gain widgets.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Remove the default audio formats from the gain class definition.
They should be added depending on the number of formats based on the
pipeline. Fix the gain-playback and gain-capture pipelines to add the
audio formats for the gain widgets.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
dma_copy_to_host_nowait() no longer exists and needs to be updated
Fixes commit 443b21de4b ("dma-trace: Fix potential race issue by using
blocking DMA copy")
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
This patch replaces the audio stream read/write frag based
access to source and sink by block processing based on
audio_stream_bytes_without_wrap() bytes count.
In a test with forced generic C for xtensa build processing load in
original was 324 MCPS, in optimized 309 MCPS, saving is 15 MCPS. The
load is nearly same for all formats s16/s24/s32. The base load was
very high in test due to a very long used FIR filter. The MCPS saving
should be the same for all stereo 48k streams.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This reverts commits e0ff1b16d8,
339e5ac217 and
09c69b7607. A different approach will
be used for making SOF a platform-agnostic Zephyr application.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
The copier component depends on special pcm conversion
code, which is only implemented in the generic pcm
converter. If we build SOF with IPC4 support with XCC,
the HIFI3 pcm converter is selected automatically, and
causes the issue of
undefined reference to `pcm_func_vc_count'
undefined reference to `pcm_func_vc_map'.
This patch forces the use of generic pcm converter
if build SOF with IPC4 and Zephyr.
This patch should be reverted once the HIFI3 pcm converter
counterpart is implemented.
Signed-off-by: Chao Song <chao.song@linux.intel.com>
The two components copier and base_fw are
essential to IPC4 support on SOF on Zephyr.
This patch integrates the build of the two
components to SOF build with zephyr RTOS.
Signed-off-by: Chao Song <chao.song@linux.intel.com>
The topology is useful for testing long binary control IPC and to
test equalization of headset and speaker in sof-hda-generic devices.
It adds a flat IIR and a generic FIR that creates a mild loudness
effect.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The previous patch increased the FIR length but it also triggered
a numerical issue in FIR design with long minimum phase filters. The
filter became essentially a band-stop filter and causes difficulties
in test of EQ component. Also the equalizer sounds subjectively
bad. The fix is to change the design to linear phase that always
converges.
Fixes: 0d296ce7d1
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
fixpoint math log() and log10() function. logarithm of a
number is the power or exponent by which another value
must be raised to produce an equivalent value of the given number
fix point log10(x) is a derivative of log2(x)/log2(10)
and loge(x) is log2(x)/log2(e)
Signed-off-by: Shriram Shastry <malladi.sastry@intel.com>
It is possible that that in trace_work() sof_ipc_dma_trace_posn ipc
message reaches host side sof driver before the dma_copy_to_host_nowait()
is finished. Change the dma_copy_to_host_nowait() implementation to
dma_copy_to_host() by adding DMA_COPY_BLOCKING flag to dma_copy()
command.
The flag is already there on the !defined(CONFIG_DMA_GW) version of
the function and the old name of the function was a bit misleading.
This commit changes also probe.c probe_task() so that it also uses the
new blocking DMA copy. I could not see any justification to use nowait
version there either.
Signed-off-by: Jyri Sarha <jyri.sarha@intel.com>
Add check for DMA buffer address alignment to hda_dma_set_config().
Wrongly aligned DMA buffer does not work correctly.
Signed-off-by: Jyri Sarha <jyri.sarha@intel.com>