Commit Graph

1534 Commits

Author SHA1 Message Date
Seppo Ingalsuo 0feff0b3e4 Tools: Test: Topology: Set DAI buffer periods to 3 for SRC tests
Test pipelines with SRC due internal block processing constraints need
this to avoid fail due to insufficient buffer. Other pipelines continue
to use 2 buffer periods.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-04-28 15:43:38 +01:00
Seppo Ingalsuo 1df8cf856a Tools: Testbench: Fix file component buffer resize
The file component buffer resize was incorrect. It caused some
SRC testbench tests to fail due to insufficient sink buffer
size. The resize of file component source/sink was in prepare().
This patch moves it to one step earlier to params(). Then the
components' check for buffers in prepare() will see the impact
and let them error if the size is not sufficient.

After this change the number of periods in the buffer (from topology)
is preserved in resize. If a test does not run, need to fix the
test topology.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-04-28 15:43:38 +01:00
Brent Lu a7103e0255 topology: sof-tgl-max98357a-rt5682: include intel-boards for link ID
Include intel-boards.m4 for BE DAI Link ID definition.

Signed-off-by: Brent Lu <brent.lu@intel.com>
2022-04-28 15:02:53 +01:00
Brent Lu deb6c5c55a topology: intel-boards: new file for machind driver differentiation
The order of BE DAI Link in topology must match the order in machine
driver. Create this include file to organize the definition of BE DAI
Link ID.

Signed-off-by: Brent Lu <brent.lu@intel.com>
2022-04-28 15:02:53 +01:00
Brent Lu 68871b05ca topology: sof-adl-cs35l41: support cs35l41 speaker amplifier
Add a topology sof-adl-cs35l41 which supports four Cirrus Logic
CS35L41/CS35L53 speaker amplifiers running in TDM mode without
headphone codec on ADL platform.

Two compile options are added to support the board configuration:
'NO_HEADPHONE' removes headphone pipelines from the topology while
'SSP_AMP_LINK_ORDER' uses the DAI Link order in sof_ssp_amp.c machine
driver instead of sof_rt5682.c.

Signed-off-by: Brent Lu <brent.lu@intel.com>
2022-04-28 15:02:53 +01:00
Chunxu Li 75dea11da9 topology1: add mt8186 related pipelines and components
add topology file for mt8186
detail:
mt8186.m4
sof-mt8186-mt6366-da7219-max98357.m4
sof-mt8186-mt6366-rt1019-rt5682s.m4

Signed-off-by: Chunxu Li <chunxu.li@mediatek.com>
2022-04-27 10:42:54 +01:00
Seppo Ingalsuo 3334bede2a Tools: Testbench: Add components to testbench load
This patch adds load possibility of mux, demux, and
google-rtc-audio-processing to testbench.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-04-26 22:18:49 +01:00
Seppo Ingalsuo 69c69d01a4 Tools: Testbench: Add capture direction and multi-pipeline run
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>
2022-04-26 22:18:49 +01:00
Pierre-Louis Bossart d380674ef2 topology1/kernel_dependent/v5.19: enable SoundWire deep-buffer headset topologies
This patch duplicates the configuration at the higher level and adds
the "HEADSET_DEEP_BUFFER" definition.

This is not very elegant and will require changes in two places, but I
don't see a better solution with M4.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2022-04-25 16:03:13 +01:00
Pierre-Louis Bossart d636482970 topology1: SoundWire: make deep-buffer optional
We don't want to release these topologies to world+dog due to
dependencies on kernel version, so let's make the deep-buffer
optional. The next patch will enable these topologies in the
development/ directory.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2022-04-25 16:03:13 +01:00
Pierre-Louis Bossart f1cf43126e topology1: SoundWire: add deep buffer support for headphone
Deep buffer is device 31 by convention

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2022-04-25 16:03:13 +01:00
Pierre-Louis Bossart 045e6f44e4 topology1: CMakeLists: split SoundWire NOJACK topologies
Before we enable the headset deep-buffer solution, we want to extract
the NOJACK topologies where the headset deep-buffer would be an
oxymoron.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2022-04-25 16:03:13 +01:00
Pierre-Louis Bossart 746bbff485 topology1: CMakeLists: regroup SoundWire topologies
For some reason the topologies are in separate blocks, regroup them.

