Commit Graph

12395 Commits

Author SHA1 Message Date
Marcin Szkudlinski 0df649af2a fix: remove reference to comp_buffer form sink/src based mod
When using sink/src API and DP processing, there are no
comp_buffer based buffers on inputs and outputs
There must not be any usage of comp_buffer in the module

this commit changes a forgotten reference to comp_buffer

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2024-09-09 11:14:35 +03:00
Mac Chiang 7fc758be43 topology2: Add cs42l43 and cs35l56 support on ADL/RPL, MTL/ARL, LNL
The ADL, ARL, LNL hardware board configurations are below:
ARL has the same dsp generiation as MTL. So set platform = mtl.

SoundWire#
  ├── link 0: cs42l43 Audio Jack and DMICs/Bridge to amplifiers.
      | |     -> sof-rpl-cs42l43-l0.tplg
      │ │     -> sof-mtl-cs42l43-l0.tplg
      │ │     -> sof-arl-cs42l43-l0.tplg
      │ │     -> sof-lnl-cs42l43-l0.tplg
      │ │
      │ ├── link 2: cs35l56 Left and Right Amplifier.
      │	            -> sof-arl-cs42l43-l0-cs35l56-l2.tplg
      │
      ├──── link 2: cs35l56 Right/Rightx2 Amplifier.
      ├──── link 3: cs35l56 Left/Leftx2 Amplifier.
                    -> sof-adl-cs42l43-l0-cs35l56-l23.tplg
                    -> sof-arl-cs42l43-l0-cs35l56-l23.tplg
                    -> sof-lnl-cs42l43-l0-cs35l56-l23.tplg

SoundWire#
  ├── link 2: cs42l43 Audio Jack and DMICs.
      │       -> sof-arl-cs42l43-l2.tplg
      │ 
      ├──── link 3: cs35l56 Left and Right Amplifier.
                    -> sof-arl-cs42l43-l2-cs35l56-l3.tplg

Signed-off-by: Mac Chiang <mac.chiang@intel.com>
2024-09-09 11:13:38 +03:00
Mac Chiang ae69f5cd26 topology2: update flags for alignment
PLATFORM=tgl, can safely removed as it is not included in cavs-sdw and
does not affect the soundwire configurations.

Remove SDW_FMT_24 flag because it has become the fixed format for
soundwire configurations.

SDW_AMP_FEEDBACK is currently used for debugging purposes. So set false
to disable it.

Signed-off-by: Mac Chiang <mac.chiang@intel.com>
2024-09-09 11:13:38 +03:00
Iuliana Prodan 0a6107e127 module_adapter: add mixer component for initialization
Add mixer component in module_adapter initialization function
otherwise, for IPC3, we get the following error:
"module_adapter_init_data() unsupported comp type 6".

Fixes: 0f4a246df1 ("module_adapter: fix switch case for spec parsing")

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2024-09-09 09:33:46 +03:00
Curtis Malainey f383b0ffab fuzz: add argument to support other sanitizers
Allows for switching out zephyr configs for other sanitizers

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2024-09-06 21:27:05 +03:00
Kai Vehmanen 7ec73c72f6 .github/zephyr: do not create tarballs in github builds
Github artifact store allows to download packages already,
so no need to create tarballs in these builds. Also this avoids
problems comparing Windows and Linux builds as due to handling
of symbolic links, the resulting tarball are not comparable.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-09-06 09:28:16 -07:00
Kai Vehmanen c8163bb58b xtensa-build-zephyr.py: create /lib/firmware tarball
With addition of loadable modules, SOF firmware installation depends
much more on symbolic links. Add a step to build script to create a
tarball of the installed firmware binaries in the build-staging-sof
tree. The created tarball (e.g. build-sof-staging/sof/sof.tar.gz)
provides a ready structure that can be unpacked to e.g. /lib/firmware on
Linux target machines.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-09-06 09:28:16 -07:00
Guennadi Liakhovetski a02f367651 llext: fix multi-core use cases
MOD_INIT_INSTANCE IPCs can be processed on different cores, different
cores can use the same modules. Make shared data uncached.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-09-06 14:32:44 +01:00
Tomasz Leman f9575cd2bb audio: base_fw: Implement IPC4_DMA_CONTROL message handling
This patch introduces handling for the IPC4_DMA_CONTROL message type in
the base firmware. The implementation includes a new function
`basefw_vendor_dma_control` to process the DMA Control configuration for
any DAI type.

