Commit Graph

11624 Commits

Author SHA1 Message Date
Andy Ross 9ac160b879 audio_stream: Rename/redocument audio_stream_set_align
After recent changes, the audio_stream_init_alignment_constants()
routine isn't an "init" step anymore, it sets requirements and can be
called at any time.  Rename it to "audio_stream_set_align()" to better
capture its behavior, and rework the documentation to make it clearer
how it works.

Signed-off-by: Andy Ross <andyross@google.com>
2024-01-09 14:51:55 +00:00
Andy Ross fec9e990e5 various components: Remove default/stub init_alignment_constants usage
Traditionally audio_stream has failed to initialize its computed
alignment fields, forcing components to do this themselves even when
they don't actually have special alignment requirements.

Remove all the code that was merely setting default values, leaving
only a handful of spots with specialr equirements (e.g. eq/area need
to treat pairs of samples, a few others have HiFi-optimized variants
which need SIMD alignment).

Signed-off-by: Andy Ross <andyross@google.com>
2024-01-09 14:51:55 +00:00
Andy Ross 4175ac7ad0 audio_stream: Persist requirements and lazy-recalculate alignment
As specified, this function was a bit of a booby trap: it has to be
called exactly once, after all other setup that modifies frame size
has been done.  If it is called in the wrong order, or not at all, any
consumers of the frame alignment API on this stream will see garbage
data in the computed fields.  That's way too much complexity for the
component code that needs to use this tool, especially as the impact
is not in the component itself (e.g. it's a downstream copier widget
with SIMD code that fails).

Instead, preserve the two requirements set by this function in the
audio_stream struct and recompute them any time any of the upstream
values change.  That allows this to be safely used from any context.

There's a mild complexity with audio_sink/source layer, which is
written to directly modify the format (it keeps a pointer into
audio_stream of its own) without going through the audio_stream API
itself.  There, the framework gives us "on_audio_format_set()"
callbacks on source and sink, so implement it there.

This is a partial fix for Issue #8639

Signed-off-by: Andy Ross <andyross@google.com>
2024-01-09 14:51:55 +00:00
Andy Ross d8edb5e566 audio_stream: refactor: Move init_alignment_constants to C file
audio_stream_init_alignment_constants() isn't a particularly small
function, isn't used in performance-sensitive contexts, and doesn't
really belong in a header.  Move to audio_stream.c for hygiene, and
because it's about to be modified.

Also move the depended-on function audio_stream_frame_align_get(), and
(as it has no consumers outside of audio_stream) remove its
declaration from the header.

Signed-off-by: Andy Ross <andyross@google.com>
2024-01-09 14:51:55 +00:00
Tomasz Leman 2cc63f239e west.yml: update zephyr to d7af6f37103
Total of 366 commits.

Changes include:

d7af6f37103 intel_adsp: ipc: pm action in busy state
61cb7d43580 adsp: hda: accept 16 byte alignment for HDA buffer size
4ae558c505b kernel: work: Fix race in workqueue thread
debb9f63523 xtensa: dc233c: force invalidating TLBs during page table swap
fa25c0b0b88 xtensa: mmu: invalidate mem domain TLBs during page table swap
d1f3f863f14 soc/xtensa/intel_adsp: fix interrupts typo

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2024-01-09 15:10:48 +02:00
Rander Wang e89f21e181 board: enable 64 bits timestamp support on intel platforms
TGL, TGL-H and ACE platforms will use 64 bits timestamp.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2024-01-08 14:23:15 +00:00
Rander Wang 76b0979c64 base_fw: sync time between host and fw for logging
It is a general implementation for logging and it doesn't use intel
audio hardware feature like ART counter. 64bits timestamp is needed
for accuracy since the timestamp used by host is beyond 32bits in most
cases.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2024-01-08 14:23:15 +00:00
Rander Wang 09ac2f01e9 base_fw: convert dsp hw cycle to dsp time
Dsp time is in format of micro second, not hw cycle.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2024-01-08 14:23:15 +00:00
Peter Ujfalusi 4bb48758ad topology2: Remove redundant DEEPBUFFER_FW_DMA_MS=100 settings
The default for DEEPBUFFER_FW_DMA_MS is 100, remove the
DEEPBUFFER_FW_DMA_MS parameter set for individual topologies when the value
set is also 100

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2024-01-08 14:19:50 +00:00
Peter Ujfalusi 80f283de0c topology2: Mark DeepBuffer D0I3 compatible by default
The DeepBuffer stream is D0I3 compatible for some time now on all IPC4
platforms, The CAVS2.5 topologies just did not got updated.

