Commit Graph

7736 Commits

Author SHA1 Message Date
Marc Herbert 425a200113 zephyr: replace obsolete README section with link to sof-docs
Replaced with
https://thesofproject.github.io/latest/getting_started/build-guide/build-with-zephyr.html

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-02-07 10:43:28 +00:00
Bartosz Kokoszko cf04ada323 volume: merge volume (ipc3) and peakvol (ipc4) component
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>
2022-02-04 17:12:37 +00:00
Tomasz Leman 7cd8d06dc5 ipc4: handler: fix for overwriting error code
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>
2022-02-04 15:54:31 +00:00
Ranjani Sridharan 849da9d0af topology2: gain: Fix the default gain value
Should be 0x7fffffff.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-04 15:01:30 +00:00
Ranjani Sridharan cb5d769a84 topology2: copier: remove format for copier widget objects
It is never used.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-04 15:01:30 +00:00
Ranjani Sridharan 80bf84c00c topoogy2: tokens: fix the token ID for out_sample_type
Should be 1938.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-04 15:01:30 +00:00
Guennadi Liakhovetski 2b620f4da6 coherent: remove now redundant _irq version of functions
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>
2022-02-04 12:09:30 +00:00
Liam Girdwood 52b33a23b8 zephyr: spinlock: Align spinlock API to use Zephyr API
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>
2022-02-04 12:09:30 +00:00
Alibek Omarov bb0641c789 topology1: Add sample topology for i.MX8MP boards with wm8904 codec
Tested to work on Variscite Symphony-Board v1.3 with VAR-SOM-MX8M-PLUS

Signed-off-by: Alibek Omarov <a1ba.omarov@gmail.com>
2022-02-04 11:03:07 +00:00
Seppo Ingalsuo 291706325c Tools: Testbench: Clean up help text and add missing help items
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>
2022-02-04 11:02:25 +00:00
Lionel Koenig 52358064fe topology: Run spk pipelines on same core as AEC
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>
2022-02-04 10:04:30 +00:00
Seppo Ingalsuo f753241cf1 Audio: TDFB: Add note how to updata the settings data files
Comment text is added to tdfb.c to help find the settings
generator shell script.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-02-04 10:02:55 +00:00
Seppo Ingalsuo 715c89433a Audio: TDFB: Track sound direction of arrival
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>
2022-02-04 10:02:55 +00:00
Seppo Ingalsuo 0a5a0b5049 Math: Add cross product function to sof/math/numbers.h
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>
2022-02-04 10:02:55 +00:00
Seppo Ingalsuo beb0610148 Math: IIR: Move IIR DF2T initialize helpers to library
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>
2022-02-04 10:02:55 +00:00
Kai Vehmanen 6363a86309 zephyr: add missing call to smp_timer_init to secondary core init
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>
2022-02-04 09:33:56 +00:00
Kai Vehmanen 10f4669ccc Revert "zephyr: implement arch_cpu_disable_core()"
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>
2022-02-02 15:48:30 +00:00
Seppo Ingalsuo bc11c6e7c8 Audio: Volume: Replace read/write frag buffers in generic C version
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>
2022-02-02 15:44:53 +00:00
Guennadi Liakhovetski 2b4d559d44 coherent: (cosmetic) align backslashes
Align several line-continuation backslashes in macro definitions.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-02-02 14:22:51 +00:00
Guennadi Liakhovetski e3eda2213b coherent: tighten up the API
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>
2022-02-02 14:22:51 +00:00
Kai Vehmanen 378d7b7822 zephyr: always use Zephyr interface to power up secondary cores
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>
2022-02-02 10:40:42 +00:00
Ranjani Sridharan 8c11871ca7 codec_adapter: fix calculation of local buffer size
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>
2022-02-02 10:24:27 +00:00
Ranjani Sridharan 55fc673634 codec_adapter: fix deep_buffer_bytes calculation
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>
2022-02-02 10:24:27 +00:00
Ranjani Sridharan efc0a1478b codec_adapter: simplify deep_buffer_bytes calculation
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>
2022-02-02 10:24:27 +00:00
Adrian Warecki 3056ce3005 copier: Added important comment about field position in structure
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>
2022-02-02 10:08:57 +00:00
Adrian Warecki a892e0f66c audio_stream: Buffer manipulation asserts
Added asserts witch helped me debug the code.

