Commit Graph

12204 Commits

Author SHA1 Message Date
Andy Ross 0c30440c6c rtnr: Fix logging crash
Commit 296af86f4c ("Audio: RTNR: Convert to module API") missed a
spot: the "rtnr_printf()" function, which is a logging callback from
the vendor library, was still using the comp_rtnr driver struct even
though it was no longer initialized.  This contained a NULL trace
context, which would panic on use.

(That would then lead to a fun glitch where the reentrantly-confused
trace code would then panic inside the tracing done by the panic
handler, clobbering the original trace info and reporting to the kenel
that the fault was in panic_dump()).

This would have been fine with the stub, which does not call
rtnr_print(), only the real library would blow up.

Fix is to use the trace context directly, as we don't have a component
pointer here.

Signed-off-by: Andy Ross <andyross@google.com>
2024-06-10 17:19:38 +01:00
Kai Vehmanen 3c70609c96 versions.json: set version to 2.10.99
Open tree for 2.11 development now that stable-v2.10 is branched out.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-06-07 17:08:21 +01:00
Guennadi Liakhovetski 01c0f182ec llext: add support for .bss directly adjacent to .data
Zephyr places .bss into a separate section element, still if it's
immediately adjacent to writable data we can merge and allocate them
together.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-06-07 17:02:13 +01:00
Guennadi Liakhovetski b5a53e836b llext: split read-only and writable data properly
We map memory pages for loaded modules dynamically and we're able to
set memory flags for write access or for code execution. This commit
takes advantage of the recently added section grouping and maps the
three module parts separately: executable code, read-only data and
writable data, including zero-initialised .bss. This also cleans up
references, pointing into module storage in IMR instead of the mapped
addresses.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-06-07 17:02:13 +01:00
Guennadi Liakhovetski 4a8670304b llext: fix error checking
llext_find_section() returns a negative error code when it cannot
find the requested section, not 0. Fix error checking.

Reported-by: Luca Burelli <l.burelli@arduino.cc>
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-06-07 17:02:13 +01:00
Guennadi Liakhovetski 59916ffd6d llext: use the first module for ELF information
When an LLEXT module contains multiple Module Adapter instances,
their manifests are stored in an array in the .module section. Those
array entries contain per-instance information like module entry
points, names, UUIDs, but ELF information is common for all
instances. Store it in the first array entry to avoid confusion.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-06-07 17:02:13 +01:00
Guennadi Liakhovetski 69626d68d7 llext: update memory access flags when mapping
When dynamically mapping memory, we need to update access flags
according to the type of the mapping.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-06-07 17:02:13 +01:00
Guennadi Liakhovetski 7658b48834 llext: (cosmetic) group headers
Re-group headers more logically in eq_iir.c and mixin_mixout.c.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-06-07 17:02:13 +01:00
Peter Ujfalusi c1ad36d592 topology2: Add new tokens 'playback/capture_pause_supported' as false by default
We need to face with reality that the pause/resume is a feature that is not
well tested (end users are using audio via audio servers and they don't
use pause/resume) causing constant issues with no real life benefit:
With IPC4 multiple pause/resume will make the delay reporting to be
exponentially shoot out, making the reported delay to be unusable.

Looks like suspend/resume with paused stream has been broken for a long
time and just got noticed (since it was not tested).

Add a new token to allow selected PCMs to advertise pause support and
keep it false by default.

The kernel side will allow ignoring the flag to keep the pause advertised
for continued testing while protecting accidental use of it by users.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://github.com/thesofproject/linux/issues/5035
2024-06-07 16:39:39 +01:00
Guennadi Liakhovetski 0bda13d0bd llext: check a Kconfig option to select ld flags
When using xt-clang we cannot build shared objects, so we use '-r' to
link relocatable objects. But the decision shouldn't be made based on
the name of the compiler, but based on the selected LLEXT_BINARY_TYPE
option.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-06-04 12:53:49 +03:00
Guennadi Liakhovetski 908d69ceac llext: remove hard-coded section names
It was clear that hard-coded section names aren't reliable enough but
they broke down way earlier than has been expected.

This patch replaces hard-coded sections with a loop, scanning all
sections and selecting them based on their flags and types.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-06-04 12:53:49 +03:00
Guennadi Liakhovetski 799f8279f7 llext: automatically select LLEXT type
When using a clang Cadence toolchain to build SOF and LLEXT modules
we need to select a different LLEXT type than when using a Zephyr gcc
toolchain.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-06-04 12:53:49 +03:00
Kai Vehmanen 013e210209 west.ytml: update to Zephyr 53ddff639562
Update Zephyr baseline to 53ddff639562 . The location of generated
headers has changed, so modify the SOF build scripts to use the new
location.

Change affecting SOF build targets:

