The generic module_set_configuration function returns 0 early when
the coming config size is 0. In aspect of DTS module, receiving 0
from module_set_configuration call means either config is obtained
succesfully or no config (size is 0). The present code doesn't
handle the latter case.
This commit handles the case in DTS module by early return.
Signed-off-by: Pin-chih Lin <johnylin@google.com>
In DTS module m4 file, the default control bytes used to have a
12-byte redundant param {0x0000, 0x000c, 0x0000}, the param id is
0 (the first 4-byte).
For DTS SDK version >= 1.0.8, error is reported while getting the
param with id=0.
This commit removes the redundant param from default control bytes.
Signed-off-by: Pin-chih Lin <johnylin@google.com>
Due to allocation failures, or invalid content in dictionary,
"params" entries in "struct proc_ldc_entry" may be NULL.
In print_entry_params(), the NULL entries may be passed
as arguments to fprintf(). While e.g. glibc handles these without
error, this is not guaranteed behaviour and may result in segfault
on some platforms.
Fix the issue by aborting program if allocation fails and
explicitly handling the cases when asprintf_entry_text returns
NULL.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Until now, one dma channel could be stopped multiple times without any
problems. From commit af6d827b64 on zephyr it is required that the start
and stop calls be perfectly balanced.
Zephyr device power manager stores an internal counter. Counter is
incremented if device is used and decremented on device release. In this
case when we call dma_start() and dma_stop().
If dma_stop() is called more times than dma_start() power manager will
reaport a error -EALREADY.
Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
Github allows to store build artifacts for 90 days after the build.
Somebody might want to examine the output of the build, now can
easily download everything that job produces.
In example, compile_commands.json file contains all compilation
commands in verbose that are not visible in the build log
by default.
Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
Recently new feature had been introduced to Github actions
"concurrency" that allows to define a name for a group of workflows
that will cause old workflow to stop if the new one had been created
and the group name matches.
This improves usage of resources in SOF project by cancelling
running workflows when pushes to pull requests are done frequently
before old jobs are completed.
Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
Zephyr workflow had been added new build-windows job.
It makes sense to rename old "build" job yo "build-linux"
for consistency.
Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
During testing of Windows CI workflow on windows-latest turned out
that github action console has issues rendering python
anytree.RenderTree graph with default style of
anytree.render.ContStyle (continuous vertical and horizontal lines).
Tests on local machines in cmd, pwershell and msys shells
proves, that all shells can render the graph (while powershell
does not do this correctly and graph is malformed).
Changing graph style to ASCII resolves the issue with Github actions.
Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
With IPC4 only two 32-bit values are copied from the host in the
common part, anything beyond that must be copied separately. Those
two values are stored in a global msg_data.msg_in object. Therefore
always when reading from it only up to 8 bytes should be read. In
most cases it is also the case, because the target object has the
same size, but in case of SOF_IPC4_MOD_INIT_INSTANCE this isn't the
case, there special care must be taken.
Also remove a redundant NULL check where NULL cannot appear.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
localtime() can return NULL in error cases. Check the return value
before dereferencing it.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Fix a case of a possible array overflow, detected by static code
analysis.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Finish the job that commit 5b29dae9c8 ("logger: Create global
convert_config variable to avoid spaghetti code.") started but did not
complete, leaving a confusing mix of globals and locals.
This confuses some static analyzer complaining that stack values are
being returned, see #6858 and #6738. This is a false positive because
convert's() stack lifespan is practically the same as a global but let's
simplify things anyway.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Finish the job that commit 5b29dae9c8 ("logger: Create global
convert_config variable to avoid spaghetti code.") started but did not
finish, leaving behind a supposedly "global" variable that is actually a
confusing global pointer to a struct local to the main() function.
This confuses some static analyzer complaining that stack values are
being returned, see #6858 and #6738. This is a false positive
because the main()'s stack lifespan is the same as a global but let's
simplify things anyway.
Also stop using 'extern' in .c files, use a proper .h file instead.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
sof-logger -u 115200 -d /lib/firmware/sof-foo.ldc
Leads to silent failure as a NULL is passed to open(). Add
explicit error handling for this case.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Convert the mixout module to use the module adapter. The
bind/unbind/get_attribute ops in the mixout module have been moved to the
module_adapter ops and is functionally the same as with the comp_drv
ops.
The struct mixout_data struct has been simplified to contain 2 fields as
the source info table has been moved to struct processing_module and
rename the consumed_yet_not_produced_frames field in struct mixout_data
to pending_frames.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Initialize the hw_params to 0 before passing it to the individual
components in the pipeline.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
The check for status counts for modules with multiple sources is only
applicable for IPC3.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
When module_reset() returns a non-zero value, print an error if needed
and return immediately.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Define the bind/unbind comp driver ops for the module_adapter which will
be used to update the source device pointers in the source_info table.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Add module_source_info_acquire/release() for coherent access to the
module's source_info data.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Introduce struct module_source_info that will be used to keep track of
all the source modules that are bound to a module. Also, add a new
field, source_info in struct processing_module to save the source
information for each module.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
On my system this brings the install_platform() duration down from about
3 seconds to less than 1 second.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
This patch adds to development topologies build of minimal topologies
sof-apl-pcm512x-drc.tplg and sof-apl-pcm512x-mdrc.tplg for testing.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
When dev->state == requested_state in comp_set_state then
COMP_STATUS_STATE_ALREADY_SET (status 1) is returned.
Then the pipeline trigger is aborted and status 1 is returned
to the pipeline_task_cmd function (status 1 in this function means
PPL_STATUS_PATH_STOP). Finally, the status of the pipeline
does not change and the IPC response returns success.
which causes errors with subsequent changes in the pipeline state
(INVALID_IPC_REQUEST)
Signed-off-by: Kwasowiec, Fabiola <fabiola.kwasowiec@intel.com>
In the lib_manager_dma_deinit() function proper checks
for dma_ext structure fields must be added to avoid
calling dma api with uninitialized parameters.
Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
Use a local variable in ipc4_get_buffer() to simplify it and remove
redundant code.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
This is a theoretical case of an invalid pipeline status, handle it
correctly.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
If the main context variable is NULL, it cannot be used to print an
error message. Since this actually should never happen, use an
assertion similar to other similar cases in the file.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
The create_dai() function can return an uninitialised value. Fix it
by reducing the scope of the variable.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
In user-space tools, memory allocations can reasonably be expected to
always succeed. Make this assumption explicit by adding error handling
after calloc.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
In user-space tools, memory allocations can reasonably be expected to
always succeed. Make this assumption explicit by adding error handling
after malloc.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
A pipeline that contains a selector cannot be run before the pipeline
that is connected to the selector because an error is returned.
The order of the run pipelines should not matter for functionality.
Signed-off-by: Kwasowiec, Fabiola <fabiola.kwasowiec@intel.com>
In theory a failure from this script should immediately stop the show
and no one should then use the staging directory.
In practice we cannot make sure, especially not with shell scripts. So
make sure no previous build of a requested platform is left behind.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
lib-manager allocated memory for library modules with a cached alias
and explicitly synchronises cache in it (apparently superfluously).
Add cache address space annotations as needed.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
src_info, as returned by find_mixout_source_info(), is a part of
mixed_data_info which is explicitly cached. Annotate src_info to be
the same.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
cache_to_uncache() and uncache_to_cache() must be inline functions
with proper argument annotations. Fix ACE definitions by alanogy with
cAVS.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Cached addresses aren't used to access the hardware in mailbox.h,
they don't need to be volatile.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
This upgrade was already performed for other jobs in commit
f71eb15818 (".github/workflows: upgrade actions/checkout@v2 -> v3")
and everything went fine. Finish the job and get rid of the last
warnings in the daily tests (example:
https://github.com/thesofproject/sof/actions/runs/3709176785)
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
The dai_index needs to be mapped similarly as in kernel. The SSP
type was handled correctly in the function but not DMIC.
Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Smart amp test module read config from ipc msg and convert ipc4 settings
to ipc3. It is a dummy module used for smart amplifier validation.
Signed-off-by: Chao Song <chao.song@linux.intel.com>
Signed-off-by: Rander Wang <rander.wang@intel.com>