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>
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>
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>
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>
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>
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>
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>
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>
As written in cmocka documentation,
these headers have to be included before cmocka.h:
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
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>
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>
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>
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>
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>
Refactors generic and HiFi3 volume processing implementations
to support variable processing sizes. The volume_copy method
will also be refactored in the near future to take advantage
of this feature.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Changes component set state handling. If component
already has the desired state, then the state propagation
will stop at that component. This allows for connecting
multiple source pipelines to one sink pipeline and
properly handling params and prepare calls.
Also removes unit tests, which don't make sense anymore.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>