Commit Graph

11435 Commits

Author SHA1 Message Date
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
Marc Herbert 7737efadf4 xtensa-build-zephyr.py: remove imx8ulp from --all
As of today's Zephyr commit 92fb8b223825, imx8ulp does not compile.

Do not remove any of its data from `xtensa-build-zephyr.py` but exclude
it from --all

Fixes:
```
scripts/xtensa-build-zephyr.py --all

-- Board: nxp_adsp_imx8ulp
No board named 'nxp_adsp_imx8ulp' found.

CMake Error at zephyr/cmake/modules/boards.cmake:167 (message):
  Invalid BOARD; see above.
Call Stack (most recent call first):
  cmake/modules/zephyr_default.cmake:129 (include)
  share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
  share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
  CMakeLists.txt:5 (find_package)
```

Fixes 61ccb4c8da ("scripts: zephyr: Add support to build sof for
imx8ulp")

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-11-20 10:57:34 +02:00
Yong Zhi 4c25202108 audio: google_rtc_audio_processing: fixup undeclared identifier
This is fixup for d4b27bfa8b

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2023-11-20 10:56:12 +02:00
Yong Zhi 8b1a01f976 topology2: cavs-rt5682: Add Deep buffer PCM on amps
Add deep buffer PCM35 on amps for sof-mtl-max98357a-rt5682 tplg.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2023-11-17 13:12:32 +00:00
Yong Zhi 6a0e9b1eb4 topology2: deep-buffer: Add second instance
Add 2nd deepbuff PCM as an option.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2023-11-17 13:12:32 +00:00
Kai Vehmanen 8cdae1334e west.yml: update Zephyr to 063ce9caf54f
Update Zephyr to bring in following Zephyr commit:

155f866ecc2c dts: intel_adsp: ace remove dw watchdog

Link: https://github.com/thesofproject/sof/issues/8418
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-11-17 12:55:36 +02:00
Baofeng Tian a451d6b69a Topology2: fix obs size for src converter from 48k
From 48k input, the obs for 11025/22050/44100/88200/176400 setting
need take care, previous implementation left 5 words redundancy
for output, this change removed redundancy, since actual output
buffer size always use double obs size.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-11-17 12:47:40 +02:00
Baofeng Tian 85a15e5a06 Topology2: fix 22khz obs setting
22050Hz obs also need a separate setting, this was missed when first
create this file, now move it to the group with obs setting.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-11-17 12:47:40 +02:00
Baofeng Tian f60dd1818f audio: tdfb: rename some macros to avoid repeat definition
Add prefix SOF_TDFB to macros to avoid repeat definition.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-11-17 12:05:58 +02: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