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>
Split pipeline functionality into smaller action to support more
complex use cases. Provide more useful logging.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Add LL scheduler emulation for testbench pipelines. Each core is
implemented as a thread.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Different platform uses different SSP MCLK frequency,
this patch applies different MCLK for different platform
for cavs-nocodec topology.
The MCLK frequencies are aligned with topology1.
Signed-off-by: Chao Song <chao.song@linux.intel.com>
Fixes incremental builds of topology2 that were missing ALSA_CONFIG_DIR.
This was making it impossible to troubleshoot alsatplg issues like #5249.
Now incremental builds fail or pass the same as builds from scratch.
Fixes commit 308a24a92b ("topology2: Add build support")
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
alsatplg accepts empty definitions -D "" so let's simplify
commit cb80023b22 ("topology2: fix build issues with no command line
definitions"); 10 lines shorter. The less CMake code the better.
Zero change, the build directory is bit for bit identical after this
commit.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
This patch adds to defaults of switch statements error prints
and error values returns to properly error non-supported
things.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch limits file read from reading more than e.g. 48 frames
at time when scheduled every 1 ms for 48 kHz audio. It helps
the testbench to execute copy() operations similarly as in real
firmware and not process multiple periods of data in the same
pipeline copy. Some components contain internal limiting for data
processing amount but most do not.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The file component new() sets function to s32. It's better to
initialize to default function that just errors if called.
The stream pointer is retrieved from buffer. There is no need to
apply twice list_first_item() function. The sample width is set
with get_sample_bytes(). The switch case for frame_fmt is changed
to use stream. It avoids an error to use 16 bit file write to
consume data from 32 bit buffer. This happens because ipc value is
from topology while stream format is from command line override. Only
the text file output becomes incorrect.
The comp_data struct contained unnecessary fields such as period_bytes,
frame_bytes, and frame_fmt.
The patch also contains some switch-case code cleanup for more compact
code and look.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch replaces the sample by sample fread() and fwrite()
operations with max length block reads and writes without
circular wrap. Both binary and text format read and write
functions are replaced with more compact versions.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The trace print slows down the test a lot while the testbench
trace output is not needed usually in these audio quality
tests. The test script can set .trace to redirect trace to a file
that is also a lot faster than scrolling the trace in Matlab
or Octave shell.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch adds test for to-be-deleted trace output file or
simulation output PCM data file. Doing delete only for regular
files allows to use e.g. /dev/null to redirect trace to
be not shown when not needed. Or run test in debugger without
need for output file.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The value for VALGRIND in the run command parameters needs to
be true or false. The value "no" causes an error in comp_run.sh
script run.
Fixes 30012d1454
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch adds legend to plot since it was difficult to see to
which play/capture channel which curve corresponded to. In script
selftest case a label called Reference is added to the legend.
Also an indentation issue is fixed in the script.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The 3s wait was not enough long time to wait for recording to complete
before copy for analysis so the wait is increased to 5s. The total
recording lengths were variable and not same 7s for a completed
recording.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch increases end marker seek length from 3s to 5s to
allow more drift for arecord and aplay timing for test signal.
The captured waveform is now always plotted and when start
and end markers are found the test signal is plotted with green
color.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The script mls_freq_resp.m has worked previously with Octave
while failed with Matlab because it does not have source
command. This patch ads function get_config() that reads
the configuration file, evaluates it, and returns the
needed variable.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch contains improvements to TDFB setup scripts and examples
those are related to sound direction estimation. The changes are add
of 15 degree angle spacing to enum control, add of rotated noise sound
create for sound direction testing in simulated acoustics.
The example line, circular, and xyz array scripts are updated for single
dual mono beam that is controllable in 15 degree or 30 degree steps. All
the two beam design examples are moved into example_two_beams.m.
The patch also contains noise field covariance matrix diagonal load
increase to -40 dB. I noticed uneven frequency response in some
designs due to numerical instability. The increased diagonal load makes
the automatic design procedure more robust at minimal hit in noise
suppression performance.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
If there are no command line definitions, the build fails because the
4th argument to the add_alsatplg2_command macro is NULL.
Fix this by using named arguments for the macro and checking for the
optional argument for command line definitions.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
The path append of current directory (.) is not correct for
the signal processing package function iirnotch. The issue does
not happen with Octave since it has pei_tseng_notch().
The standard notch function is used in all THD+N tests so this
issue has caused fail of nearly all tests with Matlab.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@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>
Remove the setup config info from all initial config data in the
codec_adapter kcontrol's. This is no longer needed.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Remove the setup config info from all initial config data in the
codec_adapter kcontrol's. This is no longer needed.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Add support for boards without speaker amplifier. Just simply remove
all speaker related components and configuration.
Signed-off-by: Brent Lu <brent.lu@intel.com>
detect pipelines require PCM_ID to be define which is the case only
when they get inserted using PIPELINE_PCM_ADD.
Note that PIPELINE_PCM_ADD and PIPELINE_ADD have different signature.
Signed-off-by: Lionel Koenig <lionelk@google.com>
Pipeline extects PIPELINE_FORMAT to be defined. When including a
pipeline using DAI_ADD, DAI_FORMAT is defined but no PIPELINE_FORMAT.
Prior c687815, the last previously defined PIPELINE_FORMAT was used.
This change ensure the requested DAI_FORMAT is used in the pipeline.
This addresses bug #5193.
Signed-off-by: Lionel Koenig <lionelk@google.com>
So far we support apl, glk, cml, jsl, tgl.
SSP0 or SSP2 can be used.
DMICS may or may not be present, the simplifying assumption is that we
have 0, 2 or 4channels.
the existing topology names are kept but will not be used with kernel
updates, the -ssp<N> and -dmic<N> ch suffixes will be added based on
NHLT information to avoid a need to override topology files.
A better solution would be a DAI index that can be overridden in a
topology file, but we have no interface to do so at the moment, so
brute-force combinatorial handling of all possible solutions it is.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
In order to ease comprehension and avoid side-effect of constants being
defined after calling a macro, this change undefined the locally define
constants for pipelines and dai macros.
Signed-off-by: Lionel Koenig <lionelk@google.com>
All .tplg output files have been compared and are strictly identical
after the change.
The deprecation warnings were added more than one year ago in
https://github.com/alsa-project/alsa-lib/commits//706192341d1d0bbb906
Now that we just upgraded our Docker image to ALSA 1.2.6
(https://hub.docker.com/r/thesofproject/sof/tags) so #5153 can enable
topology v2, the volume of warnings has became unbearable. For instance
good luck trying to find the actual error messages for the build
failures of #5155 - they're totally drowned in these deprecation
warnings.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
1.Default support 1ms period capture pipeline to update host position
more precisely.
2.Revise pipeline 1 to playback and pipeline 4 to capture in comment.
Signed-off-by: YC Hung <yc.hung@mediatek.com>
Add build support for topology2. Topology2 will be built only if the
alsatplg version if 1.2.6 or greater.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
The gdb script created by coredump-reader has a fixed reset
vector address. This address only works on a subset of supported
SOF platforms and for other platforms, user has to manually fix
the reset address in the gdb script before use.
Modify the script to emit breakpoint for "_MemErrorVector"
symbol. This is not the reset vector, but the simulation will
still be trapped early. The symbol is part of the firmware
binary, so its address can be looked up at runtime.
Also add a second breakpoint for "_MemoryExceptionVector_text_start".
This will cover SOF binaries built with Zephyr as the RTOS.
BugLink: https://github.com/thesofproject/sof/issues/5125
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Introduce a new component to perform acoustic echo cancellation
on capture path using a buffer from the playback as a reference.
1. Put the google_rtc_audio_processing at
$SOF_REPO/third_party_libraries
- libgoogle_rtc_audio_processing.a
- libgoogle_rtc_audio_processing_tuning.a
- libc++.a (Corresponding stdlibc++)
- libc++abi.a
2. Put the header in $SOF_REPO/third_party_includes
- google_rtc_audio_processing.h
3. Build firmware and tool with xcc
4. To verify it works:
- aplay some speech
- At the same time arecord the mic which uses AEC
The mic signal should not exhibit any echo from the playback.
Signed-off-by: Lionel Koenig <lionelk@google.com>
1. Default support 1ms period playback pipeline to update host position
more precisely.
2. Revise pcm node number description
Signed-off-by: YC Hung <yc.hung@mediatek.com>
Current cavs-nocodec support only 1 playback device
This is to support 2 playback/capture devices.
Due to this, DMIC is moved PCM from 1 to 3
Signed-off-by: Uday M Bhat <uday.m.bhat@intel.com>