Commit Graph

401 Commits

Author SHA1 Message Date
Baofeng Tian ae464443c8 Audio: mux: split mux code with ipc3 and ipc4
This is a clean up, purpose is de-cluster headers, toml files,
Readme.md etc per module basis, since today everything is
scattered in current code base.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-12-11 14:08:50 +02:00
Andrula Song 7494ee7e83 Audio: ASRC: Split IPC version code to speclfic file
Move IPC3 related code to asrc_ipc3.c and IPC4 related code
to asrc_ipc4.c.

Signed-off-by: Andrula Song <andrula.song@intel.com>
2023-12-11 13:10:12 +02:00
Guennadi Liakhovetski dba33ccbfd vmh test: extend test for spanning
Test both cases - when spanning multiple blocks is allowed and when
it isn't.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-12-08 15:29:06 +02:00
Guennadi Liakhovetski ee534b2203 test: extend VMH testing with an allocation
Add calls to vmh_alloc() and vmh_free() for testing.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-12-08 15:29:06 +02:00
Guennadi Liakhovetski c8ecb88355 test: add a simple VMH test
This adds an initial Virtual Memory Heap test.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-12-08 15:29:06 +02:00
Guennadi Liakhovetski 7b5d1bbe39 test: add boot-time ztest-based testing
Add a ZTEST test-suite to run SOF boot-time self-tests at the time of
the first FW_GEN_MSG IPC.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-12-08 15:29:06 +02:00
Andrula Song 6563320273 zephyr/cmake: Fix the FIR math lib c files including errors
Fix the mistake of FIR lib files, we should include FIR math
lib .c files base on CONFIG_MATH_FIR instead of CONFIG_COMP_FIR.

Signed-off-by: Andrula Song <andrula.song@intel.com>
2023-12-06 14:27:54 +02:00
Baofeng Tian e72056769c Audio: dcblock: split dcblock with ipc3 and ipc4 specific code
Split dcblock with ipc3 and ipc4 specific code.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-12-04 20:56:25 +02:00
Baofeng Tian f93f7d423f Audio: multiband drc: split out ipc3 and ipc4 specific code
Split out ipc3 and ipc4 specific code from mulitband_drc.c.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-12-04 10:43:35 +02:00
Joe Cheng ce4acfd171 audio: dts: move dts code to standalone folder
This was suggested in PR#8389. Since the module uses
module_interface, it doesn't have to put it under module_adaper/module/.
Move dts codes from src/audo/module_adapter/module/ to src/audio/codec.

Signed-off-by: Joe Cheng <joe.cheng@xperi.com>
2023-12-01 16:20:29 +02:00
Joe Cheng 089435e008 module_adapter: dts: import DTS library from third_party
Update the path to import DTS library from third_party/lib/ instead of
src/audio/module_adapter/lib/release/.
This action was requested in PR#8379.

Signed-off-by: Joe Cheng <joe.cheng@xperi.com>
2023-12-01 16:20:29 +02:00
Marc Herbert 330d73eec1 cmake: a few new add_local_sources[_ifdef]() compatibility macros
For reducing CMake duplication and centralization, see #8260

Not used yet.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-11-29 14:52:36 +00:00
Marc Herbert 98d5efc3a7 zephyr/cmake: remove now unused SOF_IPC_PATH variable
Fixes commit 1bd9e0d2c7 ("cmake/zephyr: decentralize src/ipc/")

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-11-29 14:52:36 +00:00
Andrula Song 807471497a Audio: DRC: Add HiFi4 implementation of DRC
Add HiFi4 implementation of DRC.

Signed-off-by: Andrula Song <andrula.song@intel.com>
2023-11-27 11:16:21 +02:00
Adrian Warecki f21670b3b2 module: sink: source: Move sink/source api headers to module
Moved header files to the module directory to separate an shared interface
used by sof and native loadable modules.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2023-11-24 16:17:46 +00:00
Baofeng Tian 03a4c38a3d audio: tdfb: split ipc3 and ipc4 specific code
Split out ipc3 and ipc4 specific code from tdfb module, also
refined header files for new source file.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-11-17 12:05:58 +02:00
Baofeng Tian 5e40ac7c90 Audio: eq_fir: move out eq_fir ipc3 and ipc4 specific code
Move out ipc3 and ipc4 specific code to corresponding source file.
Also, move some common functions to header file.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-11-16 16:43:50 +02:00
Joe Cheng 98d492ab94 zephyr : import dts library
Importing DTS library here to ensure DTS library is built into SOF
firmware as a static library.

