Commit Graph

8061 Commits

Author SHA1 Message Date
Ranjani Sridharan 9983ab67a9 topology2: cavs-gain: Add PGA to control names
This is needed for sof-test to identify the controls.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-09 21:50:11 +00:00
Adrian Bonislawski 33ec780df2 ipc4: add updwmix module support
Up Down Mixer module
Conversions supported:
Up/Downmixing for stereo output:
	1, 2, 2.1, 3.0, 3.1, Quatro, 4.0, 5.0, 5.1, 7.1 -> 2
Upmixing for multichannel output:
	1, 2 -> 5.1
	2 -> 7.1
Downmixing for mono output:
	4.0, Quatro, 3.1,
	2 -> 1
At initial release only hifi3 version is supported.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2022-02-09 14:35:18 +00:00
Seppo Ingalsuo e5d95d1dd3 Tools: Topology: Change playback volume ramp to 20 us
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>
2022-02-09 10:19:48 +00:00
Seppo Ingalsuo b3b937eb3d Tools: Topology: Make PGA token objects unique
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>
2022-02-09 10:19:48 +00:00
Yong Zhi 7fdd59844d topology2: cavs-nocodec: remove dai_index for copier widget
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>
2022-02-09 10:01:19 +00:00
Seppo Ingalsuo e6f677959b Tools: Test: Audio: Fix typos in tools/test/audio/*
This patch fixes the typos in audio test Matlab code.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-02-09 09:52:17 +00:00
Seppo Ingalsuo ae4c30207e Tools: Tune: Fix typos tools/tune/*
This patch fixes the typos in the setup tools Matlab code.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-02-09 09:52:17 +00:00
Seppo Ingalsuo b38b746607 Audio: Fix spelling typos in src/audio/*
This patch addresses the typos in audio processing components.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-02-09 09:52:17 +00:00
Kai Vehmanen e20384eb6a testbench: add option to override CPU core mapping
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>
2022-02-09 09:44:34 +00:00
Guennadi Liakhovetski a61ff1fe63 buffer: use a mutex for locking under Zephyr
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>
2022-02-08 13:46:45 +00:00
Guennadi Liakhovetski a3d9b029be kpb: use a mutex under Zephyr
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>
2022-02-08 13:46:45 +00:00
Guennadi Liakhovetski 81883871b6 coherent: add locking variants for thread context
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>
2022-02-08 13:46:45 +00:00
Seppo Ingalsuo 84c9033fea Tools: Test: Audio: Add sound direction test for TDFB
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>
2022-02-08 12:34:32 +00:00
Brent Lu cb755f879d comp: re-link buffers in make_shared
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>
2022-02-08 10:48:53 +00:00
Liam Girdwood 9ad987e7fd testbench: return error up the stack.
Dont exit() but return the error up the stack for proper handling.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-02-08 10:43:18 +00:00
Liam Girdwood 0cec50a976 testbench: further refactor of per pipeline data
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>
2022-02-08 10:43:18 +00:00
Liam Girdwood ac12b4a748 testbench: print a meaningful error if scheduling comp is not found
Let the user know if the scheduling component is missing and handle it.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-02-08 10:43:18 +00:00
Liam Girdwood 6f43299f3b testbench: take the global data off the stack.
Testbench prm is global data used by many thread. Take it off the stack.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-02-08 10:43:18 +00:00
Liam Girdwood 480d1ad168 testbench: improve error messages in topology load
Give users more information when failures occur.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-02-08 10:43:18 +00:00
Liam Girdwood c3adfcecc7 testbench: add support for mixer
Add mixer support to the testbench

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-02-08 10:43:18 +00:00
balapati 47ef306bf7 amd: renoir: Add lock for synchronization b/w host and DSP
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>
2022-02-08 09:28:18 +00:00
Ranjani Sridharan 1303c1a233 topology2: cavs-gain-hda: Add 32-bit support
Add 32-bit support in PCM capabilities.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-08 09:26:38 +00:00
Seppo Ingalsuo 4a2d69b50b Tools: Topology: Updated TDFB macro files
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>
2022-02-08 09:14:20 +00:00
Marc Herbert 69422bfd6c rimage: update to January 26th version ee5c3e1deb
Update rimage from version 0f64a20183 to ee5c3e1deb

ee5c3e1deb (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>
2022-02-08 09:11:57 +00:00
Tinghan Shen 99b4bdffd2 drivers: mediatek: interrupt: fix build error of spinlock API
Fix the build error by using the new SOF spinlock API.

Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>
2022-02-07 15:18:35 +00:00
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