The patch introduced in this commit:
SHA-1: 68345fb168
* module_adapter: Add support for IPC4 in module_adapter_new
broke previous implementation of iadk_modules.c, sice loadable
modueles needs congiguration size to be passed from IPC handler
to the module code. These changes resolves that issue.
Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
The memcpy_s() function is called from CPP code in IADK modules.
Declare it as extern "C" when header included in CPP code.
Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
Running a pipeline with unbinded copier leads to memory
corruption. Normally pipeline should not be started with
unbinded components, however, this still can happen due to
a bug in test or driver.
Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
we will switch to using this new logging tool, copy it to the tools
folder, then it will be uploaded to CI storage after building.
Signed-off-by: Keqiao Zhang <keqiao.zhang@intel.com>
Size parameter is moved from
struct sof_ipc_reply to struct sof_ipc_cmd_hdr.
Added changes accordingly.
Signed-off-by: Vamshi Krishna Gopal <vamshi.krishna.gopal@intel.com>
Cache issue can occur when several set large config messages
were sent one after another
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
Add test for psy_hz_to_mel(), psy_mel_to_hz(), psy_get_mel_filterbank(),
and psy_apply_mel_filterbank_16/32(). All the test data in C header
files was created with script ref_auditory.m.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch adds a psycho-acoustics and auditory system related
functions library. Currently the library provides functions for Mel
frequency scale. Functions are provided to convert between Mel and
Hz, initialize a Mel filter bank and apply Mel filter bank to
convert a linear power spectrum into an auditory power spectrum.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Modify the definition of the reset API in the module adapter interface
to make sure that it should reset the module state back to
MODULE_INITIALIZED and free all memory that was allocated during the
prepare() callback. With this change, stopping and restarting streams
will always be guaranteed to invoke the module's prepare() callback.
Also, fix the passthrough and cadence codec implementation to follow the
new definition.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
The list fields in the ipc_msg objects used by IPC4 stack, are not
initialized properly. This breaks the queueing logic in ipc_msg_send()
when it checks for "if (list_is_empty(&msg->list))". As a result,
if a IPC could not be sent immediately as the driver is busy, it would
not properly be resent later.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
ipc_send_buffer_status_notify() uses a static ipc_msg object
to send the notifications. In normal circumstances, notifications
are never queued as they are sent as high-priority messages,
but this is still possible. Requeing the same object can potentially
lead to memory corruption as the caller is modifying the message
object, while it may in fact be in use still.
To avoid this, check in ipc_send_buffer_status_notify() whether
the IPC message queue has the notify object, and if yes, skip
the message. The buffer status notifications can be safely dropped
in error case, as host can read the log buffer status directly from
the SRAM window.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
If something unexpected happens and logging subsystem is flooded
with messages, do not make the matter worse by flooding the host
with IPCs. This implements a lower threshold for how often
notifications can be sent to host.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Fix incorrect usage of k_uptime_delta() that leads to incorrect
decisions when to send the BUFFER_NOTIFY IPC.
k_uptime_delta() not only calculates the delta, but also stores the
current uptime to the argument passed as reftime. This breaks the logic
in code as mtrace_notify_last_sent was updated unintentionally.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Add DRC files to Zephyr compilation to avoid failures like this:
sof/src/audio/drc/drc_generic.c:188: undefined reference to
`drc_lin2db_fixed'
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Found one issue on Linux platform that the initialized volume setting
by alsamixer doesn't make effect when playback is started. The reason
is that the volume config set is skipped when volume module is just
initialized. Now volume will be set when it is initialized. At this
time cd->channels is not initialized so use channal count in module
config.
Signed-off-by: Rander Wang <rander.wang@intel.com>
Code can now include <rtos/wait.h> and uses native Zephyr 64
cycle API instead of SOF version.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
This patch adds cast to int64_t for the multiplication and adds 32 bit
saturation to ensure overflow of the product is not possible.
This function is used to calculate ramp time in IPC4 NHLT blob mode
where the time is not passed from topology. Currently rates up to
48 kHz remain under product int32_t range, so normally there is no
issue. However 96 kHz rate would always result to incorrect
LOGRAMP_TIME_MIN_MS (10 ms).
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch adds to header file sof/audio/format.h two new macros
for 16 * 16 fractional multiply. It's identical to 32 bit but the
name suggests that operands are 16 bit where case to int32_t is
sufficient for the product.
- The calculation of cd->max_frames is changed use Q_MULTSR_16X16()
- Max_lag calculation is added type cast to int64_t though it does
not overflow with 48 kHz. But it could overflow with 96 kHz rate.
- A comment about 64 bit type is added to calculation of thr
- src_x and src_y calculation is done with Q_MULTSR_16X16()
- az_slow calculation is done with Q_MULTSR_16X16
- deg calculation is done with Q_MULTSR_16X16
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Add logs for all inbound and outbound IPC messages using a similar
logging style as used by Linux SOF driver.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
The zephyr header zephyr.h should be only used with
CONFIG_LEGACY_INCLUDE_PATH, which is deprecate by both
Zephyr and SOF.
The latest zephyr main will complain if zephyr.h is
used but CONFIG_LEGACY_INCLUDE_PATH disabled.
This patch deprecates zephyr.h and uses kernel.h instead,
so that we don't break with latest zephyr.
Signed-off-by: Chao Song <chao.song@linux.intel.com>
Buffer params (like stream format) are usually setup by component's
params() handler. params() is called before pipeline start. When copier
is binded with component on another pipeline, it might happen that
copier copy() is already running while other component params() was not
yet executed (by other pipiline).
Processing buffer with uninitialized params usually leads to crash:
division by 0 channels when calculating frames.
Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
When gateway is copier's source, this should not prevent
from calling "set sink format" for sink pin 0.
Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
Explain how to use this script with a different image version.
Docker image versions and tags tend to confuse new users.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
This makes it possible to run interactive commands like:
./sof/zephyr/docker-run.sh /bin/bash
Fixes commit 02c1269144 ("Add new, convenience zephyr/docker-run.sh
script")
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Fixes commit d09844ab98 ("zephyr/docker-build.sh: match UID with
'adduser' instead of 'chgrp -R'")
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
The xargs option `-I/--replace` hardcodes max lines `-L 1`. In other
words, it always splits the input line by line and ignores whitespace
delimiters inside each line. Initial xargs commit
d0f4aba934 ("topology: speed up topology build") used `--replace`
after `-n/--max-args=1` which was silently ignored by xargs version
4.7.0. Now xargs 4.8.0 prints the following warning:
xargs: warning: options --max-args and --replace/-I/-i are mutually
exclusive, ignoring previous --max-args value
Remove the ignored `-n 1` to remove the warning.
I compared the outputs before and after this commit and they're exactly
the same.
There's an extra twist. The same xargs command also uses the
`-d/--delimiter=,` option which makes xargs ignore newlines and
"translates" any max-line `-L` option to `--max-args`; including the `-L
1` max implied by `--replace`. This twist does not make a difference:
any max-line or max-args is always overridden by `--replace` whether
`--delimiter` is used or not.
Of course this entire xargs script is re-inventing (C)Make/ninja that
provide build parallelism for free and much more... I digress.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
This makes it much easier to run commands in the
ghcr.io/zephyrproject-rtos/zephyr-build container.
Loosely based on scripts/docker-run.sh.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
This reverts commit e29572bb2d.
The Zephyr SDK 0.15.0 was exceptionally backwards-incompatible, which
meant the docker image could not have it ahead of time as usual, which
caused some CI failures. More details in
https://github.com/zephyrproject-rtos/zephyr/pull/49496
These CI failures were not a bug, they were a "feature": they drew our
attention to how unusual 0.15.0 was and they let us inform developers
before they hit the issue. Continuous Integration at its best; we want
more of that.
Before this unusual 0.15.0 event we had been using "latest" for many
months without any issue.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
The rmb toolchain was added in commit 4e85dfc95f ("docker: add
AMD/Rembrandt gcc toolchain") and before.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
The parameters px and py in
Q_MULTSR_32X32(px, py, qx, qy, qp) function
must be cast to (int64_t) if other type.
Signed-off-by: Arsen Eloglian <ArsenX.Eloglian@intel.com>
System service functionality used by 3rd party modules expects
that IPC data buffer will be filled with data during
notification preparation. To avoid additional data copy,
provide message buffer directly to module. This requires
that ipc_msg_send() function will not fail if source data pointer will be
equal to destination one.
Signed-off-by: Stelter, Jaroslaw <jaroslaw.stelter@intel.com>
Signed-off-by: Dobrowolski, PawelX <pawelx.dobrowolski@intel.com>
Adding for ipc4_get_comp_drv check if module is loadable
and for active library manager functionality register it dynamically.
Signed-off-by: Stelter, Jaroslaw <jaroslaw.stelter@intel.com>
Signed-off-by: Dobrowolski, PawelX <pawelx.dobrowolski@intel.com>
Commit adds ipc which contains information need to load external
libraries from HOST and required actions to make it possible
using library manager functionality.
Signed-off-by: Stelter, Jaroslaw <jaroslaw.stelter@intel.com>
Signed-off-by: Dobrowolski, PawelX <pawelx.dobrowolski@intel.com>
Library manager is part of loading external libraries responsible of
handling data and placing it in proper order and places.
This feature is using module adapter API for
loadable native and external libraries.
After receiving IPC4 load library command
- reads manifest
- after module_id choses module to load and verify it (WIP)
- loads manifest
- allocs proper memory size
- transfer module from external MEMORY to HPSRAM (WIP)
Signed-off-by: Stelter, Jaroslaw <jaroslaw.stelter@intel.com>
Signed-off-by: Dobrowolski, PawelX <pawelx.dobrowolski@intel.com>