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>
New trace entry parameter is defined: uuid of the source.
Technically, this is an address of uuid entry linked
inside a special section in elf.
Has_ids is removed from the static log entry since eventually
all entries will use uuids and -1 detection is good enough
detection for those who still do not provide ids.
Note: both changes are done in a single patch to avoid two
major dbg-abi version bumps.
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
Unique identification in form of Guid is much more
scalable for fw parts (components, dais, ...) then
existing ids and trace class ids.
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
Changes implementation of notifications allocation.
Instead of using common empty list of messages let's
switch to allocating message per source of notification.
This way we won't have problem with memory and lack of
empty messages and also we will be able to optimize memory.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
This commit moves fetching mux/demux processing functions from
mux_prepare() to mux_set_values(). It insures us against
situation when we fetch proc_func in mux_prepare() and
after that comes mux_set_values() with new mux config.
Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
Implements remote operations for params, prepare, trigger
and reset calls. If the target component is running on
different core, we should send IDC in order to execute
appropriate operation.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Implements locking and cache synchronization for buffers,
which are connecting components running on different cores.
We need to explicitly use cache here (if platform supports it),
so the shared API cannot be used in this particular case.
Shared is going through uncached area on cAVS platforms,
but it's too slow in the case of frequent buffer accesses.
Also loop in pipeline_set_params has been changed to avoid
unnecessary cache accesses after unlocking the buffer.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Adds separate task to components, which are supposed to be scheduled
on different core than the rest of the pipeline. These are so called
shared components. This way components requiring huge processing power
can be offloaded to slave cores.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Implements component reallocation in shared memory. This way
cores can share components, which are part of one core's pipeline,
but runs on other core.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Back pointer must be initialized before any instance
level logging is performed by the new() operation since
the instance identification requires access to the uuid
that will be implemented on the component driver level.
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
Static inline getters provides better control of use
component properties as L- and R-values.
They also make changes to the common component data defs
easier and transparent for clients (no code changes, just
recompilation required).
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
Implements comp_verify_params() function, which can be used in order
to set and update some of sink (playback) or source (capture) buffer
parameters with pcm parameters. There is a possibility to specify
which of parameters won't be overwritten (e.g. SRC component should
not overwrite rate parameter, because it is able to change it).
Commit also adds macros to buffer.h, which can be used in order
to specify which parameter of source/sink buffer should not be
updated.
Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
This patch refactor KPBs macros:
KPB_SAMPLING_WIDTH to KPB_SAMPLES_PER_MS as this is
exactly what this macro stands for - the amount of
samples we take each milisecond.
KPB_NR_OF_CHANNELS to KPB_NUM_OF_CHANNELS as the later
is more meaningful
Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
When new component will need to process audio data in two steps,
then temporary circular buffer will be needed. Also extra information
about data stream may be needed to choose right algorithm or assert data
compatibility.
Currently only 'comp_buffer' has such a possibility but it is component
defined in topology - with much wider capabilities - and shouldn't be
created inside component just to hold temporary data stream.
Use introduced structure in processing functions, move api responsible
for data processing from buffer to audio_stream module.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Link common_mock to each test by default.
Removed duplicated mocks in component specific folders.
Keep old mocks where implementation differs from
implementation in common_moks.c
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
In unit tests there are a lot of mocks duplication for mocks related
with memory management and panic routine.
As long as implementation doesn't have any module specific routines
and may be reused, it should be mocked in common mock space.
Marked each mock as WEAK to make it possible to overwrite this
implementation in specific test.
To use assert_false in __panic function, added dependence of
universal_mock from cmock.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
SHARED_DATA macros doesn't put shared data into separate section
when unit tests are built and uncached memory region is not used.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Changes component driver registration to use comp_driver_info
as an element to be put into the drivers list. This way
comp_driver can be constant and comp_driver_info can be
marked as shared in the future.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Adds component drivers list to sof context, so it can be
accessed globally. Also adds global getter.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Passes sof context pointer to sys_comp_init() function.
It will be needed in order to add comp_driver_list to
sof context.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
This patch reverts explicit spinlock allocation in shared
memory. From now on we assume every spinlock is already part
of the shared memory. This helps us avoid unnecessary cache
evictions, when accessing spinlock's data. Also some of the
spinlock API functions require interrupt header, so they were
extracted in order to avoid circular dependency.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
This patch adds dedicated section for shared data
on cAVS platforms. This section will be used to store
static data, which can be accessed by multiple cores.
Access to this data will go through uncached memory region.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Performance ts macros use both the platform timer and cpu timer
in case the latter is not always-running-timer.
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
Adds memory map to sof main context. Also implements
getter to easily retrieve it through one point of access.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Changes platform_init_memmap function's argument list to take
sof context. It will be needed to add memory map pointer into
sof context.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Changes accesses across the code to use platform_timer saved
in sof context instead of using externed global variable.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Creates new mem_zone enum type for heap zones.
We don't want to leave them as flags and allow
zone combinations.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Removes zone argument from balloc related functions.
They always use RZONE_BUFFER, so passing something else
is very misleading, especially it changes nothing.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Extracts flags from zone to use them as a separate argument
during allocations. It allows for addition of new zones and
also is more clear this way.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Lower power state must be disabled before host wakes up and
sends 'quit D0ix' to make sure the draining goes at full speed.
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
Removes need to pass EDF task priority during initialization.
Also removes priority definitions, which were only used by
EDF scheduler. Priorities of EDF tasks are now deprecated.
We are scheduling based only on deadline.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Extracts task operations to separate struct. This way we can
add additional ops without need to endlessly adding parameters
to schedule_edf_task_init function.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Separates task init functions for all currently supported schedulers.
Some of the parameters are not common, so there is no need to
artificially extend function signatures.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
This patch refactor KPBs macros:
KPB_SAMPLING_WIDTH to KPB_SAMPLES_PER_MS as this is
exactly what this macro stands for - the amount of
samples we take each milisecond.
KPB_NR_OF_CHANNELS to KPB_NUM_OF_CHANNELS as the later
is more meaningful
Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
This patch changes usage of notifier, passing control over callbacks
allocation, allows nested callbacks processing and prepares interface
for future extenting.
This also optimizes unnecessary cache writeback/invalidation when
evaluating callback on the same core it was dispatched.
Signed-off-by: ArturX Kloniecki <arturx.kloniecki@linux.intel.com>
Moving pcm params from component to buffer is the first
step to improve parameter propagation within pipelines. This commit
moves several pcm paremeters (framet_fmt, buffer_fmt, rate,
channels, chmap, except direction) to comp_buffer struct.
Some of specific parameters are moved to private host and
kpb data.
Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
Changes processing flow and moves pcm frame format conversion
from volume to dai component. This way we'll no longer need to
artificially add volume into the pipelines, where it's not really
needed but frame format change is e.g. KPD topology. Dai is the perfect
place for conversion, since it's format is pretty much predefined and
comes from topology. Rest of the pipeline is configured from the host.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>