Commit Graph

11444 Commits

Author SHA1 Message Date
Curtis Malainey 285c090a10 topology: Add support for buffer flags
Flags have been a part of IPC3 for ages, add support for them in the topology.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2023-11-30 10:16:59 +02:00
barry.jan 5cf1c9c0d6 topology: Add Waves codec to MT8188 topology
Modify sof-mt8188-mt6359 topology so Waves codec can be added
to playback in case 'WAVES' is defined.

Signed-off-by: barry.jan <barry.jan@waves.com>
2023-11-29 16:33:19 +00:00
Marc Herbert 2ce1f9ea34 math/cmake: use new macro add_local_sources_ifdef()
This makes the code shorter and will help with #8260

Zero functional change.

Do not use it when Zephyr use is not conditional.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-11-29 14:52:36 +00:00
Marc Herbert b53f2b08d8 module/cmake: simplify thanks to the new add_local_sources() macro
Leverage the previous commit.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-11-29 14:52:36 +00: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
Yong Zhi 5d8e03db6b audio: google_rtc_audio_processing: fixup removed struct member
This is fixup for a62b7cf1c3

error: 'struct comp_buffer' has no member named 'id'

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2023-11-29 14:26:08 +00:00
Daniel Baluta 0c3ae5ae3c audio: drc_hifi4: Fix compilation warnings
This fixes following compilation warnings:

repos/sof/src/audio/drc/drc_hifi4.c: In function ‘drc_delay_input_sample_s16’:
repos/sof/src/audio/drc/drc_hifi4.c:580: warning: assignment from incompatible pointer type
repos/sof/src/audio/drc/drc_hifi4.c:581: warning: assignment from incompatible pointer type
repos/sof/src/audio/drc/drc_hifi4.c: In function ‘drc_delay_input_sample_s32’:
repos/sof/src/audio/drc/drc_hifi4.c:718: warning: assignment from incompatible pointer type
repos/sof/src/audio/drc/drc_hifi4.c:719: warning: assignment from incompatible pointer type

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2023-11-29 14:25:23 +00:00
Daniel Baluta a4a3b3aed9 include: sof: common.h Fix compilation error
Commit 16d126a36f ("audio: Header files cleanup") removed
rtos/panic.h include but this is still needed.

Otherwise, we get the following compilation error:

/work/repos/sof/src/lib/lib.c: In function ‘memset’:
/work/repos/sof/src/lib/lib.c:31: warning: implicit declaration of function ‘sof_panic’

Fixes: 16d126a36f ("audio: Header files cleanup")
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2023-11-29 14:25:23 +00:00
Adrian Warecki 2b4e484427 rimage: module: Use file name in error message in module_write_whole_elf
By oversight, the error message did not use the file name passed as a
parameter to the module_write_whole_elf function.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2023-11-28 17:05:27 +02:00
Adrian Warecki 2b23146df6 rimage: elf_file: Fix elf_free behavior on unopened elf file
If more modules are provided in a command line than defined in a toml file,
the program outputs an error message. It frees the module structures
even though they have not been opened before. This resulted in an error
when trying to close a file that was not previously open. Added a check to
ensure that a file has been opened before trying to close it.
Error handling in the elf_open function has been simplified.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2023-11-28 17:05:27 +02:00
Laurentiu Mihalcea d42911d974 sof: coherent: Don't mark "struct coherent" as packed
On 64-bit systems (i.e: i.MX93), marking "struct coherent"
as packed leads to compilation warnings such as:

"warning: taking address of packed member of 'struct coherent'
may result in an unaligned pointer value"

This is because the "list" attribute is found at offset 36,
which is not 8B-aligned. In contrast, 32-bit systems
don't have this problem as the "list" attribute is found at
offset 24 which is 4B-aligned.

Since marking "struct coherent" as packed doesn't seem to
be necessary, remove this to fix the compilation warnings.
On 32-bit systems, 'pahole' shows no difference between
the 'packed' and the non-'packed' cases as the fields are
already naturally aligned at the moment.

A more detailed discussion regarding this issue can be
found here: https://github.com/thesofproject/sof/pull/8521.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2023-11-28 17:04:29 +02:00
Adrian Warecki 4509d7c0c0 lmdk: Update dummy module example
Updated dummy module example to use DECLARE_LOADABLE_MODULE_API_VERSION
macro.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2023-11-28 16:45:15 +02:00
Adrian Warecki cb1542dd51 lmdk: Fix build of module common functions
CMakeLists.txt file of common modules files use isZephyr macro which was
undefined on lmdk build scripts.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2023-11-28 16:45:15 +02:00
Adrian Warecki f1aaca8b85 lmdk: build: Add missing -l parameter to rimage
Added missing -l parameter in rimage command line to indicate signing of
a loadable module.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2023-11-28 16:45:15 +02:00
Adrian Warecki 98cc689232 module: module_adapter: lmdk: Improved module type detection
Defined API version used by a FDK modules. Created the
DECLARE_LOADABLE_MODULE_API_VERSION macro with which the loadable modules
can easily declare the version of used API. Improved module type
recognition. Now the type is recognized based on the value of the format
field instead of the API version. Added check for compatibility of API
version used by module.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2023-11-28 16:45:15 +02:00
Kai Vehmanen 5c0f8bdf6a versions.json: set version to 2.8.99
Open tree for 2.9 development now that stable-v2.8 is branched out.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-11-27 16:49:43 +00:00
barry.jan 39173087d9 waves: store config blob in a cache in waves.c
Store/apply config blob in a cache to avoid that
cfg.data will be released after prepare.

