Commit Graph

1393 Commits

Author SHA1 Message Date
Seppo Ingalsuo 84c9033fea Tools: Test: Audio: Add sound direction test for TDFB
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>
2022-02-08 12:34:32 +00:00
Liam Girdwood 9ad987e7fd testbench: return error up the stack.
Dont exit() but return the error up the stack for proper handling.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-02-08 10:43:18 +00:00
Liam Girdwood 0cec50a976 testbench: further refactor of per pipeline data
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>
2022-02-08 10:43:18 +00:00
Liam Girdwood ac12b4a748 testbench: print a meaningful error if scheduling comp is not found
Let the user know if the scheduling component is missing and handle it.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-02-08 10:43:18 +00:00
Liam Girdwood 6f43299f3b testbench: take the global data off the stack.
Testbench prm is global data used by many thread. Take it off the stack.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-02-08 10:43:18 +00:00
Liam Girdwood 480d1ad168 testbench: improve error messages in topology load
Give users more information when failures occur.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-02-08 10:43:18 +00:00
Liam Girdwood c3adfcecc7 testbench: add support for mixer
Add mixer support to the testbench

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-02-08 10:43:18 +00:00
Ranjani Sridharan 1303c1a233 topology2: cavs-gain-hda: Add 32-bit support
Add 32-bit support in PCM capabilities.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-08 09:26:38 +00:00
Seppo Ingalsuo 4a2d69b50b Tools: Topology: Updated TDFB macro files
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>
2022-02-08 09:14:20 +00:00
Ranjani Sridharan 849da9d0af topology2: gain: Fix the default gain value
Should be 0x7fffffff.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-04 15:01:30 +00:00
Ranjani Sridharan cb5d769a84 topology2: copier: remove format for copier widget objects
It is never used.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-04 15:01:30 +00:00
Ranjani Sridharan 80bf84c00c topoogy2: tokens: fix the token ID for out_sample_type
Should be 1938.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-04 15:01:30 +00:00
Alibek Omarov bb0641c789 topology1: Add sample topology for i.MX8MP boards with wm8904 codec
Tested to work on Variscite Symphony-Board v1.3 with VAR-SOM-MX8M-PLUS

Signed-off-by: Alibek Omarov <a1ba.omarov@gmail.com>
2022-02-04 11:03:07 +00:00
Seppo Ingalsuo 291706325c Tools: Testbench: Clean up help text and add missing help items
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>
2022-02-04 11:02:25 +00:00
Lionel Koenig 52358064fe topology: Run spk pipelines on same core as AEC
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>
2022-02-04 10:04:30 +00:00
Liam Girdwood 42f70ecffe testbench: log any errors freeing components.
let the user know if we fail to free a buffer, component or pipeline.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-01-31 16:16:27 +00:00
Liam Girdwood 28761ec8ab testbench: add support for virtual cores as threads
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>
2022-01-31 16:16:27 +00:00
Liam Girdwood 7ee22be700 testbench: file: Add support for stopping testbench on file size/copies
Allow the testbench to stop on a file size or number of file(pipeline)
copies.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-01-31 16:16:27 +00:00
Liam Girdwood 0f245bf151 testbench: split pipeline logic up into actions.
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>
2022-01-31 16:16:27 +00:00
Liam Girdwood 7d4fca9802 testbench: only enable EDF scheduler once.
EDF enabled twice with testbench. Fix it.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-01-31 16:16:27 +00:00
Liam Girdwood 9ed4557460 testbench: don't enable system agent.
SA is not used with testbench so disable it.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-01-31 16:16:27 +00:00
Liam Girdwood e4b04290d4 testbench: fix help formatting and indentation.
Easier to read now and comprehend.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-01-31 16:16:27 +00:00
Liam Girdwood 4af91f2c04 library: testbench: Add LL scheduler emulation
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>
2022-01-31 16:16:27 +00:00
Zhang Peng bcbab9e1c7 topology: Add sof-imx8ulp-9x9-btsco.m4 for imx8ulp
sof-imx8ulp-9x9-btsco.m4 is used to generate the topology
file used on imx8ulp 9x9 board.