No functionality change.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2022-04-25 16:03:13 +01:00
Pierre-Louis Bossart 15200e4091 topology1/kernel_dependent/v5.19: enable HDaudio codec deep-buffer topologies
This patch duplicates the configuration at the higher level and adds
the "DEEP_BUFFER" definition. The topologies are generated in the
kernel_dependent/v5.19 directory and shall only be used by
distro/users when their kernel is based on 5.19-rc1 or later. If these
topologies are used with an older kernel, the ASoC DPCM state machine
issues will result in broken audio. We have no ability to detect a
dependency on kernel to load a topology.

This is not very elegant and will require changes in two places, but I
don't see a better solution with M4.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2022-04-25 16:03:13 +01:00
Pierre-Louis Bossart 94203a22ff topology1: sof-hda-generic: make deep-buffer optional
We don't want to release these topologies to world+dog due to
dependencies on kernel version, so let's make the deep-buffer
optional. The next patch will enable these topologies in the
development/ directory.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2022-04-25 16:03:13 +01:00
Pierre-Louis Bossart 030f27d556 topology1: sof-hda-generic: add deep-buffer pipeline for analog playback
Use SoundWire convention with deep-buffer using device 31.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2022-04-25 16:03:13 +01:00
Pierre-Louis Bossart 96be83b0ab topology1: move sof-hda-generic-kwd to development
We don't support this topology in production and it's not clear if
it's even maintained, move to development.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2022-04-25 16:03:13 +01:00
Seppo Ingalsuo 09a4aa8a8e Topology: Topology1: Add topology with playback DRC to HDA generic
This patch enables testing of DRC in HDA generic devices by adding
it to headset/speaker pipeline after mixer.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-04-25 16:00:02 +01:00
Marc Herbert 78f4fd7de9 tools: stop copying v2 topologies to the v1 directory
STOP copying all files
 from dir: sof/tools/build_tools/topology/topology2/cavs/
 to dir:   sof/tools/build_tools/topology/

The original plan discussed in the reviews of commit c0bee428ae
("topology: prepare for Topology2.0") and commit 308a24a92b
("topology2: Add build support") and more recently
mentioned in #4611 was to overwrite in place some v1 topologies with
newer v2 topologies in order to "force" users to upgrade without them
realizing it. This original plan is now being abandoned. v2 topologies
will never overwrite v1 topologies and if ever then certainly not "en
masse". Moreover, v2 topologies will be placed in a new /lib/firmware/
subdirectory. So, partial revert the aforementioned commits. More
specifically. stop installing v2 topologies into the same directory as
v1 topologies.

Note there had never been any actual overwrite of any v1 topology yet
because there had never been any v2 topology of the same name.

At this point in time this gets rid of the following copies:

tools/build_tools/topology: abi.conf
tools/build_tools/topology: cavs-mixin-mixout-hda-2ch-cnl.conf
tools/build_tools/topology: cavs-mixin-mixout-hda-2ch-cnl.tplg
tools/build_tools/topology: cavs-mixin-mixout-hda-2ch-tgl.conf
tools/build_tools/topology: cavs-mixin-mixout-hda-2ch-tgl.tplg
tools/build_tools/topology: cavs-mixin-mixout-hda-4ch-cnl.conf
tools/build_tools/topology: cavs-mixin-mixout-hda-4ch-cnl.tplg
tools/build_tools/topology: cavs-mixin-mixout-hda-4ch-tgl.conf
tools/build_tools/topology: cavs-mixin-mixout-hda-4ch-tgl.tplg
tools/build_tools/topology: cavs-mixin-mixout-hda.conf
tools/build_tools/topology: cavs-mixin-mixout-hda.tplg
tools/build_tools/topology: cavs-passthrough-hdmi.conf
tools/build_tools/topology: cavs-passthrough-hdmi.tplg
tools/build_tools/topology: cavs-sdw.conf
tools/build_tools/topology: cavs-sdw.tplg
tools/build_tools/topology: cavs-tgl-nocodec.conf
tools/build_tools/topology: cavs-tgl-nocodec.tplg
tools/build_tools/topology: nhlt-ace-mtl-nocodec.bin
tools/build_tools/topology: nhlt.bin
tools/build_tools/topology: nhlt-cavs-tgl-nocodec.bin
tools/build_tools/topology: sof-mtl-nocodec.conf
tools/build_tools/topology: sof-mtl-nocodec.tplg