The `basefw_dma_control` function has been added to handle the
IPC4_DMA_CONTROL message. It ensures the message is atomic and contains
all necessary information before casting the data buffer to the
`ipc4_dma_control` structure and processing it. The function also calls
`basefw_vendor_dma_control` to apply the DMA Control configuration to
the hardware.

The `basefw_set_large_config` function in `src/audio/base_fw.c` has been
updated to call `basefw_dma_control` when an IPC4_DMA_CONTROL message is
received. If the `dai_config_update` operation is not implemented by the
DAI driver, the function will return `-ENOSYS`.

This change allows the base firmware to initialize or modify DMA gateway
configurations dynamically, improving the flexibility of DMA management
in response to IPC messages.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2024-09-06 13:36:42 +03:00
Tomasz Leman 55ae14549d lib: dai: Expose Zephyr DAI device retrieval function
This patch exposes the function to retrieve a pointer to the Zephyr
device structure for a DAI of a given type and index. Previously, the
function `dai_get_zephyr_device` was static and only usable within
`dai.c`. By introducing `dai_get_device`, other parts of the SOF
codebase can now access the Zephyr DAI device pointers, facilitating
integration with Zephyr native DAI drivers.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2024-09-06 13:36:42 +03:00
Seppo Ingalsuo 828b450c4d Scripts: Add testbench build for Intel PTL platform DSP
This patch adds to "scripts/rebuild-testbench.sh -p ptl" option
to test processing components with PTL ACE3.0 DSP build.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-09-06 12:31:47 +03:00
Seppo Ingalsuo 7683707944 Scripts: Cleanup set_xtensa_params.sh
This script is used to get detailed build parameters for
testbench-xt version build. The PLATFORM is in most cases
the same as the platform name in build command line so it
can be set as default. Only the cases when the name
is different need to be preserved.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-09-06 12:31:47 +03:00
Jyri Sarha 9152b87a4d tools: debug_stream.py: debug_stream record receiving and decoding
Python implementation for receiving and decoding debug-stream records
from debug window slot transportation. Opens SOF debugfs file
"debug_stream" reads and decodes the records from the circular buffer
documented in soc_debug_window_slot.h. This initial version only knows
of DEBUG_STREAM_RECORD_ID_THREAD_INFO records.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
2024-09-06 12:28:58 +03:00
Jyri Sarha 8f4672f669 debug: debug_stream_thread_info: Thread info records over debug stream
Implementation for collecting Thread stack and CPU usage statistic from
Zephyr core and send the info and debug_stream records. The records
encoding is defined and documented in debug_stream_thread_info.c
source file.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
2024-09-06 12:28:58 +03:00
Jyri Sarha fdfddff696 debug: debug_stream_slot: Debug slot transportation for debug_stream
Implementation for debug stream transportation over debug window
slot. The protocol details are documented in debug_stream_slot.h
header.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
2024-09-06 12:28:58 +03:00
Jyri Sarha f40a490cdb debug: debug_stream: Add debug stream record and stream header definition
This commit adds definition for abstract debug stream record and
stream header. The header file contains the necessary documentation.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
2024-09-06 12:28:58 +03:00
Marc Herbert 46f0eeab69 xtensa/config/core.h: provide UINT32_C() not just for __ZEPHYR__
xt-clang uses UINT32_C() without importing it.  Commit ef38a0c265
("arch: xtensa: core.h: Add define for UINT32_C") added it but only for
__ZEPHYR__, add it unconditionally.

Provide an alternative, assembly-compatible definition apparently needed
by XTOS ACP 7.0 compiled with xt-clang.

