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>
We now have a "module" directory under
src/audio/module_adapter/module so it shouldn't be ignored by git any
more.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
SOF uses IDC (Intra DSP Communication) protocol to orchestrate
work across multiple DSP cores.
The interface in sof/drivers/idc.h defines the protocol and
also provides a high-level interface for drivers. On Zephyr,
the SOF IDC protocol is used, but the actual communication
is implemented on top of Zephyr P4WQ workqueue interface,
instead of directly calling into drivers.
Move the Zephyr implementation from src/schedule/ into
src/idc/ which is more suitable place for this code.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Add function to fetch dai fifo depth from driver platform data, as for
some reason it is missing. Update all drivers that are actually using
it.
Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
In preparation for modifying the volume component to use the new
module API, add support for SET_VALUE/GET_VALUE control commands.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Define the set_large_config and get_large_config ops for the module
adapter component. These are mandatory ops needed to make the module
adapter compatible with IPC4.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Module adapter can be used by components with types other than
SOF_COMP_MODULE_ADAPTER. So modify the create op to handle components
by type.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Remove the const qualification for the data pointer and pass the pointer
for the data_offset_size. The data_offset_size will need to be read and
updated after copying the config data.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Change all functions to accept a pointer to struct processing_module
as a parameter and use mod->priv to access the module data.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
This patch changes the assert to check of IIR processing function
and fail with -EINVAL if function is not set.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch changes the assert to check of FIR processing function
and fail with -EINVAL if function is not set.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The average number of cpu cycles/ticks spent could be provided per 1024
scheduled tasks by the performance counter. It would be more accurate for
MCPS measurement than the peak number. Even so, the tracing macro will log
both of them to provide more insights.
This is enabled by CONFIG_PERFORMANCE_COUNTERS_RUN_AVERAGE, which depends
on CONFIG_PERFORMANCE_COUNTERS.
Signed-off-by: Pin-chih Lin <johnylin@google.com>
To properly use buffer-locking functions many buffer and
audio-stream API functions have to use the __sparse_cache annotation too.
Note, that we don't convert comp_update_buffer_consume() and
comp_update_buffer_produce() yet. They will be converted together
with all the buffer API users to also move buffer acquisition out of
those functions into the caller scope.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
With some compiler versions container_of() loses any type attributes
which then leads to compilation issues. Add an attribute-preserving
version of the macro.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
buffer_acquire() and buffer_release() convert between cached and
uncached addresses. Add the sparse __sparse_cache annotation to them to
track down any API misuses.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
cache_to_uncache() and uncache_to_cache() functions take a cached
memory alias or return one respectively. Add the __sparse_cache annotation
to them.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>