Signed-off-by: Zhang Peng <peng.zhang_8@nxp.com>
2022-01-31 11:16:23 +00:00
Chao Song 6c4faa1b90 topology2: use different SSP MCLK for different platforms
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>
2022-01-27 13:52:14 +00:00
Marc Herbert 0bf7b73dc8 cmake: move ALSA_CONFIG_DIR from .sh file to topology/CMakeLists.txt
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>
2022-01-26 10:14:15 -08:00
Marc Herbert a351d02b6d cmake: simplify add_alsatplg2_command() macro
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>
2022-01-26 10:14:15 -08:00
Seppo Ingalsuo d155401343 Tools: Testbench: Fix long line
The line with multiband_drc library was too long for
checkpatch.pl check.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-01-26 14:36:07 +00:00
Seppo Ingalsuo cd3795d694 Tools: Testbench: Add more errors handling code
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>
2022-01-26 14:36:07 +00:00
Seppo Ingalsuo 4869b09717 Tools: Testbench: Copy in file max dev->frames amount of frames
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>
2022-01-26 14:36:07 +00:00
Seppo Ingalsuo 594853d389 Tools: Testbench: Use in prepare() frame_fmt from stream
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>
2022-01-26 14:36:07 +00:00
Seppo Ingalsuo b502424819 Tools: Testbench: Improve binary file read and write performance
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>
2022-01-26 14:36:07 +00:00
Li-Yu Yu 46da7bd9d1 topology1: mt8195: Add topology with DTS
Add CMake build definition for
sof-mt8195-mt6359-rt1019-rt5682-dts.tplg.

Signed-off-by: Li-Yu Yu <aaronyu@google.com>
2022-01-26 14:12:53 +00:00
Seppo Ingalsuo 3faaf4c145 Tools: Audio: Test: In Matlab tests by default put trace to /dev/null
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>
2022-01-26 14:09:57 +00:00
Seppo Ingalsuo 0b4a796f72 Tools: Test: Audio: Delete only regular files in test begin
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>
2022-01-26 14:09:57 +00:00
Seppo Ingalsuo 15bf883ead Tools: Test: Audio: Fix incorrect valgrind run control in audio test
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>
2022-01-26 14:09:57 +00:00
Bard Liao 49d4bf3437 topology2: cavs-sdw: cavs-nocodec: add S32 format
We do support 32 bit format. So add S32 to pcm_caps.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2022-01-26 13:48:54 +00:00
Lionel Koenig c48a5281a0 topology1: google-aec topology
Add topology to include google-rtc-audio-processing to a main topology.

