Changes preload flow for host component using HDA-DMA.
Instead of waiting for DMA status for a limited amount
of time, it's better to just reschedule the pipeline
and check again. At least this time if the status
won't be set, we will know it's rather HW issue than
too small delay.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
This patch adds feature to retrieve volume scale min and max from
IPC if the parameters are set. Volume min and max are now used
with ramp time parameter to compute gain ramp step to achieve
constant rate ramps with any volume scale. If the min and max are
zeros the previous FW operation is preserved.
Previously the firmware did not know the volume range so the
volume code uses in volume request a check to prevent exceeding
ramp length specified in topology by step size re-adjust. It was
done to prevent very long ramps to happen with volume scales with
large gain. However the smaller transitions remained longer than
necessary. This patch fixes that last remaining issue.
The ramp length check code is preserved to be compatible with
kernel versions those do not provide the min and max volume scale
values. When provided the check code has no impact.
The patch includes some cosmetic re-arranging of volume comp data
struct fields in addition to adding new the fields vol_ramp_range,
vol_min, and vol_max.
Also error traces were added to notify if the volume min/max or
request has been limited to fit to supported volume range.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
It is better to include features based on feature Kconfig symbols,
instead of hardcoding them per platform.
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
Add INTEL config to be able to build Intel drivers only for Intel platform.
CMake should go into intel folder if it's requested explicitly.
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
DW folder shouldn't be included by default.
Designware features should be enabled explicitly.
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
Removes not needed check for DMA_CB_STATUS_END
in hda_dma_post_copy. HD-DMA is not driven using
interrupts, so there is no need to asynchronously
stop the transfer.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Refactors DMA callback data by using dedicated
callback struct along with callback status enum.
Previously field size was used to pass status
from component to DMA, which was misleading
and could cause potential issues e.g. value
0 was a valid number of bytes, but it was
also a value for DMA_RELOAD_END definition.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
This will optimize memory usage and introduces two significant optimizations:
> Separate the memory (heaps, stack) by cores so if we will turn off a specific core we can also turn off all memory of this core.
> Remove fixed defines and gaps, previously stack was at fixed position: end of memory and buffer heap was everything between stack and fw. Now everything will be packed at sof_fw memory segment and takes only this memory which is really needed, everything else we can turn off.
Changelog:
BSS section now includes heaps and stack
Removed many heap fixed position defines
Removed gap before fw text section
memmap init is using real linker positions for heaps
Temporary stack for boot_ldr placed in heap_hp_buffer (safe)
sof fw max_size and segment limited to memory configured by memory banks count
Using new macro to stack init per core
Stack is no longer a one big block for all cores (core_count*stack_size)
System_runtime_heap and system_heap are no longer a one big block for all cores
For suecreek memory it will also introduce similar changes previously introduced
in other platforms
(One shared memory block SOF_FW for SOF_TEXT, SOF_DATA and SOF_BSS sections
Moved fw_ready near to .rodata and .data)
Memory layout for every slave core aligned to hw memory bank:
--align to memory bank--
system_heap
system_runtime_heap
stack
--align to memory bank--
next slave core..
Similar layout applies to master core
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
This will add new macro to setup stack with a new memory layout when memory is separated by core
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
This will replace a fixed position define with a real linker position, which allows to set heap position by linker
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
It will fix symbol overwriting, _system_heap_start was already used in system_heap section
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
It will fix symbol overwriting, _system_heap_start was already used in system_heap section
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
It will fix symbol overwriting _system_heap_start was already used in system_heap section
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
KPB source code started to use timer related features
therefore cmocka tests need to include these
dependencies.
Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
After detection of keyword we shall stop further copy to selector
pipeline. We do this in regular copy() function so there is no need
to do it also in init_draining() function.
Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
Kpb rt_sink is confusing and was replaced with
sel_sink which stands for selector sink - the component
to which KPB copies during BUFFERING state. Likewise
the cli_sink was replaced to host_sink clearly stating
that we copy out of DSP.
Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
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>