Commit Graph

12273 Commits

Author SHA1 Message Date
Yong Zhi 9c334976c4 tools: plugin: README: remove reference to tgl-nocodec
Fix the tplg name to match the actual name used in example.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2024-06-18 14:29:11 +01:00
Marcin Szkudlinski 5f5fdb6cf9 fix: some code does not care for non-module adapter components
Legacy API that is not using module_adapter is now depreciated,
but there are still some modules that use it. So all common code
must work properly with both types of modules.
This commit is fixing crash in bind operation when binding
a legacy module. There also some comments added in potentially
similar places, but where legacy modules cannot be used.

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2024-06-18 14:25:20 +03:00
Andy Ross 79c7db16d8 sink/source: Add pipeline_id accessor API
Expose the new pipeline_id field in sof_audio_stream_params to a
cleaner sink/source API for use by module code.  Longer term this may
want to be indirected by newer backends.

Signed-off-by: Andy Ross <andyross@google.com>
2024-06-18 14:25:20 +03:00
Andy Ross d0c220d15c buffer: Move pipeline_id down into stream params
The pipeline_id has historically been part of the comp_buffer struct,
but that is being deprecated as a public API.  So move it down into
the contained sof_audio_stream_params struct where it can be found by
new style sink/source code.

Note that the actual value of the pipeline ID is a little ambiguous:
on IPC3, the buffer is defined by the user in the .tplg file as part
of a specific pipeline with a known ID.  With IPC4 topology, the
buffers are implicitly created and will be assigned the ID of their
source (!)  component.  It is legal to define a connection across two
pipelines, and there's no ability here to recover both pipeline IDs.

Signed-off-by: Andy Ross <andyross@google.com>
2024-06-18 14:25:20 +03:00
Andy Ross b08effa8e9 comp_dev: Eliminate use of drvdata for module backpointer
The current SOF architecture splits a "module" across two structs, the
legacy comp_dev and a newer struct processing_module.  The latter
contains a pointer to the former, but in many places existing code has
needed a backpointer to recover the module from a component.

So far this has abused the drvdata mechanism to store this as a void*,
but that's fragile as many components are already (!) using drvdata
for other purposes and will clobber the setting.  The fact that it
worked is seeming just by luck.  That pointer is for the exclusive use
of the comp_driver code associated with a component to store its own
data.  We can't be touching it from the global module code.

Just give the pointer a properly-typed field of its own and make sure
the two are initialized in tandem.  Longer term, SOF really needs to
fix this bifurcation and unify the two structs.

Signed-off-by: Andy Ross <andyross@google.com>
2024-06-18 14:25:20 +03:00
Andy Ross 36fd9b5e91 module_adapter: Remove modules_shim_new()
This is dead code: just a wrapper around module_adapter_new(), which
is a public API already in use.  Presumably a forgotten relic.
Remove.

Signed-off-by: Andy Ross <andyross@google.com>
2024-06-18 14:25:20 +03:00
Jaroslaw Stelter 6102aaca5e intel_adsp: ptl: Fix SOF compilation without PM
PTL has CONFIG_PM disabled. SOF should still build without
this configuration flag. This patch fixes the compilation issue.

Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
2024-06-14 15:14:36 +03:00
Grzegorz Bernat 87571f337c audio: volume: disable HIFI4 optimizations
HIFI4 has been disabled. HIFI3 is being used for
the volume component with peakVol.

There was a problem with test
test_01_09_peakvol_quality[44100Hz_16in16bit_1ch-0].
The main problem was with frequencies: 11025,
22050, 44100, 88200, 176400 Hz.
Because frame is different for these frequencies. For f=44100Hz
frame is equal 44 or 45. Some of the samples were simply not processed.

Changes to HIFI4 are not-trivial and failed to fix the problem.
However, HIFI3 is fully compatible and works properly.
Performance is worse by 1-2,5% in CPU cycle usage
but no glitches appear and all samples are processed correctly.

Signed-off-by: Grzegorz Bernat <grzegorzx.bernat@intel.com>
2024-06-14 14:46:08 +03:00
Peter Ujfalusi e137e9bcb8 topology2: common: pcm_caps: Change the periods_max from 1024 to 256
HDA host DMA has limitation on the number of BDL entries which translates
to number of periods, this limit is 256.

The Chrome ALSA compliance test is eagerly try to use as many periods as
it can which exceeds the BDL limit and the stream cannot be started.

Fixes: b3a6d1c570 ("topology2: common: pcm_caps: Increase periods_max from 16 to 1024")
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2024-06-14 11:03:12 +03:00
Seppo Ingalsuo 1470e6c585 Tools: Topology2: Use rates instead of rate_min/max in benchmark
The rate_min/rate_max is obsolete, should use rates with
list of rates to support. Without this change the playback
of non-48 kHz content happens with 48 kHz rate with pitch
shift effect. Aplay shows only a warning.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-06-13 10:37:19 +03:00
Guennadi Liakhovetski 7ee322f70a src: fix src_lite
src_lite is currently broken: its definition of the SRC_LITE macro at
the top of the file has no effect and its coefficients are never
used. Fix it by moving coefficient evaluation into a separate
function and calling it from both src.c and src_lite.c.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-06-13 10:36:15 +03:00
Guennadi Liakhovetski 8795e0f0ad src: src_lite depends on src, make this explicit
src_lite uses all the code as src only with a different set of
coefficients. Make this obvious in Kconfig and in TOML.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-06-13 10:36:15 +03:00
Guennadi Liakhovetski 73458ce214 src: make data and functions static
All the coefficient data and many functions in src don't need to be
global, make them static.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-06-13 10:36:15 +03:00
Guennadi Liakhovetski ae4f3143c1 llext: only enable on ACE platforms
cAVS platforms don't use LLEXT because memory mapping isn't supported
on them. Select LLEXT per platform, so far only for ACE 1.5 and 2.0.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-06-12 11:07:35 +01:00
Guennadi Liakhovetski c79628308f llext: don't build if CONFIG_LLEXT=n
Not all configurations need LLEXT, don't include LLEXT support in
such cases.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-06-12 11:07:35 +01:00
Guennadi Liakhovetski 1673b1097e west: update to Zephyr "main", fixing disabled LLEXT builds
Fixes, needed for a recent Zephyr head plus a PR to fix
CONFIG_LLEXT=n builds.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-06-12 11:07:35 +01:00
Seppo Ingalsuo 65bad5c0c1 Tools: Testbench: Fix load of MFCC component
The load of MFCC fails with testbench due to missing call of
sys_comp_module_mfcc_interface_init() in common_test.c
testbench initialize.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-06-10 17:20:59 +01:00
Andy Ross 5df28c4ae7 module_adapter: Correct C99ism
Compiler flags used with older xcc compilers still disallow
declarations in for() expressions.

Signed-off-by: Andy Ross <andyross@google.com>
2024-06-10 17:19:38 +01:00
Andy Ross 57948614c1 platform/mt8195: Bump AEC stack size again
This was OK a few months ago, but something in recent SOF has expanded
stack requirements and we now get overflows.  Move to 12k stacks when
AEC is enabled.

Signed-off-by: Andy Ross <andyross@google.com>
2024-06-10 17:19:38 +01:00
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