Merge peakvol component into already existing volume component.
The main differences:
- curve duration format is in hundred of ns (ipc4) and ms (ip3);
- volume format sent by driver: Q1.31 (ipc4) and Q8.16 (ipc3);
In ipc4 case volume format is converted into Q1.23 inside firmware.
Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
Value return by ipc_wait_for_compound_msg is overriding errors
reported by previous ipc handlers like ipc4_process_module_message.
This is causing false success report visible only on traces.
Error code should be overwritten only when operations fails.
Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
Now coherent_acquire_irq() has become equivalent to
coherent_acquire(), similar for coherent_release() and
coherent_shared(). Remove the _irq version and its only user - the
buffer locking API.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Align the SOF spinlock API with Zephyr spinlock API.
Currently SOF spinlock has two locking variants: with and without
disabling local IRQs. Since taking a spinlock potentially puts the
CPU into busy-looping, periods of time for holding spinlocks should
be kept as short as possible. This also means, that usually the CPU,
holding a spinlock shouldn't be interrupted. So usually spinlocks
should be taken in atomic contexts. Therefore using the version, not
locking local IRQs should only be done when IRQs are already
disabled. This then saves several CPU cycles, avoiding reading and
writing CPU status again. However, this should be only done with
extreme care and it introduces potential for current and future bugs,
including dead-locks.
Zephyr spinlock API always disables local IRQs. This makes it simpler
and less error prone. Switching to it potentially wastes several CPU
cycles in some locations, but makes the code more robust.
This is first part of work for spinlock Zephyr alignment, subsequent
updates will align headers and associated splinlock dependecies.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
This patch changes the help print function. The print look and details
are improved. Executable behavior with option -h is fixed. Previously
the help text was printed twice.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
In order to avoid inter core communication while running
GOOGLE_RTC_AUDIO_PROCESSING, this change ensure that the speaker
processing and the amplifier feedbacks are running on the same core as
the AEC.
Signed-off-by: Lionel Koenig <lionelk@google.com>
This patch adds sound direction estimation. TDFB component updates
the sound direction control to user space. User space may control
the beam direction towards the source with help of the reported
angle.
Sound direction estimation is based on cross correlation maximums
pattern and match of theoretical propagation delays to measured
pattern. Cross correlation search is triggered by short term
level when it exceeds the estimated background noise level. An
emphasis filter is used to filter out typical low frequency noise.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch adds function cross_product_s16(). Cross product is
commonly used function in computational geometry.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The DF2T IIR core has been moved earlier to library but the
helper functions for configuring it were left to EQ component.
This patch eases use of IIR core from other components. The
file src/audio/eq_iir/iir.c is moved to src/math. There are no
changes except of remove iir.h since the contents specific
for DF2T type were merged to iir_df2t.h
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
To align with Zephyr smp.c:smp_init_top(), add the missing call to
smp_timer_init() in secondary_init() of the SOF wrapper. Also
add inline documentation why we are open-coding the function on
SOF side.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
This reverts commit 414089aa44.
Failures hit with 4core cAVS2.5 configuraions, so this has
to be reverted. We need an implementation that keeps both
Zephyr (and SOF runtime-DSP if still used) in the loop.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
This patch replaces the non efficient per sample fragment functions
with audio_stream_bytes_without_wrap() aided block processing.
The volume component MCPS is optimized from 24 MCPS to 8 MCPS. The
saving is similar in all s16, s24, s32 volume copy() functions.
The test was done in TGL-H platform with HiFi3 code version disabled
and with xt-xcc compiler.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch adds documentation to the coherent API header and cleans
up several potentially harmful operations. Specifically, it isn't a
good idea to modify memory via uncached addresses and then write back
caches, because the latter can overwrite uncached writes. It works
because there is no data in cache at that point, which also makes
that call redundant. Similarly, we are sure not to have any data in
caches when obtaining access to the memory, because otherwise our
spinlock-acquisition operation could be overwritten by a speculative
write back.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Currently there is code to power up secondary cores both
in Zephyr architecture hooks in wrapper.c, as well as in
SOF runtime-PM driver.
Some of this is necessary overlap until full replacement of
SOF runtime-PM is available. But for secondary core power up,
we can already clean up the flow and hook the Zephyr core
enable code to runtime-PM driver directly. This fixes startup
issues seen on Intel cAvS2.5 platforms.
Core power-down is left intentionally for runtime-PM driver
to handle as the related interface in Zephyr is not ready
for use yet.
BugLink: https://github.com/thesofproject/sof/issues/5018
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
The local buffer is used for copying the output samples. So, its size
must be calculated based on the out_buff_size set by the module instead
of the in_buff_size.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
buff_periods is calculated based on the lower of the two, period_bytes
or in_buff_size. So deep_buffer_bytes must also be set based on the MIN
of the two values.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Remove the default buff_periods and the check for period_bytes !=
in_buff_size. buff_periods will evaluate to 2 if period_bytes and
in_buff_size are equal.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
config must be the first field in copier_data structure, because function
ipc4_create_buffer casts components private data as ipc4_base_module_cfg.
Signed-off-by: Adrian Warecki <adrianx.warecki@intel.com>
This will be used to assemble all the fragments of the configuration
data and load it.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
This will be used to classify the fragments when sending/retrieving
configuration data.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Modify the signatures of waves_effect_allocate() and
waves_effect_buffers() to pass the pointer to struct processing_module
as input.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
As part of the 3rd part module API changes, change the signature of the
free op in the module interface API to pass the pointer to struct
processing_module instead of comp_dev. Also. modify the signature of the
module_free_all_memory() to pass struct processing_module pointer as
input.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
As part of the 3rd part module API changes, change the signature of the
reset op in the module interface API to pass the pointer to struct
processing_module instead of comp_dev.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
As part of the 3rd part module API changes, change the signature of the
prepare op in the module interface API to pass the pointer to struct
processing_module instead of comp_dev.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
As part of the 3rd part module API changes, change the signature of the
init op in the module interface API to pass the pointer to struct
processing_module instead of comp_dev.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Add a pointer to comp_dev in struct processing_module. This is a
temporary change that is needed for trace messages in the module
implementation. This should be removed when the trace API is updated to
not need the dev pointer.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>