This patch adds two more code owners of codec_adapter.
Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Useful error messages when forgetting to use "sudo" or to change
permissions in udev.
Some places were printing the errno decimal. Others no specific error
at all.
Sample outputs:
error: Unable to open version file /sys/kernel/debug/sof/fw_version: \
Permission denied
error: Unable to open version file /sys/kernel/debug/sof/fw_version: \
No such file or directory
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
The pipeline position metadata lookup table is only used by the graph
code so move it there.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Statically defined pipelines should be stitched into the FW image as
topology data rather than coded in C. This code was never used after
initial development so can be removed.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Split the pipeline logic up into stream, params, graph, scheduling and xrun
so that it easier to follow and understand. This is to help on the TSC work
to integrate the codec adaptor into core logic.
This PR is all mechanical code moves. There are NO functional changes. Some
function that were static are now public.
Followup patches will add more documentation updates alongside.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
A side effect of the pipeline splitting work means that testbench is
not building. Provide a temporary fix until Zephyr native APIs are used.
/component.c.o -c /home/lrg/work/sof/sof/src/audio/component.c
/home/lrg/work/sof/sof/src/audio/component.c: In function ‘get_drv’:
/home/lrg/work/sof/sof/src/audio/component.c:41:2: error: ‘flags’ is used uninitialized in this function [-Werror=uninitialized]
41 | irq_local_disable(flags);
| ^~~~~~~~~~~~~~~~~~~~~~~~
/home/lrg/work/sof/sof/src/audio/component.c: In function ‘comp_register’:
/home/lrg/work/sof/sof/src/audio/component.c:150:2: error: ‘flags’ is used uninitialized in this function [-Werror=uninitialized]
150 | irq_local_disable(flags);
| ^~~~~~~~~~~~~~~~~~~~~~~~
/home/lrg/work/sof/sof/src/audio/component.c: In function ‘comp_unregister’:
/home/lrg/work/sof/sof/src/audio/component.c:163:2: error: ‘flags’ is used uninitialized in this function [-Werror=uninitialized]
163 | irq_local_disable(flags);
| ^~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
We are only setting the parameters on the allocation of the local buffer
which means if the params change on the next run it will not change and
break things.
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
After commit ed027d045b ("codec_adapter: Differentiate between consumed/produced bytes")
the codec adapter expects codecs to update consumed / produced bytes separately.
This fixes passthrough and waves codecs.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
commit e50ae6be8c ("codec_adapter: Initialize processing") uses
the generic function codec_init_process which in turns needs a callback
for each type of codec.
Thus waves and passthrough are broken because there is no .init_process
callback provided. Fix this now.
Notice that the callback is mostly empty, the only thing that needs
to be done is to set codec->cpd.init_done to true.
Fixes: e50ae6be8c ("codec_adapter: Initialize processing")
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
init_process API is used to initialize the processing phase.
(e.g for Cadence: search for valid header, decode header in order
to get parameters).
init_process needs to have access to the input frames so it will be
called by codec adapter copy() function.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
In this way we avoid crashing the SOF FW and warn the user that
the callback is missing from the implementation.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
In an ideal world, every CI engine records and shares the most important
CI information:
- current date and time in a well identified timezone
- git version of the pull request
- git version of the moving branch the PR is being merged with
In the real world we have multiple CI solutions and they unfortunately
cannot not all be trusted to perform their most basic job
correctly. Fortunately, they all make at least build logs available so
these very few lines of code adding very few lines of output cost near
zero extra build time and solve the problem once for all. I feel stupid
I didn't do this sooner, this would have saved me hours and hours in
vain requests and discussions and in trying to puzzle that information
together.
Sample output:
-- Preparing Xtensa toolchain
version.cmake starting SOF build at 2021-03-31T18:09:46Z UTC
Building git commit with parent(s):
150fd1e4c968 4249bdb1b305 [other parent if merge] (HEAD -> main) cmake: ...
-- GIT_TAG / GIT_LOG_HASH : v1.7-rc1-174-g150fd1e4c968-dirty / 150fd1e4c968
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
oops, forgot to update interface so build was silently not linking the
passthrough interface to the adapter
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Required by #3459 / #3975 "elfsize" proof of concept and probably by
other things too in the future - we use both ELF and Python
everywhere; it's surprising they haven't met each other yet.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Add some useful information logs about the task scheduling point with
ll_scheduler, which will help to capture logs once we hit scheduling
issue on some specific task.
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Request for owner has gone unacknowledged, ToT adapter is broken
suggesting we likely need additional reviewers given we have no existing
code owner.
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
There could be some codecs which require 0 byte library configure, e.g.
the passthrough one, change to make this possible.
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
For at least two reasons:
- exposes sneaky change(s) performed by automation if/when any
- solves the mystery of the Source content hash (printed on the next
line) changing while the git version does not.
Example, at https://sof-ci.01.org/sofpr/PR3941/build8429/build/bdw_gcc.txt
-- Found Git: /usr/bin/git (found version "2.17.1")
-- GIT_TAG / GIT_LOG_HASH : v1.7-rc1-151-g023c4abacde1 / 023c4abac
-- Source content hash: 91f261ea
whereas at https://github.com/thesofproject/sof/runs/2166298087,
xtensa-build-all:
-- Found Git: /usr/bin/git (found version "2.17.1")
-- GIT_TAG / GIT_LOG_HASH : v1.7-rc1-151-g023c4abacde1 / 023c4abac
-- Source content hash: 67f31697
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
ESAI allocates private data and retrieves this data using
dai_get_drvdata().
But this is never set using dai_set_drvdata() and sometimes
dai_get_drvdata() returns NULL.
So, after private data is allocated, set it using dai_set_drvdata().
Without this fix, on i.MX8QM, on playback we get:
root@imx8qmmek:~# aplay -Dhw:1,0 -f S16_LE -c 2 -r 48000 -d 5 -t raw /dev/urandom
Playing raw data '/dev/urandom' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
[ 197.478128] sof-audio-of 556e8000.dsp: error : DSP panic!
[ 197.483547] sof-audio-of 556e8000.dsp: error: runtime exception
[ 197.489473] sof-audio-of 556e8000.dsp: error: trace point 0dead006
[ 197.495658] sof-audio-of 556e8000.dsp: error: panic at :0
[ 197.501064] sof-audio-of 556e8000.dsp: error: DSP Firmware Oops
[...]
Fixes: f40222a1ea ("drivers: imx: esai: use rate from topology")
Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
buffer_unlock() does not use flags.
Silences this gcc 8.1.0 (and valid) warning in
src/audio/pipeline.c#pipeline_for_each_comp(). For some strange reason
it shows up only with CONFIG_OPTIMIZE_FOR_DEBUG=y. Heuristics?
In file included from sof/src/include/sof/audio/pipeline.h:16,
from sof/src/include/sof/audio/buffer.h:12,
from sof/src/audio/pipeline.c:8:
src/audio/pipeline.c: In function 'pipeline_for_each_comp':
src/include/sof/spinlock.h:200:38: error: 'flags' may be used uninitialized in this function [-Werror=maybe-uninitialized]
src/audio/pipeline.c:182:11: note: 'flags' was declared here
uint32_t flags;
^~~~~
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
The configuration names with _2017 are a consequence of the way I did
the internal configuration update. To keep it simple I update these
build scripts.
Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
Implement a kwd function based on small
neural network able to detect yes/no
keywords. This represents an alternative
to the default kwd function and is
implemented in a separate file. Enabling
the usage of this kwd nn functionality is
done by enabling KWD_NN_SAMPLE_KEYPHRASE.
The inference function of the neural network
operates on 990 ms which are gathered in the
acquisition input buffer exposed by the detection
component.
Signed-off-by: Cristina Feies (ilie) <cristina.ilie@nxp.com>
Define & allocate acquisition buffer where
collecting the necessary amount of input data
required by the detection algorithm. In our
case the kwd_nn detection algorithm requires
~1s of data once which is more than what
the current configuration of the pipeline
offers once: 20ms of data.
Signed-off-by: Cristina Feies (ilie) <cristina.ilie@nxp.com>
Expose detect_test_notify function for
other modules which would implement
an alternative of default kwd detection
Signed-off-by: Cristina Feies (ilie) <cristina.ilie@nxp.com>
GCC configuration for ct-NG uses newlibc libc versions of common
memcpy() and memset(). Check this in makefile and lib.c so we can use
the correct versions.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Following move of open source to remove oppressive language from open
source, dummy is one of the terms to avoid. Also the term does a poor
job of describing what the adapter actually does.
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
During the initialization of a decoder, the initialization task reads the
input stream to discover the parameters of the encoding.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
This function should be called before processing. It searches
for a valid header, does header decoding to get the parameters
and initializes state and configuration structures.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
We need to save initialization status to a persistent (between calls)
variable in order to check it each time we want to do processing.
Initialization only takes place once before first frames are decoded.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>