For C code, simply include <stdint.h>

Longer and convoluted story in #9413.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-09-06 10:43:14 +03:00
Curtis Malainey 54bb3e4d01 ipc3: move pointer assignments to after validation
UBSAN is complaining about the pointers being overflown given we haven't
checked the parameters. Move it behind the code that protects this to
satisfy the sanitizer.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2024-09-05 17:42:54 +03:00
Curtis Malainey 53adb48cfa ipc3: catch ext_data_length overflows
If ext_data_length is > UINT32_MAX - sizeof(struct sof_ipc_comp) then it
will overflow the 32bit pointer in the second half of this error check
therefore bypassing the check.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2024-09-05 17:42:54 +03:00
Kai Vehmanen 0741e1eb00 boards: ace30: enable SOF log level at INF level
Re-enable normal INFO level log output for ace30_ptl target.
Move the limited log level setting to FPGA overlay.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-09-05 16:22:40 +03:00
Kai Vehmanen 56ca0e6d99 west.yml: update Zephyr to 689d1edee1d5
Total of 191 commits, including following affecting SOF build
targets:

 81977f2bff2e drivers: dma: intel_adsp_hda: fix intel_adsp_hda_unused() check
 9fd2e119445e drivers: dma: intel-adsp-hda: Report total_copied bytes on ACE2/3
 dd50ff558537 llext: add dependencies
 c5e305fce6c4 llext: fix flag evaluation for section grouping
 a8db637ead17 llext: export a symbol needed for immediate logging
 fe609dd8e8e1 llext: look for symbols in other LLEXT objects too
 19ccec6a0390 llext: use EXPORT_SYMBOL() universally
 bd09a5c73921 llext: make EXPORT_SYMBOL() universal
 92a7c772d90b llext: remove an unused variable
 4902f189ae00 dts: xtensa: intel_adsp: Set soft-off state as disabled
 b9a4900c3002 drivers: dma: intel_adsp_hda: change L1 exit defaults

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-09-05 14:26:12 +03:00
Marc Herbert b2f79a0c3d intel_adsp_ace15_mtpm.conf: replace blanket _STUBS with focused RTC MOCK
CONFIG_COMP_STUBS=y was enabled in #8722 / commit 8e34109e10 ("AEC:
Enable Google AEC with Mock compliation").

CONFIG_COMP_STUBS indirectly enables
CONFIG_GOOGLE_RTC_AUDIO_PROCESSING_MOCK which was the desired
effect. However it also automatically and silently "mocks" all other 3rd
party modules which is not desirable. So, replace it with the more
focused `CONFIG_GOOGLE_RTC_AUDIO_PROCESSING_MOCK`. `src/audio/Kconfig`
says "CONFIG_STUBS: This should only be used in testing environments
like fuzzers or CI."

Official sof-bin releases include `google_rtc_audio_processing_mock.c`
because the CI that uses it can't use extra CONFIGS. That's another
topic for another day, see #9410.

build-mtl/zephyr.strip is identical before versus after this commit.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-09-04 08:58:58 -07:00
Marc Herbert ff57b7917f .github/ipc_fuzzer: use new -i 3 and -i 4 fuzz.sh options
Stop hardcoding -DCONFIG_IPC_MAJOR_x=y and use the new -3 and -4 fuzz.sh
CLI flags.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-09-02 16:48:32 +01:00
Marc Herbert 2a23f3be21 Add new `fuzz_*features.conf` files to add more CONFIG_ when fuzzing
The goal of these new files is to:
1. Fuzz more code
2. Reduce the configuration gap between fuzzed SOF and the real thing.

See the fuzz_features.conf header for more details.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-09-02 16:48:32 +01:00
Marc Herbert 8a99c58906 fuzz.sh: add -i3 and -i4; shortcuts for -DCONFIG_IPC_MAJOR_$i=y
Only a shortcut for now but allow more IPC version-dependent logic
later.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-09-02 16:48:32 +01:00
Marcin Szkudlinski c72778f904 buf: missing dp_queue rename to ring_buffer
one variable have been forgotten during renaming
dp_queue to ring_buffer

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2024-09-02 16:47:40 +01:00
Marcin Szkudlinski 4786d6ffeb buf: make comp_buffer use sof_audio_buffer base
comp_buffer is a legacy buffer, but currently is widely
used in SOF.