Swap the default for the DEEPBUFFER_D0I3_COMPATIBLE to true.
New, experimental platforms can change this if needed until the feature is
verified.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2024-01-08 14:19:50 +00:00
shastry 3ed4ddd02f Audio: DRC: Use fast exponent functions
The exp_fixed() function is replaced by fast sofm_exp_fixed()
and sofm_db2lin() functions. It saves 40 MCPS, from 123 to 83 MCPS
in a test run in TGL platform.

Signed-off-by: shastry <malladi.sastry@intel.com>
2024-01-08 13:54:00 +00:00
Seppo Ingalsuo 8852db8b6c Zephyr: Patch Zephyr CMakeLists with exponential source files
In Zephyr CMakeLists, add exponential source files to facilitate
the compilation of math C and HiFi code.

Signed-off-by: shastry <malladi.sastry@intel.com>
2024-01-08 13:54:00 +00:00
Seppo Ingalsuo 2befdac3ae Math: Exp: Add functions sofm_exp_fixed and sofm_db2lin
This change allows the fast exponent library to replace
the decibels library for applications like DRC where exponent
function is used in hot code parts.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Signed-off-by: shastry <malladi.sastry@intel.com>
2024-01-08 13:54:00 +00:00
shastry 7a4f7c25df Math: Exp: Fix warning: incompatible pointer type initialization.
Unused variables from HiFi4/5 were reshuffled and placed in order
to use HiFi3 code. If the variable 'ret' is used uninitialized
whenever the 'if' condition is false, set it to false.

Signed-off-by: shastry <malladi.sastry@intel.com>
2024-01-08 13:54:00 +00:00
shastry 09c4a5005a Math: Exp: Rename and move common macros for generic and HiFi
The macros are moved to header file. There are no functional changes.

Signed-off-by: shastry <malladi.sastry@intel.com>
2024-01-08 13:54:00 +00:00
Andy Ross e802aa7b49 zephyr: Update GOOGLE_RTC_AUDIO_PROCESSING
Unbreak the Zephyr build when this is enabled, and add the needed bits
to produce a working executable.

This is mostly just a recapitulation of the existing integration,
which means that it's manually pulling in bits from the Cadence
toolchain it needs.  SOF isn't yet using the Zephyr C++ integration
(which isn't xt-clang aware yet), nor does it really want to as SOF
itself includes no such code.  Zephyr doesn't have a "C++ binary
linkage only" feature yet.

Signed-off-by: Andy Ross <andyross@google.com>
2024-01-08 11:03:07 +02:00
Andy Ross b2909e976d zephyr/alloc: Add newlib-style allocator stub for C++ builds
This is a weak stub for the Cadence libc's allocator (which is just a
newlib build).  It's traditionally been provided like this in SOF for
the benefit of C++ code where the standard library needs to link to a
working malloc() even if it will never call it.

Longer term this should be integrated as a working allocator, either
unified with the one here or in the Zephyr libc layer.  Zephyr already
provides a newlib-compatible _sbrk_r(), we just have to tell it to use
it when linking against Cadence libc.

Signed-off-by: Andy Ross <andyross@google.com>
2024-01-08 11:03:07 +02:00
Andrula Song dae9214e37 Topology: Topology2: Add sof-hda-benchmark-src24/16-<platform>
This patch adds build of hda-generic development topologies to
test SRC component with s24/16 format.

Signed-off-by: Andrula Song <andrula.song@intel.com>
2024-01-08 10:47:30 +02:00
Andrula Song 344778384a Tools: Topology2: Add more specific src format .conf files
Add more s24 and s16 format src .conf files. These files
have the similar function as s32 files.

Signed-off-by: Andrula Song <andrula.song@intel.com>
2024-01-08 10:47:30 +02:00
Chao Song 874eda7ca8 Topology2: Add sof-lnl-rt712-l2-rt1712-l3 topology
This patch adds the topology for LNL RVP with rt712
multiple function codec.

Signed-off-by: Chao Song <chao.song@linux.intel.com>
2024-01-05 13:15:49 +02:00
Marc Herbert 0698fa334a .github/sparse: switch sparse version back to the upstream main branch
This should work now that Guennadi's endianness fix 98b20341967 has been
merged.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-01-04 15:32:05 +00:00
Marc Herbert 652a393e6d .github/sparse: upgrade to checkout@v4 and switch to filter: 'tree:0'
`fetch-depth: 0` fixes git describe while `tree:0` keeps things fast.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-01-04 15:32:05 +00:00
Andrula Song 1c33c4e1b7 Topology: Topology2: Add sof-hda-benchmark-src32-<platform>
This patch adds build of hda-generic development topologies to
test SRC component with s32 format.