Signed-off-by: Joe Cheng <joe.cheng@xperi.com>
2023-11-14 08:20:54 -08:00
Rander Wang b7858e8af1 zephyr: cavs: add secondary core context save support
Register pm_state_notifier to set ready_flag for secondary core when it
is powered up for second time after first fw boot. We can remove
CONFIG_ADSP_IMR_CONTEXT_SAVE check for cavs platform for this feature.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2023-11-09 11:17:43 +02:00
Marc Herbert 1bd9e0d2c7 cmake/zephyr: decentralize src/ipc/
Adding all source files in a single, giant zephyr/CMakeLists.txt is
inconvenient and does not scale.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-11-08 16:53:28 +00:00
Marc Herbert ef563ebfe3 cmake/zephyr: decentralize src/init/
Adding all source files in a single, giant zephyr/CMakeLists.txt is
inconvenient and does not scale.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-11-08 16:53:28 +00:00
Jaroslaw Stelter 253e09feb8 idc: ipv4: Add idc_comp_free operation
New IDC request idc_comp_free() is required to delete
component located on different core than the pipline to which
the module belongs.

Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
2023-11-08 14:34:35 +02:00
Zhang Peng 8447952438 zephyr: build: add support for imx8ulp
Build SOF with Zephyr for i.MX8ULP platform.

Signed-off-by: Zhang Peng <peng.zhang_8@nxp.com>
2023-11-06 09:34:37 +01:00
Marc Herbert 09eae9beb4 Revert "samples: Fix zephyr config"
This reverts commit fbde1dccf8.

Now that CONFIG_SAMPLE_SMART_AMP has a hard, menu dependency on
CONFIG_SAMPLES, we don't need to encode Kconfig dependencies in CMake
any more.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-11-02 12:49:08 +02:00
Fabiola Kwasowiec 90fef5afd2 src_lite: add module
Addition of SRC Lite module,
which only supports a subset of conversions
supported by the SRC module.

Purpose of SRC Lite module is memory optimization.
Code of SRC Lite is drastically reduced and requires
significantly less memory. When needed one of
defined conversions, driver can choose SRC Lite
module instead of SRC module to optimize memory utilization.

48 -> 16kHz
44.1 -> 16 kHz
32 -> 16 kHz
44.1 -> 48

Signed-off-by: Fabiola Kwasowiec <fabiola.kwasowiec@intel.com>
2023-10-26 17:08:29 +03:00
Serhiy Katsyuba 88b609ed07 ipc4: Add cross-core binding support
Implements binding of two pipelines from different cores so stream could
travel cross-core.

Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
2023-10-25 10:57:53 +03:00
Baofeng Tian 9e0f7eecec audio: eq_iir: create generic/ipc3/ipc4 source files for eq_iir
Create generic ipc3 ipc4 source files and move related code
into these source files.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-10-20 14:57:24 +01:00
Marc Herbert fd497c906a
Merge e330fb4ec7 into 5b5566f534 2023-10-11 16:16:37 +02:00
Anas Nashif 5b5566f534 zephyr: remove stray } from RIMAGE_CONFIG_PATH
A stray } is at the end of RIMAGE_CONFIG_PATH causing issues when
signing images.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-10-11 17:07:08 +03:00
Baofeng Tian 48616b2092 audio: module adapter: create ipc3 and ipc4 specific source file
create ipc3 and ipc4 specific source file, these files will
only be used to store specific code accordingly.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-10-10 14:56:20 +03:00
Marc Herbert f55338a985 Switch Zephyr build to new sof/tools/rimage location
Switch away from the independent rimage submodule. Long story in
https://github.com/thesofproject/sof/issues/8178 and others.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-10-09 13:06:12 -07:00
Marc Herbert e08b2c2043 zephyr/cmake: add new ${RIMAGE_TOP} constant
In preparation for changing it, see
   https://github.com/thesofproject/sof/issues/8178

No functional change yet.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-10-05 17:34:00 +03:00
Tomasz Leman 6d2352a107 west.yml: update zephyr to 3.5.0-rc1
Zepych update: total of 853 commits.

Changes include:

