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>
Force DMA buffer to be correctly aligned. If the buffer is only
64-byte aligned, when using hda-dma, then the last 64-bytes of the DMA
buffer is not transferred correctly to host side.
Signed-off-by: Jyri Sarha <jyri.sarha@intel.com>
The topologies sof-hda-generic were earlier fixed to use short
20 ms ramp because of nearly inaudible UI blip tones with 250 us
ramp. Some changes to topologies build m4 macros have brought
back the long ramp.
This patch fixes the playback ramps to use 20 ms long transitions.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch avoids the issue that topology .conf file after m4
processing can contain multiple same name objects playback_pga_conf
for volume component tokens with possibly different settings. Alsatplg
does not error from such input and it's not defined which impacs
topology binary.
The new naming is pga_conf_X and and_pga_tokens_X where X is the
pipeline number.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>