Commit Graph

48 Commits

Author SHA1 Message Date
Peter Ujfalusi cff6a6b6f3 topology2: Enable ChainDMA for HDMI links unconditionally
Make the HDMI_USE_CHAIN_DMA set to true by default as enabling it for every
configuration just does not scale.

The generic HDA topologies enabled this for all IPC4 platforms already.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2023-12-05 11:11:39 +02:00
Peter Ujfalusi cf473b5aa7 topology2: Rename USE_CHAIN_DMA to HDMI_USE_CHAIN_DMA
In practice all HDA links (on LNL SDW/SSP/DMIC also) can use ChainDMA, but
the flag is used to enable this only for display links.

Rename the flag to be precise about this.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2023-12-05 11:11:39 +02:00
Yong Zhi 8b1a01f976 topology2: cavs-rt5682: Add Deep buffer PCM on amps
Add deep buffer PCM35 on amps for sof-mtl-max98357a-rt5682 tplg.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2023-11-17 13:12:32 +00:00
Yong Zhi 4986e3135d topology2: cavs-mixin-mixout-ssp: Use macros for pipeline IDs
Use macros for pipeline IDs for better maintainability.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2023-11-09 11:21:47 +02:00
Yong Zhi 49377e8c9e topology2: google-rtc-aec: expose DP module core_id for overriding
RTC_AEC module is using DP and rest of pipeline is LL and both can
run on different cores.

For the purpose to assign DP module individually on secondary core,
now add a new macro GOOGLE_AEC_DP_CORE_ID.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2023-11-07 14:48:38 +00:00
Joe Cheng 244df9feda topology2: dts: add DTS playback pipeline
Add cavs-mixin-mixin-mixout-eqiir-dts-ssp.conf to support EQ IIR + DTS
processing on rt5682

Co-developed-by: Mac Chiang <mac.chiang@intel.com>
Signed-off-by: Mac Chiang <mac.chiang@intel.com>
Signed-off-by: Joe Cheng <joe.cheng@xperi.com>
2023-11-03 18:33:00 +02:00
Joe Cheng 04130acffc topology2: dts: move playback pipeline to independent topology
In order to adopt more different playback pipelines, refer to
sof-hda-generic.conf and move playback pipeline in cavs-rt5682.conf to
cavs-mixin-mixout-ssp.conf.

Co-developed-by: Mac Chiang <mac.chiang@intel.com>
Signed-off-by: Mac Chiang <mac.chiang@intel.com>
Signed-off-by: Joe Cheng <joe.cheng@xperi.com>
2023-11-03 18:33:00 +02:00
Ranjani Sridharan 18595e9cd3 topology2: speaker-echo-ref: Remove the echo ref PCM
The echo-ref pipeline ie the DAI capture pipeline involving the speaker
codec is already part of the list of pipelines that gets set up and
triggered when the DMIC capture starts. Therefore, there's no need for
the echo-ref PCM to explicitly start the reference capture. So, remove
it and connect the codec DAI to the google-rts-aec module directly.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-10-03 18:14:41 +03:00
Rander Wang 9e21d8ba62 topology2: set pipeline priority for google aec stream
Set priority for aec stream so that driver can trigger pipeline based on
pipeline priority.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2023-10-03 18:14:19 +03:00
Yong Zhi 107043f978 topology2: cavs-rt5682: use macros for all PCM IDs
Make it less error-prone for maintenance.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2023-08-31 15:22:05 +01:00
Yong Zhi aec3bfdb77 topology2: add core id macros for echo ref & EC pipelines
Add macros in preparation to run RTC AEC on secondary core

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2023-08-16 14:06:01 +01:00
Yong Zhi a6de3b1602 topology2: cavs-rt5682: Change ECHO_REF_PCM_ID to 29 to avoid conflict
Fix tplgtool2.py caught error with sof-mtl-max98357a-rt5682.tplg

ERROR: Multiple pcm id=27: 2 (['EchoRef', 'DMIC0 RTC AEC'])

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2023-07-24 16:38:34 +01:00
Yong Zhi 47cb612379 topology2: speaker-echo-ref.conf: Use macros for PCM ID
Use macro to avoid hardcoding of the PCM Id.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2023-07-14 14:29:12 +03:00
Mac Chiang 1e6f4e0618 topology2: cavs-rt5682: make BT offload as option
Consider the variant projects with/without bt offload feature
so include BT_OFFLOAD pipelines as an option if needed

