The change done in commit b53573a15c
("ipc3: override type field once comp_driver found") expects
the component type via init IPC to be the same as module
register sets (SOF_COMP_MODULE_ADAPTER).
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Change all access to the first element of dev->bsource_list
from direct to API call comp_dev_get_first_data_producer
access in pipeline management code, like module adapter,
is omitted intentionally
Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
Change all access to the first element of dev->bsink_list
from direct to API call comp_dev_get_first_data_consumer
access in pipeline management code, like module adapter,
is omitted intentionally
Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
comp_buffer, implemented in buffer.c file, should
be kept in the buffers directory, together with all
buffers
Also it has been renamed to comp_buffer.c
Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
Adds a channel map parameter to conversion functions, allowing for
the introduction of conversions that can handle both format conversion
and channel remapping.
Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
The current SOF architecture splits a "module" across two structs, the
legacy comp_dev and a newer struct processing_module. The latter
contains a pointer to the former, but in many places existing code has
needed a backpointer to recover the module from a component.
So far this has abused the drvdata mechanism to store this as a void*,
but that's fragile as many components are already (!) using drvdata
for other purposes and will clobber the setting. The fact that it
worked is seeming just by luck. That pointer is for the exclusive use
of the comp_driver code associated with a component to store its own
data. We can't be touching it from the global module code.
Just give the pointer a properly-typed field of its own and make sure
the two are initialized in tandem. Longer term, SOF really needs to
fix this bifurcation and unify the two structs.
Signed-off-by: Andy Ross <andyross@google.com>
Make the filename argument be a const char * to avoid the following
warning with c++ compliation:
warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
The test function is based on test function for the cordic
sine function. The error tolerance is adjusted to just pass.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Remove unused META definition, below work is done:
1. removed META definition.
2. removed cmocka preproc module.
3. removed cmocka strcheck and debugability module.
With this change, cmocka does not have any dependency on
META programming.
Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
Direct numbers are hard to know what exactly means, it
actually represent log error level print, use macro to replace
it.
Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
This is a clean up, purpose is declutter headers, toml files,
Readme.md etc per module basis, since today everything is scattered
in current code base.
Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
This is a clean up, purpose is de-cluster headers, toml files,
Readme.md etc per module basis, since today everything is
scattered in current code base.
Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
Moved header files to the module directory to separate an shared interface
used by sof and native loadable modules.
Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
Move out ipc3 and ipc4 specific code to corresponding source file.
Also, move some common functions to header file.
Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
By default ipc_get_comp_by_ppl_id() routine omits component
from core different that the one where pipeline is working.
However with introduction of DP modules such situation can happen.
In some flows we need to find modules that belongs to given pipeline
but are scheduled on different core. This modifications will allow to
select when include such modules in the search.
Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
create ipc3 and ipc4 specific source file, these files will
only be used to store specific code accordingly.
Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
Host build should not depend on testbench symbols. Also add timestamp to
the trace log.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
This commit removes coherent.h from struct comp_buffer
As sharing status of a buffer is known at creation time, it is
enough to create a buffer in shared (not cached mem alias)
when it will be used by several cores
Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
For sample format with 24 bits valid sample bit and 32 bits container,
valid sample is at msb 24bits if IPC4_TYPE_MSB_INTEGER is set.
Signed-off-by: Rander Wang <rander.wang@intel.com>
This check in change eliminates the extra include isa.h header file
from the exp_fcn_hifi.c file, as it does in the exp_fcn.h file.
Signed-off-by: ShriramShastry <malladi.sastry@intel.com>
Fix the cmocka build issue after adding functions
for explicitly get ipc device for component, buffer
and pipeline.
Signed-off-by: Chao Song <chao.song@linux.intel.com>
For sample format with 24 bits valid sample bit and 32 bits container,
valid sample is at msb 24bits if IPC4_TYPE_MSB_INTEGER is set.
Signed-off-by: Rander Wang <rander.wang@intel.com>
Defined a new frame type SOF_IPC_FRAME_U8 for 8-bit unsigned samples. Added
support for a new format to stream format conversion function and
get_sample_bytes function.
Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
The switch supporting various sample formats was missing a default handler,
which caused compilation errors when enabling/adding a new format that is
not supported.
Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
The switch supporting various sample formats was missing a default handler,
which caused compilation errors when enabling/adding a new format that is
not supported.
Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
Add passthrough functions implementation. If the gain of all
channels equal 0dB, then we use passthrough functions to process
the volume component.
Signed-off-by: Andrula Song <andrula.song@intel.com>
Module prepare is an operation that needs to set up sink
and source according to needs.
Therefore it must have access to sink/source handlers
This commit adds handlers to API. In case the module uses
legacy audio stream sink/source pointers will be NULLs
and number of sinks/sources will be zero
Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
Target is to make all modules use sink/source API as
data source and destination.
However, current implementation of module adapter
allows 2 other completely different interfaces to be used:
"simple_copy"
modules receive output_stream_buffer and
input_stream_buffer table. void * data pointers
from both structures point to audio_stream
other fields in the structures are in fact not needed
but are used
"! simple_copy"
modules receive output_stream_buffer and
input_stream_buffer table. void * data pointers
from both structures point to raw linear data
to make transition smooth and easy, both
legacy ways have been kept, just to make the code
more clear - put at separate module API calls,
Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
Make audio_stream capable of using pipeline2.0
sink and source API
This change makes integration of sink/src api
possible in incremental way
Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
There are many operations on sink/source that may be put into a
common library. This is the place for it.
Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
this is a definition of API to sink of audio data
THE SINK is any component that can store data somehow
and provide a buffer to be filled with data at request.
The sink API does not define how the data will be processed/used
The user - a module - sees this API as a destination
it must send data to
The IMPLEMENTATION - audio_stream, DP Queue -
sees this as a producer that PROVIDES data for processing
Examples of components that should expose SINK api
- /dev/null
all the data stored in sink buffer are just simply discarded
- I2S sender
Data stored in sink buffer will be sent to the external world
- a memory ring buffer
data stored in the buffer will be sent to another module
(usually using source API, but it does not matter in fact).
Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
this is a definition of API to source of audio data
THE SOURCE is any component in the system that have data
stored somehow and can give the data outside at request.
The source API does not define who and how has produced
the data
The user - a module - sees this as a producer that
PROVIDES data for processing
The IMPLEMENTATION - audio_stream, DP Queue - sees
this API as a destination it must send data to
Examples of components that should expose source API:
- DMIC. Data are coming from the outside world,
stores in tmp buffer and can be presented
to the rest of the system using source_api
- a memory ring buffer
Data are coming from other module
(usually using sink_api, but it does not matter in fact)
Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
The 32-bit HiFi4 exponential library function has an accuracy of 1e-4,
a unit in last place error of 5.60032793, and output ranges from
0.0067379470 to 148.4131591026 for inputs from -5 to +5 (Q4.28) (Q9.23).
Signed-off-by: ShriramShastry <malladi.sastry@intel.com>
Set byte_align as 1 and frame_align as 1 means no limit on both byte and
frame for this stream. Call audio_stream_init_alignment_constants in
audio_stream_init, set default align info while buffer created. And every
specific component can set its own byte and frame align info in its
prepare function later.
Signed-off-by: Andrula Song <andrula.song@intel.com>
This patch converts the demux_copy, mux_copy, and
mux_get_processing_function tests to module adapter API.
The main change is in component new preparations with
UUID reference.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The purpose of this commit is to separate XTOS-specific code
from the Zephyr-specific code found in sof/schedule/task.h.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
The purpose of this commit is to separate the XTOS-specifc
code from the Zephyr-specifc code found in sof/sof.h.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Fix the peak volume calculation error in volume component, calculate
the maximum absolute value of input as peak volume as close source
firmware did.
Signed-off-by: Andrula Song <andrula.song@intel.com>