module_adapter:dts: support module life cycle change
1. Add a free memory function to support PR#6230 and PR#6331,
the latest prepare/reset API flow update of module_adapter.
2. This requires DTS library v1.0.7 to support this change.
This commit refines the following procedures to
make it more stable on different platforms.
1. The initial data( not config ) defined in the topology
is empty. On some platforms rtnr_get_comp_data
might be called with the size equals 0 during
initialization. We only do the memcpy_s when the size
is valid.
2. There are 3 control widgets in RTNR topology. During
initialization, the initial data could be received via IPC
in the form of config+data+switch or config only. In
either case we now just copy the preceding portion
of the data since it has the required config.
Signed-off-by: Ming Jen Tai <email address hidden>
(cherry picked from commit 4a438b962b7201d15a87840cc330cda96bf0f608)
codec_adapter:Fix dangling pointer issue in module reset
During module_reset and module_free Calls, pointers are not
getting reset to NULL which causes dangling pointer exceptions.
Initialize pointers to NULL after deallocating the memory.
This is cherry picked from commit 53b3bc6 on main but rollback to be
applied on codec_adapter instead.
Modify the definition of the reset API in the codec adapter interface
to make sure that it should reset the codec state back to
MODULE_INITIALIZED and free all memory that was allocated during the
prepare() callback. With this change, stopping and restarting streams
will always be guaranteed to invoke codec's prepare() callback.
This is cherry picked from commit b9889d5 on main but rollback to be
applied on codec_adapter instead. Skip cadence and passthrough code
update since they won't be used by mt8195 firmware.
At present codec_adapter, period_bytes is calculated assuming the schedule
period is 1ms, which could be arbitrary in practice determined by the
topology.
This commit replaces the calculation code by audio_stream_period_bytes().
In addition, the timing for getting period_bytes is moved to the beginning
of prepare() (prior to the codec prepare). At that moment it is guaranteed
that all parameters in components/buffers are settled through the pipeline.
This is cherry picked from commit b3106c3 on main but rollback to be
applied on codec_adapter instead.
Signed-off-by: Pin-chih Lin <email address hidden>
SOF CMake defines SOF_MAJOR, SOF_MINOR and SOF_MICRO for 3 fields of
firmware file version major.minor.micro. But CMake only passes the major
and minor version to rimage.
Now CMake will also pass the mirco version to rimage, so that rimage can
write it to different firmware manifest headers for cAVS platforms and
then sof_ri_info.py will be able to dump entire file version info from
the firmware binary.
Signed-off-by: Mengdong Lin <email address hidden>