Commit Graph

341 Commits

Author SHA1 Message Date
Karol Trzcinski a264e77011 pcm_converter: Normalize floats value during conversion
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>
2020-05-25 09:48:01 +01:00
Karol Trzcinski b1eb29d62d pcm_converter: Add unit tests for conversion float to fixed
Implement mocks, cmake modification and unit test architecture.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-05-25 09:48:01 +01:00
Marcin Maka 6ce635aa82 trace: replace TRACE_CLASS_ by uuids
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>
2020-04-30 11:39:37 +02:00
Tomasz Lauda 8d9e61f698 notifier: add flags
Adds possibility of defining flags, when performing
notifier registration.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-04-23 10:30:34 +02:00
Marcin Maka 8a7875d5e4 comp: run default params handler if not defined by target comp
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>
2020-04-15 14:55:54 +02:00
Karol Trzcinski b12a6626c5 trace: Remove metaprogramming from trace implementation
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>
2020-04-10 19:28:37 +01:00
Marcin Maka 245f5aa8a8 alloc: remove unused rrealloc
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>
2020-04-10 20:00:05 +03:00
Tomasz Lauda 1c2f3c0ce5 schedule: return status of operations
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>
2020-04-10 14:45:49 +02:00
Marcin Maka e306d1293e alloc: fix potential oob in rbrealloc
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>
2020-04-08 10:51:37 +01:00
Marcin Maka 75b8c1e8f8 alloc: fix potential oob in rrealloc
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>
2020-04-08 10:51:37 +01:00
Sam Muhammed de085f22f5 sof: Avoid comparison with NULL
Use (!x) instead of comparison with NULL.