During transition to pipeline2.0 there's a need that comp_buffer
expose a common API, as any other buffer

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2024-09-02 16:47:40 +01:00
Marcin Szkudlinski a2813a79bd buf: rename buffer.c to comp_buffer.c and move to buffers
comp_buffer, implemented in buffer.c file, should
be kept in the buffers directory, together with all
buffers
Also it has been renamed to comp_buffer.c

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2024-09-02 16:47:40 +01:00
Marcin Szkudlinski 051009b8b7 buf: introduce ops instead of a single free function
in struct audio_buffer there was only one virtual method
(free). There are probably more coming, so an ops structure
is introduced.

ring buffer which uses audio buffer as a base must adjust,
including using of an audio_buffer_init procedure, what implies
using audio_stream_params located in audio_buffer

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2024-09-02 16:47:40 +01:00
Marcin Szkudlinski d23f8e81d9 buf: add secondary buffer support to struct audio_buffer
secondary buffer mechanism is a feature independent of a buffer
implementation, therefore it should be located in a base class for
all buffers

this commit intentionally is not removing the same feature from
comp_buffer nor trying to use it anywhere

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2024-09-02 16:47:40 +01:00
Marcin Szkudlinski be02062341 bug: missed fixes when CONFIG_INCOHERENT=0
cache operations are pointless when architecture is
coherent

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2024-09-02 16:47:40 +01:00
Seppo Ingalsuo 7ed55e5b15 Audio: DCblock: Tune: Prefix top level functions with sof_
This patch renames with prefix sof_ all the top level functions
for dcblock blobs design.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-09-02 13:32:56 +01:00
Seppo Ingalsuo a9702cc168 Audio: DCblock: Fix blob export paths after move
The paths for exported blobs for topology and for sof-ctl need
to be fixed after directory move.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-09-02 13:32:56 +01:00
Seppo Ingalsuo b647d9a29e Audio: DCblock: Fix search path to common functions
A function dcblock_paths.m is added to handle add and remove
of path.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-09-02 13:32:56 +01:00
Seppo Ingalsuo 82252055c0 Audio: DCblock: Tune: Move dcblock setup scripts to module directory
The change is done to consolidate the files belonging to the
module. This patch only moves the files to a new location.
Successive patches address the issues caused by this move.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-09-02 13:32:56 +01:00
Seppo Ingalsuo fcf3d65f03 Audio: Crossover: Prefix top level functions names with sof_
The names are changed to avoid any collisions with multiple
Octave or Matlab paths enabled.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-09-02 11:28:58 +01:00
Seppo Ingalsuo 4bac61ca32 Audio: Crossover: Fix paths after scripts move
The paths to topology and sof-ctl blobs are updated. The paths
to other setup scripts (common, eq) are set with a new helper
function crossover_paths.m.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-09-02 11:28:58 +01:00
Seppo Ingalsuo 80c621aeff Audio: Crossover: Move blob configuration scripts to module directory
To consolidate the audio moves the scripts are moved to the same
directory as the module. This first step only moves the files.
The next steps rename the scripts and fix possible issue to
directories move.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-09-02 11:28:58 +01:00
Marc Herbert 43912a70ed native_sim_libfuzzer.conf: override some incompatible hardware options
Override incompatible options CONFIG_SMP_BOOT_DELAY and
CONFIG_SCHED_CPU_MASK_PIN_ONLY found in `sof/app/prj.conf` to silence
build time warnings. Strange why these are in `app/prj.conf` but not our
problem here.

