Commit Graph

12582 Commits

Author SHA1 Message Date
Guennadi Liakhovetski 1dd1b278d8 volume: move gain.toml and peakvol.toml into volume.toml
To make volume an LLEXT module it should have a single TOML
configuration file named volume.toml. This is easy to do, using
respective Kconfig options.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-09-12 18:07:16 +03:00
Guennadi Liakhovetski cfd27fbde0 src: convert to a loadable module
Build src as a loadable llext module.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-09-12 18:07:16 +03:00
Kai Vehmanen 0c3be86751 platform: lunarlake: remove drivers/interrupt.h
Remove the unused platform header.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-09-12 16:42:19 +03:00
Jyri Sarha 7dd2d7fca0 debug: debug_stream: Couple of debug print and comment typo fixes
Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
2024-09-11 18:32:04 +03:00
Jyri Sarha 8884a5dae7 debug: debug_stream_slot: Fix circular buffer alignment and update comments
The cache-line alignment was removed from circular buffer descriptors
on last moments of debug_stream_slot PR's review process. This broke
the circular buffer alignment and its now fixed in this PR. The commit
also contains the documentation update for the alignment removal change
that was also forgotten from the original PR.

Since this only affects the offsets of the circular buffers, that are
explicitly written in the debug window slot, there is no need to
update anything on the host side client. Also the unaligned circular
buffers appeared to work just fine, because of that.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
2024-09-11 18:32:04 +03:00
Curtis Malainey 0ab4441e74 ipc3: check alignment of ext data
Sizes are not currently checked for alignment, this can generated
unaligned pointers for aligned types which is undefined behaviour.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2024-09-11 16:12:51 +03:00
Seppo Ingalsuo 97e5c0ded9 Tools: Topology2: Enable DMIC capture pre-processing for hda-generic
This patch adds to DMIC0 capture TDFB beamformer and DRC for
dynamic range control. The impacted topology names are:

- sof-hda-generic-2ch.tplg
- sof-hda-generic-4ch.tplg
- sof-hda-generic-cavs25-2ch.tplg
- sof-hda-generic-cavs25-4ch.tplg
- sof-hda-generic-ace1-2ch.tplg
- sof-hda-generic-ace2-2ch.tplg

The DMIC0 capture pipelines before this patch was:

DAI-copier -> IIR -> gain -> module copier -> host-copier

After:

DAI-copier -> IIR -> gain -> module copier ->
TDFB -> DRC -> host-copier

The beamformer is set for 2ch topologies to a narrow user
direction stereo image enhance with about 3 dB signal-to-noise
ratio improvement with blob "line2_generic_pm10deg.conf". In 4ch
topologies the beamformer is set to pass-through due to large
variations in notebook array geometries. The processing need to
be enabled per product by UCM2. The beamformer control switch is
by default off.

The DRC is set with blob "dmic_default.conf" to produce up to
10 dB boost in capture level. It helps to make DMIC capture louder
in normal silent conditions while it prevents clipping of samples
in loud conditions. The DRC control switch is by default off.

The added controls (seen with "amixer -c0 controls") are:

- Dmic0 Capture DRC bytes
- Dmic0 Capture DRC switch
- Dmic0 Capture TDFB angle set enum
- Dmic0 Capture TDFB beam switch
- Dmic0 Capture TDFB bytes

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-09-11 14:12:19 +01:00
Seppo Ingalsuo 707c0c5bce Tools: Topology2: Add beamformer and DRC to HDA analog capture
This patch adds to analog microphone capture pipeline TDFB
beamformer and DRC for dynamic range control.

The enhanced host copier pipeline is enabled if
HDA_MIC_ENHANCED_CAPTURE is set to true in topologies build.
The keys EFX_HDA_MIC_TDFB_PARAMS and EFX_HDA_MIC_DRC_PARAMS
control the applied configurations blobs.

There is no processing applied to capture audio since the
topology is built with pass-through blobs. E.g. UCM2 should
set up processing with blobs those have effect.

The change impacts sof-hda-generic.tplg. The other topologies
with DMIC are kept as before without added processing. The
analog capture pipelines are before this change:

dai-copier -> eqiir -> module-copier -> host-copier

After:

dai-copier -> eqiir -> module-copier -> TDFB -> DRC -> host-copier

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-09-11 14:18:53 +03:00
Seppo Ingalsuo cf7f45ecb0 Tools: Topology2: Add module copier to HDA analog capture
This patch changes in cavs-mixin-mixout-hda based topologies the
analog capture pipeline from