Signed-off-by: Adrian Warecki <adrianx.warecki@intel.com>
2022-02-02 10:08:57 +00:00
Ranjani Sridharan 499b4f554c module_interface: Add the set/get_processing_mode API's
These will be used to set/get the processing mode for the modules.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-02 10:00:17 +00:00
Ranjani Sridharan a992ce7f4c codec_adapter: Introduce new enum for processing modes
This will be used to set the processing mode for the modules.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-02 10:00:17 +00:00
Ranjani Sridharan 91893750f7 module_interface: remove the apply_config op
The set_configuration op replaces this one.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-02 10:00:17 +00:00
Ranjani Sridharan b231a60b08 codec_adapter: Use the set_configuration op in codec_adapter_set_params
Use the new set_configuration op in codec_adapter_set_params().

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-02 10:00:17 +00:00
Ranjani Sridharan 367e305abc codec_adapter: waves: Define set_configuration
Define the set_configuration op in the module interface.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-02 10:00:17 +00:00
Ranjani Sridharan 4a032f29bc codec_adapter: dts: Define set_configuration
Define the set_configuration op in the module interface.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-02 10:00:17 +00:00
Ranjani Sridharan c6892be67e codec_adapter: cadence: Define set_configuration
Define the set_configuration op in the module interface.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-02 10:00:17 +00:00
Ranjani Sridharan 3f95f6a600 module_interface: Add a common helper for set_configuration
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>
2022-02-02 10:00:17 +00:00
Ranjani Sridharan 80ef5bb5e0 module_interface: Introduce get_configuration and set_configuration ops
These ops will be used to set or retrieve the module configuration.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-02 10:00:17 +00:00
Ranjani Sridharan 2f83e49095 module_interface: Introduce enum for config fragment position
This will be used to classify the fragments when sending/retrieving
configuration data.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-02 10:00:17 +00:00
Ranjani Sridharan 78a448605e codec_adapter: modify the signature of module_free_memory()
To pass struct processing_module pointer.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-02 10:00:17 +00:00
Ranjani Sridharan 70158f93d3 codec_adapter: modify the signature of module_allocate_memory()
Pass the pointer to struct processing module instead of comp_dev.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-02 10:00:17 +00:00
Ranjani Sridharan 3f2f149b9c codec_adapter: waves: modify the signatures of a couple of functions
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>
2022-02-02 10:00:17 +00:00
Ranjani Sridharan 40f2e2f7e4 codec_adapter: dts: change the memory allocation context
To pass the pointer to struct processing_module.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-02 10:00:17 +00:00
Ranjani Sridharan 4df1382692 codec_adapter: cadence: modify the signature of init_memory_tables()
To pass the struct processing_module pointer as input.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-02 10:00:17 +00:00
Ranjani Sridharan 0943b4da2d module_interface: Change the signature of free API
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>
2022-02-02 10:00:17 +00:00
Ranjani Sridharan f0efa20421 module_interface: Change the signature of reset API
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>
2022-02-02 10:00:17 +00:00
Ranjani Sridharan 438b310403 module_interface: Change the signature of prepare API
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>
2022-02-02 10:00:17 +00:00
Ranjani Sridharan 90ecd4f137 module_interface: Change the signature of init API
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>
2022-02-02 10:00:17 +00:00
Ranjani Sridharan bb305328d6 codec_adapter: Add pointer to comp_dev in struct processing_module
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>
2022-02-02 10:00:17 +00:00
Kai Vehmanen 414089aa44 zephyr: implement arch_cpu_disable_core()
Add implementation of secondary core disable with a call
to SOF runtime-PM framework.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-02-01 15:25:48 +00:00
Liam Girdwood 620142bdcc cmakefile: audio: enable vectorisation
Enable autovectorisation for audio processing modules for GCC on x86.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-01-31 16:16:27 +00:00
Liam Girdwood 42f70ecffe testbench: log any errors freeing components.
let the user know if we fail to free a buffer, component or pipeline.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-01-31 16:16:27 +00:00
Liam Girdwood fb46b5cbae ipc: common: log any failure when freeing compdev
Let the user know if we have any failures freeing a compdev.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-01-31 16:16:27 +00:00