Assertions don't show proper location for functions implemented
in header file.
Before changes, example location of this assert was:
Location: src/audio/pipeline.c:303
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Included changes:
0d2af68a9e gitignore: Add checkpatch temporary file to gitignore
8249abfa11 toml: Keep available manifest parsers in list
c98a29da14 toml: Extract version parsing to separate function
b9cf1aeb3b pkcs1_5.c: don't pretend everything is fine when failing to sign
e87db0f080 pkcs1_5.c: intermediate named constants in ri_manifest_sign_v1_x()
86754c1389 hash: Assert memory overflow during hash calculation
37323face2 Merge pull request #28 from marc-hb/copy-sram-overflow
7322c02349 manifest.c: assert buffer overflow in man_copy_sram()
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
After experiments I found that current SDMA watermark
causes SDMA to miss SAI DMA requests.
The empirical value was chosen so that watermark is a
divisor of min(bd_count, fifo watermark).
Of course this needs to be revisited, but for now "it just works" (tm).
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
For handling events we only needs an enable/disable functionalities.
Setting up an event (that means reading the event number and saving
it in dma_pdata is already done at config time).
So, this patch just introduces:
* smda_enable_event
* sdma_disable_event
and removes existing sdma_clear_event and sdma_set_event.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
A channel will be scheduled when both an event has occurred
and the users have enabled the channel.
This allows us to strictly control channel scheduling.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Without this index will always be 0 and we cannot differentiate
between channels for various function calls.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Host platform sets HSTART_HE bit to activate the corresponding channel
and the DSP will clear the HE bit when done.
In order, for the channel to be rescheduled we need to start again the
HSTART_HE after we got an interrupt that a BD was processed.
This is done in sdma_copy using sdma_enable_channel.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
During several runs next_bd might not be zero, this means that
when an interrupt arrives we will mark the wrong BD as being ready
to be processed by the DSP.
This causes the DSP to block waiting forever for an available BD.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
We no longer care about setting overrides values at stop
because they are correctly set at config time.
What we need to do instead, is to clear HE bit (SDMA_STOP_STAT).
This patch also introduces sdma_disable_channel function to simmetry
with sdma_enable_channel.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
A channel is scheduled when the following condition is true:
(HE[i] or HO[i]) and (EP[i] or EO[i])
In order to strictly control a channel's behavior we allow it to run
only after the users has started the channel in sdma_start and an
event arrives.
For this reason we need to set host override and event override to 0.
This is already done at config time.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Channel priority is set during config time.
Also, notice that only channels will index != 0 will call
sdma_start so it is correct to not check for index != 0 in
sdma_start. This makes code easier to read.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
A few error paths through ipc_pipeline_complete() didn't send
any error log. Each silent error path is some kind of firmware
malfunction.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Both the fuzzer and the testbench call init_system_notifier which
initializes the struct so there is no need for this check (which causes
a double alloc) in the get function.
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
The bf_defaults() now sets the default directory locations for
for bf_export() so it does not need to be set in every script.
Also the defaults for input channels and output mixing are set to
that in typical design they do not need to be set.
The default distance for look direction is set to 5.0m so it is better
guaranteed in far field for even relatively large arrays. The far field
assumes planar sound waves. The design equations do not fully support
near field with spherical waves.
The FFT length is changed to 1024 to enable design of longer filter bank
filters. There's no compromise in performance for for e.g. length 64.
The incorrect use of mic_n (number of microphones) is replaced by
num_filters. It's possible define beamformer that ignores some mic
channels so these are not the same.
The automatic systematic design file names are now created for all array
types, not just line.
The script is made more flexible to run without need to export data and
clutter just to quickly interactively check from plots what kind of
beam pattern and other characteristic some array, e.g. circular with
some radius and mic count gives.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The common array identifier string is brought up for easier edit to
test other array geometries than this default. A typo about 16 kHz
is fixed, the test runs at 48 kHz testbench default rate.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch adds the missing XYZ 3D array helper and does minor fixes
for two others. The L-shape microphones orientation is made similar as
in rectangular array by inverting the y-axis. The missing centering
of rectangular array is added.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The memory sanitzer catches uninitialized value errors on the size check
for small data sizes. Therefore lets us calloc so we can assume the
whole region exists without having the sanitizer get upset.
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
Previously, the __GNUC__ flag was used to differentiate between GCC and XCC.
However, that flag is defined by XCC as well,
as a result, __XCC__ flag should be checked instead.
Signed-off-by: Slawomir Blauciak <slawomir.blauciak@linux.intel.com>
Audio component samples have been moved to a new location, fix Zephyr
builds to account for it.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
To use CAVS_VERSION* macros the <cavs/version.h> header has to be
included. Also remove superfluous empty lines from that header.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
ubsan found the following bug via oss-fuzz
/src/sof/src/ipc/handler.c:1385:9: runtime error: left shift of 15 by 28 places cannot be represented in type 'int'
This is caused by SOF_GLB_TYPE_MASK which has an implicit length of 15
(int16_t)
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
Any generated file should be tracked by git to keep repositiry clean.
Such an file should be added to .gitignore to reduce possibility of
accidentally pushig this file to remote branches, eg. after typing
`git add *` before pushing changes.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
This file is generate by checkpatch run, any temporary file shouldn't
be tracked by git. It was added to git by:
538eb6a: ("host: stub about required functions")
Moreover file is problematic for developers working on Windows,
now try to pull changes from remote repository ends up with:
$ git pull
error: invalid path '.checkpatch-camelcase.git.'
Updating 6e85152..7709924`
cloning repository ends up with:
$ git clone https://github.com/thesofproject/sof.git
Cloning into 'sof'...
remote: Enumerating objects: 97, done.
remote: Counting objects: 100% (97/97), done.
remote: Compressing objects: 100% (96/96), done.
remote: Total 67251 (delta 49), reused 4 (delta 1), pack-reused 67154
Receiving objects: 100% (67251/67251), 13.41 MiB | 2.62 MiB/s, done.
Resolving deltas: 100% (49768/49768), done.
error: invalid path '.checkpatch-camelcase.git.'
fatal: unable to checkout working tree
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
It should be replaced with new SOF_MEM_ZONE_RUNTIME_SHARED
for memory which will need free and SOF_MEM_ZONE_SYS_SHARED
elsewhere.
This commit removes old way of defining allocating shared
memory region and in new way, platform_rfree_prepare()
doesn't need to translate address for cavs platform,
because runtime shared heap is defined on uncashed memory
region internally.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Shared memory shouldn't be connected with any cpu core,
because in general such an resource may be shared between
any number of arbitrary chosen cores.
Connecting it with with core 0 heap, leads to unbalanced
heap usage between core 0 and secondary cores.
Moreover operations like alloc and free may be called from
two different cores, what's not possible in current implementation.
Such an situation is especially possibly during handling resources
describing hardware components, eg. DAI or DMA, from two different
cores.
Moving shared memory management to dedicated heap, allows to easily
use another memory region, what may be needed to fulfill platform
specific demands.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Extract common part to internal function, to allow easily add
new heap in future and remove code duplication.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
This allows to reuse this functions for another heaps.
Moreover it helps to omit double memmap committing,
because each client of this function already use memmap,
so is oblidged to call platform_shared_commit().
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
This modification allows parameter write at runtime.
Same modificatino was added to smart_amp_test.c
Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com>
Propley handle buffer data invalidation and writeback.
This is importnat to keep data synchronized.
Took modification from smart_amp_test.c
Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com>
frame_fmt for feedback was hardcoded to S32_LE format.
This workarround code is no longer needed.
Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com>
Use 'comp_get_state' function to read state instead of
doing directly access to state member viariable.
Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com>
There is no place for unused arguments, their are consequence of invalid
argument list as usual.
Such an situation is highly possible especially during defining trace
filters, eg `-Fv=mux 4.1` instead `-F"v=mux 4.1"` or `-Fv=mux4.1`.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
TE/RE bit will remain set until the end of current frame. So,
for example, even if we set TE to 0 the transmitter will still be
enabled until the end of current frame.
This can have unexpected results when quickly restarting a channel.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
The topology has two speaker amp configured, with voltage info
feedback-ed to host for each channel in the EchoRef, so update
SMART_REF_CH_NUM accordingly.
Signed-off-by: Yong Zhi <yong.zhi@intel.com>
The handler is the primary entry point for the fuzzer and therefore
needs to be added to the build.
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>