i8c4eec7ac6 intel_adsp: boot_complete must be done PRE_KERNEL_1
1fc16e6565 release: Zephyr 3.5.0-rc1
c910dc81a6 sys_clock: header: minor cleanup and doxygenization
b9f8b91692 kernel: sys_clock: remove stray z_enable_sys_clock prototype
cc2a558707 kernel: move more internal smp calls into internal domain
a1c7bfbc63 kernel: remove unused z_init_thread_base from kernel.h
209ff606be kernel: move internal smp calls to a internal header
e19f21cb27 kernel: move z_is_thread_essential out of public kernel header
f0c7fbf0f1 kernel: move sched_priq.h to internal/ folder
e6f1090553 kernel: Integrate object core statistics
1d5d674e0d kernel: Add initial k_obj_core_stats infrastructure
6df8efe354 kernel: Integrate object cores into kernel
55db86e512 kernel: Add initial obj_core infrastructure
eb1e5a161d kernel: FIFO and LIFO have their own sections
9bedfd82a2 kernel: Refactor CPU usage
baea37aeb4 kernel: Re-factor sys_mem_blocks definition
2f003e59e4 kernel: Re-factor k_mem_slab definition
41e0a4a371 llext: Linkable loadable extensions
4289359eb2 modules: mcux: fix HAS_CMSIS_CORE selection
1194a35aa2 xtensa: cast char* to void* during stack dump with %p
fcf22e59b8 xtensa: mark arch_switch ALWAYS_INLINE
b2f7ea0523 soc: xtensa/intel_adsp/ace: fix _end location
e560bd6b8c boards: intel_adsp: fix board compatible
b4998c357e mm_drv: tlb: Fix compile time warning
759e07bebe intel_adsp: move memory window setup to PRE_KERNEL_1

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2023-10-03 09:55:47 +03:00
Kai Vehmanen 9f2d19d30c vmh_free: cosmetic changes to local variable
The_very_long_variable names make it hard to modify
the code and keep to under-100-characters coding
guidelines of the codebase.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-10-03 09:55:47 +03:00
Seppo Ingalsuo f57e478f4c Zephyr: Fix path to google_hotword_detect.c
The file is found from subdirectory src/audio/google. Without
fix if CONFIG_COMP_GOOGLE_HOTWORD_DETECT is enabled build fails:

CMake Error at sof/zephyr/cmake/modules/extensions.cmake:424
(add_library):
Cannot find source file:
/src/audio/google_hotword_detect.c

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-09-25 10:35:27 -07:00
Daniel Baluta 7ca9a2eb8a driver: imx: Add PDM MICFIL driver
The Pulse Density Modulated Microphone Interface (MICFIL) is a popular
way to deliver audio from microphones to the processor in several
applications, such as mobile telephones. However, current digital-audio
systems use multibit audio signal (also known as multibit PCM) to
represent the signal. This block implements the required digital
interface to provide a 24-bits audio signal from a PDM microphone
bitstream in a configurable output sampling rate.

This patch adds initial support for PDM MICFIL IP found on i.MX8MP
board.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2023-09-20 14:43:11 +03:00
Baofeng Tian 9fdbf1c398 audio: src: split src ipc3 and ipc4 specific file
create new files to cover ipc3 and ipc4 specific code.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-09-13 12:06:57 +03:00
Marcin Szkudlinski bec031a7a3 dp: introduce dp_queue
DP queue is a lockless circular buffer
providing safe consumer/producer cached operations cross cores

prerequisites:
 1) incoming and outgoing data rate MUST be the same
 2) Both data consumer and data producer declare
    max chunk sizes they want to use (IBS/OBS)

required Buffer size:
	- 2*MAX(IBS,OBS) if the larger of IBS/OBS
          is multiplication of smaller
	- 3*MAX(IBS,OBS) otherwise

The queue may work in 2 modes
1) local mode
   in case both receiver and sender are located on
   the same core and cache coherency
   does not matter. dp_queue structure is located in cached memory
   In this case DP Queue is a simple ring buffer

2) shared mode
   In this case we need to writeback cache when new data
   arrive and invalidate cache on secondary core.
   dp_queue structure is located in shared memory

dpQueue is a lockless consumer/producer safe buffer.
It is achieved by having only 2 shared variables:

 write_offset - can be modified by data producer only
 read_offset - can be modified by data consumer only

 as 32 bit operations are atomic, it is multi-thread and multi-core save

There some explanation needed how free_space and
available_data are calculated

number of avail data in circular buffer may be calculated as:
	data_avail = write_offset - read_offset
  and check for wrap around
	if (data_avail < 0) data_avail = buffer_size + data_avail

