ca_copy_from_source_to_module() and ca_copy_from_module_to_sink() are
both invoked during every copy. So use memcpy() instead of memcpy_s() to
speed up the copies.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
When the module produces only period_bytes every period, there's no need
to save the produced samples in the intermediate local buffer, instead
copy them directly to the sink buffer and save an extra copy.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Simplify the logic by removing the unnecessary consume label. This will
change the logic to loop through the local output buffers when return is
-ENODATA or -ENOSPC. But since there will be no produced samples, this
loop will do nothing. It is not intended to optimize the performance at
this point and in fact the first few cycles might even take the hit
because of the extra looping. But this will help with clubbling the
handling of output samples simpler in the following patches.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
We need to use UUID in order to identify a component. For now
we only support module_adapter components so just skip checking
config->type.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
The audio_stream structure might be different between branches. To maintain the compatibility between branches, a layer between sof and RTNR is added.
Signed-off-by: Ming Jen Tai <mingjen_tai@realtek.com>
This removes a small but conflicting difference with upstream.
Fixes commit d98a7ed103 ("checkpatch: check ABI updates before warning
on it")
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Use a separate if(!$SOF) to minimize differences with upstream.
Also remove some spurious whitespace differences with upstream.
Zero functional change.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
These attributes were added to Zephyr's include/zephyr/debug/sparse.h by
commit 17eb313a1b15 ("sparse: add an address space and a __sparse_force
annotation")
This gets rid of dozens of warnings in
https://github.com/thesofproject/sof/runs/6387526478
```
ERROR: need consistent spacing around '*' (ctx:WxV)
+ struct comp_buffer __sparse_cache *buffer_c, *sink_c;
^
ERROR: need consistent spacing around '*' (ctx:WxV)
+ struct comp_buffer __sparse_cache *source_c;
^
```
etc.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Change to use the new model_handler to handle configs. In this way,
`config_new` is no longer needed and the code looks much cleaner now.
Signed-off-by: Eddy Hsu <eddyhsu@chromium.org>
Update rimage from version from ee5c3e1deb to 9d453321f89d453321f8 (origin/main) Write firmware file micro version to manifest
for cAVS platforms
05be213d46 config: Add mt8186.toml
ee5c3e1deb (HEAD) Added handling of OpenSSL on Windows with MSYS2
Signed-off-by: mengdonglin <mengdong.lin@intel.com>
Fix panic with capture pipeline prepare. Fw checks sink component
in another incomplete pipeline but the sink component is not set
at this time.
Stop pipeline check for ipc4 component in another pipeline and
return immediately.
BugLink: https://github.com/thesofproject/sof/issues/5777
Signed-off-by: Rander Wang <rander.wang@intel.com>
Use Zephyr API k_sleep() instead of obsolete wait_delay(). In XTOS
build the k_sleep() is implemented in xtos-wrapper/include/kernel.h
and it actually calls the same old wait_delay().
Signed-off-by: Jyri Sarha <jyri.sarha@intel.com>
Add k_sleep() and a minimum set of related typedefs and macros needed
to make the API usable. The implementation calls wait_delay(). Commit
adds also safeguard not to let Zephyr build include the file.
Signed-off-by: Jyri Sarha <jyri.sarha@intel.com>
fix mediatek driver build error after ipc_cmd_hdr is updated.
sof/src/drivers/mediatek/mt8186/ipc.c: In function ‘ipc_platform_do_cmd’:
sof/src/drivers/mediatek/mt8186/ipc.c:77: error: ‘ipc_cmd_hdr’ undeclared (first use in this function)
sof/src/drivers/mediatek/mt8186/ipc.c:77: error: (Each undeclared identifier is reported only once
sof/src/drivers/mediatek/mt8186/ipc.c:77: error: for each function it appears in.)
sof/src/drivers/mediatek/mt8186/ipc.c:77: error: ‘hdr’ undeclared (first use in this function)
CMakeFiles/sof.dir/build.make:714: recipe for target 'CMakeFiles/sof.dir/src/drivers/mediatek/mt8186/ipc.c.o' failed
Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>
There are few left paths and config names after switching from
codec_adapter to module_adapter.
Without this building codec modules fails
Fixes: b4591ca8f4 ("codec_adapter: rename it to module_adapter and fix all includes")
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
heap_alloc_aligned_cached() is a helper function used to allocate
memory with a cached alias. Therefore its returned pointer should
use the __sparse_cache annotation.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Cache synchronisation and address space conversion functions
explicitly specify the address space for their arguments and return
types. Add forced type-casts to make sure such address space changes
are documented.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
struct sof_mux_config and struct mux_stream_data are used to
load binary data from userspace. Add packed attribute to ensure
it has a stable and platform-independent layout.
Signed-off-by: Li-Yu Yu <aaronyu@google.com>
sizeof(struct mux_stream_data) was PLATFORM_MAX_CHANNELS-dependent.
In particular, if PLATFORM_MAX_CHANNELS < 8 the struct becomes
smaller. However in m4/muxdemux.m4, there is no easy way to supply
ROUTE_MATRIX with a smaller matrix other than 8x8 bits.
This commit pads struct mux_stream_data so it always has the a
platform-independent size: as if PLATFORM_MAX_CHANNELS were 8.
Signed-off-by: Li-Yu Yu <aaronyu@google.com>
Add a new -d option to support SOF debug build. This
option will add CONFIG_DEBUG=y to SOF configuration,
which is aligned with xtensa-build-all.sh script.
The -d option is a shortcut for '-o debug_overlay_path'.
Signed-off-by: Chao Song <chao.song@linux.intel.com>
Pipeline macro pipe-eq-iir-volume-capture-16khz.m4 misses an
update done to other pipelines. The macro COMP_PERIOD_FRAMES()
gives the correct buffer size in other pipelines.
Without this patch change of pipeline scheduling to 10 ms
from default 1 ms causes pipeline fail to buffer size check.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This commit adds Google RTC processing and RTNR to MT8195 override
config.
Please note that Google RTC Audio mocking processing is used in this
commit.
Signed-off-by: Ming Jen Tai <mingjen_tai@realtek.com>
The current IPC4 protocol implementation is not standalone but
but builds up on top of IPC3 which is used throughout SOF core.
The sof/ipc/common.h holds definitions which are related to
component interface and not IPC ABI specific so it's not a
suitable spot to keep IPC3 or IPC4 specific definitions.
This patch fixes the hierarchy of IPC4/IPC3 to match reality and
moves the ABI specific definitions of ipc_cmd_hdr to a suitable spot.
Signed-off-by: Rafal Redzimski <rafal.f.redzimski@intel.com>
The ipc_cmd_hdr should have size no lesser that largest
of the headers amongst all ipc protocol versions.
The use of smaller type for ipc_cmd_header is unsafe because
of casting pointers between differently sized headers followed by
accessing data through incremented pointer.
Signed-off-by: Rafal Redzimski <rafal.f.redzimski@intel.com>
IPC4 request/reply always consists of primary and extension dwords.
Since the extension is always present it makes no sense to:
- pretend that extension is first dword of payload,
- do tx_size related logic to handle extension,
- dynamically allocate extension along payload.
This patch updates common IPC4 structure definitions and
modifies the usage to get rid off the special treatment of
the extension dword.
Signed-off-by: Rafal Redzimski <rafal.f.redzimski@intel.com>
For every IPC4 command the header consists of two dwords.
First of which is primary and the second being extension.
This patch renames the ipc4 header fields for specific ipc4 command
structures to reflect that.
Signed-off-by: Rafal Redzimski <rafal.f.redzimski@intel.com>
ipc_msg_init should use the already initialized size field in
rhdr structure instead using the sizeof.
Signed-off-by: Rafal Redzimski <rafal.f.redzimski@intel.com>
comp_update_buffer_produce() and comp_update_buffer_consume() acquire
and release buffers internally. We need versions of those functions,
that take already acquired cached buffer objects as arguments, we
will switch over to them completely gradually. This patch adds such
functions.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
For some legacy reason(s), SOF assert() is not optional. This is unlike
any other assert() anywhere else. This hasn't been a problem yet because
until now SOF assert() has been mapped to a non-optional and limited
Zephyr k_oops()
This commit makes it possible to temporarily or permanently switch the
Zephyr build to Zephyr's __ASSERT(expr, #expr) macro which logs the
asserted expression. This commit does NOT make such a switch.
Note this commit is not enough to make assert() optional in the XTOS
build.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
assert() semantics are very clear: because asserts are optional, the
argument should never have side-effect, period. assert arguments should
be treated exactly the same as logging arguments. So
`assert(!memcpy_s())` is an obvious bug. Use variable to break that down
into two statements.
Fixes commit 0b7fd030b3 ("demux: return config on COMP_CMD_GET_DATA")
Fixes commit 385586a5f6 ("zephyr: implement IDC using P4WQ")
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
SOF CMake defines SOF_MAJOR, SOF_MINOR and SOF_MICRO for 3 fields of
firmware file version major.minor.micro. But CMake only passes the major
and minor version to rimage.
Now CMake will also pass the mirco version to rimage, so that rimage can
write it to different firmware manifest headers for cAVS platforms and
then sof_ri_info.py will be able to dump entire file version info from
the firmware binary.
Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Use Zephyr API k_msleep() instead of obsolete wait_delay_ms(). In XTOS
build the k_msleep() is implemented in xtos-wrapper/include/kernel.h
and it actually calls the wait_delay_ms().
Signed-off-by: Jyri Sarha <jyri.sarha@intel.com>
The commit adds kernel.h header at the top level of xtos-wrapper
include directory. The idea is to be able to write OS agnostic code
using Zephyr kernel API calls and simply including kernel.h without
worrying if we are building for XTOS or Zephyr.
This first commit contains Zephyr API style k_msleep() and k_usleep()
implementations. The functions in fact call the old
wait_delay-functions.
More implementations and declarations following Zephyr kernel.h
content can be added as needed.
Signed-off-by: Jyri Sarha <jyri.sarha@intel.com>
This can fail for various reasons listed in a comment.
Remove now redundant `west topdir` check.
Without this check, a not found SOF fails with very cryptic Kconfig
errors:
zephyr/samples/subsys/audio/sof/prj.conf:5:
warning: attempt to assign the value 'n' to undefined symbol HAVE_AGENT
zephyr/samples/subsys/audio/sof/prj.conf:8:
warning: attempt to assign the value 'n' to undefined symbol
DEBUG_MEMORY_USAGE_SCAN
zephyr/samples/subsys/audio/sof/boards/intel_adsp_cavs15.conf:1:
warning: attempt to assign the value 'y' to undefined symbol APOLLOLAKE
etc.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>