Commit Graph

119 Commits

Author SHA1 Message Date
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
Janusz Jankowski d33f8c99a1 test: rename CHECK to UNIT_TEST
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-03-25 14:11:47 +00:00
Jakub Dabek f8703cd32c memory: changed memcpy calls to memcpy_s in audio lib
Signed-off-by: Jakub Dabek <jakub.dabek@linux.intel.com>
2019-03-21 16:51:51 +00:00
Janusz Jankowski f9494d9ce5 cmocka: add stdint.h includes
As written in cmocka documentation,
these headers have to be included before cmocka.h:

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-03-20 11:37:04 +00:00
Janusz Jankowski 0cc895d609 cmake: cmocka: add toolchain file for xt
It's needed to make cmocka build correctly
for generic instead of unix system

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-03-20 11:37:04 +00:00
Janusz Jankowski 6f88295017 cmake: fix memory mock lds for windows
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-03-20 11:37:04 +00:00
Janusz Jankowski c47f3dbc03 cmake: fix unit tests for ninja
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-03-20 11:37:04 +00:00
Bartosz Kokoszko 648345065a scheduler: add new generic scheduler api
This commit:
1. Renames specific schedulers:
	- schedule (.c/.h) -> edf_schedule (.c/.h)
	- work (.c/.h) -> ll_schedule (.c/.h)
2. Implements new generic scheduler api based on generic
   struct with scheduler ops. Every specific
   scheduler exports struct with pointers to its
   specific functions.
3. Makes edf and ll using generic api (exports structure
   with pointers to its own specific functions)
4. Updates host and pipeline tests due to scheduler
   changes.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2019-03-19 14:37:15 +00:00
Jakub Dabek 935d13b891 memory: prework for memcpy calls change
Prepared host build and whole solution to use new memcpy_s
Fixed string.h dependencies

Signed-off-by: Jakub Dabek <jakub.dabek@linux.intel.com>
2019-03-14 10:05:47 +00:00
Lech Betlej 18673780c3 test: selector: add support for binary configuration data
Channel selector component supports configuration get/set using
COMP_CMD_GET_DATA & COMP_CMD_SET_DATA commands
of SOF_CTRL_CMD_BINARY type

Signed-off-by: Lech Betlej <lech.betlej@linux.intel.com>
2019-03-11 18:25:11 +01:00
Marcin Rajwa c833f572d0 KPB: search for real time sink
This change allows host to keep real time
sink at any position - not forced to be the
very first sink. Pointer to the sink itself
has been added to component private data
therefore .copy takes slightly less resources.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-03-11 18:23:39 +01:00
Adrian Bonislawski c06a65a8d0 Memory: self registering ability for audio components
No more need to update global component.h and audio.c component init list

New macro DECLARE_COMPONENT
The component can "register itself" in the appropriate linker section

Example of usage:
DECLARE_COMPONENT(sys_comp_*_init);

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2019-03-11 15:43:01 +00:00
Tomasz Lauda c694c09824 buffer: add buffer callback
Adds buffer callbacks, which can be called
after produce or consume.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-03-06 14:58:38 +00:00
Tomasz Lauda ad646299af pipeline: change copy flow
Changes copy flow to unify it no matter what is
the source of scheduling. Capture pipelines will always
start from source component and go downstream to sink
component. Playback pipelines for the first time will
start from sink component and go upstream to source
component (preload run). Further playback pipeline
copies will first copy sink component and then go
upstream to source component.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-03-06 14:58:38 +00:00
Tomasz Lauda 6077b57e19 pipeline: add sink component
Adds sink component to pipeline. It will allow
for pipeline copy direction simplification.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-03-06 14:58:38 +00:00
Tomasz Lauda 9a6a38a609 mixer: add support for variable data copy
Adds support to mixer for variable
data size copy.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-03-06 14:20:39 +00:00
Bartosz Kokoszko 0b63fde14d memmap: init memmap in runtime for cavs platforms
This commit adds:
1. memmap struct initialization for cavs in run-time.
2. setting proper .caps for all cores for system runtime memory.
3. add generic defines for heaps.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2019-03-05 12:05:03 +00:00
Lech Betlej 9845c9d418 test: kpb component name fixed in a configuration file
kpb directory is now added to cmoka test afer CONFIG_COMP_KPB is set

Signed-off-by: Lech Betlej <lech.betlej@linux.intel.com>
2019-03-04 13:20:57 +01:00
Tomasz Lauda 99ee4432d1 cmocka: add unit tests for channel selector
Adds unit tests for channel selector component.

Signed-off-by: Lech Betlej <lech.betlej@linux.intel.com>
2019-03-01 18:36:12 +01:00
Bartosz Kokoszko eae1d3a31c mailbox: deduplication of mailbox headers for cavs
Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2019-03-01 10:26:54 +01:00
Marcin Rajwa 53a63eac14 KPB: add cmocka test cases for real time copy and internal buffering
Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-03-01 10:16:23 +01:00
Adrian Bonislawski f8bf720ec1 Kconfig: make Mixer component a config option
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2019-02-28 18:34:26 +01:00
Janusz Jankowski 5ccbab2659 tests: add panic symbols for alloc
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-02-19 16:52:10 +00:00