Format for validation in the attenuation
function is taken from base_audio_fmt
instead of out_fmt
Signed-off-by: Kwasowiec, Fabiola <fabiola.kwasowiec@intel.com>
Cache invalidation after memory unmap is not required and
could trigger exceptions depending on memory protection
configuration.
Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
Maintain codec configuration initialization for ipc4 protocol in cadence
module by separation critical functions into ipc3/ipc4 versions
Changes affect:
- different size of init/runtime config allocation
- resolving codec id from configuration from configuration params for ipc4
Signed-off-by: Piotr Makaruk <piotr.makaruk@intel.com>
Simple copy does not need full buffer info for every iteration.
Only calculate what we need.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
All available ACE and CAVS platforms use INCOHERENT config, so set it by
default.
Signed-off-by: Przemyslaw Blaszkowski <przemyslaw.blaszkowski@intel.com>
buffer_size_max of PCM cap for deepbuf is configured for 65536.
Quadruple the buffer_size/period_size to allow aplay to use larger
buffer size.
Signed-off-by: Yong Zhi <yong.zhi@intel.com>
This is a porting of SRC module to use sink/src API
To have src fully ported there's a need to get 100%
independent of audio_stream and buffer.c
This step is necessary because other implementations of
sink/src, like DP Queue, may not be based on buffer
implementation
Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@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>
As no internals of audio_stream nor comp_buffer should be
accessible directly, move all calls to buffer_fmt to API
In addition, to let sink/source interface working,
move the parameter to audio_stream structure
Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
The function applying the attenuation should be based
on write pointer and the current number of copied data in
the current systick.
Signed-off-by: Damian Nikodem <damian.nikodem@intel.com>
The function applying the attenuation should be based
on write pointer and the current number of copied data in
the current systick.
Signed-off-by: Damian Nikodem <damian.nikodem@intel.com>
Some topologies have the same file name specified as nhlt debug output
so they will override others. Change the names to be unique.
Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
The source frames count need to be checked from every
active input_buffers[n].size). Similarly in consuming the
source buffers it needs to be updated to every
mod->input_buffers[n].consumed.
Fixes: #7308
Fixes: c399624 ("Audio: Mux: Convert mux and demux to module adapter")
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.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>
The config CONFIG_LOG_FUNC_NAME_PREFIX_xxx is only
enabled for ACE platforms and INF log level, and the
timestamp used is different on TGL and MTL, which
is not quite consistent.
This patch make sure the log format is consistent
among platforms and log levels.
Signed-off-by: Chao Song <chao.song@linux.intel.com>
Remove the internal linear buffer to get/store data from source
and sink. And use the index table to reduce the mod operation.
Signed-off-by: Andrula Song <andrula.song@intel.com>
use the audio_stream_avail_frames_aligned to get processing
frames and then can reduce the division of comp_get_copy_limits.
Signed-off-by: Andrula Song <andrula.song@intel.com>
There is pinmux on MTL platform to optionally enable DMIC,
add this config to the build and run the pipeline on core 1.
Signed-off-by: Yong Zhi <yong.zhi@intel.com>
The address translation is needed only for shared in functions
coherent_release() and coherent_release_thread().
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
As host_common_params() only sets a subset of the fields,
initialize the Zephyr DMA interface struct "dma_block_config"
with zeroes before use.
Issue found in code review.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
No reason to mix cached and noncached operations when
initializing the buffer in buffer_alloc(). We take a cached
reference, so let's use that to initialize the object.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Removing writebacks of internal buffers: buf_in and buf_out.
Aria instance has exclusive access to this memory, so they are always
used at the same core.
Signed-off-by: Przemyslaw Blaszkowski <przemyslaw.blaszkowski@intel.com>
In specific cases, Aria could get more than 1ms of data in input buffer
and more than 1ms free space in output buffer. In such case, Aria tried
to process more than 1ms, while internal buffers and algorithm are
prepared only for 1ms of data. In result buffer overflow was observed
and other module data was overwritten.
Limiting Aria processing size to IBS.
Signed-off-by: Przemyslaw Blaszkowski <przemyslaw.blaszkowski@intel.com>
A ton of (valid!) warnings but this will make sure the code at least
compiles.
For more context see #7192
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
When calculating number of frames to be attenuated in HOST copier
source stream frame bytes should be used instead of sink frame bytes.
E.g. in case of 24/24 bit to 24/32 bit PCM conversion using sink
container size will reduce frames number by 1/4 which will lead to
multiple glitches.
Also attenuation has to be applied in HOST copier in playback scenario
only, thus remove from do_conversion_copy()
Signed-off-by: Ievgen Ganakov <ievgen.ganakov@intel.com>
Use the input_audio_format and output_audio_format objects instead
and fix the number of input/output formats to 1.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
There's really no reason to fall back on a default "platform" and pick
up a bunch of other, totally random settings.
Now the following command fails immediately with a useful `platform not
defined` error message instead of stopping with a cryptic
`platform/trace/trace.h: No such file or directory` after successfully
compiling half the .c files in a Frankenstein CONFIG_uration.
```
west build -p --board mimx8mm_evk_a53 modules/audio/sof/app
```
More context in #7192.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Don't rely on some semi-random default value.
The final `zephyr/.config` and binaries are strictly identical.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Use get_filename_component() to get the basename and remove the
$platform_folder special case for CONFIG_RENOIR and
CONFIG_REMBRANDT. Zero change, binaries are identical.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
The rimage submodule was accidentally changed to a difference
version. Change back to the version in west.yml.
Fixes: 7511a1da15 ("kpb: Don't assert on memcpy overruns")
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>