Signed-off-by: barry.jan <barry.jan@waves.com>
2023-11-27 16:55:39 +02:00
Rander Wang 383d17a19e copier: add support for windows driver
Windows driver always set sample type of MSB for 24/32 format but SOF FW
supports 24/32 LSB type for non-copier modules. So FW will convert the
input MSB 24/32 to LSB 24/32 and process it and convert it back to MSB
24/32 when exiting gtw.

Signed-off-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Damian Nikodem <damian.nikodem@intel.com>
2023-11-27 12:06:09 +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 4d4421a046 lmdk: Build module common functions
Added building a static library containing common functions for modules
provided by sof. Native loadable modules are statically linked to it.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2023-11-24 16:17:46 +00:00
Adrian Warecki f3e0959472 lmdk: module: Use extracted module headers in lmdk
Use of a separated module headers when building native loadable libraries.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2023-11-24 16:17:46 +00: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
Adrian Warecki 60e992426b module: format: stream: audio_stream: Move some definitions to module
Extracted struct sof_audio_stream_params and enum sof_ipc_frame definitions
get_sample_bytes, get_sample_bitdepth and get_frame_bytes functions to a
new files in 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
Adrian Warecki 0cfe9d95ea module: module_adapter: Move api_ver header file 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
Adrian Warecki af3486635f module: module_adapter: Move generic header file 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
Adrian Warecki 37dd2336c0 module: module_adapter: Move module_interface header 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
Adrian Warecki 68798e52a6 module: Move adsp_error_code header 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
Adrian Warecki e4ae7ecae9 module: Move ip4/base-config 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
Pawel Dobrowolski 16d126a36f audio: Header files cleanup
Removed unused includes from a header files.

Signed-off-by: Pawel Dobrowolski <pawelx.dobrowolski@intel.com>
2023-11-24 16:17:46 +00:00
Rander Wang 472458ef71 basefw: add support for fw config query for context save
If CONFIG_ADSP_IMR_CONTEXT_SAVE is enabled, base fw will report
fw_context_save is supported to host. Driver will assume fw doesn't
support this feature if it is not reported.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2023-11-24 14:16:00 +00:00
Rander Wang 173adc990c base_fw: sync config from ref fw
Update the basefw config query.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2023-11-24 14:16:00 +00:00
Andrula Song f4d043724d Audio: Move components related config to subfolder
Create a Kconfig for each module and include them from src/audio/Konfig.

Signed-off-by: Andrula Song <andrula.song@intel.com>
2023-11-24 14:12:51 +00:00
Rander Wang f1ee910fc2 west.yml: update Zephyr to efc32081893d
Update Zephyr to bring in following Zephyr commit:
efc32081893d soc: intel_adsp: cavs: mask idc interrupt
before halting cpu

Link: https://github.com/thesofproject/sof/issues/8492