6509b8199b02 shell: add shell backend for audio DSP using shared memory window
5a7600bec60b soc: intel_adsp: tools: add shell support to cavstool.py
db00b813f043 soc: intel_adsp: tools: align code style in maps_regs()
44dd5a4da9c0 soc: intel_adsp: tools: fix ace20 fw load flow
fa798ce2d5be soc: intel_adsp: only implement FW_STATUS boot protocol for cavs
8fc76f1b6d16 soc: intel_adsp: tools: improve FW boot handling on ace1.x
024bd41efb65 llext: xtensa: add support for the xt-clang toolchain

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-06-04 11:04:04 +03:00
Guennadi Liakhovetski d6ee13c37c ipc: simplify CMakeLists.txt by using a suffix variable
Everywhere, where IPC3 and IPC4 are distinguished in CMakeLists.txt
the only difference is the use of x_ipc3.c vs. x_ipc4.c. Instead of
duplicating all build instructions for IPC3 and IPC4 just define and
use a suffix variable.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-06-03 18:44:02 +03:00
Kai Vehmanen 2f3f877fb9 west.yml: update Zephyr to 69d790b29331
Fast-forward Zephyr by 450+ commits including following patches
affecting SOF build targets:

 5ca3bc92c8e0 intel_adsp: power: SoC restores the clock
 4c5ee9b2dbc5 pm: system: Restore clock after sleep
 1860dd9153c7 pm: system: Resume devices in pm_system_resume
 f7437ac3b1a3 pm: Move z_pm_save_idle_exit to pm subsys
 f54232e9124d intel_adsp/ace: power: Do not re-implement cache func
 693b65583c88 power_domain: intel_adsp: Use register definitions
 b496d0e52d3c intel_adsp/ace: pm: Remove unnecessary cache flush
 c335cb542c24 intel_adsp/ace: pm: Keep irq locked until restore context
 e728adffd276 intel_adsp/ace: pm: Remove unnecessary cache flush
 301055dec086 intel-adsp/ace: pm: Only core 0 can d0i3
 991b3623b014 soc: intel_adsp: ipc: don't call k_sem_init() multiple times
 369a3a167584 soc: intel: adsp: tgl: ace: Set correct virtual memory size

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-05-30 18:58:39 +03:00
Bard Liao 8af48c03d3 Topology2: sof-mtl-sdw-cs42l42-l0-max98363-l2: add SDW_AMP_FMT_24=true
Max98363 doesn't support 32 bit format. Use 24 bit format instead.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2024-05-30 14:07:17 +03:00
Zoran Zhan 90c54a6116 scripts: Add support for MediaTek mt8188 platform
Add MediaTek mt8188 platform to the DEFAULT_PLATFORMS list.

Signed-off-by: Zoran Zhan <zoran.zhan@mediatek.com>
2024-05-27 13:07:19 +03:00
Seppo Ingalsuo 10de58da07 Tools: Topology2: Remove unnecessary NHLT binary from EFX topologies
The NHLT binary is not needed in these audio processing development
and test topologies. With the current build options the NHLT would
work only with cAVS2.5 platforms (TGL). Without NHLT add these are
safe to use in all platforms where the NHLT blob is retrieved from
BIOS.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-05-27 13:06:32 +03:00
Zoran Zhan 9d65e938c2 docker_build: Add support for MediaTek mt8188
Add support for building MediaTek mt8188 toolchains in docker image.

Signed-off-by: Zoran Zhan <zoran.zhan@mediatek.com>
2024-05-27 13:06:15 +03:00
Seppo Ingalsuo 0b6cf0250e Audio: TDFB: Optimize pass-through MCPS for beamformer
This patch adds use of dedicated pass-through functions to save
MCPS. The pass-through is used when ALSA beam control is to off.
The earlier pass-through mode was made with a minimum length set
channels filters for the FIR filter bank.

In TGL platform with 4 to 2 channels beamformer the patch
saves 18 MCPS, from 27 to 9 MCPS. With 2 to 2 channels beamformer
the patch saves 14 MCPS, from 16 to 2 MCPS.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-05-27 13:05:55 +03:00
Seppo Ingalsuo e2dbe90358 Audio: TDFB: Optimize direction updates check
The check of cd->direction updates before calling the function
tdfb_direction_copy_emphasis() saves in TGL platform 2.9 MCPS.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-05-27 13:05:55 +03:00
Seppo Ingalsuo eb2e6fe985 Audio: TDFB: Simplify processing function select set_func()
The optimized processing functions are handled other way,
so these processing set functions were never used for the
purpose of selecting different code versions.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-05-27 13:05:55 +03:00
Seppo Ingalsuo ef12d4c6fb Audio: TDFB: Remove unnecessary memset() from tdfb_generic.c
The memset() is unnecessary because the same cd->out clear
is done in function tdfb_core().

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-05-27 13:05:55 +03:00
Seppo Ingalsuo 8bed24057e Audio: TDFB: Reduce beamformer trace verbosity
No need to have these as comp_info(), changing to comp_dbg().

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-05-27 13:05:55 +03:00
Marc Herbert e0701e54d1 xtensa-build-zephyr.py: checksum .llext files
Even with the cryptographic salt, the ability to match a download with
the corresponding build log is still useful.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-05-27 13:04:58 +03:00
Marc Herbert 3c1b3b0622 xtensa-build-zephyr.py: clean staging / sof-ipc4-lib/ directories
Delete per-platform, "build-sof-staging/sof/intel/sof-ipc4-lib/mtl/"
directories every time just like we've always done it for
"build-sof-staging/sof/intel/sof-ipc4/mtl/". This is especially
important considering the new LLEXT complexity, symbolic links etc.