dai-copier -> eqiir -> host-copier

to

dai-copier -> eqiir -> module-copier -> host-copier

It allows more flexibility with processing add into host-copier
pipeline and allow capture stream duplication to multiple PCMs.

This change adds 2.2 MCPS from module-copier in TGL platform.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-09-11 14:18:53 +03:00
Seppo Ingalsuo b9aa4c5603 Tools: Topology2: Cleanup dai-copier-eqiir-module-copier-capture
The pipeline is generic for any type of DAI, so using DMIC0_DAI_EQIIR
to select IIR blob is wrong. The blob definition need to be done
at upper level where endpoint is known.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-09-11 14:18:53 +03:00
Seppo Ingalsuo 51f6eaeb4b Tools: Topology2: Remove unused include from cavs-es83x6.conf
The topologies built with cavs-es83x6.conf
(sof-mtl-es83x6-ssp1-hdmi-ssp02.tplg and sof-mtl-hdmi-ssp02)
are not using dai-copier-eqiir-module-copier-capture pipeline,
so this include can be deleted.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-09-11 14:18:53 +03:00
Curtis Malainey 186251cddc fuzzer: add ubsan support
Adds support for undefined fuzzing

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2024-09-11 14:04:01 +03:00
Kai Vehmanen e983b510be base_fw: move SRAM bank details to Intel specific code
The SRAM definitions like SRAM_BANK_SIZE and EBB_BANKS_IN_SEGMENT
are only used in Intel specific code and not really needed in
platform layer that needs to implemented by all platforms.
Move these definitions to base_fw_intel.c and clean up related
definitions from platform layer.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-09-11 14:00:03 +03:00
Kai Vehmanen 8c619cf740 rtos: add Zephyr implementation of sof/lib/dai.h
Implement sof/lib/dai.h for Zephyr build and do not rely o
the xtos version for Zephyr builds. Add a warning to catch
invalid build configurations.

Link: https://github.com/thesofproject/sof/issues/9015
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-09-11 09:51:33 +03:00
SaiSurya Ch d00561e1a3 amd: Remove inclusion of unrequired header files.
amd: Remove inclusion of unrequired header files.

Signed-off-by: SaiSurya Ch <saisurya.chakkaveeravenkatanaga@amd.com>
2024-09-11 09:28:36 +03:00
SaiSurya Ch 9e3ad3de83 src: alloc: Remove unused functions
src: alloc: Remove unused get memory size functions.

Signed-off-by: SaiSurya Ch <saisurya.chakkaveeravenkatanaga@amd.com>
2024-09-11 09:28:36 +03:00
SaiSurya Ch dbe3d45a67 spinlock: Remove unused variable 'result'
Remove the unused variable 'result' that is causing the build error with GCC 11.4.0.
error: variable 'result' set but not used [-Werror=unused-but-set-variable]

Signed-off-by: SaiSurya Ch <saisurya.chakkaveeravenkatanaga@amd.com>
2024-09-11 09:28:36 +03:00
SaiSurya Ch c34c0e0483 platform: Add ACP_7_0 platform support
- Add ACP_7_0 platform support

Signed-off-by: SaiSurya Ch <saisurya.chakkaveeravenkatanaga@amd.com>
2024-09-11 09:28:36 +03:00
SaiSurya Ch d2713622d5 amd: acp_7_0: add build support for ACP_7_0
Add build support to enable ACP_7_0 platform.

Signed-off-by: SaiSurya Ch <saisurya.chakkaveeravenkatanaga@amd.com>
2024-09-11 09:28:36 +03:00
SaiSurya Ch 22744b16ad rimage: config: add acp_7_0 toml file to support acp_7_0 build
Add acp_7_0 toml file to support sof-acp_7_0.ri binary build

Signed-off-by: SaiSurya Ch <saisurya.chakkaveeravenkatanaga@amd.com>
2024-09-11 09:28:36 +03:00
SaiSurya Ch 979abb6d8d tools: topology: add ACP_7_0 topology support
Add ACP_7_0 platform topology.

Signed-off-by: SaiSurya Ch <saisurya.chakkaveeravenkatanaga@amd.com>
2024-09-11 09:28:36 +03:00
SaiSurya Ch c3dff854a8 src: arch: xtensa: configs: add ACP_7_0 defconfig
Add defconfig for ACP_7_0 platform.

