Changes place of setting DAI config from IPC handler to
dai_config operation of DAI audio component. It's much
more cleaner solution in terms of error reporting
and core ownership.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Adds core id to comp_buffer structure. It allows for
easy retrieval of core on which buffer has been created.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Adds new fields to ipc_comp_dev structure: core and id.
ipc_comp_dev instances are shared among cores, so the data
from here can be easily accessed by SMP code.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
This patch moves the validation of host params to
prepare() method. Therefore we can tell user right
away something is wrong with his params instead of
waiting till draining.
Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
This patch checks if draining should be controlled
in terms of speed. Such condition may be necessary
if host buffer is smaller than KPB's history buffer.
Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
This patch slightly reworks validate_host_params()
function to check how big is host buffer. If it is
big enough to store all data from history buffer we
can skip further validation.
Signed-off-by: Marcin Rajwa <marcin.rajwa@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>
In HiFi implementation should be used copy methods with prefix
from audio_stream_* instead buffer_* because of removing this
functionality to audio_stream module.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
In source code there are places where are implemented pointer
wrapping by hand, what looks quite complicated for a first eye catch
and is messy because of pointer type casting.
Using as_wrap is very well descriptive method and consist with DRY
principle.
as_get_frag has been changed to preprocessor function as it is just
moving given pointer and wrapping result.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@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>
Changed line was longer than 80 chars and refer to nested variable
twice - after changes both problems disappears.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Const keyword is added to explicitly indicate that nothing in given
source buffer can be changed in processing functions - read pointers also.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
To keep code clean and consistent create processing function
interface outside comp_data function definition to omit
duplicated definitions.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Const keyword is added to explicitly indicate that nothing in given
input devices buffer can be changed in processing functions -
- read pointers also.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
To keep code clean and consistent create processing function
interface outside comp_data function definition to omit
duplicated definitions.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Const keyword is added to explicitly indicate that nothing in given
input devices buffer can be changed in processing functions -
- read pointers also.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Functions like src_get_copy_limits should have const marking to
avoid error related with unintentional fields editing.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Const keyword is added to explicitly indicate that nothing in given
input devices buffer can be changed in processing functions -
- read pointers also.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
To keep code clean and consistent create processing function
interface outside comp_data function definition to omit
duplicated definitions.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Const keyword is added to explicitly indicate that nothing in given
source buffer can be changed in processing functions - read pointers also.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Const keyword is added to explicitly indicate that nothing in given
source buffer can be changed in processing functions - read pointers also.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Const keyword is added to explicitly indicate that nothing in given
source buffer can be changed in processing functions - read pointers also.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
In new convention there is no need to break the line in function call,
so there will be less effort after rename location of local_fmt value
in near future.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
This value was calculated in two calls in dma_buffer_copy_*.
While those functions has long list of arguments, introducing
new variable makes code little more readable and avoid possible
error of making some patch on calculating sink_bytes in only
one place instead of both.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Const keyword is added to explicitly indicate that nothing in given
source buffer can be changed in processing functions - read pointers also.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Const keyword is added to explicitly indicate that nothing in given
source buffer can be changed in processing functions - read pointers also.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
To keep code clean and consistent create processing function
interface outside comp_data function definition.
This solution allow in a future to use pointers to function
with compatible interface as a function arguments or return type.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Const keyword is added to explicitly indicate that nothing in given
source buffer can be changed in processing functions - read pointers also.
Moreover same thing needs to be done in *setup_circular functions
to achieve successful compilation.
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>
Timers can be shared between cores, so we need to mark
timer as SHARED_DATA in order to benefit of the newly
introduced platform_shared_commit() API.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
After commit dece398b22 ("timer: add platform timer to sof context")
platform timer was added to sof context so global platform timer is
no longer used. Remove it now.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
After commit 8dcf0a7c89 ("timer: add cpu timer to sof global
context") cpu timer is also stored in sof context for later use.
Initial support for i.MX8M didn't set cpu_timer field of sof global
context, so set it now.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Changes sequence of initialization in platform_init(),
so that DMA scheduling domain can be initialized with the DMA
taken through sof context. This allows for removal of another
externed global variable.
This is similar with commit 9c62ac56eb ("platform: use dma from sof
context for domain initialization")
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Messaging Unit can be found on all i.MX8 platforms so move
the implementation into a common place so that it can be
used by everyone.
Users need to define their own specific MU_BASE address.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
DMIC01 is just useless for a user. After multiple rounds of
discussion, we agreed to remove numbers (which could be understood as
a mic position) or a frequency (which is misleading since it can be
updated to e.g. 96kHz by topology), so by default the DMIC interface
is called just that...
Conversely, we add a clear 16kHz qualifier for the low-frequency
path. While in theory the frequency can be changed with modifications
of the FIR filter, applications do need 16kHz support.
Also make sure we only use 'DMIC' for 'PCH-attached DMICs'. For
RT715-based solutions, the microphones can be analog, so use more
generic 'Microphones' description.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Changes sequence of initialization in platform_init(),
so that DMA scheduling domain can be initialized with the DMA
taken through sof context. This allows for removal of another
externed global variable.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>