There is no way the build can be smart enough and extend "incremental"
builds to the staging directory.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-05-27 13:04:58 +03:00
Marc Herbert 2e6162bf78 zephyr/cmake: fix llext.uuid growing from the last build
Reset the llext.uuid file so it does not start with content from the
previous build.

Fixes LLEXT incremental builds which apparently never worked (some
people like it slow?)

Fixes commit 05e69e1bb9 ("llext: update to use add_llext_target()")
and the ones before that.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-05-27 13:04:58 +03:00
Grzegorz Bernat f9eaaba5ac Audio: Volume: fix problem with generic peakVol
Fixed a problem with generic implementation
of function vol_passthrough_s16_to_s16.
Corrected Pointer Types. Variables x and y are
treated as int16_t pointers since we are dealing with 16-bit samples.

That was tested in test:
test_01_09_peakvol_quality[44100Hz_16in16bit_1ch-0]

Signed-off-by: Grzegorz Bernat <grzegorzx.bernat@intel.com>
2024-05-27 13:04:37 +03:00
Kai Vehmanen 737d4d41fb app: add winconsole_overlay.conf
Add a new overlay to enable logging via winstream backend. This is
alternative memory window based logging backend that typically
uses memory window 3 as transport. The backend is directly
using Zephyr winstream protocol, and has no dependency to SOF
IPC definitions.

One client is available in Zephyr upstream at:
zephyr/soc/intel/intel_adsp/tools/cavstool.py

Note: winstream backend is not supported by Linux SOF driver.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-05-24 14:54:26 +03:00
Adrian Warecki 5081044f3d regions_mm: New memory mapping functions
The previous memory mapping function did not work properly if the buffer
size exceeded the memory page size. In this case the size of the region to
be checked passed to the sys_bitarray_is_region_cleared function was zero,
causing the function to always return false. As a result, the allocator
stated that a page was already mapped for a given address and did not map
it. This led to a cpu exception when trying to access the allocated buffer.

The function responsible for unmapping memory had a similar problem.
Additionally, the size of the freed area was incorrectly determined and
an incorrect offset was passed to the sys_bitarray_is_region_cleared
function.

New functions have been created to map and unmap memory pages for allocated
buffers. It don't need allocation of temporary array and manipulation of
memblocks bitarray.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2024-05-24 12:46:39 +03:00
Adrian Warecki cabc2e84a3 regions_mm: Use static initialization of the vmh_list list head
A macro was used to statically initialize the vmh_list list head. This
allowed to resign from calling a function whose only task was to initialize
the list header. This function was removed as no needed anymore.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2024-05-24 12:46:39 +03:00
Iuliana Prodan 00664d091a topology: imx: Add a variable for schedule domain
Add DMA_DOMAIN variable and based on this we set
SCHEDULE_DOMAIN to SCHEDULE_TIME_DOMAIN_DMA, otherwise
is SCHEDULE_TIME_DOMAIN_TIMER.

Now, only i.MX8MP is using SCHEDULE_TIME_DOMAIN_DMA.
Therefore the DMA_DOMAIN is added only for 8MP topologies.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2024-05-23 19:17:56 +03:00
Guennadi Liakhovetski 852a664704 lp64: fix undefined reference compilation breakage
__udivdi3 isn't defined on LP64, don't export it.

Fixes: a306792a68 ("llext: add missing symbol exports")
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-05-23 18:54:43 +03:00
Seppo Ingalsuo a8f2b845ce Tools: Topology2: Define only same channels counts for DMIC0 dai-copier
This patch defines e.g. for sof-hda-generic-2ch.tplg DMIC0 only
stereo formats as s16/24/32. Similarly for e.g. sof-hda-generic-4ch.tplg
only four channels formats are defined.

The reduction of input formats options avoids the issue with kernel
that it possibly selects invalid channels count for DMIC0 DAI when
the channels count in connected pipelines varies due to processing
components.

