Commit Graph

1439 Commits

Author SHA1 Message Date
Li-Yu Yu 5cfc37040b sof-ctl: Fix -Wformat,-Wsometimes-uninitialized
* Use %z specifier for size types to avoid format
  specifier warnings on arm32
* in ctl_dump(), size_t n may be used uninitialized
  if ctl_data->out_fd > 0 and !ctl_data->binary.

Signed-off-by: Li-Yu Yu <aaronyu@google.com>
2022-04-29 12:42:55 +01:00
Seppo Ingalsuo 0d5e731b19 Audio: SRC: Add IPC4 full conversions matrix to SRC comp and tools
This patch adds the Kconfig option COMP_SRC_IPC4_FULL_MATRIX and
adds handling to src.c. Testbench build was changed to use this
largest matrix.

The coefficients were generated with script src_ipc4_int32.m. The
new sample rates were added to test script src_test.m.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-04-29 12:42:38 +01:00
Seppo Ingalsuo a0ff2bb277 Tools: Tune: SRC: Allow pass of desired gain to src_generate()
There's need to have a 0 dB gain SRC conversion matrix while
earlier all defaulted to -1 dB. With this change the parameter
cfg.gain can be used with src_generate() function.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-04-29 12:42:38 +01:00
Seppo Ingalsuo 91afe67ae5 Tools: Tune: SRC: Add line break between structs in generated code
This patch helps to pass the code style check in generated header
file src_<profile>_<data type>_table.h. The error was:

CHECK: Please use a blank line after function/struct/union/enum
declarations

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-04-29 12:42:38 +01:00
Seppo Ingalsuo 5683382872 Tools: Tune: SRC: Avoid flood of plot windows with large SRC matrix
This patch forces open of every plot to the same picture window.
Earlier version could open hundreds of windows and freeze the
computer.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-04-29 12:42:38 +01:00
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