Commit Graph

12233 Commits

Author SHA1 Message Date
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
Guennadi Liakhovetski 753e363f0f mixin-mixout: make modular
Convert mixin-mixout to a loadable llext module.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-05-14 14:37:44 +01:00
Guennadi Liakhovetski 89d90ae0af build: remove a redundant call to 'str()'
west.configuration.get() already returns a string, no need to call
'str()' on it again.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-05-14 14:37:44 +01:00
Guennadi Liakhovetski 05e69e1bb9 llext: update to use add_llext_target()
Zephyr now provides a convenient cmake API for LLEXT modules, update
SOF to use it by defining common cmake functions.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-05-14 14:37:44 +01:00
Guennadi Liakhovetski 30386bae13 llext: add and use macros for easier LLEXT conversion
Add 3 macros to simplify LLEXT module implementation and use them in
mixin-mixout and eq_iir. Only two of them can be used in
smart_amp_test_ipc4.c so far, because it's also used for LMDK-style
module building.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-05-14 14:37:44 +01:00
Guennadi Liakhovetski c34cdaf376 compile: replace 'typeof' with '__typeof__' globally
When compiled with '-std=c99' or newer 'typeof' is unavailable and
'__typeof__' should be used instead [1].

[1] https://gcc.gnu.org/onlinedocs/gcc/Alternate-Keywords.html

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-05-14 14:37:44 +01:00
Damian Nikodem 529a4c6246 audio: base_fw_intel: refactor memory power management register access
This commit refactors the memory power management register access to use
the HPSRAM_REGS and LPSRAM_REGS macros instead of direct io_reg_read calls.

Signed-off-by: Damian Nikodem <damian.nikodem@intel.com>
2024-05-13 15:29:38 +01:00
Marcin Szkudlinski 618bdbdb40 dp: remove unused code from dp_queue
Dp queues are no longer kept as a list of objects,
remove unused list maintenance code and data

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2024-05-13 12:05:03 +03:00
Marcin Szkudlinski 4240869c09 dp: use shadow dp_queue from comp_buffer
Instead of creating dp_queue in module adapter, use shadow
buffering provided by comp_bufer

It simplifies the code and makes it more race-resistant

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2024-05-13 12:05:03 +03:00
Marcin Szkudlinski 6e769c417d dp: using of a dp_queue as a shadow of comp_buffer
Connection between LL and DP component is implemented bu using
double buffering - between comp_buffer and DP component there's
additional "shadow" dp_queue

Currently shadow buffers are created in module adapter in "prepare"
handler and freed in "reset" handler. It may lead to races when there
are bind/unbind operation between a components in separate pipelienes,
especially when one of the pipelines is already running

The commit makes shadow dp_queue to be a part of comp_buffer. When
shadow is created, it replaces source or sink interface of audio_stream
allowing the module connected to it using all properties of dp_queue,
like lockless cross-core connection.

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2024-05-13 12:05:03 +03:00
Marcin Szkudlinski e117e9a004 mod: mark sink/src api as private in audio_stream
as agreed some time ago, parts of structures
that should not be modified or accessed directly
("private") should be marked with _ prefix
https://github.com/thesofproject/sof/issues/8100

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2024-05-13 12:05:03 +03:00
Seppo Ingalsuo 374d2d668d Audio: SRC: Use valid_bit_depth to select processing function
The check of cd->ipc_config.base.audio_fmt.depth results to
select S32_LE format processing function for SRC when the format
is S24_LE. The check need to be done for valid_bit_depth instead.

The S32_LE function appears to work but any sample that exceeds
the range -2^23 .. +2^23-1 is overflow for S24_le. Also the use
of S24_LE processing core will improve the signal-to-noise ratio.

Reported-by: Tomasz Leman <tomasz.m.leman@intel.com>
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-05-09 10:50:25 +01:00
Tomasz Lissowski 7f6d1c6c7e cadence: disable deep buffering of encoder output
Suppress the existing 'deep buffering' feature in the case of Cadence
encoders. This prevents the encoder output stream from being expanded
with (inappropriate) all-zeros leading data.

Signed-off-by: Tomasz Lissowski <tomasz.lissowski@intel.com>
2024-05-09 10:49:09 +01:00
Tomasz Lissowski 4f3e4f98ac cadence: add support for mp3 encoder
This adds support for Cadence MP3 Encoder module.

Signed-off-by: Tomasz Lissowski <tomasz.lissowski@intel.com>
2024-05-09 10:49:09 +01:00
Guennadi Liakhovetski 0431d2d3b3 toml: (cosmetic) unify indentation
Reduce indentation to match other files.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-05-09 10:47:34 +01:00
Guennadi Liakhovetski 9c3a3e9f33 lnl: convert to modular toml
Convert LNL to a modular TOML layout. Many modules have different
configurations for different platforms. In this version we put them
all in respective TOML files directly. If desired, they can be later
extracted into per-platform files. This can be done on a per-module
basis, in which case individual commits will be small.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-05-09 10:47:34 +01:00
Seppo Ingalsuo a81a235ae6 Tools: Topology2: Intel: Add 16 and 24 bit DMIC DAI copier format option
This patch allows the kernel to choose 16 bit format if the DMIC
NHLT is missing the recommended 32 bit mode blob. The 24 bits is
also in theory possible so it is added for completeness.

The DAI copier is converting the output format for internal pipelines
into S32_LE format, so the other operation is not impacted. For systems
with 32 bit DMIC NHLT there is no impact.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-05-09 11:19:12 +03:00
Marc Herbert 8a78394a13 .github: llext: unhardcode mtl/module_overlay.conf
Ready to add LNL or other back

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-05-09 11:16:51 +03:00
Marc Herbert afc769f3c9 llext_link_helper.py: use a raw string for '\.so$' regex
Always use a "raw string" for regular expressions, otherwise the
backslash is used to start Unicode escape sequences.

Fixes hopefully harmless error:
```
scripts/llext_link_helper.py:38: SyntaxWarning: invalid escape sequence '\.'
  p = re.compile('(^lib|\.so$)')
```

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-05-09 11:16:51 +03:00
Marc Herbert 59bc4e26ba fuzz.sh: fix ZEPHYR_BASE comment
Explain why and when ZEPHYR_BASE is useful. Zero code change.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-05-09 11:16:51 +03:00
Kai Vehmanen d533d4290e topology2: common_definitions: improve SAMPLE_TYPE documentation
Clarify documentation of SAMPLE_TYPE_MSB_INTEGER sample type
value and fix documentation of SAMPLE_TYPE_LSB_INTEGER. These
definitions are often confused with integer endianness, which is
not related. Clarify this better.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-05-09 11:14:12 +03:00
Andy Ross e7f76eec4d platform/posix: Unbreak fuzzer support
Upstream Zephyr moved the LLVM fuzzer entry point out of the arch
layer and made it an app responsibility, so we broke.  Add back the
support here that got removed.

Fixes #9101

Signed-off-by: Andy Ross <andyross@google.com>
2024-05-09 11:13:15 +03:00