From an "installer/" and sof-bin release perspective, this removes the
following topology that was just added by commit
ba26eeff9d ("topology2: cavs-nocodec: Add support for MTL nocodec
topology"). Installing v2 topologies into a new /lib/firmware/
subdirectory has not been implemented yet.

No other change besides dropping these copies, everything else is the
same.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-04-25 15:07:12 +01:00
Pierre-Louis Bossart dbdaba93bb topology1: sof-hda-generic: remove digital paths
These paths are not well supported on all devices and lead to errors such as

17:06:06 kernel: HDA Digital: ASoC: dpcm_be_dai_startup() failed at Digital Playback and Capture (-22)
17:06:06 kernel: Digital Playback and Capture: __soc_pcm_open() failed (-22)
17:06:06 kernel: snd_hda_codec_conexant ehdaudio0D0: ASoC: error at snd_soc_dai_startup on Digital Codec DAI: -22
17:06:06 kernel: snd_hda_codec_conexant ehdaudio0D0: ASoC: error at snd_soc_dai_startup on Digital Codec DAI: -22
17:06:06 kernel: snd_hda_codec_conexant ehdaudio0D0: didn't find PCM for DAI Digital Codec DAI

We've already removed this digital path for IPC4/topology2, let's also remove this for topology1.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2022-04-22 14:37:57 -05:00
Ranjani Sridharan ba26eeff9d topology2: cavs-nocodec: Add support for MTL nocodec topology
The key difference is the DMIC HW IP version.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-04-20 13:52:33 +01:00
Ranjani Sridharan 2efc3ea41c topology2: dmic-generic: add support for 4ch capture
Add support for 4ch DMIC capture and modify the nocodec topology to use
it.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-04-19 11:50:55 +01:00
Ranjani Sridharan 5d75b0f309 topology2: cavs: passthrough: Add 4ch audio formats
Add the audio formats for 4ch in passthrough-be and passthrough-capture
pipelines.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-04-19 11:50:55 +01:00
Curtis Malainey 9cf8e0c777 m4: add RO bytecontrol
Sometimes we want to load a binary block of data without letting
userspace interact with the underlying control. An RO control will do
this exactly by loading the data and providing no write access.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2022-04-18 16:39:43 +01:00
Seppo Ingalsuo a10ccbdcb2 Tools: Topology: Add a development topology to RUN SRC on UP2
Add this topology to be able to test SRC playback and capture.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-04-11 21:45:29 +01:00
Vamshi Krishna 39f2626c47 topology1: sof-adl-rt1019-rt5682: add new topology
for amplifier rt1019 SSP1 link is used
for headset rt5682 SSP0 link is used

Signed-off-by: Vamshi Krishna <vamshi.krishna.gopal@intel.com>
2022-04-08 13:20:13 +01:00
Marc Herbert bde4858625 topologies: docker --env USE_XARGS, NO_PROCESSORS and VERBOSE
Building in parallel is much faster but it makes logs unreadable and
build failures impossible to understand. This is especially true when
building with recent ALSA that produces of deprecation warnings, see
examples below. For test topologies the problem is even worse: its
XARGS parallel build provides no log at all.

To find what actually fails, it is required to fall back on a single
threaded and verbose build and this is achieved with the variables
USE_XARGS, NO_PROCESSORS and VERBOSE. Pass these through docker-run.sh
and CMake.

Examples from #5608
https://github.com/thesofproject/sof/runs/5717553555?check_suite_focus=true
https://sof-ci.01.org/sofpr/PR5608/build12556/build/tools.txt

ALSA pcm.c:1523:(parse_hw_config) deprecated fsync value 'codec_slave',...
ALSA pcm.c:1471:(parse_hw_config) deprecated bclk value 'codec_slave',...
ALSA pcm.c:1523:(parse_hw_config) deprecated fsync value 'codec_slave',...
ALSA pcm.c:1471:(parse_hw_config) deprecated bclk value 'codec_slave',...
ALSA pcm.c:1523:(parse_hw_config) deprecated fsync value 'codec_slave',...

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-04-05 14:37:28 +01:00
Ranjani Sridharan 3b0fd1e203 topology2: abi: fix size of ABI bytes
The major/minor/patch values are represented with u16 in the FW. So,
change the numbers of bytes to match that of the FW when adding the
ABI to the topology manifest for IPC4. For IPC3, we still only use 3
bytes as there's no clean way to increase the number of bytes without
breaking backwards compatibility with the older kernel. There are no
topologies using topology2 for IPC3 today but it is possible in the
future.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-04-05 14:37:05 +01:00
Marc Herbert 0bbdbb111f test/topology: make tplg-build.sh callable from anywhere
This removes two layers of indirection when trying to find what fails.
The lack of this proved especially painful when working on #5632 and
similar backports.

Also move outputs to a subdirectory by default. No change when invoked
from CMake which does not use the default output directory.

Also show the exact m4 and alsatplg commands run when not using XARGS
parallelization. Again this is critical when something fails.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-04-02 17:51:04 +01:00
Ming Jen Tai a5fd52ec43 [RTNR] Fix buffer size calculation
The correct frame length should be calculated by
FRAME_LEN = SAMPLING_RATE * PERIODS / 1000000

The macro COMP_PERIOD_FRAMES does the thing.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
Signed-off-by: Ming Jen Tai <mingjen_tai@realtek.com>
2022-03-30 14:00:16 +01:00
Joe.Cheng 64378c57f0 topology1:ADL:add DTS topology
The DTS Codec can be conditionally added to the sof-adl-nau8825 topology
on those pipelines intended for headphone and speaker output.

Signed-off-by: Joe.Cheng <joe.cheng@xperi.com>
2022-03-28 16:14:04 +01:00
Jairaj Arava 95c53eafc7 topology1: add DMIC 48K Core ID flag to CMake for RTNR
For builds with no Hotword on DSP, generic dmic m4 is used.
RTNR is running on DMIC CORE ID 1. Hence adding the flag.

Signed-off-by: Jairaj Arava <jairaj.arava@intel.com>
2022-03-24 13:39:06 -07:00
Liam Girdwood 0db4a82964 tplg parser: refactor and cleanup part 1
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>
2022-03-24 16:54:40 +00:00
Lionel Koenig b0b8bc7a34 sof-ctl: Allow setting arbitrary size for controls
sof-ctl assumed the binary control were of size of a
multiple of unsigned integer.
This caused the control byte array to be truncated when the
size of the control was 6 bytes.
This change allow setting any size of control in binary form.
Using CSV will always end up with a number of unsigned integer size.

I tested this change using the Google RTC Audio processing with control
of size:
  - 6 bytes,
  - 2 bytes
  - and 4 bytes.

Signed-off-by: Lionel Koenig <lionelk@google.com>
2022-03-22 13:46:49 +00:00
Libin Yang 5ef9e496d0 topology1: CMakefile: add sof-adl-rt711-l2-rt1316-l01
Add sof-adl-rt711-l2-rt1316-l01 support. This tplg doesn't include any
local MICs.

Signed-off-by: Libin Yang <libin.yang@intel.com>
2022-03-21 16:21:29 +00:00
Libin Yang 0bb995a7a6 topology1: sof-icl-rt711-rt1308-rt715-hdmi: add NO_LOCAL_MIC & NOAMP support
add sof-icl-rt711-rt1308-rt715-hdmi NO_LOCAL_MIC & NOAMP support

Signed-off-by: Libin Yang <libin.yang@intel.com>
2022-03-21 16:21:29 +00:00
Libin Yang 4bb686380e topology1: sof-icl-rt711-rt1308-rt715-hdmi: correct the link description
The links are dynamically assigned. The descriptions should
be changed correspondingly.

Signed-off-by: Libin Yang <libin.yang@intel.com>
2022-03-21 16:21:29 +00:00
Libin Yang 2898a1a6d9 topology1: sof-icl-rt711-rt1308-rt715-hdmi: remove NO_AGGREGATION
NO_AGGREGATION is never used now. Let's remove it.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Libin Yang <libin.yang@intel.com>
2022-03-21 16:21:29 +00:00
Pin-chih Lin 0c634ab6f7 topology: add waves and waves-2way for sof-adl-max98357a-rt5682 tplg
Add support for waves codec for both two and four max98357a speaker
amplifiers on ADL boards.

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2022-03-17 13:07:25 -07:00
Ming Jen Tai bcccf1253d [RTNR] Add Realtek Noise reduction support option to ADL with MAX98360A topology
Signed-off-by: Ming Jen Tai <mingjen_tai@realtek.com>
2022-03-16 17:44:29 -07:00
Ben Zhang 51e7c61801 google_rtc_audio_processing: Add config controls
1. Added a byte control to accept Google RTC audio processing
   configuration blob
     `name='GOOGLE_RTC_PROCESSING10.0 Config'`

Tested using:
    sof-ctl -n 48 -t 0 -b -r -s /root/tuning.bin
And verified correct audio processing behaviour on a alderlake board.

Signed-off-by: Ben Zhang <benzh@chromium.org>
Signed-off-by: Lionel Koenig <lionelk@google.com>
2022-03-15 16:27:53 -07:00
Allen-kh Cheng edc80c793f topology1: add sof-mt8195-mt6359-max98390-rt5682 topology
Add sof-mt8195-mt6359-max98390-rt5682 topology

Signed-off-by: YC Hung <yc.hung@mediatek.com>
Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Signed-off-by: Allen-KH Cheng <allen-kh.cheng@mediatek.com>
2022-03-14 15:36:39 +00:00
Fred Oh f039b9eda1 topology2: common: fix to add '$' for SAMPLE_TYPE_LSB_INTEGER
$ and S are hard to tell in text editor. Without '$' final value are
much different.

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
2022-03-14 15:03:52 +00:00
Seppo Ingalsuo 6f0bb2b012 Topology: Add sof-hda-generic topologies to test multiband-drc
This patch adds build of topologies sof-hda-generic-multiband-drc.tplg
and sof-hda-generic-2ch-multiband-drc.tplg. The processing happens in
pipeline part after mixer. Volume is controlled in PGA before mixer.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-03-14 11:40:22 +00:00
Balakishorepati 8be523eb79 topology1: Set Dmic samplerate to 48000Hz
Set default samplerate for DMIC to 48000Hz for
amd platforms.

Signed-off-by: Balakishorepati <balaKishore.pati@amd.com>
2022-03-11 13:19:53 +00:00
Bard Liao ccde447b05 topology2: add be pipeline for sdw
Use two separated pipelines for BE and FE.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2022-03-11 13:03:07 +00:00
Seppo Ingalsuo c9d603bb11 Tools: Test: Fix mistake in script test_run.m
Remove the extra argument for fprintf(). For some reason there was
no harm seen but this should trigger an error when run in Octave or
Matlab.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-03-09 15:44:06 +00:00
Lionel Koenig 980a5b25b3 topology1: Fix m4 issue in conditional definition
Due to m4 peculiarities it is require to escape the content of an
ifdef. I forgot to add those escaping for around the `SPK_MIC_PERIOD_US`
definition leading to erroneous value if GOOGLE_RTC_AUDIO_PROCESSING was
defined.

Signed-off-by: Lionel Koenig <lionelk@google.com>
2022-03-08 22:05:15 +00:00
Pierre-Louis Bossart 83ada5ac08 topology: disable SSP0 and SSP1 on APL/GLK to enable Zephyr tests
This is a temporary work-around to enable CI tests while performance
is being optimized.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2022-03-08 15:17:29 +00:00
Lionel Koenig 21a1ee1d16 topology1: Simplify the DMICPROC selection
This should make sure to surface pipeline period and microphone
processing in the top topology file so incoherence are easier to spot
and correct.

I compared topology1/production/*.conf outputs prior and after the
change: except some new line and comment change introduced by the
simplification, there are no changes.

Signed-off-by: Lionel Koenig <lionelk@google.com>
2022-03-08 14:58:44 +00:00
YC Hung ecec8d11d1 topology1: mt8195: support 2ms pipeline capture period
When host is more heavy loading(e.g. camera recoding case),
the size of dai buffer is 4ms and not enough. Increase 2ms
period capture pipeline to buffer more data to avoid overrun.

Signed-off-by: YC Hung <yc.hung@mediatek.com>
2022-03-07 14:21:12 +02:00
Pierre-Louis Bossart 9709ef81dc topology1: sof-glk-es8336: use mclk ID0
It's not clear why the initial contribution used mclk ID1, mclk ID0 is
used by 99% of devices - and a manual inspection of NHLT supports that
claim. We will have to deal with the MCLK ID1 case with quirks.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2022-03-03 16:46:39 +00:00
Malik_Hsu c42ede6a97 topology: sof-adl-max98360a-rt5682-waves: add new topology
Add support for max98360a speaker amplifiers with waves function.

Signed-off-by: Malik_Hsu <malik_hsu@wistron.corp-partner.google.com>
2022-03-02 14:00:40 +00:00
Curtis Malainey 57e0e149aa topology1: add build with no hotword or 16k dmic
Some builds require more memory, hotword can be handled by CRAS so lets
add the ability to drop it. The 16kHz dmic is not needed either so lets
drop that too.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2022-02-28 13:19:19 +00:00
Ranjani Sridharan ce050aa25b topology2: cavs-nocodec: split pipelines into host and dai pipelines
Split pipelines into host and DAI pipelines and fix some SSP params

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-26 11:06:21 +00:00
Ranjani Sridharan 3629141cbb topology2: cavs-nocodec: include dmic-generic.conf if needed
Include dmic-generic conditionally based on NUM_DMIC's and add nhlt
build support in CMake variables.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-26 11:06:21 +00:00
Ranjani Sridharan ae5326ccd2 topology2: intel: dmic-generic: Move all definitions to dmic-default.conf
Move all defaults variable definitions to dmic-default.conf. These should
be included by all topologies before overriding the defaults with
platform-specific or machine-specific definitions.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-26 11:06:21 +00:00
Ranjani Sridharan 2abef019d3 topology2: intel: dmic-generic: Add a few more variables
Add a few more variables to make the dmic-generic topology more
configurable.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-26 11:06:21 +00:00
Ranjani Sridharan a2d8987921 topology2: clean up unnecessary nocodec topology builds
Only TGL is tested right now. So, build only that one.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-26 11:06:21 +00:00
Pierre-Louis Bossart 0fcad5052c topology: sof-apl-da7219: add missing virtual widgets
Align this topology with the GLK one to avoid probe errors

[    4.224516] bxt_da7219_max98357a bxt_da7219_mx98357a: ASoC: no source widget found for iDisp3 Tx
[    4.224518] bxt_da7219_max98357a bxt_da7219_mx98357a: ASoC: Failed to add route iDisp3 Tx -> direct -> hifi3
[    4.224522] bxt_da7219_max98357a bxt_da7219_mx98357a: ASoC: no sink widget found for iDisp3 Tx
[    4.224524] bxt_da7219_max98357a bxt_da7219_mx98357a: ASoC: Failed to add route iDisp3_out -> direct -> iDisp3 Tx
[    4.224529] bxt_da7219_max98357a bxt_da7219_mx98357a: ASoC: no source widget found for iDisp2 Tx
[    4.224531] bxt_da7219_max98357a bxt_da7219_mx98357a: ASoC: Failed to add route iDisp2 Tx -> direct -> hifi2
[    4.224535] bxt_da7219_max98357a bxt_da7219_mx98357a: ASoC: no sink widget found for iDisp2 Tx
[    4.224537] bxt_da7219_max98357a bxt_da7219_mx98357a: ASoC: Failed to add route iDisp2_out -> direct -> iDisp2 Tx
[    4.224542] bxt_da7219_max98357a bxt_da7219_mx98357a: ASoC: no source widget found for iDisp1 Tx
[    4.224544] bxt_da7219_max98357a bxt_da7219_mx98357a: ASoC: Failed to add route iDisp1 Tx -> direct -> hifi1
[    4.224549] bxt_da7219_max98357a bxt_da7219_mx98357a: ASoC: no sink widget found for iDisp1 Tx
[    4.224551] bxt_da7219_max98357a bxt_da7219_mx98357a: ASoC: Failed to add route iDisp1_out -> direct -> iDisp1 Tx
[    4.224559] bxt_da7219_max98357a bxt_da7219_mx98357a: snd_soc_bind_card: snd_soc_dapm_add_routes failed: -19

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2022-02-25 15:26:34 +00:00
Chao Song 2c0d875df1 topology1: move capture dai to another pipeline for echo ref
The explanation takes sof-adl-max98357a-rt5682 as an example:

During pipeline_complete(), we search for the source widget
for a pipeline from a list and the ipc_get_ppl_comp() returns
the first widget from the list of source widgets for a pipeline.

With SSP2.IN on pipeline 1, which is the same pipeline ID as the
ECHO_REF playback pipeline for PCM0P, pipeline_complete() for
pipeline 1 ends up not walking the rest of widgets in pipeline 1.

This Echo Ref feature works in chrome kernel today by accident,
because we set up the widgets in the reverse order after resuming
from runtime suspend and the source widget happens to be PCM0P.

To fix this, create a new pipeline for the capture dai widget SSP2.IN,
so that it doesn't pollute the widget list for pipeline 1.

Fixes: #5395

Signed-off-by: Chao Song <chao.song@linux.intel.com>
2022-02-24 22:59:45 +00:00
Bard Liao c7246d2212 topology2: HDA: add 24 bit audio format
We declare that S24_LE is supported by a HDA PCM, but 24 bit audio
format is not included in the available audio format list.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2022-02-24 22:20:46 +00:00
Ranjani Sridharan 487d514b9d topology2: cavs: gain-pipelines: change the input/output bit depths
The DAI copiers only support 32-bit format. Change the gain-playback and
gain-capture to set the input/output bit-depth to match the DAI copier
requirement.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-24 21:42:08 +00:00
Ranjani Sridharan 33bae7afa1 topology2: cavs: dmic-generic: Add input/output bit depths
Add the input/output bit depth's for the BE DAI copier for the DMIC
capture pipeline.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-24 21:42:08 +00:00
Ranjani Sridharan acff9049f2 topology2: intel:dmic-generic: fix dma_buffer_size
It should be based on ibs but works today because ibs and obs are the
same.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-23 14:07:52 +00:00
Ranjani Sridharan 0d84f55361 topology2: pipelines: cavs: Fix the Dai copiers to only support 32-bit
format

Only the host copier should do the conversion based on the runtime
params. The DAI copiers should always support only 32-bit playback and
capture. So, fix the input/output formats for the copiers in the
respective pipelines.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-23 14:07:52 +00:00
Seppo Ingalsuo 74fcc02ff5 Tools: Test, Tune: Improve Matlab scripts for EQ testing
The test scripts missed test component keyword change from e.g.
eqiir to eq-iir. Due to this the process_test() failed for IIR and
FIR for gain and frequency response due to wrong result expect.

The expected result is retrieved with the blob decode function. It
can be also used manually to check the filters defined in the
blob. The help texts in the decode functions needed fix. Also some
usage examples were added.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-02-18 21:47:16 +00:00
Ranjani Sridharan 0e53d54684 topology2: cavs: Add support for including DMIC in HDA topology
Currently we build separate topologies for TGL and CNL since their
io_clk's are different. Eventually, we'd need to unify these and let the
driver handle the blob selection in the kernel.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-18 21:39:50 +00:00
Ranjani Sridharan 8d0ac8e2da topology2: cavs: Add DMIC generic topology
Add the topology for 48k DMIC pipeline. 16K support will be added later.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-18 21:39:50 +00:00
Marc Herbert 15a7774626 Revert "topologies: switch all .m4 files to codec_provider and codec_consumer"
This reverts commit f50b6fe0ad.

I discovered the hard way that this change causes alsatplg version
1.2.2 (the default version in the current LTS Ubuntu) to corrupt just
a few bytes in .tplg output in an incredibly discrete and
time-consuming way: no error message at build time and same file size.
See example at https://github.com/thesofproject/sof/pull/5162.

We could/should just require a minimum alsatplg version at the CMake
level but at this moment we don't even know which minimum version is
needed and we would also need to take some time to test a few alsatplg
versions. If version 1.2.2 would just fail with an decent error
message that can be searched and discussed then everything would be
fine but silent corruption is really not OK.

So users of recent versions will unfortunately have to live with the
huge number of warnings for now.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-02-18 11:22:36 +00:00
Andrey Borisovich 2c1f089d39 Added standard headers include path for MSYS
Windows users building with MSYS2 need to provide additional include
path to the POSIX standard headers to build sof-logger with GCC.
Added this include directory when environmental variable
MSYS_INSTALL_DIR is set.

Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
2022-02-16 12:02:40 +00:00
Andrey Borisovich f11e275aab Fixed warning W-char-subscripts in sof logger
Newer gcc compilers 9.1+ issue a W-char-subscripts warning when argument
type passed to isspace is not explicitly int. Added cast to int.

Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
2022-02-16 12:02:40 +00:00
Pierre-Louis Bossart 04a0d3c1b5 topology1: sof-cml-es8336: use correct 24MHz MCLK
Rookie mistake, the clock can't possibly be 19.2 MHz

Reported-by: Nikolai Kostrigin <nickel@altlinux.org>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2022-02-16 12:01:30 +00:00
Ranjani Sridharan 24d1b1a012 topology2: cavs: hda: remove unwanted topologies
We only want the mixin/mixout based HDA and passthrough HDMI topologies.
Delete everything else.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-16 11:59:00 +00:00
Ranjani Sridharan 3d9b6ffd29 topology2: cavs: remove deep buffer pipeline
Remove deep buffer pipeline until the driver code to ready to handle it.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-16 11:59:00 +00:00
Ranjani Sridharan 6001e44241 topology1: remove redundant kcontrol for codec adapter pipelines
The codec adapter component only uses a single config now. So remove the
runtime config kcontrol as the same kcontrol can be used for runtime
config as well.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-16 12:28:08 +02:00
Ranjani Sridharan 8c0b05d579 topology2: cavs: all pipelines should be dynamic by default
Set all pipelines to be dynamic by default.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-15 10:58:34 +00:00
Ranjani Sridharan c84d64b524 topology2: CMakeLists: clarify the pipelines for mixin-mixout tplg
Only the HDA pipelines use mixin/mixout based pipelines.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-14 11:12:44 +00:00
Ranjani Sridharan c94ae772a0 topology2: cavs: split the passthrough pipeline into host and DAI parts
We cannot have one single pipeline going from the host copier to the DAI
copier. So split the passthrough pipeline into host and DAI pipelines.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-14 11:12:44 +00:00
Ranjani Sridharan 788e0534d6 topology2: mixin/mixout pipelines: Add gain before and after mixers
Add gain widgets before and after the mixers in all the
mixin/mixout-based pipelines. Change the cavs-mixin-mixout-hda.conf
topology to add the mixer names for all gain widgets.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-14 11:12:44 +00:00
Ranjani Sridharan 3120b7c4c9 topology2: gain: remove default audio formats
Remove the default audio formats from the gain class definition.
They should be added depending on the number of formats based on the
pipeline. Fix the gain-playback and gain-capture pipelines to add the
audio formats for the gain widgets.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-14 11:12:44 +00:00
Seppo Ingalsuo cf43cb1604 Tools: Topology: Add long FIR EQ topology for sof-hda-generic
The topology is useful for testing long binary control IPC and to
test equalization of headset and speaker in sof-hda-generic devices.
It adds a flat IIR and a generic FIR that creates a mild loudness
effect.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-02-11 10:41:55 +00:00
Seppo Ingalsuo e9048e4b7d Tools: Topology: Fix erratic FIR example response
The previous patch increased the FIR length but it also triggered
a numerical issue in FIR design with long minimum phase filters. The
filter became essentially a band-stop filter and causes difficulties
in test of EQ component. Also the equalizer sounds subjectively
bad. The fix is to change the design to linear phase that always
converges.

Fixes: 0d296ce7d1

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-02-11 10:41:55 +00:00
Lionel Koenig 28de049330 topology1: Fix issue in google-rtc-audio-processing pipeline
This fixes a mistmatch in the PCM capabilities for the Google
RTC audio processing pipeline.

Signed-off-by: Lionel Koenig <lionelk@google.com>
2022-02-10 16:37:13 -08:00
Ranjani Sridharan 9983ab67a9 topology2: cavs-gain: Add PGA to control names
This is needed for sof-test to identify the controls.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-09 21:50:11 +00:00
Seppo Ingalsuo e5d95d1dd3 Tools: Topology: Change playback volume ramp to 20 us
The topologies sof-hda-generic were earlier fixed to use short
20 ms ramp because of nearly inaudible UI blip tones with 250 us
ramp. Some changes to topologies build m4 macros have brought
back the long ramp.

This patch fixes the playback ramps to use 20 ms long transitions.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-02-09 10:19:48 +00:00
Seppo Ingalsuo b3b937eb3d Tools: Topology: Make PGA token objects unique
This patch avoids the issue that topology .conf file after m4
processing can contain multiple same name objects playback_pga_conf
for volume component tokens with possibly different settings. Alsatplg
does not error from such input and it's not defined which impacs
topology binary.

The new naming is pga_conf_X and and_pga_tokens_X where X is the
pipeline number.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-02-09 10:19:48 +00:00
Yong Zhi 7fdd59844d topology2: cavs-nocodec: remove dai_index for copier widget
When generating the tplg, copier inherits its dai_index
from the parent DAI object, since there is no need to overwrite
dai_index with different value, let's remove them from top level conf.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2022-02-09 10:01:19 +00:00
Seppo Ingalsuo e6f677959b Tools: Test: Audio: Fix typos in tools/test/audio/*
This patch fixes the typos in audio test Matlab code.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-02-09 09:52:17 +00:00
Seppo Ingalsuo ae4c30207e Tools: Tune: Fix typos tools/tune/*
This patch fixes the typos in the setup tools Matlab code.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-02-09 09:52:17 +00:00
Kai Vehmanen e20384eb6a testbench: add option to override CPU core mapping
Add option to override how a core id, specified in SOF topology, is
mapped to host core. This allows to map a multithreaded pipeline
execution to specific range of host CPUs.

Implement the option via environment variable "SOF_HOST_CORE0", which is
understood by the CONFIG_LIBRARY implementation of ll-scheduler.

Document the usage to testbench help. mapping of DSP core ids specified
SOF_HOST_CORE

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-02-09 09:44:34 +00:00
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