Signed-off-by: Andrula Song <andrula.song@intel.com>
2024-01-04 15:31:26 +00:00
Baofeng Tian 694053b79e Testbench: use macro replace immediate number
Direct numbers are hard to know what exactly means, it
actually represent log error level print, use macro to replace
it.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2024-01-04 13:48:16 +00:00
Baofeng Tian 28e065258f audio: crossover: split out ipc3 and ipc4 specific code
This is a clean up, purpose is declutter headers, toml files,
Readme.md etc per module basis, since today everything is
scattered in current code base.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2024-01-04 13:43:24 +00:00
Baofeng Tian cfa5a2cbd6 Crossover: move some inline functions to header file
This is a clean up, purpose is declutter headers, toml files,
Readme.md etc per module basis, since today everything is scattered
in current code base.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2024-01-04 13:43:24 +00:00
Baofeng Tian 990c253e6f crossover: move header file to module folder
This is a clean up, purpose is declutter headers, toml files,
Readme.md etc per module basis, since today everything is scattered
in current code base.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2024-01-04 13:43:24 +00:00
Baofeng Tian aee89ccf87 Audio: crossover: create share header file for crossover and multiband DRC
Multiband DRC requires crossover functionality to cover crossover
specific process, previously, these information defined in crossover
specific directory, now, create a new shared header file for common
information shared both in crossover and multiband DRC.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2024-01-04 13:43:24 +00:00
Yong Zhi 1f3cf75a1b topology2: cavs-rt5682: Assign RTC_AEC to secondary core
Run RTC_AEC module on core 2 to balance workloads.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2024-01-04 15:27:16 +02:00
Serhiy Katsyuba 9315ada541 ipc4: mixin/mixout: Modify .prepare() to use sink/source API
Modification of mixin/mixout .prepare() handler to use sink/source API.

Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
2024-01-03 13:09:22 +02:00
Serhiy Katsyuba 61b14a56c6 ipc4: mixin/mixout: Remove redundant buf size check
The removed code may falsely fail for freq like 44.1 kHz.

Also, we generally do not check for sufficient buffer size in module
.prepare() handler. That should be/is done elsewhere. No need to do
the exception for mixout component.

Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
2024-01-03 13:09:22 +02:00
Serhiy Katsyuba 7d961e154e ipc4: mixin/mixout: Remove redundant channel setup
In channel remapping mode mixin sinks could have different number of
channels. Since channel remapping mode has been removed, no need to
support individual channel number setup for each sink.

Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
2024-01-03 13:09:22 +02:00
Serhiy Katsyuba 297d92cc7b ipc4: mixin/mixout: Modify .process() impl to use sink/source API
Modifications to mixin/mixout .process() and .reset() implementations
to switch to use sink/source API.

Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
2024-01-03 13:09:22 +02:00
Kalva, DineshKumar cae1c3acf8 amd: add probe functionality in AMD platforms.
Add probe functionality in AMD platforms.

Signed-off-by: Kalva, DineshKumar <dineshkumar.kalva@amd.com>
2024-01-03 10:27:01 +02:00
Kalva, DineshKumar a732b3bbd3 amd: add probe functionality in AMD/vangogh platform.
Add probe functionality in AMD/vangogh platform.

Signed-off-by: Kalva, DineshKumar <dineshkumar.kalva@amd.com>
2024-01-03 10:27:01 +02:00
Kalva, DineshKumar eb3fcc67b8 amd: add probe functionality in AMD/rembrandt platform.
Add probe functionality in AMD/rembrandt platform.

Signed-off-by: Kalva, DineshKumar <dineshkumar.kalva@amd.com>
2024-01-03 10:27:01 +02:00
Kalva, DineshKumar 0604bf49f9 amd: add ACP_FUTURE_REG_ACLK_0 Register in AMD/Acp_6_3 Platform.
Add ACP_FUTURE_REG_ACLK_0 Register in AMD/Acp_6_3 Platform.

Signed-off-by: Kalva, DineshKumar <dineshkumar.kalva@amd.com>
2024-01-03 10:27:01 +02:00
Kalva, DineshKumar e5e87adeb2 amd: add ACP_FUTURE_REG_ACLK_0 Register in AMD/Renoir Platform.
Add ACP_FUTURE_REG_ACLK_0 Register in AMD/Renoir Platform.