The output formats are reduced similarly since copier always has
the same input and output channels count.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-05-23 14:32:12 +03:00
Seppo Ingalsuo b6f1bba44f Tools: Topology1: Change name of default DRC test blob
The tplg1 blobs are still used with IPC3 testbench test pipelines.

The updated script example_drc.m exports the blob used for DRC
test with name "speaker_default" so, the blob file name to include
to test pipeline is changed. The blob content is same as before.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-05-22 16:20:03 +01:00
Seppo Ingalsuo 1ff7c36363 Tools: Tune DRC: Export DRC for DMIC capture and cleanup filenames
A DRC blob for capture dmic_default is created. It boosts the capture
by 10 dB when the signal level is low.

The name of speaker blob is changed to speaker_default. The name with
endpoint name first helps to organize them e.g. in UCMv2 blobs data
directories.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-05-22 16:20:03 +01:00
Fred Oh bf149274ad pull-request.yml: add mt8188 to gcc-build-only
mt8188 toolchain is added to SOF docker image.

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
2024-05-22 15:24:39 +01:00
Fred Oh 4cbff552bf scripts/docker-run.sh: thesofproject/sof:latest to default
latest_ubuntu22.04 was used when upgrading to Ubuntu 22.04.
Now it is time to go back to the latest.

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
2024-05-22 15:24:11 +01:00
Ranjani Sridharan f38f118b93 plugin: noise_suppression_interface: Query available devices
Query the list of available devices and use the NPU if available,
otherwise compile the model for the CPU.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2024-05-22 15:20:05 +01:00
Seppo Ingalsuo 8c71b7ef48 Audio: TDFB: Fix firmware crash caused by TDFB sink format set
The code in tdfb_params() was incorrect for a component that can
have different number of channels in source and sink. The update
of sink format can it worst case crash the successive component
in pipeline if the source channels count has changed from the
value the component has been initialized for.

The channels count need to be retrieved from input and output pins
information in extended IPC4 base config. To get the extension the
rimage toml files need to add for TDFB component the line
init_config = "1".

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-05-22 15:17:44 +01:00
Kai Vehmanen 283475c0d6 west.yml: update Zephyr to 9d8059b6e5541
Fast-forward Zephyr by 700+ commits including following patches
affecting SOF build targets:

ae082064ffa5 drivers: dai: sai: write some data into TX FIFO before start
0ca7ef78bc50 soc: intel_adsp: tools: merge cavstool.py and acetool.py code

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-05-22 14:02:02 +03:00
Pierre-Louis Bossart 69249fb75b topology2: add mtl-rt712 topologies version
For some reason the sof-mtl-rt712-l0 topology was not created despite
being listed in the kernel, and we now need the rt712 VB support with
an additional SmartMic path.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2024-05-16 18:11:29 +03:00
Kai Vehmanen fdb67ee782 west.yml: update Zephyr to e97d33d0c896
Fast-forward Zephyr by around 300 patches, including following
affecting SOF build targets:

soc/intel_adsp: ipc: initialize semaphore in driver init
drivers: dai: ssp: fix MN_MDIVCTRL_M_DIV_ENABLE for ACE+ platform
drivers: dai: intel: ssp: Only setup mclk/bclk when it is needed by role

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-05-14 20:34:10 +03:00
Daniel Baluta aab1368352 module_adapter: passthrough: register module logs in Zephyr
Use LOG_MODULE_REGISTER() to register cadence in the Zephyr logger
framework.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2024-05-14 15:00:16 +01:00
Guennadi Liakhovetski ab682597ee lnl: add support for llext modules
LNL now supports modular TOML, it can now also support LLEXT modules.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-05-14 14:48:13 +01:00
Seppo Ingalsuo b02a852053 Tools: Topology2: Add benchmark topologies for TDFB component
This patch adds s16/s24/s32 format test topologies for the
time domain fixed beamformer component.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-05-14 14:42:46 +01:00
Guennadi Liakhovetski 01228bbce7 llext: add support for files with multiple modules
Some components like mixin-mixout implement multiple modules
internally.  They should be handled by LLEXT as a single ELF object,
including for use-counting. But at the SOF level they implement
multiple module adapter drivers.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-05-14 14:37:44 +01:00
Guennadi Liakhovetski cfc84f4473 lib_manager: fix a memory leak
If module_adapter_new() fails in lib_manager_module_create(),
lib_manager_free_module() must be called to free allocated resources.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-05-14 14:37:44 +01:00
Guennadi Liakhovetski a306792a68 llext: add missing symbol exports
Export additional symbols, needed for modules like eq_iir and
mixin-mixout.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-05-14 14:37:44 +01:00
Guennadi Liakhovetski f86ad4fa20 eq-iir: convert to a loadable module
Build eq-iir as a loadable llext module.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-05-14 14:37:44 +01:00