memcpy_s has wrong check condition for
overlapping sections. The copy from adjacent memory
bloks will result in dsp panic while it should be
allowed. This patch fixes the issue for cmocka
tests.
Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
arch_memcpy_s has wrong check condition for
overlapping sections. The copy from adjacent memory
bloks will result in dsp panic while it should be
allowed. This patch fixes the issue for xtensa
architecture.
Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
arch_memcpy_s has wrong check condition for
overlapping sections. The copy from adjacent memory
bloks will result in dsp panic while it should be
allowed. This patch fixes the issue for host
architecture.
Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
It provides better memory/cache performance since it aligns with memory IO burst size and cache line size
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
It provides better memory/cache performance since it aligns with memory IO burst size and cache line size
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
It provides better memory/cache performance since it aligns with memory IO burst size and cache line size
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
The raw capture from digital microphones contain some DC signal
in the beginning. The DC compensation filter is set to be quite slow
to enable capturing lowest audio frequencies. The unmute gain ramp
is used in DMIC driver to conceal the DC signal. The required time
for clean looking start is is microphone model and platform dependent.
Also since not all applications are sensitive to DC waveform it is useful
to specify the ramp length in topology.
This patch adds to DMIC driver feature to define the unmute ramp
length in milliseconds. If the value from IPC is zero the existing
hard coded 400 ms long ramp is used. If the value is non-zero and
within min/max 10ms/1000ms limits the topology defined ramp length is
used.
The code uses the db2lin_fixed() function to convert the dB step
to a linear gain update coefficient. Also the hardcoded ramp definition
is simplified to use dB initial gain value and length in milliseconds
instead of magic looking numbers.
This patch also contains ABI minor version increase to 8.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch adds to all DMIC related topologies the new token
SOF_TKN_INTEL_DMIC_UNMUTE_RAMP_TIME_MS. The value is set to 400
to correspond to 400 milliseconds long unmute ramp time. The
topology defined unmute will override the firmware internal
hard coded value if it is set in topology.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch adds two functions: db2lin_fixed() and exp_fixed().
The first can convert fractional format dB values to linear within
range -100..+66 dB. The latter is a more generic fractional e^x
function. See the code comments for used Qx.y fractional formats
and limitations.
The implementation for exp(x) core function is based on first 11 terms
of Taylor series approximation for |x| < 2. The larger values of x
are computed with help of rule exp(x) = exp(x/2) * exp(x/2). It
achieves sufficient accuracy for volume control type of applications.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch fixes the overflow that happened with term (1 << qy)
in the macro with qy set to 31. Casting to int64_t avoids the
macro internal overflow with all fractional 32 bit formats.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
If all symbols in menu are not selectable if some
other symbol is not present, then there is no point
in showing that menu.
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
Removes min_bytes argument from comp_underrun and comp_overrun
methods. With the current way of copying as much data as possible
min_bytes doesn't say anything
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Removes checks for xruns in all components besides
dai. There is no need to check for underrun and
overrun in every component, because no free or avail
space in buffer doesn't mean that data is not continuous.
We can have processing modules inside the pipeline, which
work on different frame sizes than rest of the pipe. In
such cases we will detect false xrun. In the future we
can think about adding xruns checks to the components,
which will be connection points for multiple pipelines
e.g. separate pipe with the mixer in the beginning.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Process of documentation building and publishing requires
3 repositories. It is troublesome for people that are responsible
f.e. only for documentation publishing. It makes the process
easier by turning some easy to break steps from publisher instructions
into a script.
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
Default build option for APL is UP so it should use default CORE_COUNT value (1) to not waste memory
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
Removes deprecated comment from boot_loader.
Memory window is enabled by ROM even before
FW is loaded, so there is no need for usage
of additional registers.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Removes period_bytes from dai_data structure as
it's only needed in dai_params function. No need
to store it globally.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Splits comp_set_period_bytes method to two separate
functions: comp_frame_fmt and comp_period_bytes.
Setting these two parameters in one function wasn't
intuitive nor atomic enough. Also setting value typed
variables through reference isn't pretty.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Removes not needed check from host component.
It was supposed to detect if there is not enough
avail/free data, but since we've switched to
host copy on buffer callback this check is deprecated.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
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>