Signed-off-by: Sam Muhammed <jane.pnx9@gmail.com>
2020-04-07 12:07:59 +03:00
Artur Kloniecki e20cd2811e muxdemux: Remove obsolete references to config->num_channels.
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>
2020-04-02 10:12:28 +01:00
Artur Kloniecki a0c9aebe05 muxdemux: Remove dependency on config->num_channels.
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>
2020-04-02 10:12:28 +01:00
Artur Kloniecki 8d76846ba8 muxdemux: Remove dependency on config->frame_format.
(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>
2020-04-02 10:12:28 +01:00
Sam Muhammed 288b8f3ade test: cmocka: Use ARRAY_SIZE
Instead of computing array size, use the ARRAY_SIZE
macro defined in <sof/common.h>.

Signed-off-by: Sam Muhammed <jane.pnx9@gmail.com>
2020-03-31 15:01:14 +01:00
Marc Herbert 8dbbbf0329 test: fix mixer_test.c:comp_register() 'uninitialized err' -Werror
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>
2020-03-30 14:56:26 +01:00
Payal Kshirsagar 22be53b98a test: cmocka: src: avoid NULL comparison
Replace NULL comparison with boolean negation. Issue found using
Coccinelle.

Signed-off-by: Payal Kshirsagar <payalskshirsagar1234@gmail.com>
2020-03-27 10:50:52 +01:00
Marcin Maka 36e58d279b alloc: replace r- macros with renamed functions
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>
2020-03-27 10:43:23 +01:00
Iulian Olaru 303ed59e87 test: Add extra tests fot gcd
This patch adds extra tests for the gcd of
(0, 0), (a, 0), (0, b), (-a, -b), (-a, b), (a, -b)

Signed-off-by: Iulian Olaru <iulianolaru249@yahoo.com>
2020-03-26 12:12:55 +00:00
Marcin Maka 0f88be3e1a mm: separate alloc api and heap mgmt api
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>
2020-03-26 10:09:32 +00:00
Marcin Maka 8d350a3eff test: move timer mocks to the common part
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>
2020-03-25 15:02:37 +01:00
Marcin Maka 415906e822 comp: rename private field to priv_data
Another cpp keyword that confuses documentation generation
process.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-03-25 11:04:15 +01:00
Marcin Maka 23d0eae9e2 comp: ops: rename new as create
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>
2020-03-25 11:04:15 +01:00
Janusz Jankowski 9da1fce247 test: audio: remove kpb
KPB tests don't work and it's better to remove it,
than keeping here disabled code.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2020-03-20 16:36:44 +01:00
Marc Herbert ff88cd03b7 test/kpb: fix tests[1] array out of bounds
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>
2020-03-20 12:14:52 +00:00
Marc Herbert 726dd545d6 cmocka/cmake: don't re-fetch (and change) cmocka.git on every build
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>
2020-03-20 12:07:44 +00:00
Janusz Jankowski 162ca407eb test: fix pipeline tests
Initialize global objects that are required by pipelines
logic - pipeline_posn.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2020-03-19 11:30:03 +01:00
Tomasz Lauda b144a02bdc cmocka: fix ut building
We don't support section .shared in unit tests,
so add appropriate flags to make files.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-03-18 21:25:56 +00:00
Marcin Maka ac01040efe comp: api: advanced and internal functions separated
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>
2020-03-17 16:13:29 +01:00
Marcin Maka 0529c141f4 tasks: add uuid based identification for tasks
Tasks activities may be traced and analysed easier if they
are identified by uuids and named.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-03-17 15:11:42 +02:00
Marcin Maka 322e150080 trace: add uuid to trace entry and remove trace ids
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>
2020-03-06 10:15:04 +01:00
Marcin Maka 3100546463 uuid: add simple static uuids linked to ldc section
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>
2020-03-06 10:15:04 +01:00
Tomasz Lauda 3609fa6fc6 ipc: use notifications allocated by sources
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>
2020-03-02 13:28:52 +01:00
Bartosz Kokoszko 6b250ff8a9 mux: move fetching proc function from prepare() to set_values()
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>
2020-02-28 16:21:59 +00:00
Tomasz Lauda 46a1db20a8 component: add operations for remote components
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>
2020-02-26 16:14:28 +00:00
Tomasz Lauda e3a6efd8e7 buffer: use locks for inter-core buffers
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>
2020-02-26 16:14:28 +00:00
Tomasz Lauda de0a0b85c5 component: add task when scheduled on different core
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>
2020-02-26 16:14:28 +00:00
Tomasz Lauda ec15c0ac38 component: implement component sharing functionality
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>
2020-02-26 16:14:28 +00:00
Marcin Maka 247af133b8 comp: init back ptr to driver early in new
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>
2020-02-19 20:51:58 +00:00
Marcin Maka 210f907ba2 comp: improve access to component properties
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>
2020-02-19 14:22:11 +00:00
Marcin Rajwa 53d35e4912 ut: add missing source file to build of KPB
This patch adds missing spinlock.c file to the build of
KPB component.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2020-02-17 20:25:38 +01:00
Bartosz Kokoszko bdc95775af component: add generic comp_verify_params() function
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>
2020-02-17 16:21:57 +00:00
Karol Trzcinski f493e907a1 test: buffer: Replace memcpy to memcpy_s
Introduced change resolve checkpach issue related with edited lines
of code.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-01-23 22:04:42 +02:00
Marcin Rajwa 895b46771c kpb: refactor some of KPBs macros
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>
2020-01-23 10:32:43 +00:00
Karol Trzcinski 9508d2efbd buffer: Create audio stream buffer
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>
2020-01-22 14:56:22 +00:00
Karol Trzcinski 9a091a1320 test: Use common_mocks in each unit test
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>
2020-01-22 14:45:29 +00:00
Karol Trzcinski 816f8919db test: Implement common mocks
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>
2020-01-22 14:45:29 +00:00
Karol Trzcinski b7c92f18e6 test: Rename universal_mocks.c to common_mocks.c
Old name was quite misleading, new one better describes file content

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-01-22 14:45:29 +00:00
Tomasz Lauda a3e01c805a test: don't use shared section and uncache for unit tests
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>
2020-01-20 14:37:01 +00:00
Tomasz Lauda 7867944946 component: use comp_driver_info during registration
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>
2020-01-20 14:37:01 +00:00
Tomasz Lauda 5eea994a3a component: add comp drivers list to sof context
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>
2020-01-20 14:37:01 +00:00
Tomasz Lauda 47917c1f3d component: pass sof context to sys_comp_init()
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>
2020-01-20 14:37:01 +00:00
Tomasz Lauda e465bca588 spinlock: revert explicit allocation
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>
2020-01-16 21:58:10 +00:00
Tomasz Lauda 80972f1d78 cavs: add section for shared data
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>
2020-01-16 21:58:10 +00:00
Marcin Maka 114a718e8d perf: add simple performance timestamps macros
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>
2020-01-16 13:28:58 +00:00
Tomasz Lauda 1065e12a63 memory: add memory map to sof context
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>
2020-01-11 16:10:04 +00:00
Tomasz Lauda 3f53d59e7b memory: pass sof context to platform_init_memmap
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>
2020-01-11 16:10:04 +00:00
Tomasz Lauda 670246e2f8 timer: use platform_timer from sof context
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>
2020-01-11 16:10:04 +00:00
Tomasz Lauda 5f85648c5a alloc: create enum type for heap zones
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>
2019-12-23 21:11:48 +01:00
Tomasz Lauda bc246b5da8 alloc: remove zone argument from balloc functions
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>
2019-12-23 21:11:48 +01:00
Tomasz Lauda 6a8a3d02f1 alloc: extract flags to separate argument
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>
2019-12-23 21:11:48 +01:00
Marcin Maka 53eaa8c884 kpb: disable pm-runtime of master dsp core for data draining
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>
2019-12-20 18:55:53 +01:00
Tomasz Lauda 8fe7b72682 edf_schedule: remove priority
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>
2019-12-19 20:29:59 +00:00
Tomasz Lauda c42f9bd621 task: extract task ops to separate struct
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>
2019-12-19 20:29:59 +00:00
Tomasz Lauda 2baeeadeda schedule: separate task init functions for schedulers
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>
2019-12-19 20:29:59 +00:00
Janusz Jankowski 3d44dead6f Revert "kpb: refactor some of KPBs macros"
This reverts commit 0eabf51c9d.
2019-12-17 11:14:07 +01:00
Marcin Rajwa 0eabf51c9d kpb: refactor some of KPBs macros
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>
2019-12-16 15:58:19 +00:00
ArturX Kloniecki a88543a92c notifier: Refactor notifier interface and inner workings.
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>
2019-12-12 11:08:00 +01:00
Bartosz Kokoszko 74e1bcc786 component: move pcm params from component to buffer struct
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>
2019-11-29 10:58:33 +00:00
Tomasz Lauda e0491ff778 dai: volume: make pcm conversion in dai component
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>
2019-11-26 13:42:17 +00:00
Janusz Jankowski 1d92e8e175 sof: use RELATIVE_FILE instead of __FILE__
Use RELATIVE_FILE because __FILE__ makes binary output
dependent on project location.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-11-11 12:50:30 +00:00
Karol Trzcinski 59a7e2819f kconfig: volume: test only supported data format
Do not run unit tests on unsupported by configuration
data types. See CONFIG_FORMAT_* macro.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2019-11-11 12:22:11 +00:00
Karol Trzcinski 33d11ad659 kconfig: volume: group functions by supported data type
It will be helpful during next step - conditional code
compilation depending on configuration

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2019-11-11 12:22:11 +00:00
Karol Trzcinski 20dabd5f1e kconfig: selector: test only supported by configuration data format
Do not carry test on unsupported data format for a five firmware
version.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2019-11-11 12:22:11 +00:00
Karol Trzcinski 34be3cec87 kconfig: mux: test only supported data types
Do not include data type test when it is not supported by
some platform or firmware version.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2019-11-11 12:22:11 +00:00
Paul Olaru 5c7a49af38 sof: build: Disallow void pointer arithmetic
Add compiler flags so that void pointer arithmetic is not allowed.

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2019-11-04 15:26:20 +01:00
Tomasz Lauda 8fa4b80213 component: do not set buffer sizes
Change flow of components to not resize sink buffers.
We should just check the size of the allocated buffers
and let the topology define the maximum sizes.
Components can easily work with non aligned buffer sizes.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-10-24 10:17:03 +02:00
Tomasz Lauda df6017f950 buffer: add and init id, pipeline_id and caps fields
Adds and initializes id, pipeline_id and caps fields in buffer struct.
This is the only data needed after buffer creation. It allows us to
remove the whole sof_ipc_buffer struct from the buffers.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-10-24 10:17:03 +02:00
Tomasz Lauda 6b22503e54 ipc: check whether pipeline id is already taken
When new pipeline is created we need to also verify whether
given pipeline id is already taken.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-10-17 13:39:41 +02:00
Tomasz Lauda 99c16a69e3 ipc: rename ipc_get_comp function
Renames ipc_get_comp function to ipc_get_comp_by_id.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-10-17 13:39:41 +02:00
Jakub Dabek 66b0a0f0b8 memory: Add alignment option for allocation
Add alignment option for memory requests.
Fix alloc definitions for UT.
Function definitions were using defines in their body
which blocked usage of const values in said defines.

Signed-off-by: Jakub Dabek <jakub.dabek@intel.com>
2019-10-11 14:26:08 +02:00
Tomasz Lauda de7d4c95cf pipeline: allocate pipe_task only if needed
Changes implementation of pipe_task allocation and initialization
to happen in prepare call instead of during pipeline creations.
It might be that the pipeline will never be used.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-10-01 14:32:36 +02:00
Tomasz Lauda 3afc474518 task: add complete callback
Adds complete callback to task. Some EDF tasks will need to have
additional callback on task completion, which will be executed
in critical section along the setting task state to complete.
Doing it during regular execution is not enough, because it's done
on passive level and we want to avoid any race condition.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-10-01 11:24:40 +02:00
Tomasz Lauda eb0d309cf9 task: rename func to run
Renames task's func to run to better show intention of this callback.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-10-01 11:24:40 +02:00
Tomasz Lauda b80338c395 idc: move to cavs drivers
Moves idc implementation to cavs drivers instead of keeping
it in generic xtensa arch directory. IDC is specific for
SMP cAVS platforms.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-09-30 11:34:39 +02:00
Bartosz Kokoszko d42c01956f buffer: add overwrite in circular wrap case
In case when we overwrite "old" data in buffer
(when buffer is full) we should align r_ptr
with w_ptr.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2019-09-24 12:44:16 +02:00
Tomasz Lauda 8c61213c37 schedule: support dynamic scheduler creation
Refactors schedule code in order to allow dynamic scheduler
creation. We don't want to add every new scheduler to the static
array of scheduler_ops and also we don't want to have every
scheduler created on every platform. Maybe some of the platforms
won't need some of the future scheduler types.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-09-11 16:24:00 +02:00
Tomasz Lauda 20acc16791 edf_schedule: implement the new version of EDF scheduler
This patch implements the new version of EDF scheduler.
This is the first basic implementation, which can be easily extended
in the future.

Previous implementation had two major flaws:
- Tasks could only be preempted based on the interrupt level on which
they have been scheduled, so it was limited based on the hardware.
- This led to the system not fully utilized, so we could never achieve
full EDF functionality.

The new implementation uses only one software interrupt and allows for
dynamic context switching between different tasks based on the deadline.
Also for some cases priority is taken into consideration e.g. for idle
and almost idle tasks, which don't have deadline at all and should be
executed only if the system is free. All other normal tasks should have
the same priority. Task chosen to be run is executed on passive level,
so automatically can be preempted by every interrupt. Every task has
its own private stack on which current context is saved and restored
if needed. Note that main firmware loop is task scheduled with
idle priority, so it will be executed only after every other task
is completed.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-09-06 15:51:02 +01:00
Tomasz Lauda d1ede217e8 test: alloc: remove tests which don't test anything
Removes two tests which don't really test anything
and are based on magic numbers. Changing memory map
can easily break them.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-09-06 15:51:02 +01:00
Jaska Uimonen ebf406d084 unit tests: fix cmocka test for pipeline connect
cmocka pipeline connect unit test is checking the successful
connection from frames count set in components. However the frames
are not set in pipeline complete if we set the frames from stream
parameters. So check now that the pipeline pointer has been set
and matches the pipeline in high level test function.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2019-08-15 14:29:22 +02:00
Tomasz Lauda 9a6616a89b spinlock: replace spin_lock_* with irq_local_*
Replaces spin_lock_* macros with irq_local_* macros
in many places. Most of the code doesn't need to keep
synchronization between cores. Setting critical section
by disabling local interrupts is enough. Spinlocks should
be used only in the places, where both cores have access.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-08-07 14:22:52 +02:00
Tomasz Lauda ec9d1cad94 schedule: make some functions static inline
Transforms some of the short functions to static inline.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-08-06 18:51:20 +01:00
Tomasz Lauda 4100fa0ac3 schedule: make schedule functions return task state
Instead of returning next period, schedule functions should return
state of the executed task. Period of the tasks is set during
initialization and doesn't change dynamically, so it doesn't make
sense to return it. With the new added SOF_TASK_STATE_RESCHEDULE
we can easily decide if the task is completed or maybe need to
be run once again.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-08-06 18:51:20 +01:00
Tomasz Lauda 99005e21bc schedule: extract flags to generic task data
Extracts flags to generic task data, so there is no need
for ll_schedule to keep them privately. Also changes the
way they are passed. From now on flags should be set only
during task initialization and not when starting scheduling.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-08-06 18:51:20 +01:00
Tomasz Lauda 2d16db19de ll_schedule: keep task period in private data
Adds new period field to task private data to keep
period set during schedule. Tasks shouldn't change
their period dynamically and in fact there is no
such task.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-08-06 18:51:20 +01:00
Janusz Jankowski f837e57b6e test: mux calc_sample_s16le
Unit tests for calc_sample_s16le with up to 8 channels.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-08-02 13:31:44 +02:00
Janusz Jankowski 1bf779eef7 test: mux calc_sample_s24le
Unit tests for calc_sample_s24le with up to 8 channels.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-08-02 13:31:44 +02:00
Janusz Jankowski 21375d45a2 test: mux calc_sample_s32le
Unit tests for calc_sample_s32le with up to 8 channels.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-08-02 13:31:44 +02:00
Janusz Jankowski cfa339fece test: mux_prepare
Unit tests for mux prepare with valid and invalid formats.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-08-02 13:31:44 +02:00
Janusz Jankowski b5654b851f test: demux_copy
Unit tests for demux copy with 1 source, 4 sinks and 8 channels.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-08-02 13:31:44 +02:00
Janusz Jankowski a4dcabcfc6 test: mux_copy
Unit tests for mux copy with 4 sources, 1 sink and 8 channels.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-08-02 13:31:44 +02:00
Marcin Rajwa 5e3b739043 kpb: disable sys_agent before draining
Draining task can take a long time depending
on various params. This patch disables system
agent which raises DSP PANIC in case firmware
is hanged. However draining task can look to
system agent in exactly the same manner thus
we disable it right before draining task and
reenable after draining is done.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 21:49:58 +02:00
Marcin Rajwa 0b279e06bc kpb: move history buffer allocation to prepare
This change moves history buffer allocation
from kpb_new() to kpb_prepare(). This is to
folow the calling convention with kernel.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 21:49:58 +02:00
Marcin Rajwa d180cd343f memory: set LPSRAM related defines to zero if LP not configured
This patch sets all LPSRAM related memory defines to
zero if CONFIG_LP_MEMORY_BANKS is not defined.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-07-30 19:29:59 +02:00
Bartosz Kokoszko f3d79e7398 component: add comp_set_sink_buffer() function
Component in comp_prepare() should change sink buffer
only when sink component is not connected to dma.
comp_set_sink_buffer() checks whether sink component
is not connected to dma and in that case it try to
resize sink buffer.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2019-07-27 13:30:18 +02:00
Tomasz Lauda 5449dc2a30 panic: keep interrupts disabled after panic
This patch fixes the issue, where we've reenabled
the interrupts for the DSP, which sometimes caused
immediate DSP exception and overwrite of our dump.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-07-27 12:55:41 +02:00
Tomasz Lauda 418ddec569 panic: move panic related functions to new panic.h
Moves panic related functions from arch/sof.h to newly created
arch/debug/panic.h. Also change definition of arch_dump_regs
function to take dump buffer from caller. It decreases the
number of included headers in arch/debug/panic.h.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-07-27 12:55:41 +02:00
Tomasz Lauda 14b23ba5d3 task: move task structure and defines to the right header
Moves task structure and defines to the sof/task.h,
where they should be from the beginning. sof/schedule.h is
just for scheduler related things.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-07-19 15:50:35 +02:00
Tomasz Lauda 54d4d01d64 sof: move c files to dedicated directories
Moves c files to dedicated directories.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-07-18 16:00:24 +02:00
Tomasz Lauda 4ee9e1159c sof: move headers to dedicated directories
Moves headers to dedicated directories in sof/include,
arch/include and platform/include. File tree was too flat,
so some of the files has been moved.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-07-18 16:00:24 +02:00
Tomasz Lauda 1944052617 drivers: include: platform: cleanup includes
Cleanups includes in all drivers, include and
platform files. Unused headers has been removed
and needed has beed added.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-07-16 15:02:06 +02:00
Tomasz Lauda a990c611c4 sof: change approach to including arch headers
Further work, but now it's done for remaining arch headers.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-07-15 13:29:29 +02:00
Tomasz Lauda 2eb5857c77 arch: xtensa: merge UP and SMP architectures
Merges xtensa UP and SMP architectures.
The amount of code which were duplicated by creating
SMP architecture as separate instance is too big
to maintain. I've decided to merge both architectures,
change explicit selection of SMP to be dependent on
configured number of cores (> 1) and add branching in
xtos based on currently used processor configuration.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-07-12 15:05:57 +02:00
Seppo Ingalsuo 34d0db94be Cmocka: Volume: Increase test coverage for S24_LE output format
This patch adds check for sample to not exceed S24_LE range that
could happen in int32_t type storage. The existing check for
abs(delta) > 1 does not cover such case if e.g. the reference
volume code would output e.g. INT24_MAX and the FW component
INT24_MAX + 1.

Similar check is added for every reference volume function that
outputs S24_LE format.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2019-07-09 15:15:15 +02:00
Janusz Jankowski 084e7d6e79 test: add realloc stubs
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-07-03 13:55:30 +02:00
Tomasz Lauda 25bbc9f5cd schedule: extract schedulers to separate directory
Extracts schedule related implementations to the separate
directory to make it easier to locate and implement new
schedulers in the future.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-06-24 17:24:59 +01:00
Marcin Rajwa afbb2a6f53 memcpy: fix bug in memcpy_s for cmocka
memcpy_s has wrong check condition for
overlapping sections. The copy from adjacent memory
bloks will result in dsp panic while it should be
allowed. This patch fixes the issue for cmocka
tests.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-06-18 23:16:21 +02:00
Adrian Bonislawski f1fe78367a memory: new memory layout for APL, ICL, CNL and SUE
This will optimize memory usage and introduces two significant optimizations:

> Separate the memory (heaps, stack) by cores so if we will turn off a specific core we can also turn off all memory of this core.
> Remove fixed defines and gaps, previously stack was at fixed position: end of memory and buffer heap was everything between stack and fw. Now everything will be packed at sof_fw memory segment and takes only this memory which is really needed, everything else we can turn off.

Changelog:
BSS section now includes heaps and stack
Removed many heap fixed position defines
Removed gap before fw text section
memmap init is using real linker positions for heaps
Temporary stack for boot_ldr placed in heap_hp_buffer (safe)
sof fw max_size and segment limited to memory configured by memory banks count

Using new macro to stack init per core
Stack is no longer a one big block for all cores (core_count*stack_size)
System_runtime_heap and system_heap are no longer a one big block for all cores

For suecreek memory it will also introduce similar changes previously introduced
in other platforms
(One shared memory block SOF_FW for SOF_TEXT, SOF_DATA and SOF_BSS sections
Moved fw_ready near to .rodata and .data)

Memory layout for every slave core aligned to hw memory bank:
--align to memory bank--
system_heap
system_runtime_heap
stack
--align to memory bank--
next slave core..

Similar layout applies to master core

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2019-06-11 13:49:37 +02:00
Marcin Rajwa fb111cdebe cmocka: update KPB tests for new dependencies
KPB source code started to use timer related features
therefore cmocka tests need to include these
dependencies.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-06-11 13:25:16 +02:00
Marcin Rajwa b33574ce65 cmocka: update kpb test case
KPB_MAX_BUFFER_SIZE has changed therefore cmocka test
which uses this macro needs to be changed accordingly.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-06-06 09:47:33 +01:00
Tomasz Lauda 4d22a98f6c idc: change waiting code to be ms based
Changes waiting code in arch_idc_send_msg to be
milliseconds based instead of DSP cycles based.
This aligns nicely with the rest of waiting functions.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-06-05 21:22:50 +01:00
Janusz Jankowski 5dd9aaccb4 cmake: xtensa: use absolute paths for tools
CMake has convention of changing relative paths to absolute
for CMAKE_* variables. It does it automatically f.e. CMAKE_C_COMPILER.
However for our tools like objcopy we have to do it manually.
It also helps with integration of CMake in some IDEs.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-06-05 11:38:23 +02:00
Janusz Jankowski c6064624f6 cmake: add spdx license identifier
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-06-02 16:38:17 +01:00
Janusz Jankowski ecd506e16d license: use spdx in .c, .h and .S files with BSD3
Use SPDX License identifier in files that already
contain BSD-3-Clause license.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-06-02 16:38:17 +01:00
Janusz Jankowski 02ffbea1a1 test: kpb: add license
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-06-02 16:38:17 +01:00
Janusz Jankowski d59cedbe61 test: include: add license
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-06-02 16:38:17 +01:00
Janusz Jankowski e39ed5ebf4 include: split uapi headers into more directories
Some of interface headers are not needed by kernel,
but are needed by user-space applications, so we can split them
into multiple directories that indicate their purpose.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-05-31 20:10:45 +01:00
Daniel Bogdzia 17eba5b190 test: add rballoc tests
Rballoc tests check if the current heap is full
the succeeding one would be taken

Signed-off-by: Daniel Bogdzia <danielx.bogdzia@linux.intel.com>
2019-05-30 12:02:05 +02:00
Tomasz Lauda ca45bc8303 audio: put multifile components to directories
This patch moves multifile components to separate
directories. All component headers are also moved to
include/sof/audio.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-05-17 17:39:45 +02:00
Jakub Dabek 3020d4aba4 memory: changed memcpy_s error handling
Failing to copy will result in FW panic

Signed-off-by: Jakub Dabek <jakub.dabek@intel.com>
2019-05-11 09:08:31 +02:00
Keyon Jie 72360bd42f kpb: fix kpb reset issue to make the consequent iteration work
We need reset kpb->state to KPB_STATE_BUFFERING, and unregister notifier
in .reset() as we will register it again at next .prepare(), otherwise,
the consequent record won't work.

Add definition of notifier_unregister() into cmoka fix the link error to
avoid breaking UT at the same time.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-05-07 12:26:56 +02:00
Janusz Jankowski 3a65b78f5f host: replace CONFIG_HOST and CONFIG_LIB with CONFIG_LIBRARY
We don't need 3 symbols - they all are used in the same case.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-05-07 08:49:48 +02:00
Seppo Ingalsuo adf8d66caf Volume: Improve coverage of cmocka tests
To help catching overflows this patch exercises the volume
component test with larger absolute value test data, both
positive and negative numbers. A test generator is added for
S24_4LE format.

Since the reference float arithmetic sometimes calculates the
sample with less accuracy than fixed point firmware code the
error is asserted when delta of reference and firmware is larger
than one LSB. The float code is off by one sometimes with negative
samples. To not complicate the test code this simple relaxation is
proposed.

The table of test inputs is commented with numbers to help to quickly
find a failing test case function if such happens from printed output
from cmocka test run.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2019-04-29 09:57:16 -07:00
Keyon Jie cbf2be22ed component: refine state change for xrun handling
When trigger xrun arrives, we will reset the component state to be
READY, which means prepare will needed before we can recover.

Update state machine diagram and cmoka unit test cases also.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-04-24 22:38:26 +01:00
Marcin Rajwa 304336ba60 CMOCKA-KPB: test and verify internal buffering
Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-04-19 17:52:45 +02:00
Marcin Rajwa e39d0729e7 CMOCKA-KPB: perform copy test and its verification
Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-04-19 17:52:45 +02:00
Marcin Rajwa e6967498c1 CMOCKA-KPB: connect sink and source to KPB device
Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-04-19 17:52:45 +02:00
Marcin Rajwa 827b240847 CMOCKA-KPB: fill source buffer with test data
Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-04-19 17:52:45 +02:00
Marcin Rajwa fb8a650877 CMOCKA-KPB: create dummy source && sink buffers
Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-04-19 17:52:45 +02:00
Marcin Rajwa 3ff3b61886 CMOCKA: removed old memory allocation in testcases of KPB
The KPB component has changed its buffering
algorithm therefore its test cases needs to
be changed accordingly.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-04-19 17:52:45 +02:00
Seppo Ingalsuo 50bd96ded4 Volume: Allow use of extended volume scale up to 42 dB
This patch alters the volume IPC and ramp to use sQ8.16 gain
values instead of previous Q2.16 kind of unsigned gain value.
The driver has never set the min/max volume values in volume
new() IPC so the macro values VOL_MAX (+42 dB) and VOL_MIN (mute)
are used instead as limits.

The overflow in generic C code with s16 format is fixed. The
comments about volume Q format are updated.

The optimimized xt-xcc version of volume is changed to use 64
bits for multiply result to avoid loss of LSB bits in left shift
after multiply. With 64 bit result there is no need to scale the
volume multiplier as it was done with use of 32 bit multiply
result.

The cmocka volume type is changed to signed integer to match
component type used in this patch. The xtensa AE integer types
are signed so better to avoid unsigned gain values. The volume
scale in reference volume does a small error and cannot handle
above 0 dB max so it is changed as well. The test levels are
changed to exercise gains above and below 0 dB.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2019-04-18 22:06:13 +02:00
Slawomir Blauciak 0b56f064c2 kpb: rename comp_data struct to avoid conflicts
The kpb's comp_data struct is located in a public header,
which will be used by different components.
As such, it would cause conflicting definitions.

Signed-off-by: Slawomir Blauciak <slawomir.blauciak@linux.intel.com>
2019-04-18 12:51:01 +01:00
Janusz Jankowski c93670853f test: pipeline: remove mock for removed scheduler function
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-04-09 10:47:26 +02:00
Janusz Jankowski adc6cbe1be test: component: add missing header
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-04-09 10:47:26 +02:00
Janusz Jankowski 426647343f test: selector: remove unused variables
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-04-09 10:47:26 +02:00
Janusz Jankowski 51ef2db3d2 test: fix kpb compilation with -Werror
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-04-09 10:47:26 +02:00
Janusz Jankowski cfc78646e6 test: fix mixer compilation with -Werror
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-04-09 10:47:26 +02:00
Seppo Ingalsuo 22ecaa41e1 Component: Add comp_get_copy_limits() function for copy() preparations
This patch adds into component.c/h an utility function and
a data structure to simplify audio component's copy() method code.

The do-nothing function pipeline_xrun() is added to avoid cmocka test
fail due to adding function comp_get_copy_limits().

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2019-04-02 09:53:29 +01:00
Tomasz Lauda c14554349f component: add check if optional comp_ops are available
Adds check if optional comp_ops are available.
This patch also adds assert for mandatory ops.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-04-01 14:54:43 +01:00
ArturX Kloniecki 25cd7795cc debugability: extend core dumps to provide AR registers.
Signed-off-by: ArturX Kloniecki <arturx.kloniecki@linux.intel.com>
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2019-03-27 21:10:48 +00:00