Before the fix the comp->core in ipc_comp_new() is garbage
and the check for maximum core count fails. The pointer to
struct asrc should be passed instead of address of pointer.
Fixes: d9f9340e1a
("tplg_parser: split out testbench logic and partition
features per file.")
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch avoids the build errors. Most of the issues are
from different types for formatted printing in gcc vs. xt-xcc.
The "__attribute__ ((fallthrough));" is not supported in xt-xcc.
The xtensa C library does not have clock_gettime() so it is
only left out from build. The cycles count and MCPS is printed
instead.
The include of dlfcn.h is not needed since the testbench no
more has dynamic libraries.
Structs within structs need to be initialized to zero in xt-xcc
with multiple brackets.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Strip out all the threading and cache debug to become a pure xt-run
application. This removes a lot of code, including in the host LL
scheduler.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Abstract the topology APIs to provide support for other IPC ABIs and
further simplify the codebase. Makse sure all public APIs have the tplg
prefix and make sure private APIs are in the correct places.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Reduce complexity by parsing all topology objects in memory rather than
by seeking file, reading into allocated memory and then freeing memory.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
The simple {0} is not accepted by xt-xcc compiler. It gives
"warning: missing braces around initializer".
Adding sufficient number of braces to match the struct definition
fixes the build.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
No runtime semantic change. Use C library when RTOS uses
C library otherwise use own C library calls.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
This is another tplg_parser and testbench update on the road to provide
further flexibility around supporting new modules and IPC versions.
There will more to follow.
Changes are mostly mechanical code movements i.e. moving testbench related code
to the testbench, splitting the files into per module/component files and
making some functions static and public.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
This patch changes testbench to retrieve pipeline direction
from pipeline host direction. Earlier all pipelines were forced
to playback.
The topology parsing filters the parsed pipelines to command line
specified pipeline IDs. All the pipeline operations are done
looped to these pipelines to be able to simulate multiple simultaneous
pipelines.
The pipeline context struct remains single. So the simulation works
only for pipelines with identical PCM format and rate.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
No functional change.
Move some common testbench code into the topology parser and group
feature parsing by file name.
Add a tplg_ prefix to external APIs without a prefix, others with an
existing prefix to follow this change.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
The testbench currently has a global structure that contains
per topology and per pipeline data. Refactor to move data to the
most appropriate structure for use.
This is not the final fix, further refactoring is needed.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
This is the first step in running a full DSP topology on multiple testbench
"virtual" cores. Testbench will use threads to virtualise a emulate a core
allowing topologies with more than one core to run simultaneously.
This patch makes the following changes.
1) Adds and passes a topology testbench context to all APIs instead of
relying on some globals.
2) Splits the testbench up into small functions that have a single purpose.
3) Creates a thread for each pipeline which in turn share a virtual core.
4) Adds the command line options to enable testing different cores and
pipelines.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
This patch adds to command line switch -n for output channels count.
Existing -c is for in channels, new -n is for out channels count. Out
channels count is same as input if -n is not present. Switch -q is
added to quiet the trace output if it is not needed.
The Matlab language test scripts for components are updated to use
the -t config.sh interface of comp_run.sh. It allows more flexible
control of input and output streams.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch prevents topology parse failure when there are multiple
controls, e.g. enum controls.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Buffer and params not initialised to zero like the other IPC structures
used by testbench. Fix this.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
This patch adds the initial IPC4 messaging structures as used by existing
host middle ware. These are mapped onto existing pipeline APIs to support
creation of certain pipeline elements using IPC4.
This patch only upstream the interfaces, the IPC handler is to follow.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Split IPC APIs out by feature so that the IPC layer to help future
IPC infrastructure changes support more than one IPC ABI MAJOR version.
No code changes here, only code partitioning and Doxygen comments.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Several files had multiple blank lines even before the removal of
platform_shared_commit(). Fix them with "cat -s"
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
This fixes compilation with:
CFLAGS=-fno-common ./scripts/rebuild-testbench.sh
sof/tools/testbench/topology.c:24: multiple definition of `lib_table';
sof/tools/testbench/testbench.c:39: first defined here
This was detected by Gentoo 10 which uses -fno-common by default, thanks
Guennadi for the report and investigation.
Commit 03067c6c77 ("host: set up shared library table") introduced a
strange "lib_table" symbol that was apparently meant to be global but
was not really because of some confusion between arrays and pointers and
needed to be passed around and "initialized to itself" (!) at run time
as seen in the sample trace below:
topology.c
struct shared_lib_table *lib_table;
parse_topology(..., library_table,...)
{
printf("DEBUG1 ----- %p, %p, %p\n",
&lib_table, lib_table, library_table);
lib_table = library_table;
printf("DEBUG2 ----- %p, %p, %p\n",
&lib_table, lib_table, library_table);
}
Log:
DEBUG1 ----- 0x56298c954040, 0x56298c951183, 0x56298c954040
DEBUG2 ----- 0x56298c954040, 0x56298c954040, 0x56298c954040
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
The if test needs to be done for comp_type. The index does not refer
to comp types but items in lib_table that is not correct. As result
testbench loads crossover for all UUID based components. The load of
beamformer works correctly with this change.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Add methods to load process libraries based on uuid. Testbench will
first search the old process enums and if match isn't found the same
search is done with uuid. Hence old process components should get loaded
with enums and new uuid based components should get loaded with uuids if
the uuid definition is declared and added to the library table.
Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
This patch uses the functionality added by the c9e090ccf3 commit
to check for array size mismatch in various components.
Not doing so may result in cases, where we try to write into the
space not allocated leading to segmentation fault.
Signed-off-by: Mohana Datta Yelugoti <ymdatta.work@gmail.com>
This patch uses the functionality added by the c9e090ccf3 commit
to check for array size mismatch in components.
Since, the components are in places other than tplg_parser, the
function which checks for the mismatch has been made an external
function from a static one. The function declaration has been
added to the tplg_parser header files, so that the function can
be used by any code which needs array size checks in components.
Signed-off-by: Mohana Datta Yelugoti <ymdatta.work@gmail.com>
When the realloc() function fails, a NULL pointer is returned. But,
if the size argument is zero, then also NULL is returned. So, to
differentiate that, we also check if size is non zero. Only if
pointer is NULL and size is non-zero, we come to the conclusion that
realloc() failed and the allocated memory till now is freed and
appropriate error is returned.
If realloc is called on a pointer and fails, the memory pointed by
the pointer isn't freed. When realloc() fails, even this memory
is freed.
Signed-off-by: Mohana Datta Yelugoti <ymdatta.work@gmail.com>
In order to run multi-output component playback by testbench, this patch
supports multiple output file mode on running testbench. Argument "-o" is
modified to accept specifying up to 4 filenames delimited by comma,
e.g. "-o output1,output2,..."
Moreover, debug messages in tplg_parser/tplg_parser.c is refined for
demonstrating multiple pipelines better.
Signed-off-by: Pin-chih Lin <johnylin@google.com>
When we try to free a pointer which is not initialized, we are
using a value in the program which is undefined. So, initialize
the pointer variable, so that in future, when we free the pointer
it won't cause a problem.
Signed-off-by: Mohana Datta Yelugoti <ymdatta.work@gmail.com>
This patch replaces the manually set error codes with errno that
is set to exact fail reason like ENOMEM etc. by these functions. The
missing return code checks for fseek() calls are added.
Include of header errno.h is added to topology.c. The order of
include statements is fixed.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch fixes the crash by adding initialize of sof->pipeline_posn
into pipeline initialization code.
Also the in load_pipeline() function the pipeline is initialized
to zeros to prevent random values to be passed in not set
struct fields. It didn't fix anything but makes debugging of crash
easier.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch adds to testbench capability to run pipelines with EQ_IIR
and EQ_FIR components. The component is configured with the topology
embedded configuration blob when instantiated with new().
The load of volume component has been enhanced to parse volume tokens and
compute the min and max volume parameters.
The topology parsing and component library load has been changed to
support processing component load and extracting of control private
data. The testbench build has been changed to create libraries
for EQ components.
The testbench command line parsing has been improved to return
error for invalid library request.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch fixes the fail to execute tests due to recent pipeline
updates. Now the fileread and filewrite component is instantiated
as host or DAI depending on stream direction. The DAI file component
is added the capability to report HW stream parameters. In testbench
case the stream parameters originate from command line parameters.
The file params() handling is updated to be similar as in other
components to successfully propagate the parameters.
The added capture pipelines support is not fully functional and will
be fixed later.
The testbench cleanup includes elimination of global variables for
certain component ids. The needed misc parameters were added to
testbench parameters struct that is passed through most topology
parsing functions.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch avoids the testbench to crash when file read or write
file open was not successful. E.g. invoking testbench with
incorrect input file name caused a segfault.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch sets in topology parsing core to zero for file reader,
file writer, and buffer since it was left uninitialized and caused
the core check in pipeline run to fail.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch adds the ASRC component and the new tokens into topology
parser and testbench component loader.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The topology parser in testbench can be re-used for
the other applications like the fuzzer. In order to
accomplish this, this commit does the following:
1. Separate the topology parser into a separate project
(tplg_parser) which implements the callbacks for parsing
all the components in topology.
2. Add support for parsing new components such as host
pcm, dai and mixer
3. Include the topology parser as an external project
in the testbench.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Moves headers to dedicated directories in sof/include,
arch/include and platform/include. File tree was too flat,
so some of the files has been moved.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>