Signed-off-by: Lionel Koenig <lionelk@google.com>
2022-01-26 13:48:00 +00:00
Seppo Ingalsuo 7d05389b63 Tools: Tune: EQ: Add legend to frequency response plot
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>
2022-01-25 15:53:09 +00:00
Seppo Ingalsuo 6e2084ee8e Tools: Tune: EQ: In mls_freq_resp wait longer for capture to end
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>
2022-01-25 15:53:09 +00:00
Seppo Ingalsuo a9fb42836f Tools: Tune: EQ: Improve robustness of mls_freq_resp script
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>
2022-01-25 15:53:09 +00:00
Seppo Ingalsuo 387d74ea6d Tools: Tune: EQ: Fix script compatibility with Matlab
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>
2022-01-25 15:53:09 +00:00
Seppo Ingalsuo f976333a81 Tools: Tune: TDFB: Updates to design scripts for sound direction estimate
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>
2022-01-25 15:50:54 +00:00
Ranjani Sridharan cb80023b22 topology2: fix build issues with no command line definitions
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>
2022-01-24 12:51:11 +00:00
Seppo Ingalsuo e0ec195bcd Test: Audio: Fix stdnotch_get() function issue in Matlab
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>
2022-01-24 11:23:21 +00:00
Seppo Ingalsuo 30012d1454 Tools: Testbench: Support for different in/out channels count and other
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>
2022-01-24 11:23:21 +00:00
Bard Liao 7f1572f4d9 topology2: cavs-nocodec: add audio format tokens
Add audio format tokens for I2S + DMIC.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2022-01-21 17:15:38 +00:00
Ranjani Sridharan bfd5e61768 topology1: remove setup config info from all codec_adapter topologies
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>
2022-01-21 12:55:38 +00:00
Liam Girdwood 0df9dc1398 Revert "topology1: remove setup config info from all codec_adapter topologies"
This reverts commit 5062a8bf79.
2022-01-21 12:03:53 +00:00
Ranjani Sridharan 5062a8bf79 topology1: remove setup config info from all codec_adapter topologies
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>
2022-01-21 11:36:50 +00:00
Brent Lu 113a49d253 topology: sof-adl-rt5682: add new topology
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>
2022-01-18 16:59:35 +00:00
Lionel Koenig 07a612258e topology: Ensure PCM for detect pipeline
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>
2022-01-17 14:41:04 +01:00
Lionel Koenig 7162534498 topology: define PIPELINE_FORMAT from DAI_ADD
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>
2022-01-17 14:41:04 +01:00
Bard Liao 06c83dc375 topology2: cavs-sdw: add audio format tokens
Add audio format tokens for cavs-sdw.conf

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2022-01-14 16:52:37 +00:00
Pierre-Louis Bossart 6b8b1cee16 topology: add all possible permutations for ES8336-based platforms
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>
2022-01-13 14:18:43 +00:00
Lionel Koenig c687815185 topology1: Undefine after in DAI & PIPELINE macros
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>
2022-01-11 15:57:41 +00:00
Marc Herbert f50b6fe0ad topologies: switch all .m4 files to codec_provider and codec_consumer
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>
2022-01-10 11:52:26 +00:00
YC Hung e7f6430004 topology1: mt8195: support 1ms pipeline capture period
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>
2022-01-10 11:48:08 +00:00
Ranjani Sridharan 308a24a92b topology2: Add build support
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>
2022-01-06 21:38:43 +00:00
Ranjani Sridharan a1dd222112 topology2: move all cavs topologies
Move all cavs tooplogies to the cavs folder.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-06 21:38:43 +00:00
Ranjani Sridharan fcfd5d65be test: topology: fix build with latest alsa-lib
Remove the extra space to make the topology build with upstream
alsa-lib.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-06 09:52:51 -08:00
Kai Vehmanen afaad99125 coredump-reader: do not hardcode reset vector address
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>
2022-01-05 13:28:51 +00:00
Lionel Koenig 9ee413bf46 comp: Add initial Google AEC
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>
2022-01-04 15:24:18 -08:00
YC Hung 606cd44bc8 topology1: mt8195: support 1ms pipeline playback period
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>
2022-01-03 21:38:43 +00:00
Uday M Bhat 37ad90ba1c topology2: cavs-nocodec: support for the remaining 2 devices for nocodec
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>
2021-12-30 22:08:20 +00:00
Brent Lu 03adf55bed topology: sof-adl-max98357a-rt5682-4ch: add new topology
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>
2021-12-27 20:53:31 +00:00
Marc Herbert 8f3f2d6f4b Revert "topology: redirection to workaround hardcoded alsatplg permissions"
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>
2021-12-25 20:55:54 +00:00
Marc Herbert 8e8d1060f5 logger: move "log_entry_address x not in dictionary range" to stderr
Make DMA trace corruption #5120 a bit more visible in the logs.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-12-25 20:46:32 +00:00
Mark Barton 37ce03fbd9 topology1: mt8195: Remove DTS-specific workaround for period
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>
2021-12-25 20:41:25 +00:00
Lionel Koenig 996a067632 topology: Ensure buffers get allocated on 0.
Ensure all buffers got allocated by core 0

