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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>