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>
Refactor the whole pipeline component:
- one method to handle both upstream and downstream walk
across the pipeline graph,
- code deduplication,
- cuts pipeline implementation size by half.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Disables following tests:
Debugability - not designed to be run on host at all
Volume - needs some tuning to not fail
Buffer - needs some fixes to not have segfault
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
Fix some build issues with cmocka for host test bench target so that
cmocka UTs can run native on host architecture. This makes it easy for
users to update UTs when APIs change as they dont need architecture
specific version of cmocka.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Added macro functions to make repetitive, nearly identical functions more maintainable via metaprogramming. They generate code in pre-compile, conceptually similar to C++17 if-constexpr. sof/trace, host/trace: rewrote _trace_event/d+ functions using preproc.h. test/cmocka/include/test_group_generator: rewrote macros to not conflict with new ones. Added unit tests to check whether more advanced and less obvious macros do in fact work.
Signed-off-by: Michal Jerzy Wierzbicki <michalx.wierzbicki@linux.intel.com>
Adds support for multicore notifications:
- IDC that needs to be sent to slave cores.
- Flag which tells notifier, which cores should be notified.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Unfortunately tests for buffer/runtime zones will remain broken,
might require some rework in the firmware code.
For this reason, they shall be temporarily disabled.
Signed-off-by: Slawomir Blauciak <slawomir.blauciak@linux.intel.com>
Added tests for pipeline free and underlining static functions.
Also refactored previously added tests to incorporate code reuse.
Signed-off-by: Jakub Dabek <jakub.dabek@linux.intel.com>
Added tests for pipeline complete and subsequently to
pipeline connect upstream and connect downstream since
they are both statics.
Signed-off-by: Jakub Dabek <jakub.dabek@linux.intel.com>
Update comp_set_state test cases due to refinement the component's
state machine in commit 5198517.
Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
I've fixed multiple assert occurance in comp_set_state test functions.
Now single UT has only one assert. There is also a change of the name
of the test file due to name restrictions.
Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
Support for multiple cores executing the same code
with the new arch xtensa-smp:
- Updated xtos to the latest version (2017.8).
- Modified xtos to handle interrupts per core.
- Added interrupt structures and stacks per core.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
This patch adds initial empty implementation of runtime power management.
It is based on linux kernel implementation and will be developed
in the future.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>