Signed-off-by: Mac Chiang <mac.chiang@intel.com>
2023-07-10 15:07:56 +01:00
Jyri Sarha bda1bcd5bc topology2: cavs-rt5682.conf: Rename mixers
Rename mixers according to the new naming convention by referring to
the associated PCM name and the position in the topology. Create defines
for PCM names so the name is only in one place.

This produces following changes:

'Playback Volume 1' -> 'Pre Mixer Headset Playback Volume'
'Playback Volume 3' -> 'Pre Mixer Speaker Playback Volume'
'Main Playback Volume 2' -> 'Post Mixer Headset Playback Volume'
'Main Playback Volume 4' -> 'Post Mixer Speaker Playback Volume'

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
2023-06-28 17:17:15 +03:00
Ranjani Sridharan 4a64defa94 topology2: cavs-rt5682: Replace audio_format objects
Use the input_audio_format/output_audio_format objects instead.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-06-21 12:10:02 +03:00
Ranjani Sridharan 66aaa599e9 topology2: dai-copier: Change the naming convention
Change the naming from dai-copier.<copier_type>.<pipeline_id>.<instance>
to dai_copier.<copier_type>.<stream_name.<direction>.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-05-29 09:56:13 +03:00
Ranjani Sridharan 96bd6bc62d topology2: copier: Rename it to dai-copier
To make it explicit that it is only for the DAI gateway.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-05-29 09:56:13 +03:00
Yong Zhi 94f8b0c4d4 topology2: fix number range between 1 and 1000 used by Regex
Since IncludeByKey uses Regular expressions to validate text match,
the expression [1-1000] does not filter number between 1 to 1000 as
intended. For example, DEEPBUFFER_FW_DMA_MS=0 results in matched while
DEEPBUFFER_FW_DMA_MS=5 returns not found, fix with regex flavor pattern.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2023-05-23 13:12:21 +03:00
Ranjani Sridharan ac26e70d95 topology2: host-gateway-capture: use host-copier
Replace the generic copier with host-copier in the class definition and
the instances.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-05-19 08:17:34 -07:00
Ranjani Sridharan f211f4c9da topology2: host-copier-gain-mixin-playback: Use host-copier
Replace the generic copier with host-copier object in the pipeline class
definition and all its instances.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-05-19 08:17:34 -07:00
Rander Wang 406e660a34 topology2: add google rtc aec support
Add google rtc aec in topolog for chrome project