Signed-off-by: Rander Wang <rander.wang@intel.com>
2023-11-24 14:06:13 +00:00
Kai Vehmanen 05bffd7e30 ipc4: handler: maintain IPC set_pipeline_state order
Fix a side-effect of commit 068f143810 ("ipc4: handler: Use separate
loops for pipeline state phases") where the order of pipeline
triggers was changed when the trigger handling was delayed to
the pipeline thread. If host asked for pipelines to be triggered
in order 2, 1, 0, the actual trigger order might end up as 0, 1, 2
based on how LL scheduler runs the pipeline tasks (0 is run first).

Fix the issue by adding a blocking wait to the IPC thread between
each delayed trigger.

Link: https://github.com/thesofproject/sof/issues/8481
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-11-24 13:25:47 +00:00
Kai Vehmanen 6c6a186727 audio: pipeline: do not propagate pipeline triggers for IPC4
One major difference in IPC4 versus IPC3 is that each pipeline
will get a separate SET_PIPELINE_STATE command. This is in stark
contrast to IPC3 where host sends STREAM_TRIG_START and firmware
is expected to propagate the state change to all connected
pipelines in the graph.

Change the code such that when pipeline component trigger is executed in
IPC4 build, propagation is stopped whenever we reach another pipeline.

This prevents bugs stemming from IPC3 related logic to propagate
pipeline triggers, interfering with IPC4 usages like in bug 8481.

To avoid false -ENODATA errors, drop IPC4 support for this capability.
The check added in commit b154132b46 ("ipc4: check pipeline priority
for error report") covers most cases, but this relies on host to send
the SET_PIPELINE_STATE calls in particular order. This unfortunately is
not a mandatory order to follow, so logic to check upstream pipeline
status to conclude downstream is in permanent -ENODATA state, is not as
solid as it is for IPC3. As this may lead to hard to debug errors (e.g.
when changing pipeline priorities in topologies which again affects the
order of the SET_PIPELINE_STATE), better to simply disable this feature
for IPC4.

Link: https://github.com/thesofproject/sof/issues/8481
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-11-24 10:48:44 +02:00
Marcin Szkudlinski c82226ec5c sink/src: add ID to sink/src API
add get buffer ID to sink/src api

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2023-11-22 19:38:08 +02:00
Marcin Szkudlinski a62b7cf1c3 buf: move buffer/stream ID to runtime_stream_params
runtime_stream_params is a container for all
parameters of a stream
Add an API call to retrieve it

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2023-11-22 19:38:08 +02:00
Kai Vehmanen ee80da7b00 schedule: zephyr_ll: update zephyr_ll_task_insert_unlocked comments
Clarify the inline comment in zephyr_ll_task_insert_unlocked()
explaining the task priority semantics. The old text is not clear on
what is "high priority". Make it explicit that 0 is the highest priority
and that the tasks are executed in order of task priority.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-11-22 12:02:23 +02:00
Ranjani Sridharan 2c8b76a9cb ipc4: module/handler: Fix compilation error
Fix the typecasting in a couple of places and compiler attributes to
prevent the following compilation errors:

ipc4/handler.c:1007:45: error: pointer targets in initialization of ‘const uint8_t *’
			{aka ‘const unsigned char *’} from ‘const char *’ differ in signedness [-Werror=pointer-sign]
 1007 |                 const uint8_t *end_offset = data + data_off_size;
      |                                             ^~~~
ipc4/handler.c:1040:57: note: expected ‘const char *’ but argument is of type ‘uint8_t *’ {aka ‘unsigned char *’}

ipc4/module.h:67:12: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__aligned’
   67 | } __packed __aligned(4);

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-11-22 09:41:50 +02:00
Ranjani Sridharan 615152019c ipc4: logging: Remove ipc4_logging_enable_logs() definition when CONFIG_LIBRARY is set
This is already defined in logging.c when a known logging method is not
set.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-11-22 09:41:50 +02:00
Ranjani Sridharan 48324bd3f4 tools: plugin: alsa: Remove calls to buffer_acquire/release
These dont exist anymore.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-11-22 09:41:50 +02:00
Ranjani Sridharan a8b2b86c9e audio: asrc: prevent compilation error when CONFIG_ZEPHYR_NATIVE_DRIVERS is not set
Use 2 separate signatures when CONFIG_ZEPHYR_NATIVE_DRIVERS is set vs
not set.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-11-22 09:41:50 +02:00
Ranjani Sridharan a8b027f7d4 audio: mixin_mixout: Make a couple of functions static
Make the mixout bind/unbind functions static.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-11-22 09:41:50 +02:00
Ranjani Sridharan f5ced09a5b posix: idc: Add missing definitions
Add a couple of missing definitions.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-11-22 09:41:50 +02:00
Marcin Szkudlinski e1cd2d2c99 DP: bugix - lists initialization was done too late
in case module prepare fails, dp_queue lists were left
uninitialized.
It may lead to crash if module reset was performed later

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2023-11-21 20:51:29 +02:00
Seppo Ingalsuo 980b9884f7 Tools: Test: Audio: Remove unused argument from src_test.m
In function test_run_src() the second argument "t" is not used
so it can be safely removed.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-11-20 15:43:51 +00:00
Marcin Szkudlinski 50c25760ab idc: check if secondary core is down before sending IDC
If for any reason a secondary core is down, IDC message has no
chance to be processed. This may lead to process hang in case
of blocking calls and to undefined actions in case of non
blocking.

This commit adds a check and error log message in case of
target core is down.

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2023-11-20 15:31:45 +00:00
Michal Bukowski ae31a28741 rimage: mtl: add cadence module entry
Added entry allows to enable cadence codec module.

Signed-off-by: Michal Bukowski <michal.bukowski@intel.com>
2023-11-20 15:27:53 +00:00
Fabiola Kwasowiec 1b81841a0b peakvol: set the correct vol_min and vol_max values
The current values result in incorrect signal
amplitudes at the peakvol module output.

Signed-off-by: Fabiola Kwasowiec <fabiola.kwasowiec@intel.com>
2023-11-20 11:02:20 +02:00