memcpy function doesn't care about "wrap-ups"
and sample sizes which are crucial in copy
of audio signals.
Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
With this patch default preamble is set to zero
meaning KWD is activated from start, no delay.
Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
Remove unnecessary check of preamble time. Previously
it was allowing preamble time smaller than kpb buffering
time. There is no reason for such a constrain.
Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
This patch adds two new trace messages into draining
task - the amount of drained data and time needed to
drain them in milliseconds.
Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
This patch provides default parameters for newly added
detect_preamble and history_depth. Both by default are
set to max buffering time of KPB.
Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
Detector was using keyphrase_length to:
1. delay detection
2. to calculate the amount of data that shall be
drained from history buffer.
This was confusing people, therefore we use two
separate variables name with better naming.
1. history_depth -> to define default draining
request. (in bytes)
2. preamble_time -> to define delay after which
detection should be active.
Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
This patch adds new state KPB_STATE_DRAINING. In this
state kpb drains data from internal history buffer to
host sink bypassig any other component. In the same
time internal buffering is turned off.
Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
Move kpb configuration structure to user header folder to expose it to users such as applications/tools.
The configuration structure is needed to create a binary blob that allows to control the component.
Signed-off-by: WojciechX Wittbrodt <wojciechx.wittbrodt@linux.intel.com>
Move selector configuration structure to user header folder to expose it to users such as applications/tools.
The configuration structure is needed to create a binary blob that allows to control the component.
Signed-off-by: WojciechX Wittbrodt <wojciechx.wittbrodt@linux.intel.com>
Currently we don't have atomic reallocation implemented. So make
unlocked versions of malloc and balloc, so they can be used in
single locking context with brealloc and realloc.
Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
In case of multiple modules, rimage should not expect these sections
in bootloader module: .bss, .static_log_entries .fw_ready.
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
This commit updates paths of installed headers to match
new headers folders structure.
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
The idle tasks scheduler new feature enable idle
tasks to reenter themselves at some later time.
Therefore pipeline tasks needs to be updated
accordingly.
Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
Some idle task like for example KWD draining needs
significant amount of time to finish their job.
For example, to drain whole history buffer 6 miliseconds
are needed in non-synchronied mode and as much as 2100
miliseconds in synchronized mode with period 400 frames.
Therefore it is vital to exit idle task when it itself
is in *idle* state and allow other tasks to do their
job.
Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
The DMA "channel" parameter, used in many DMA API functions, is
currently only checked for "< HDA_DMA_MAX_CHANS" except for one case,
where it's also checked for ">= 0." But if a configuration step is
missed, the channel can stay at its initial value of DMA_CHAN_INVALID
which is equal to (32-bit) -1, or it can contain a negative error
code, returned by dma_channel_get(). Therefore a comparison to
HDA_DMA_MAX_CHANS doesn't catch such cases. This leads to a panic
like in issue https://github.com/thesofproject/sof/issues/1485 To
avoid such crashes make "channel" unsigned everywhere and make checks
more consistent.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Logger was aware only of debugfs entries for BYT/HSW platforms.
This commit adds debugfs entries for APL/CNL.
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
Sets preload flag only for playback streams.
Capture streams scheduled on timer no longer need
this, because new xrun handling in dai allows
for valid ppl path stop, when data is not yet
available on first timer tick.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Fixes xrun handling by moving check from callback
to copy. Check in callback wasn't making any sense,
because bytes passed there have been already calculated
based on avail/free.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Extracts more granular functions for buffer full and
buffer empty checking. It improves readability and
removes repeated code.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Adds missing check in pipeline_comp_copy for
PPL_STATUS_PATH_STOP. It fixes the issue, where
playback pipeline hasn't been able to stop copying
even with component returning such status.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Decreases PLATFORM_SSP_DELAY for cAVS platforms.
This delay is used after SSP start and before stop
to let frame and clock synchronize. It was very long,
so was decreased from 1/8 ms to 1/24 ms. Experiments
show that it's still enough for slave clock to synchronize
and to not lose first data sample.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
KPB_MAX_BUFFER_SIZE has changed therefore cmocka test
which uses this macro needs to be changed accordingly.
Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
Kpb defines like KPB_MAX_BUFFER_SIZE were calculating
buffer size only for one, fixed sampling width. Now
defines accept a parameter "sw" sampling width.
Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
This new function checks if config parameter regarding sampling
width is supported by current implementation.
Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
Reorders trace points sequence to be incremental.
Because of many changes in init code the trace points
values stopped to be logged in incremental order.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Refactors IDC sending in blocking mode to
utilize DONE interrupt instead of manually
polling for DONE bit. It allows for removal
of spinlock, which prevented longer IDC
timeouts.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Changes waiting code in arch_idc_send_msg to be
milliseconds based instead of DSP cycles based.
This aligns nicely with the rest of waiting functions.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Optimizes IDC interrupt handler by:
- Omitting currently used core.
- Omitting check for DONE irq on slave cores.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
This will add default ALIGN macro so defines which are using ALIGN
can work in main code and linker scripts using linker definition for ALIGN
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
Aligns copied trace size to DMA burst size for HD-DMA.
Previously we've copied data on the DSP side and sent
the right offset to the host, but actually if the data
wasn't aligned to the burst size, the host would read
old traces for the part of data not yet pushed to the
host.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
CMake has convention of changing relative paths to absolute
for CMAKE_* variables. It does it automatically f.e. CMAKE_C_COMPILER.
However for our tools like objcopy we have to do it manually.
It also helps with integration of CMake in some IDEs.
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
Dump the ABI header from source CSV or DSP data. This will make it
obvious if there are any ABI differences.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
This tool is generic and can be used with any binary kcontrol to
send data to/from components at runtime.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Unifies multiple different align macros spread
across the source code. Now we have ALIGN_UP and
ALIGN_DOWN macros defined in sof.h.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Changes starting sequence of DAI. Now IO interface is
started before DMA. The purpose of this change is to
allow slave interfaces to prepare their FIFOs before
DMA starts transferring to them.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Adds delay after starting SSP interface.
It allows for SSP in slave mode to nicely
synchronize with clock and frame inputs.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Adds missing stdint header, since we are using types
defined in that file. Right now format.h compiles
by accident.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Fixes cache handling for dma-trace buffer.
Current implementation wasn't fully supporting
multicore traces. This patch changes buffer
writeback invalidations after buffer write to
invalidations before read and writebacks after
write. Also removes not needed cache operations
on retrieving current traces size.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Moves static variable dropped_entries to common
dma_trace_data structure. This structure is
accessed through uncached memory region, so
all the cores don't need any additional
synchronization.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
dw-dma transfer size setting was changed in cleanup and because of that
we need to zero the ctrl_hi value before twiddling the bits.
Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>