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>
When generating the tplg, copier inherits its dai_index
from the parent DAI object, since there is no need to overwrite
dai_index with different value, let's remove them from top level conf.
Signed-off-by: Yong Zhi <yong.zhi@intel.com>
Add option to override how a core id, specified in SOF topology, is
mapped to host core. This allows to map a multithreaded pipeline
execution to specific range of host CPUs.
Implement the option via environment variable "SOF_HOST_CORE0", which is
understood by the CONFIG_LIBRARY implementation of ll-scheduler.
Document the usage to testbench help. mapping of DSP core ids specified
SOF_HOST_CORE
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Buffers are never handled from atomic context. Use the _thread
variant of the coherent API for them to use a mutex under Zephyr.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
KPB is using a lock to protect its buffers. That lock is taken in two
contexts: in the KPB draining task and in the pipeline task, that it
notifying KPB to drain buffers. Under Zephyr both these contexts
are running in thread context. This allows us to use a mutex under
Zephyr for this lock.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
When used from thread context the coherent API can use mutexes for
locking to avoid unnecessarily disabling interrupts.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
This patch adds Matlab script tdfb_direction_test.m. The test
simulates acoustical microphone array capture with 360 degrees
rotated noise source. The test topologies build adds an array
identifier to component name in topology file name. That
allows the scripts to simulate with several arrays. Now a
basic 2 mic array (no array suffix, just tdfb), 4 mic line,
and 8 mic circular are tested. Test pass/fail is so far only
visual check from plot.
The existing tdfb_test.c is extended to perform test with the
three test array configurations.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
After moving component to a new memory location, not only source and
sink lists need to re-link but also the buffers which already been
connected to this component.
Signed-off-by: Brent Lu <brent.lu@intel.com>
The testbench currently has a global structure that contains
per topology and per pipeline data. Refactor to move data to the
most appropriate structure for use.
This is not the final fix, further refactoring is needed.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Add hardware semaphore lock before accessing trigger
bits to achieve proper synchronization between host and
DSP during IPC communication.
Note: Same hardware lock is implemented in amd host driver.
Signed-off-by: balapati <balakishore.pati@amd.com>
The tdfb_controls.m4 is changed for better 15 degree control enum
spacing for beam direction. The file is with this change dedicated
for line arrays with physical limitation to -90 to +90 degrees that
is just achievable with 16 max. enum values.
The new tdfb_controls360.m4 uses the previous 30 degree spacing for
360 degrees arrays such as circular. The pipeline macros for 360
degrees are added to pipelines macros. The difference is only include
of 360 degrees controls version.
The topology development CMakeList.txt is changed to build topologies
with TDFB with single dual mono -90 to +90 degree angle steerable
beam. The stereo dual beam setup files are preserved and updated but
currently used only for testbench test for more complex configuration.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Update rimage from version 0f64a20183 to ee5c3e1debee5c3e1deb (origin/main) Added handling of OpenSSL on Windows with MSYS2
1589641903 Fixed warning of wrong variable type in fprintf
d0062122a8 Fix confusion in headers between uint8_t arrays and strings
d855fbfe7c Remove unconditional "(1 || verbose)" debug hack in cavs25
ecb6a66932 Update to C99 standard to match SOF. Silenced warning \
generated by newest GCC compiler related to int cast of \
char typed values that may result in negative values. Syntax \
fix in linkage of crypto library to more generic approach.
ce69d7bad8 adsp_config: fix invalid format specifier This patch fixes \
an invalid format specifier that causes a numeric value to \
be interpreted as a string, resulting in an Segmentation \
fault.
8753a9e162 Remove unused declaration global platform specific manifests
3b4b1429b0 rimage: fix openssl 1.0 support
23a53ac8b6 cse: fix signed integer overflow
32052add99 remove x from getopt
0f64a20183 (HEAD) manifest: fix buffer init in resign
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
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>