Signed-off-by: Rander Wang <rander.wang@intel.com>
2023-05-11 12:46:44 -07:00
Ranjani Sridharan b3139af01c topology2: Remove num_audio_formats attribute
This has been replaced by num_input_audio_formats and
num_output_audio_formats. So remove the attribute from all components
and mark the token ID as deprecated.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-04-24 10:10:51 +03:00
Yong Zhi ffe0ce68a1 topology2: cavs-rt5682: remove 24-bit override in mixout-gain-dai-copier-playback
With 208c2049f ("topology2: deep buffer: use 32 bits to align with
other pipeline"), we can remove this override now.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2023-04-19 21:59:41 -07:00
Ranjani Sridharan 78be251a44 topology2: Move common_definitions.conf
These are Intel-specific, so move them to the platform/intel folder

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-04-11 15:54:31 +03:00
Ranjani Sridharan cbe01073f6 topology2: copier: Make node_type mandatory
Introduce a new class for module-to-module copiers and make node_type
mandatory for the copier class.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-04-11 15:54:31 +03:00
Ranjani Sridharan b74c26b52c topology2: Rename passthrough-capture.conf
Rename it to host-gateway-capture to align it with the documentation.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-04-11 15:54:31 +03:00
Ranjani Sridharan 3ee2ab63a7 topology2: Rename passthrough-playback.conf
Rename it to host-gateway-playback.conf to align with the documentation.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-04-11 15:54:31 +03:00
Ranjani Sridharan 91a436ef7d topology2: Rename passthrough-capture-be
Rename it to io-gateway-capture.conf to align with the documentation.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-04-11 15:54:31 +03:00
Ranjani Sridharan 650423feb1 topology2: Move the hw_config class definition
Move and rename the hw_config class to
platform/intel/hw_config_cardinal_clk.conf.
This hw_config is specific to Intel SSP DAI that use the cardinal clock
for the mclk frequency.

Ideally, this class should have immutable mclk_frequency and link clock
source. But because the alsatplg compiler expects the name of the hw
config class to be "hw_config" without any extensions, it is left as
modifiable for now. Once the topology compiler is modified, this will be
made immutable in a follow up PR.

Also, introduce a new hw_config_simple.conf file that contains the
hw_config definition for the HDA/DMIC/SDW type DAIs with only the ID and
name attributes.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-04-05 13:32:30 -07:00
Ranjani Sridharan afb0f73512 topology2: rename passthrough-be to io-gateway.conf
All it contains is a IO gateway copier and a pipeline widget. So rename
it accordingly.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-04-04 18:36:19 -07:00
Ranjani Sridharan 362a0781f2 topology2: Remove dma_buffer_size attribute
There's been a recent kernel change to compute the DMA buffer size using
the ibs/obs. So this attribute no longer needs to be set in the
topology.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-03-31 20:41:07 +03:00
Seppo Ingalsuo d371135a63 Tools: Topology2: Add IIR high-pass with gain to DMIC capture
This patch replaces in DMIC0 capture the gain.N.1 component with IIR
high-pass. The gain has been a placeholder
dai-copier-gain-module-copier-capture.conf while the EQ component has
not been available. The pipeline is replaced by
otherwise similar dai-copier-eqiir-module-copier-capture.conf.

The dmic-default.conf sets the default IIR response to 40 Hz
high-pass with 0 dB gain. The topologies will get only the high-pass
filter but no amplification.  The default is changed in
sof-hda-generic.conf to 20 dB gain to address the too silent capture
because these topologies for generic Linux end users do not contain
any other capture enhancements.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-03-02 22:56:00 +00:00
Yong Zhi 7fdc62375a topology2: cavs-rt5682: override BT playback pipeline id
Override the default PIPELINE_ID for BT_PB.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2023-02-20 16:16:43 +00:00
jairaj-arava d85d853c6c topology2: add second capture stream for DMIC0 for MTL topology
This patch adds second capture stream by means of copier module

Signed-off-by: jairaj-arava <jairaj.arava@intel.com>
2023-02-20 12:54:57 +02:00
Ranjani Sridharan 45e4cc484d topology2: Move to using arrays for defining objects
Where there more than 1 object of the same type defined at the same node
level, use arrays to define the object. For example, we can define 2
routes as follows:
Object.Base.route [
	{
		source	"smart_amp.2.1"
		sink	"copier.SSP.2.1"
	}
	{
		source	"mixin.1.1"
		sink	"mixout.2.1"
	}
]

This allows us to merge 2 arrays from different conf files without
needing to make their instance ID's unique.

Assume we add another route in a separate conf file like below:
Object.Base.route [
        {
                source  "gain.5.1"
                sink    "copier.5.1"
        }
]

The alsatplg compiler will merge them as follows resulting in 3 route
objects.

Object.Base.route [
        {
                source  "smart_amp.2.1"
                sink    "copier.SSP.2.1"
        }
        {
                source  "mixin.1.1"
                sink    "mixout.2.1"
        }
	{
                source  "gain.5.1"
                sink    "copier.5.1"
        }
]

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-02-17 09:16:34 +02:00
Kai Vehmanen cfeaceb394 topology2: use passthrough-capture-be instead of passthrough-be
As the copier can do format conversions, and many pipeline components
can do conversions as well, it is important for the topology to define a
single format to use in the "dai_out" copier. This ensures deterministic
behaviour with the driver.

Implement this behaviour by switching topologies to use the
passthrough-capture-be pipeline as template for the backend capture
pipelines.

The previously used passthrough-be template is problematic as
the base class already defines multiple audio formats, with multiple
different sample formats. The new passthrough-capture-be only defines
one sample format by default and is a better starting point as a base
class.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-02-15 19:18:16 +02:00
Jaska Uimonen f63e5357fd topology2: enable BT offload in cavs-rt5682
Add bluetooth pipeline to rt5682 topologies.

Co-developed-by: Uday M Bhat <uday.m.bhat@intel.com>
Signed-off-by: Uday M Bhat <uday.m.bhat@intel.com>
Co-developed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2023-02-07 16:37:11 +00:00
Guennadi Liakhovetski 426b113071 topology2: add support for simplified copier module
Currently copier components of the module type are used in pairs -
one on each pipeline, connecting to each other. This isn't necessary.
It's enough to have one such copier component on the side, that does
forking. Add a single-copier capture pipeline variane and switch
DMIC over to it.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-02-07 11:30:59 +00:00
Rander Wang 4b0f1bbb9d topology2: add gain and copier in DMIC0 pipeline
This patch will support multiple capture streams with DMIC. The pcm stream
is composed of two pipelines: (1) copier host <- gain <- copier module
(2) copier module <-gain <- copier DMIC. We need to use copier module
to connect two pipelines because of the restriction with the ref FW that
the gain module can only be connected to modules that are in the same
pipeline

Signed-off-by: Rander Wang <rander.wang@intel.com>
2023-02-07 11:30:59 +00:00
Yong Zhi 594e3f7da9 topology2: cavs-rt5682: add reference capture for MAX98357A speaker amp
Use lbm_mode to loopback playback data for PCM27.
Add copier module in DAI BE for demux function.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2023-02-01 14:49:05 +00:00
Ranjani Sridharan ae8ca22a59 topology2: Add instance attribute for all classes
In preparation for making it easier to write topology conf files that
can be conditionally included without having to worry about conflicting
node ID's for objects between the included file and the top-level conf
file, modify all classes to include an instance attribute. This means
that irrespective of the object type, all objects will be instantiated
as follows:

Object.Widget.gain.1 {} or Object.Base.pdm_config.2 {} etc

The instance ID's are typically only meant for the alsatplg compiler to
differentiate the nodes in the conf file and are not relevant for the
kernel or the firmware. This change will allow the alsatplg compiler to
be modified to automatically make the node ID's unique before
conditionally including conf files.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-01-25 12:16:29 -08:00
Ranjani Sridharan 3ab06327df topology2: cavs-rt5682: Parameterize all HS and Speaker names
Add variable definitions for all HS and Speaker settings such as codec
name, SSP DAI index, PCM caps names etc in preparation to make this file
reusable for variations in the SSP ports in different machines.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Dharageswari R <dharageswari.r@intel.com>
2023-01-25 10:10:28 -08:00
Ranjani Sridharan 97374b6f91 topology2: Make name a mandatory attribute in hw_config
Add an instance attribute and make the name attribute mandatory for the
hw_config objects. This is required because the topology2 compiler allows
for expansion of string values with variable definitions. So, if we
wanted to expand the name from a variable definition(as shown below), it
is only possible if it were a normal attribute instead of the node ID as
it is currently.

Define {
	SSP0_HW_CONFIG_NAME	"SSP0"
}
Object.DAI.SSP.1 {
	dai_index 0
	Object.Base.hw_config.1 {
		name $SSP0_HW_CONFIG_NAME
	}
}

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-01-23 21:14:17 +02:00
Ranjani Sridharan 54f6f623de topology2: remove all pipeline stream_name setting
It is not used at all.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-01-23 21:14:17 +02:00
Bard Liao f963fa0e49 topology2: set NUM_HDMIS=3 topologies
Set NUM_HDMIS=3 for all topologies.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2023-01-11 14:29:15 +00:00
Yong Zhi 2cfa90d324 topology2: cavs-rt5682: add deep buffer support on headset
Deep buffer is mixed with ssp0 stream.
Override mixout copier audio_format.1 from 32/24 to 32/32 for I2S.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2022-12-15 12:23:00 +00:00
Yong Zhi a4e5fea520 topology2: Add rt5682+max98357a support
Add sof-mtl-max98357a-rt5682 topology which supports
RT5682 headset and MAX98357A speaker amplifiers.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2022-12-02 15:09:56 +00:00