Signed-off-by: SaiSurya Ch <saisurya.chakkaveeravenkatanaga@amd.com>
2024-09-11 09:28:36 +03:00
SaiSurya Ch 14efeb8091 scripts: add support for ACP_7_0 platform
Add support for ACP_7_0 in build scripts.

Signed-off-by: SaiSurya Ch <saisurya.chakkaveeravenkatanaga@amd.com>
2024-09-11 09:28:36 +03:00
Eddy Hsu 17c15fc06b comp: ctc: properly set up and clean component state.
Check CTC state is properly inited and cleanup.

Signed-off-by: Eddy Hsu <eddyhsu@google.com>
2024-09-10 15:30:25 +01:00
Eddy Hsu 7789531bfc comp: ctc: add ctc switch control.
Add enablement switch controls of Google CTC component.

Signed-off-by: Eddy Hsu <eddyhsu@google.com>
2024-09-10 15:30:25 +01:00
Eddy Hsu 175a97ec6b comp: ctc: add ctc binary control.
Add binary controls of Google CTC component to load different configs.

Signed-off-by: Eddy Hsu <eddyhsu@google.com>
2024-09-10 15:30:25 +01:00
Curtis Malainey 01c9ce9eda posix: align mailboxes
Using unaligned mailboxes with UBSAN causes fuzzing failures with
aligned data structures

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2024-09-10 15:26:14 +01:00
Kai Vehmanen 19ea950b61 platform: intel: ace: remove redundant definitions from memory.h
Platforms that can only be built with Zephyr, can directly use
Zephyr cached/uncached functions in memory.h. It turns out the SRAM
address and size definitions were only needed for these duplicate
cache operations, so they can be removed as well.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-09-10 13:57:13 +03:00
Seppo Ingalsuo 1a27843e4b Audio: Multiband-DRC: Fix paths after move of scripts
The paths to topology and sof-ctl blobs are updated. The paths
to other setup scripts (common, crossover, drc, eq) are set with
a new helper function multiband_drc_paths.m.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-09-10 12:06:37 +03:00
Seppo Ingalsuo fce09fc56b Audio: Multiband-DRC: 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-10 12:06:37 +03:00
Guennadi Liakhovetski 8c75f80f96 llext: add missing modules to LNL overlay
LNL modules overlay is missing eq_iir and mixin_mixout entries, add
them there.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-09-10 09:23:24 +03:00
Guennadi Liakhovetski 9f48037505 llext: automatically calculate module addresses
Currently LLEXT module starting addresses are hard-coded in their
respective CMakeLists.txt files. This is very wasteful, since it's
unknown in what order modules are loaded, inflexible and not easily
extendible to other platforms. Switch to calculating addresses
automatically based on a single per-platform Kconfig value.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-09-10 09:23:24 +03:00
Guennadi Liakhovetski dfee44d7cd llext: add a convenience Kconfig option to build LLEXT modules
Add a Kconfig option that can be used to flip all LLEXT-supporting
code to a modular build. Use that global flag for smart-amp-test,
mixin-mixout and eq-iir.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-09-10 09:23:24 +03:00
Seppo Ingalsuo 2950246415 Tools: Test: Audio: Add to process_test.m option to show plots
This change replaces 6th argument with show_plots. If it is
set to 1, the plots are not hidden. If set to 2, also the
temporary sound files are not deleted that is useful for
debugging.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-09-09 12:39:44 +03:00
Seppo Ingalsuo 85b8ab64ac Tools: Test: Audio: Fixes for process_test.m for moved files
The full process test fails due to changed paths of Octave
module setup scripts.

The path EQ blob decoder has changed after the EQ tool was moved
under the module. Also the SOF ABI version retrieve function
path need to be set to tune/common to use the generic function
instead of the first version that was made for EQ export.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-09-09 12:39:44 +03:00
Marc Herbert 76c976f8b3 app: drop "overlay" from the name of a few extra configs
Zephyr does not call extra configs "overlays", it uses overlays only for
Device Tree.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-09-09 10:16:39 +01:00
Marc Herbert ffe80eb0e6 xtensa-build-zephyr.py: cosmetic: rename "overlays" variable
The Zephyr documentation uses the term "overlay" for Device Tree, not
for Kconfig.

This commit does not change the wrongly named --overlay option not to
break anything but it stops that wrong name from leaking all over the
code. Also tweak the --help text.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-09-09 10:16:39 +01:00
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