The problem is when write_offset == read_offset,
!!! it may mean either that the buffer is empty
    or the buffer is completely filled !!!

To solve the above issue having only 2 variables mentioned before:
 - allow both offsets to point from 0 to DOUBLE buffer_size
 - when calculating pointers to data, use:
         data_bufer[offset % buffer_size]
 - use double buffer size in wrap around check when calculating
   available data

And now:
  - write_offset == read_offset
		always means "buffer empty"
  - write_offset == read_offset + buffer_size
		always means "buffer full"

  - data_avail = write_offset - read_offset
	if (data_avail < 0) data_avail = 2 * buffer_size + data_avail

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2023-09-12 15:11:44 +03:00
Gerard Marull-Paretas 014d2624ca zephyr: lib: regions_mm: add missing init.h
Because module uses SYS_INIT defined in init.h. Things likely worked
because of indirect includes.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-09-06 14:09:36 +03:00
Gerard Marull-Paretas b66e79dc3d zephyr: lib: alloc: s/device.h/init.h
Module is using Zephyr SYS_INIT API, defined in init.h, not device.h.
Code relied on indirect includes.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-09-06 14:09:36 +03:00
Fabio Baltieri f78d759f89 zephyr: edf-schedule: fix CONTAINER_OF type
The z_delayed_work field in struct task is a delayed work, so to go from
k_work to it safely there's an extra step. Add a
k_work_delayable_from_work to fix that.

This is harmless right now because k_work is the first field in
k_work_delayable but the extra step is the safe way of doing it.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-08-31 22:14:37 +03:00
ShriramShastry 31453ceca3 Math: Library: Add the HiFi3, HiFi4, HiFi5 exponential function
This check in change eliminates the extra include isa.h header file
from the exp_fcn_hifi.c file, as it does in the exp_fcn.h file.

Signed-off-by: ShriramShastry <malladi.sastry@intel.com>
2023-08-31 15:22:43 +01:00
Baofeng Tian 7d9a3ca030 audio: volume: move volume out from module adapter
move volume from module adapter to src/audio directory, it is a
critical audio component.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-08-30 13:49:48 +01:00
Baofeng Tian 550968b169 audio: volume: create ipc3 and ipc4 specific file
create ipc3 and ipc4 specific files and used to cover specific
functions.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-08-30 13:49:48 +01:00
Peter Ujfalusi 4a27f3bce0 idc: Add phase definition to IDC_MSG_PPL_STATE extension
Add definitions for pipeline state change phases to be executed when a
PPL_STATE message is handled by a remote core.
The phase can be a combination of:
PREPARE and TRIGGER.
PREPARE will run a configuration (state change preparations) phase on the
	pipeline
TRIGGER will run a a trigger on the pipeline

Set ONESHOT in ipc4_set_pipeline_state() to have both phases to be run in
order to avoid regression.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2023-08-29 18:29:05 +03:00
Peter Ujfalusi fd60858a4c idc: Add pipeline ID mask definition to IDC_MSG_PPL_STATE extension
In preparation to share the extension with an action, first introduce a
mask so that the idc code is prepared for a shared use of the extension.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2023-08-29 18:29:05 +03:00
Kai Vehmanen 0b79666a6d platform: tigerlake: remove CAVS_LPS support
Remove support for Intel cAVS Low Power Sequencer for Power Management.
This code is specific to XTOS builds for Tiger Lake (cAVS)
platforms and no longer used in Zephyr builds.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-08-23 12:58:46 +03:00
Kai Vehmanen 3a02dacab5 zephyr: Intel cavs25: remove non-native build
Remove all cmake rules to build SOF for Intel cAVS2.5 hardware
using non-native drivers (i.e. use XTOS drivers from SOF tree
instead of Zephyr native drivers). This is no longer supported
nor tested, so can be removed.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-08-21 12:21:55 +03:00
Kai Vehmanen 6efff4ccdb zephyr: remove mem_window.c from Intel cAVS2.5 build
Memory window management has been moved to Zephyr drivers
for this platform, so building this file on SOF side is no
longer needed.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-08-21 12:21:55 +03:00
Baofeng Tian 05dcf1ccde audio: zephyr: add -fno-inline-functions option to zephyr code
By enable/disable COMPILER_INLINE_FUNCTION_OPTION to control
add or remove -fno-inline-functions build option for sof zephyr
code.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-08-18 10:15:44 +03:00