Use goto to just to an existing error handling label instead of
freeing memory in place and returning.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
- Use rzalloc() instead of rmalloc() + memset()
- Don't check for NULL before freeing
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Zephyr has a logging module, named "modules" too, use "sof_modules"
to avoid a conflict.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Remove unneeded initialisation and move a variable definition closer
to where it's used.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
The loadable module API needs to support all module-adapter methods,
add all the missing ones.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
The library manager uses a DMA buffer only to receive data via DMA
from the host and to copy it from it once completely to a destination
buffer. With that flow using cached access to the DMA buffer doesn't
accelerate IO but adds complexity and can slow it down instead.
Switch over to using uncached access.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
The code here never really worked right. The module base config
values weren't saved by the core layers, so querying the attribute
returned nothing. A few components have been modified with a whitebox
workaround where they write directly to the basecfg_ext field in the
module_config, but that's not really an API we should want to support.
Get the values from the now-correctly-saved-and-parsed fields the
module init layer has left for us, with considerable code savings and
much less heap thrashing for the temporary copy.
Signed-off-by: Andy Ross <andyross@google.com>
The kernel-provided "base_cfg_ext" data wasn't being handled correctly
by the module adapter layer. These structs (packed wire formats) only
ever lived in the IPC memory. The module would set them on an
"init_data" before calling into driver init, and then clear that
pointer afterwards. That's a critical problem, because the values in
that struct need to be used at pipeline setup time to configure buffer
formats!
Save the data correctly. Also pre-parse it so users don't need to do
byte math on raw buffers and can just use "in/output_pins[]" arrays on
the module_config struct.
Signed-off-by: Andy Ross <andyross@google.com>
This patch adds build of hda-generic development topologies to
test SRC LITE component with all s16/s24/s32 formats
Signed-off-by: Andrula Song <andrula.song@intel.com>
After recent changes, the audio_stream_init_alignment_constants()
routine isn't an "init" step anymore, it sets requirements and can be
called at any time. Rename it to "audio_stream_set_align()" to better
capture its behavior, and rework the documentation to make it clearer
how it works.
Signed-off-by: Andy Ross <andyross@google.com>
Traditionally audio_stream has failed to initialize its computed
alignment fields, forcing components to do this themselves even when
they don't actually have special alignment requirements.
Remove all the code that was merely setting default values, leaving
only a handful of spots with specialr equirements (e.g. eq/area need
to treat pairs of samples, a few others have HiFi-optimized variants
which need SIMD alignment).
Signed-off-by: Andy Ross <andyross@google.com>
As specified, this function was a bit of a booby trap: it has to be
called exactly once, after all other setup that modifies frame size
has been done. If it is called in the wrong order, or not at all, any
consumers of the frame alignment API on this stream will see garbage
data in the computed fields. That's way too much complexity for the
component code that needs to use this tool, especially as the impact
is not in the component itself (e.g. it's a downstream copier widget
with SIMD code that fails).
Instead, preserve the two requirements set by this function in the
audio_stream struct and recompute them any time any of the upstream
values change. That allows this to be safely used from any context.
There's a mild complexity with audio_sink/source layer, which is
written to directly modify the format (it keeps a pointer into
audio_stream of its own) without going through the audio_stream API
itself. There, the framework gives us "on_audio_format_set()"
callbacks on source and sink, so implement it there.
This is a partial fix for Issue #8639
Signed-off-by: Andy Ross <andyross@google.com>
audio_stream_init_alignment_constants() isn't a particularly small
function, isn't used in performance-sensitive contexts, and doesn't
really belong in a header. Move to audio_stream.c for hygiene, and
because it's about to be modified.
Also move the depended-on function audio_stream_frame_align_get(), and
(as it has no consumers outside of audio_stream) remove its
declaration from the header.
Signed-off-by: Andy Ross <andyross@google.com>
It is a general implementation for logging and it doesn't use intel
audio hardware feature like ART counter. 64bits timestamp is needed
for accuracy since the timestamp used by host is beyond 32bits in most
cases.
Signed-off-by: Rander Wang <rander.wang@intel.com>
The default for DEEPBUFFER_FW_DMA_MS is 100, remove the
DEEPBUFFER_FW_DMA_MS parameter set for individual topologies when the value
set is also 100
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
The DeepBuffer stream is D0I3 compatible for some time now on all IPC4
platforms, The CAVS2.5 topologies just did not got updated.
Swap the default for the DEEPBUFFER_D0I3_COMPATIBLE to true.
New, experimental platforms can change this if needed until the feature is
verified.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
The exp_fixed() function is replaced by fast sofm_exp_fixed()
and sofm_db2lin() functions. It saves 40 MCPS, from 123 to 83 MCPS
in a test run in TGL platform.
Signed-off-by: shastry <malladi.sastry@intel.com>
In Zephyr CMakeLists, add exponential source files to facilitate
the compilation of math C and HiFi code.
Signed-off-by: shastry <malladi.sastry@intel.com>
This change allows the fast exponent library to replace
the decibels library for applications like DRC where exponent
function is used in hot code parts.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Signed-off-by: shastry <malladi.sastry@intel.com>
Unused variables from HiFi4/5 were reshuffled and placed in order
to use HiFi3 code. If the variable 'ret' is used uninitialized
whenever the 'if' condition is false, set it to false.
Signed-off-by: shastry <malladi.sastry@intel.com>
Unbreak the Zephyr build when this is enabled, and add the needed bits
to produce a working executable.
This is mostly just a recapitulation of the existing integration,
which means that it's manually pulling in bits from the Cadence
toolchain it needs. SOF isn't yet using the Zephyr C++ integration
(which isn't xt-clang aware yet), nor does it really want to as SOF
itself includes no such code. Zephyr doesn't have a "C++ binary
linkage only" feature yet.
Signed-off-by: Andy Ross <andyross@google.com>
This is a weak stub for the Cadence libc's allocator (which is just a
newlib build). It's traditionally been provided like this in SOF for
the benefit of C++ code where the standard library needs to link to a
working malloc() even if it will never call it.
Longer term this should be integrated as a working allocator, either
unified with the one here or in the Zephyr libc layer. Zephyr already
provides a newlib-compatible _sbrk_r(), we just have to tell it to use
it when linking against Cadence libc.
Signed-off-by: Andy Ross <andyross@google.com>
This patch adds build of hda-generic development topologies to
test SRC component with s24/16 format.
Signed-off-by: Andrula Song <andrula.song@intel.com>
This patch adds build of hda-generic development topologies to
test SRC component with s32 format.
Signed-off-by: Andrula Song <andrula.song@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 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 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>
Multiband DRC requires crossover functionality to cover crossover
specific process, previously, these information defined in crossover
specific directory, now, create a new shared header file for common
information shared both in crossover and multiband DRC.
Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
The removed code may falsely fail for freq like 44.1 kHz.
Also, we generally do not check for sufficient buffer size in module
.prepare() handler. That should be/is done elsewhere. No need to do
the exception for mixout component.
Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
In channel remapping mode mixin sinks could have different number of
channels. Since channel remapping mode has been removed, no need to
support individual channel number setup for each sink.
Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
Modifications to mixin/mixout .process() and .reset() implementations
to switch to use sink/source API.
Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
Remove CONFIG_DMA_GW macro to use dma_copy_set_stream_tag function
to get dma channel on AMD platforms for probe.
Signed-off-by: Kalva, DineshKumar <dineshkumar.kalva@amd.com>