Signed-off-by: Lionel Koenig <lionelk@google.com>
2021-12-22 21:34:38 +00:00
Marc Herbert 352ed2ca4b logger: when FW is loaded, show the expected checksum in -d output
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>
2021-12-22 20:11:25 +00:00
Marc Herbert 4aaffbe9a2 logger: add dictionary checksum in output of dump_ldc option
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>
2021-12-22 20:11:25 +00:00
Marc Herbert 9ce91cbf74 logger: rename verify_fw_ver() to verify_ldc_checksum(), fix -h help
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>
2021-12-22 20:11:25 +00:00
Ranjani Sridharan 5ce0d2b43f topology2: gain: fix dB scale min and step values
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>
2021-12-21 15:20:47 +00:00
Seppo Ingalsuo 0d296ce7d1 Tools: Tune: Make example FIR response long for large IPC test
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>
2021-12-20 22:33:06 +00:00
Pierre-Louis Bossart 0bef266966 topology1: sof-hda-generic: use mixer-based pipelines for analog playback
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>
2021-12-16 11:13:59 +00:00
Pierre-Louis Bossart 02041297ac topology: sof-hda-generic: prepare addition of deep-buffer support
Just move of definitions, no functionality change

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-12-16 11:13:59 +00:00
Pierre-Louis Bossart 29e46af073 topology1: pipe-eq-iir-eq-fir-volume-playback: remove duplicate volume
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>
2021-12-16 11:13:59 +00:00
Pierre-Louis Bossart cfb3ac5b00 topology1: add pipe-mixer-eq-iir-eq-fir-volume-dai-playback.m4
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>
2021-12-16 11:13:59 +00:00
Pierre-Louis Bossart 43dacdc016 topology1: soundwire: split headphone pipe in host- and dai-parts
Prepare for the introduction of deep buffer support

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-12-16 11:13:59 +00:00
Pierre-Louis Bossart 9f4af6b013 topology1: soundwire: fix misleading comment on ALH buffer format
All platforms use s24le for ALH, fix misleading comment.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-12-16 11:13:59 +00:00
Pierre-Louis Bossart e8b8854e3a topology1: soundwire: move cnl-rt5682 to development directory
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>
2021-12-16 11:13:59 +00:00
Pierre-Louis Bossart fb03464dd5 topology1: fix comments in pipe-mixer-volume-dai-playback.m4
buffer information and formatting was incorrect

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-12-16 11:13:59 +00:00
Pierre-Louis Bossart fad16d8330 topology1: rename pipe-mixer-dai-playback to pipe-mixer-volume-dai-playback
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>
2021-12-16 11:13:59 +00:00
Marc Herbert eb34437522 topology: redirection to workaround hardcoded alsatplg permissions
Use a redirection to work around hardcoded alsatplg permissions.
See bug https://github.com/alsa-project/alsa-utils/issues/126

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-12-14 10:39:14 +00:00
Marc Herbert 4538a07b02 topology: new add_alsatplg_command() CMake macro to reduce duplication
Less copy/paste/diverge => more maintenance.

Zero visible change, pure copy/paste reduction.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-12-14 10:39:14 +00:00
Dirk Su d2a3ec2273 sof_ri_info: add ADL Intel prod key to list of known keys
Extracted from
https://github.com/thesofproject/sof-bin/blob/main/v1.9.x/sof-v1.9.2/intel-signed/sof-adl.ri

Signed-off-by: Dirk Su <dirk.su@canonical.com>
2021-12-14 10:38:18 +00:00
Ranjani Sridharan f4287dd3e8 topology2: cavs: Set audio formats for all topologies
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>
2021-12-14 10:33:16 +00:00
Ranjani Sridharan a4b8d11678 topology2: pipelines: cavs: Add audio formats for all pipeline modules
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>
2021-12-14 10:33:16 +00:00
Ranjani Sridharan 4d23794607 topology2: mixin/mixout: Add audio formats and new attributes
Add audio format objects and num_audio_formats attribute.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2021-12-14 10:33:16 +00:00
Ranjani Sridharan eb96d21caf topology2: gain: Add new attributes for gain
Add audio format objects and num_audio_formats attribute for gain.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2021-12-14 10:33:16 +00:00
Ranjani Sridharan 6631743209 topology2: common: Add new class definition for audio_format
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>
2021-12-14 10:33:16 +00:00
Ranjani Sridharan eb013c738b topology2: copier: Add extra attributes
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>
2021-12-14 10:33:16 +00:00
Ranjani Sridharan 0c517d4af7 topology2: copier: remove stale comment
All known DAI types added already.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-12-14 10:33:16 +00:00
Ranjani Sridharan d523e67e6e topology2: tokens: Add additional tokens needed for cavs topologies
Add all tokens required for cavs topologies.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2021-12-14 10:33:16 +00:00
Ranjani Sridharan d0c3965808 topology2: cavs: Add some commonly used definitions for cavs topologies
Used for setting audio format attributes and copier attributes.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-12-14 10:33:16 +00:00
balapati 926fc9ad7d topology1: Add sof-rn-rt5682-max98360, sof-rn-rt5682-rt1019
Add topology support for max98360,rt1019 speaker amplifiers
for amd renoir platform.

Signed-off-by: balapati <balakishore.pati@amd.com>
2021-12-13 11:38:06 +00:00
Brent Lu 25f61384f9 topology: sof-adl-max98360a-rt5682-2way: rename macro
The macro 2_WAY_SPK is renamed 2CH_2WAY to specify it's a L/R 2-way
system.

Signed-off-by: Brent Lu <brent.lu@intel.com>
2021-12-13 11:33:33 +00:00
Brent Lu 6c13aad711 topology: sof-adl-max98360a-rt5682-4ch: add new topology
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>
2021-12-13 11:33:33 +00:00
Marc Herbert 07c63c1f99 topology1: build the production topologies one level down
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>
2021-12-13 10:57:20 +00:00