Signed-off-by: Kalva, DineshKumar <dineshkumar.kalva@amd.com>
2024-01-03 10:27:01 +02:00
Kalva, DineshKumar 9824a05d7c dma-copy: remove CONFIG_DMA_GW macro.
Remove CONFIG_DMA_GW macro to use dma_copy_set_stream_tag function
to get dma channel on AMD platforms for probe.

Signed-off-by: Kalva, DineshKumar <dineshkumar.kalva@amd.com>
2024-01-03 10:27:01 +02:00
Kalva, DineshKumar b9d0d86e46 probe: small fixes in probe functionality.
local dma_sg_config is not required,
struct probe_dma_ext holds the DMA config segments.

proper fix for notifier_unregister to remove the probe point functionality.

Signed-off-by: Kalva, DineshKumar <dineshkumar.kalva@amd.com>
2024-01-03 10:27:01 +02:00
Peter Ujfalusi 98cc1d3da3 xtensa-build-zephyr.py: Add arl-s alias to mtl platform
ARL-S is using the same debugkey/community key binary as MTL.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2024-01-02 12:35:14 +02:00
Jaroslaw Stelter d66ad570e8 iadk: module_adapter: Fix return code for IADK proc
IADK processing module interface uses uint32_t return code
while cSOF is using int type. This patch checks return value
from processing() method and returns -ENODATA in case of
failure.

Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
2023-12-22 13:53:13 +02:00
Jaroslaw Stelter d4bed3df83 iadk: module_adapter: Check return code for sink/source
Add check of return code for sink/source api functions.

Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
2023-12-22 13:53:13 +02:00
Baofeng Tian b617388c62 rimage: mtl: add copier and eq-iir CPC cases
Copier missed ibs(384)/obs(192) case, and eq-iir missed
ibs(384)/obs(384) case, adding it to current CPC config for mtl.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-12-22 12:55:29 +02:00
Kai Vehmanen a9bd8245d2 topology2: cavs-nocodec-bt: fix PCM0 and PCM1 capabilities
The pipelines for PCM0 and PCM1 only support S32_LE audio
format. Fix the PCM capability descriptions to match the actual
pipeline definitions. This allows to run test suites that enumerate
all support PCMs and their formats.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-12-22 11:36:39 +02:00
Serhiy Katsyuba 2a0607c658 ipc4: Regression FIX: Do not clear sources/sinks on reset
After https://github.com/thesofproject/sof/pull/8594 been merged, sources
and sinks are now setup on .bind() and .unbind(). Previously they were
setup in .prepare(). However, there were code left in
module_adapter_reset() which clears sources and sinks arrays. That broke
some tests: modules which use source/sink API stopped working correctly
after pipeline reset.

Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
2023-12-21 16:03:26 +00:00
Seppo Ingalsuo dabf0a672e Tools: Topology2: Add switch control to topologies with DRC
The mixer control for switch is added to widget definition
of drc.conf.

In cavs-mixin-mixout-efx-hda.conf the existing control name
is changed to have "bytes" similarly as multiband-drc has. The
switch control is added for the widget to implement the switch.

The controls definitions files in benchmark topologies are replaced
to new format from current .conf generator script. The bytes control
is same as before, and the mixer control for switch is added.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-12-21 13:12:42 +00:00
Seppo Ingalsuo 439d69c155 Audio: DRC: Add processing enable switch control
This patch adds to DRC component in IPC4 mode a control to
switch processing on/off. The control is useful for DRC
pipeline that is used for both headphone (unprocessed) and
speaker (processed). It also allows the user to switch off
DRC processing if desired.

If a blob has enable set to false the processing cannot be
enabled with the switch control. If the blob enables processing,
the user space can control processing on or off.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-12-21 13:12:42 +00:00
Guennadi Liakhovetski cf9a444bfc toml: modularise TOML configuration
Split TOML configuration files into platform and module parts. Use
the C preprocessor to merge them back together.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-12-21 13:07:13 +00:00
Serhiy Katsyuba 60212cf387 ipc4: mixin/mixout: Fix naming after channel remapping removal
Previously when channel remapping was supported processing was done
iterating by frames. After channel remapping was removed processing
was changed to iterate by samples, however, for some reason the code
still uses confusing "frame" variables.

Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
2023-12-20 19:49:50 +02:00