This patch adds Matlab script tdfb_direction_test.m. The test
simulates acoustical microphone array capture with 360 degrees
rotated noise source. The test topologies build adds an array
identifier to component name in topology file name. That
allows the scripts to simulate with several arrays. Now a
basic 2 mic array (no array suffix, just tdfb), 4 mic line,
and 8 mic circular are tested. Test pass/fail is so far only
visual check from plot.
The existing tdfb_test.c is extended to perform test with the
three test array configurations.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@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>
The tdfb_controls.m4 is changed for better 15 degree control enum
spacing for beam direction. The file is with this change dedicated
for line arrays with physical limitation to -90 to +90 degrees that
is just achievable with 16 max. enum values.
The new tdfb_controls360.m4 uses the previous 30 degree spacing for
360 degrees arrays such as circular. The pipeline macros for 360
degrees are added to pipelines macros. The difference is only include
of 360 degrees controls version.
The topology development CMakeList.txt is changed to build topologies
with TDFB with single dual mono -90 to +90 degree angle steerable
beam. The stereo dual beam setup files are preserved and updated but
currently used only for testbench test for more complex configuration.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch changes the help print function. The print look and details
are improved. Executable behavior with option -h is fixed. Previously
the help text was printed twice.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
In order to avoid inter core communication while running
GOOGLE_RTC_AUDIO_PROCESSING, this change ensure that the speaker
processing and the amplifier feedbacks are running on the same core as
the AEC.
Signed-off-by: Lionel Koenig <lionelk@google.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>
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>
Add support for four max98357a speaker amplifiers running in TDM mode
which format is 8 slots with 32 bit slot/sample width on ADL boards.
The only difference between this one and sof-adl-max98360a-rt5682-4ch
is the SSP port for speaker amplifiers; this one is using SSP2 while
max98360a's topology is using SSP1.
This topology implements a 4-channel pipeline directly to speaker
amplifiers so audio effects need to be done in user space.
Signed-off-by: Brent Lu <brent.lu@intel.com>
This reverts commit eb34437522.
Fixes#5113
The `alsatplg -o -` feature is incompatible with `-v` and basically
buggy because it happily sends .tplg output and debug statements to
the same place without a care. To reproduce the bug, simply run:
VERBOSE=1 ./scripts/build-tools.sh -T
... then observe .tplg output files like this:
B0x003d3b/015675 - pcm 'DMIC': write 912 bytes
B0x0040cb/016587 - pcm 'HDMI1': write 912 bytes
B0x00445b/017499 - pcm 'HDMI2': write 912 bytes
B0x0047eb/018411 - pcm 'HDMI3': write 912 bytes
B0x004b7b/019323 - pcm 'DMIC16kHz': write 912 bytes
B0x004f0b/020235 - block size for type be (11:10) is 0x2ad4/10964
B0x004f0b/020235 - header index 0CoSA^E^@^@^@^@^@^@^@^H^@^@^@$^@^@
^@^@^@^@^@s^@^@^@^@^@^@^@^A^@^@^@p^@^@^@ ^@^@^@.^@^@^@ ^@^@^@^F^@^
@^@^F^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^
@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^
@^@^@^@^@^@^@^@^@^...
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
In a previous commit DTS changed the period of this topology to 1000 when `DTS` was defined. This
commit removes this behaviour as DTS codec now supports the original period for this topology
Signed-off-by: Mark Barton <mark.barton@xperi.com>
Sample output:
logger ABI Version is 5:3:0
ldc_file ABI Version is 5:3:0
ldc_file src checksum 0x07d4f1ad
Loaded FW expects chksum 0x07d4f1ad <=== NEW!
Components uuid dictionary size: 2400 bytes
Components uuid base address: 0x1fffa000
...
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Since commit 901f991eee ("logger: Validate by src_hash instead of abi
version from fw_ready") the dictionary checksum has become the most
important information.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Fixes commit 901f991eee ("logger: Validate by src_hash instead of abi
version from fw_ready") that changed the feature without updating the
name.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
It is not intuitive for the end-ser to set linear values for
minimum gain. Set the dB gain min value to -90dB and steps to 2dB.
Also, modify the max to 45 to allow the volume gain range -90dB to 0dB.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
The loudness EQ is changed to 250 taps to create large IPC
message type. It also improves subjective quality of this
effect with better bass response. The earlier version was
made very short to fit the that time IPC size limit.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Convert playback pipeline on analog output to have a mixer so adding a
deep-buffer pipeline will be simpler.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
The same volume information is present twice, remove the one that
seems out of place in the pipeline.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
mix/merge of parts coming from pipe-mixer-volume-dai-playback.m4 and
pipe-eq-iir-eq-fir-volume-playback.m4
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
This topology was used initially on UpExtreme but isn't shipped in any
commercial device.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To include deep buffer for HDaudio topologies, we need the ability to
replace volume by some other component (e.g. eq-iir-eq-fir-volume)
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Set audio formats and new attributes for all modules in the CAVS
topologies.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Add audio formats and all new attributes for all modules in the
cavs pipelines.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Add definition for audio format class for defining the input and output
audio formats for each components in cavs topology.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Add some new attributes along with math expression to calculate the
attribute "is_pages".
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Add support for four max98360a speaker amplifiers running in TDM mode
which format is 8 slots with 32 bit slot/sample width on ADL boards.
This topology implements a 4-channel pipeline directly to speaker
amplifiers so audio effects need to be done in user space.
Signed-off-by: Brent Lu <brent.lu@intel.com>
Move generated *.conf and *.tplg v1 files down from:
build_tools/topology/topology1/*.{conf,tplg}
_to:
build_tools/topology/topology1/production/*.{conf,tplg}
... then copy/"install" the production/* subdirectory two levels up.
This fixes the race condition #5067 that also copied a random number of
development/ and dsp_enhancement/ topologies, sometimes even truncating
these.
In other words, this commit REMOVES the following two copies:
build_tools/topology/development/ # randomly corrupted copy, removed
build_tools/topology/dsp_enhancement/ # randomly corrupted copy, removed
build_tools/topology/topology1/development/ # real build dir, unchanged
build_tools/topology/topology1/dsp_enhancement # real build dir, unchanged
Production topologies are copied only to help with the v1->v2
transition. That duplication makes the build directory confusing enough,
no need to extend that copy to development topologies. A single instance
of development topologies in the build directory is enough.
This removal may break some CI script(s): this is perfect because such
CI script(s) were copying randomly corrupted data.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>