```
warning: SCHED_CPU_MASK_PIN_ONLY (defined at kernel/Kconfig:139) was
assigned the value 'y' but got the value 'n'. Check these unsatisfied
dependencies: SMP (=n).

warning: SMP_BOOT_DELAY (defined at kernel/Kconfig.smp:32) was assigned
the value 'y' but got the value 'n'. Check these unsatisfied
dependencies: SMP (=n).
```

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-09-02 11:25:14 +01:00
Ranjani Sridharan 847b2ae7a7 tools: plugin: noise_suppression: Fix build error
Recent changes to UUID naming dropped the _comp in the UUID declaration.
Fix the noise suppression module to adhere to the new naming while
declaring the module interface and trace.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2024-09-02 11:24:53 +01:00
Seppo Ingalsuo b55cb64ac1 Audio: EQIIR: Tune: Prefix top level functions with sof_
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-09-02 11:21:20 +01:00
Seppo Ingalsuo 73de9de524 Audio: EQ: Tune: Move equalizer setup scripts to module directory
The scripts are moved to consolidate the audio modules.

The setup tool is common for IIR and FIR where IIR is more
commonly used so the destination directory is eq_iir. The
equalizers with both IIR and FIR part are also designed in
the same run so the design is not split.

The paths are fixed in code for new location. There are no
other changes.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-09-02 11:21:20 +01:00
Seppo Ingalsuo e1e26b5eb4 Audio: MFCC: Remove unnecessary space from HiFi4 code
Only cosmetic change, no functionality changed. Noticed while
comparing hifi3 and hifi4 code versions. Now one difference
less.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-09-02 13:03:14 +03:00
Seppo Ingalsuo c232feb19c Audio: MFCC: Fix mistake with HiFi4 circular buffer index
The instruction AE_L16_XC() uses circular buffer0, so the
buffer setup instruction need to be changed. The proper
instruction for buffer 1 would have been AE_L16_XC1().

Due to this error the MFCC output became incorrect after
wrong circular buffer wrap.

Fixes: 5c92bddcf4 ("Audio: MFCC: Add HiFi4 implementation of MFCC")

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-09-02 13:03:14 +03:00
Grzegorz Bernat 39ace344cf Audio: Volume: Fix problem with Hifi4
This patch fixes an issue with gain and peakvolume processing
with s16 sample format and with sample rates where period is not
multiple of four samples SIMD processing assumption. With 44.1 kHz
rate the period is normally 44 frames but every 10th is 45. However,
the value of 45 was not handled correctly. A Glitch appeared to
output when this happened.

The fixed code adds sample-by-sample volume process code for the
remaining amount of up to 3 samples to process.

The earlier workaround (87571f337c "audio: volume: disable HIFI4
optimizations") is reverted.

Signed-off-by: Grzegorz Bernat <grzegorzx.bernat@intel.com>
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-09-02 10:34:14 +01:00
Seppo Ingalsuo 298687c016 Tools: Rimage: Config: Add mfcc.toml include for MTL, LNL, PTL
The MFCC component is not loading in these platforms due to
missing edit to <platform>.toml.h.

As editorial change the missing newline in the end of
ptl.toml.h is fixed.

Fixes: f7715b814b
       ("Audio: MFCC: Fix build of component for current SOF")

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-09-02 10:30:34 +01:00
Guennadi Liakhovetski 728fb98d81 Zephyr: update to include LLEXT logging protection
Zephyr PR 77289 fixed deferred logging with LLEXT objects, update to
a Zephyr version, containing it.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-08-30 16:03:28 +03:00
Guennadi Liakhovetski 8b48c563ce drc: move logging context to the base image
Logging context can be accessed from the deferred logging
thread. Therefore it must be always available to avoid
access to unmapped memory when an LLEXT module is unloaded.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-08-30 16:03:28 +03:00
Guennadi Liakhovetski 0ddf797dc6 uuid: add a missing header
uuid.h uses uint32_t, uint16_t and uint8_t types, it must include
stdint.h or inttypes.h.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-08-30 16:03:28 +03:00
Guennadi Liakhovetski 3db820d9d4 clock: only update clock frequency if actually changing it
No need to set clock frequency if the new one is equal to the current
one.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-08-30 16:03:28 +03:00