Array streams represents streams on "many" side i.e. input
for MUX and output for DEMUX.
For DEMUX each stream has masks array - 1 mask per output
channel. Each mask shows, from which input channel data
should be taken.
This commit reverts "demux" part of commit:
"b1b31e7154a5c159d81459634eabd8013b434181"
Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
Input and output channel settings from matrix row and column
are in reverse order, so they should be swapped.
Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
Also create trace_log_unfiltered() function, to be used internally
by tracing subsystem to emit information about suppressed trace messages.
The *unfiltered function could be also used as replacement
in _log_message() macro, to disable log filtering for debugging purposes.
Signed-off-by: Artur Kloniecki <arturx.kloniecki@linux.intel.com>
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>
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>
Currently pcm converter unit tests use mocked-up audio_stream
implementation which should be replaced with real FW implementation.
Signed-off-by: Artur Kloniecki <arturx.kloniecki@linux.intel.com>
UUID objects are represented by struct sof_uuid_entry instances in SOF.
Instead of casting pointers to them to integers for passing around,
carry them as pointers until they have to be cast to integers for
packing into data structures. This also fixes printing UUID, using a
"%pU" format.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Currently selector unit tests mock audio_stream by hand, which
adds maintenance overhead in case of changes in audio_stream
implementation, which are under way.
Signed-off-by: Artur Kloniecki <arturx.kloniecki@linux.intel.com>
Currently volume unit tests mock buffer components by hand, which
adds maintenance overhead in case of changes in buffer implementation,
which are under way.
Signed-off-by: Artur Kloniecki <arturx.kloniecki@linux.intel.com>
Currently buffer is filled by memcpy_s and verified by memcmp, which
would require more UT maintenance during upcoming buffer changes.
With this change, usage of the buffer better reflects real-life usage.
Signed-off-by: Artur Kloniecki <arturx.kloniecki@linux.intel.com>
All audio_stream clients should use provided audio_stream_get_avail*/free*
API, instead of directly accessing .avail and .free member fields.
Signed-off-by: Artur Kloniecki <arturx.kloniecki@linux.intel.com>
This kconfig collides with one of the same name in Zephyr. Rename it
for clarity ("MULTICORE" was picked for symmetry with the existing
"CORE_COUNT", though it's admittedly a little long...).
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
This commit simplifies mux processing functions and
does not allow mux to mix channels.
Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
Mechanism of comparison pipe_id from ipc_comp_dev will be used in
trace filtering, so this part should be moved to separate function
and allow code reusability.
Moreover function usage is compact and descriptive method to define
what given block of code should do, so after such a refactor code
readability is improved.
Include from pipeline.h is removed to omit circular reference.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
This commit rewrites functions responsible for large config configuration
from detect_test component and puts them in component.c file as
generic ones - as a result they can be used by other components.
Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
Ability to change log level per UUID component improve user
experience during debugging firmware. Threshold trace level
defined in log message with value from trace context, where
trece context is related with component instance (local or
global instance).
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
UUID key is too detailed information for logging function to allow
easy functionality extension in future. Trace context structure is
designed to work directly with logging function, so there is no
reason to unpack values from this struct in trace macro-functions
and pass them as separate arguments to trace_log().
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Each trace function should refer to trace context, where are
stored information like uuid and runtime editable logs level,
to unify trace API and allow trace filtering in future.
Remove buf_cl_* functions, as no longer supported.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Used method need floating point unit in DSP core.
Vectorized conversion functions are inaccessible for used cores.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Respect fixed point data format as Q1.X instead of QX.
After change values in float will be in range <-1;1)
what will correspnd to fixed point data MAX/MIN value
in Q1.X format.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
All trace entries are identified by uuids only now.
Previous TRACE_CLASS_ identification removed completely.
UUIDs are passed to the tracing subsystem inside a trace
context. Each trace context defines run-time log level.
The level is initialized to LOG_LEVEL_INFO (this may be
change per instance is needed) and may be re-configured
at run-time.
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
Actions perfomed by the default handler are required to keep
the component device state consistent (e.g. dev->frames are
initialized). While the current comp_params() silently skips
the component if params are not defined.
New simple components will not be required to define a handler
if no extra steps are needed.
It is also an opportunity to reduce the code of existing components
Note that most of the extra steps are moved to prepare() in many
implementations already (like volume), others may follow and remove
their params() handlers once reduced to a single call to the default
handler (like mux recently did).
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
Functions written with metaprogramming are hard to read and debug,
so newly introduced version should be easier to understand for
new developers. Moreover introduced version is more generic and
compact because of usage single logging function implementation
regardless of given parameters number and usage of atomic or
mbox version.
There is no longer a need to heavy test logging function under
UT with different number of arguments, because of it singular
implementation.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
rrealloc function is no longer in use, so it is better
to remove it. Unused code is no longer tested so its
quality is unknown.
The current implementation is simple but expensive since
extra calls to malloc/free requires time and risky since
at some point requires double allocation of potentially
large object. Please consider re-implementation instead
of restoring.
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
Changes schedule operations to return error in case
chosen scheduler is not found or scheduler doesn't
support mandatory operation.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Previous memcpy of bytes is unsafe if new object is larger
then old one.
Typically realloc retrieves the old size internally and does
not need this information passed as argument but sof heap
implementation does not store the exact size of the allocated
memory buffer.
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
Previous memcpy of bytes is unsafe if new object is larger
then old one (which is probably most popular realloc use).
Typically realloc retrieves the old size internally and does
not need this information passed as argument but sof heap
implementation does not store the exact size of the allocated
memory buffer.
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
Few artifacts of the past were left after dependency removal. This patch
is there to address that.
Signed-off-by: Artur Kloniecki <arturx.kloniecki@linux.intel.com>
In the past, when parameters were held by components, it was impossible
to manage input/output streams with different channels' count.
Now, after params were moved to buffers, we can properly handle such
scenario, which in turn allows for more flexible approach in terms of
runtime configurability.
Signed-off-by: Artur Kloniecki <arturx.kloniecki@linux.intel.com>
(de)mux_get_processing_function() call depended on config->frame_format
being properly configured, which was obsolete from the very beginning.
This patch removed that dependency in favor of reading frame_fmt from
downstream buffer during the call, rendering that field completely
obsolete.
Signed-off-by: Artur Kloniecki <arturx.kloniecki@linux.intel.com>
Fixes:
error: 'err' may be used uninitialized in this function
[-Werror=maybe-uninitialized]
if (err)
^
As I found nothing in the entire code base checking the return value of
comp_register() (the real function seems to always succeed), I also
simplify the main path and pass through the value returned by
memcpy_s().
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Once the debug version of allocation functions are removed,
macros may be replaced with functions declared without leading
_ which makes the documentation (and the header) more readable,
the defines section does not need to contain doubled documentation
of alloc api.
bzero macro is not esasily removable due to include deps which
bring earlier declaration of non-inline prototype.
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
All clients that just wants to allocate and free memory
does not need to know all the heap management api
and internals.
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
Previously used by kpb tests only and defined locally.
New pieces of the code, like perf macros need them
globally.
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
New is c++ keyword which causes errors while generating
the documentation for component api with sphinx and breathe.
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
As reported by gcc.
Fixes: 0b279e06bc. This is a partial, one-line revert of that commit
that decreased the size of this array for no obvious reason.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Add "UPDATE_DISCONNECTED True" property in ExternalProject_Add() so:
- Unit tests can be rebuilt without a network connection
- The code can't change from one build to the next without the developer
being aware.
Found by chance thanks to some network issue.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
The current content of component.h is a mix of basic api, common
basic helpers for every component developers as well as advanced
functions and macros used by infrastructure and very specialized
components like host, dai, kpb etc.
This patch moves the advanced part to component_ext.h and keeps
only basic part in component.h to avoid overloading effects
component developers with declarations and code they do not use.
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>