diff --git a/tools/topology/topology2/README.md b/tools/topology/topology2/README.md index 88e2a8ff5456..8002a7595939 100644 --- a/tools/topology/topology2/README.md +++ b/tools/topology/topology2/README.md @@ -242,8 +242,10 @@ default ID ranges for the same endpoint types. | Jack Echo Ref | 11 | `SDW_JACK_ECHO_REF_PCM_ID` | | Speaker Echo Ref | 12 | `SDW_SPK_ECHO_REF_PCM_ID` | | Bluetooth | 2 or 20 | `BT_PCM_ID` | -| USB Audio Offload (UAOL) | 21 | `UAOL_PCM_ID` | -| Deepbuffer UAOL | 22 | `DEEP_BUFFER_PCM_ID` | +| USB Audio Offload (UAOL0) | 21 | `UAOL_PCM_ID` | +| USB Audio Offload (UAOL1) | 22 | `UAOL_PCM1_ID` | +| Deepbuffer UAOL0 | 23 | `UAOL_DB_PCM_ID` | +| Deepbuffer UAOL1 | 24 | `UAOL_DB1_PCM_ID` | | Deep Buffer (Jack) | 31 | `DEEP_BUFFER_PCM_ID` | | Deep Buffer (Speaker) | 35 | `DEEP_BUFFER_PCM_ID_2` | | DMIC Deep Buffer | 46 | `DMIC0_DEEP_BUFFER_PCM_ID` | @@ -303,9 +305,12 @@ is at N1 (50/51, 60/61, 70/71, 80/81). | HDMI 4 Host / DAI | 80 / 81 | `HDMI4_HOST_PIPELINE_ID` / `HDMI4_DAI_PIPELINE_ID` | | Compress Jack / Speaker | 90 / 92 | `COMPR_PIPELINE_ID` / `COMPR_2_PIPELINE_ID` | | PCH DMIC0 Host / DAI | 100 / 101 | `DMIC0_HOST_PIPELINE_ID` / `DMIC0_DAI_PIPELINE_ID` | -| UAOL Playback Host / DAI | 210 / 211 | `UAOL_PB_HOST_PIPELINE_ID` / `UAOL_PB_DAI_PIPELINE_ID` | -| UAOL Capture Host / DAI | 212 / 213 | `UAOL_CP_HOST_PIPELINE_ID` / `UAOL_CP_DAI_PIPELINE_ID` | -| UAOL Deepbuffer | 214 | `DEEP_BUFFER_PIPELINE_ID` | +| UAOL0 Playback Host / DAI | 210 / 211 | `UAOL_PB_HOST_PIPELINE_ID` / `UAOL_PB_DAI_PIPELINE_ID` | +| UAOL0 Capture Host / DAI | 212 / 213 | `UAOL_CP_HOST_PIPELINE_ID` / `UAOL_CP_DAI_PIPELINE_ID` | +| UAOL0 Deepbuffer | 214 | `UAOL_DB_PIPELINE_ID` | +| UAOL1 Playback Host / DAI | 215 / 216 | `UAOL_PB1_HOST_PIPELINE_ID` / `UAOL_PB1_DAI_PIPELINE_ID` | +| UAOL1 Capture Host / DAI | 217 / 218 | `UAOL_CP1_HOST_PIPELINE_ID` / `UAOL_CP1_DAI_PIPELINE_ID` | +| UAOL1 Deepbuffer | 219 | `UAOL_DB1_PIPELINE_ID` | **Intel HDA Pipeline IDs:** diff --git a/tools/topology/topology2/cavs-uaol.conf b/tools/topology/topology2/cavs-uaol.conf index f6a9dbe17f67..a351ca1e9f7a 100644 --- a/tools/topology/topology2/cavs-uaol.conf +++ b/tools/topology/topology2/cavs-uaol.conf @@ -42,26 +42,44 @@ Define { - UAOL_PLAYBACK_PCM 'UAOL Playback' - UAOL_CAPTURE_PCM 'UAOL Capture' + UAOL_PLAYBACK_PCM 'UAOL0 Playback' + UAOL_CAPTURE_PCM 'UAOL0 Capture' # The two directions are separate DAI links so that the format fixup of - # a link is decided by the DAI copier of that direction alone. The names - # are abbreviated because alsatplg drops widget tuples above 36 characters - # and the dai-copier name is 'dai-copier.UAOL..' - UAOL_PB_DAI_NAME 'UAOL0-Play' - UAOL_CP_DAI_NAME 'UAOL0-Cap' + # a link is decided by the DAI copier of that direction alone, and the + # link carries two streams per direction, each with a backend of its + # own: UAOL-Play and UAOL-Cap. The names are abbreviated + # because alsa-lib drops widget tuples once the dai-copier name, + # 'dai-copier.UAOL..', exceeds 37 characters + UAOL_PB_DAI_NAME 'UAOL0-Play0' + UAOL_CP_DAI_NAME 'UAOL0-Cap0' # The BE IDs are the dai link IDs that are matched with the machine - # driver, which creates the playback link first + # driver, which creates the backends in the order Play0, Cap0, Play1, + # Cap1 UAOL_PB_BE_ID 9 UAOL_CP_BE_ID 10 # UAOL_DAI_INDEX is the UAOL link the DSP uses, only link 0 is addressable UAOL_DAI_INDEX 0 - UAOL_PCM_NAME 'UAOL' + UAOL_PCM_NAME 'UAOL0' UAOL_PCM_ID 21 UAOL_PB_HOST_PIPELINE_ID 210 UAOL_PB_DAI_PIPELINE_ID 211 UAOL_CP_HOST_PIPELINE_ID 212 UAOL_CP_DAI_PIPELINE_ID 213 + + # Second stream pair of the link, on its own PCM + UAOL_NUM_STREAMS 2 + UAOL_PLAYBACK1_PCM 'UAOL1 Playback' + UAOL_CAPTURE1_PCM 'UAOL1 Capture' + UAOL_PB1_DAI_NAME 'UAOL0-Play1' + UAOL_CP1_DAI_NAME 'UAOL0-Cap1' + UAOL_PB1_BE_ID 11 + UAOL_CP1_BE_ID 12 + UAOL_PCM1_NAME 'UAOL1' + UAOL_PCM1_ID 22 + UAOL_PB1_HOST_PIPELINE_ID 215 + UAOL_PB1_DAI_PIPELINE_ID 216 + UAOL_CP1_HOST_PIPELINE_ID 217 + UAOL_CP1_DAI_PIPELINE_ID 218 # Both paths pass through whatever the offloaded USB device asks for, so # the PCM advertises everything a USB device may support. 7 channels is # left out of the widget formats, it has no channel config and no channel @@ -73,15 +91,15 @@ Define { UAOL_RATE_MAX 384000 UAOL_RATES '8000,11025,12000,16000,22050,24000,32000,44100,48000,64000,88200,96000,128000,176400,192000,384000' - # The deep buffer PCM feeds the same mixer as the normal playback PCM. It - # takes the source and the sink as plain widget names, so it repeats the - # pipeline IDs defined above. + # The deep buffer PCMs feed the same mixer as the normal playback PCM of + # their stream UAOL_DEEP_BUFFER 'true' - DEEP_BUFFER_PCM_NAME 'Deepbuffer UAOL' - DEEP_BUFFER_PCM_ID 22 - DEEP_BUFFER_PIPELINE_ID 214 - DEEP_BUFFER_PIPELINE_SRC 'mixin.214.1' - DEEP_BUFFER_PIPELINE_SINK 'mixout.211.1' + UAOL_DB_PCM_NAME 'Deepbuffer UAOL0' + UAOL_DB_PCM_ID 23 + UAOL_DB_PIPELINE_ID 214 + UAOL_DB1_PCM_NAME 'Deepbuffer UAOL1' + UAOL_DB1_PCM_ID 24 + UAOL_DB1_PIPELINE_ID 219 } diff --git a/tools/topology/topology2/development/sof-hda-generic-uaol.conf b/tools/topology/topology2/development/sof-hda-generic-uaol.conf index c4f1653f6863..bb3ffcd1501b 100644 --- a/tools/topology/topology2/development/sof-hda-generic-uaol.conf +++ b/tools/topology/topology2/development/sof-hda-generic-uaol.conf @@ -11,7 +11,9 @@ # # The module parameter also stops the machine driver from appending the -idisp # suffix, so this topology carries the iDisp backends unconditionally, as -# sof-hda-generic does. +# sof-hda-generic does. For a machine without an HDA codec, where the driver +# would have picked sof-hda-generic-idisp, use the sof-hda-generic-idisp-uaol variant +# instead, which is built from this file without the HDA codec paths. # # The UAOL function itself lives in platform/intel/uaol-generic.conf, and is # shared with the cavs-uaol function topology of the sof_sdw card. @@ -32,27 +34,48 @@ Define { - UAOL_PLAYBACK_PCM 'UAOL Playback' - UAOL_CAPTURE_PCM 'UAOL Capture' + UAOL_PLAYBACK_PCM 'UAOL0 Playback' + UAOL_CAPTURE_PCM 'UAOL0 Capture' # The two directions are separate DAI links so that the format fixup of - # a link is decided by the DAI copier of that direction alone. The names - # are abbreviated because alsatplg drops widget tuples above 36 characters - # and the dai-copier name is 'dai-copier.UAOL..' - UAOL_PB_DAI_NAME 'UAOL0-Play' - UAOL_CP_DAI_NAME 'UAOL0-Cap' + # a link is decided by the DAI copier of that direction alone, and the + # link carries two streams per direction, each with a backend of its + # own: UAOL-Play and UAOL-Cap. The names are abbreviated + # because alsa-lib drops widget tuples once the dai-copier name, + # 'dai-copier.UAOL..', exceeds 37 characters + UAOL_PB_DAI_NAME 'UAOL0-Play0' + UAOL_CP_DAI_NAME 'UAOL0-Cap0' # The BE IDs are the dai link IDs that are matched with the machine # driver. skl_hda_dsp_generic assigns fixed IDs, so these are the same - # whichever other functions the board has + # whichever other functions the board has. The backends come in the + # order Play0, Cap0, Play1, Cap1 UAOL_PB_BE_ID 9 UAOL_CP_BE_ID 10 # UAOL_DAI_INDEX is the UAOL link the DSP uses, only link 0 is addressable UAOL_DAI_INDEX 0 - UAOL_PCM_NAME 'UAOL' + UAOL_PCM_NAME 'UAOL0' UAOL_PCM_ID 21 UAOL_PB_HOST_PIPELINE_ID 210 UAOL_PB_DAI_PIPELINE_ID 211 UAOL_CP_HOST_PIPELINE_ID 212 UAOL_CP_DAI_PIPELINE_ID 213 + + # Second stream pair of the link, on its own PCM. Each backend offloads + # the USB PCM its route kcontrol points at; with a single USB device both + # routes point at it and the second PCM fails with EBUSY while the first + # one runs, a second device or a second PCM of the first lets both run + UAOL_NUM_STREAMS 2 + UAOL_PLAYBACK1_PCM 'UAOL1 Playback' + UAOL_CAPTURE1_PCM 'UAOL1 Capture' + UAOL_PB1_DAI_NAME 'UAOL0-Play1' + UAOL_CP1_DAI_NAME 'UAOL0-Cap1' + UAOL_PB1_BE_ID 11 + UAOL_CP1_BE_ID 12 + UAOL_PCM1_NAME 'UAOL1' + UAOL_PCM1_ID 22 + UAOL_PB1_HOST_PIPELINE_ID 215 + UAOL_PB1_DAI_PIPELINE_ID 216 + UAOL_CP1_HOST_PIPELINE_ID 217 + UAOL_CP1_DAI_PIPELINE_ID 218 # Both paths pass through whatever the offloaded USB device asks for, so # the PCM advertises everything a USB device may support. 7 channels is # left out of the widget formats, it has no channel config and no channel @@ -64,9 +87,15 @@ Define { UAOL_RATE_MAX 384000 UAOL_RATES '8000,11025,12000,16000,22050,24000,32000,44100,48000,64000,88200,96000,128000,176400,192000,384000' - # The HDA playback already has the one deep buffer PCM the topology can - # hold, so the UAOL runs without one here - UAOL_DEEP_BUFFER 'false' + # The deep buffer PCMs feed the same mixer as the normal playback PCM of + # their stream, next to the one the HDA playback has + UAOL_DEEP_BUFFER 'true' + UAOL_DB_PCM_NAME 'Deepbuffer UAOL0' + UAOL_DB_PCM_ID 23 + UAOL_DB_PIPELINE_ID 214 + UAOL_DB1_PCM_NAME 'Deepbuffer UAOL1' + UAOL_DB1_PCM_ID 24 + UAOL_DB1_PIPELINE_ID 219 } diff --git a/tools/topology/topology2/development/tplg-targets.cmake b/tools/topology/topology2/development/tplg-targets.cmake index 2da804cdf6a7..ffcffdb01005 100644 --- a/tools/topology/topology2/development/tplg-targets.cmake +++ b/tools/topology/topology2/development/tplg-targets.cmake @@ -333,6 +333,9 @@ PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-tgl-nocodec-webrtc-ns2.bin" # snd_sof.tplg_filename=sof-hda-generic-uaol.tplg "development/sof-hda-generic-uaol\;sof-hda-generic-uaol\;HDA_CONFIG=mix,HDA_MIC_ENHANCED_CAPTURE=true,\ EFX_HDA_MIC_TDFB_PARAMS=line2_pass,EFX_HDA_MIC_DRC_PARAMS=passthrough" +# The same for a machine without an HDA codec, HDMI only, load it with +# snd_sof.tplg_filename=sof-hda-generic-idisp-uaol.tplg +"development/sof-hda-generic-uaol\;sof-hda-generic-idisp-uaol\;" # SSP test topology for Data Processing SRC on MTL "cavs-nocodec\;sof-mtl-nocodec-dp-test\;PLATFORM=mtl,NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1,\ diff --git a/tools/topology/topology2/platform/intel/uaol-deep-buffer.conf b/tools/topology/topology2/platform/intel/uaol-deep-buffer.conf new file mode 100644 index 000000000000..572c9fc57a78 --- /dev/null +++ b/tools/topology/topology2/platform/intel/uaol-deep-buffer.conf @@ -0,0 +1,61 @@ +# Deep buffer playback of the first UAOL stream pair. +# +# Included by platform/intel/uaol-generic.conf when UAOL_DEEP_BUFFER is true +# and the deep buffer DMA size is in range. An instance of the deepbuffer-playback +# pipeline on the UAOL_DB_* variables, routed into the mixer of the first +# playback stream, the way platform/intel/deep-buffer-spk.conf is for the +# speaker. platform/intel/deep-buffer.conf cannot be used, it works on the +# global DEEP_BUFFER_* variables, which the deep buffer of a jack or speaker the +# topology also has takes. + +Object.Pipeline.deepbuffer-playback [ + { + index $UAOL_DB_PIPELINE_ID + + Object.Widget.host-copier.1 { + stream_name $UAOL_DB_PCM_NAME + pcm_id $UAOL_DB_PCM_ID + } + Object.Widget.gain.1 { + Object.Control.mixer.1 { + name 'Pre Mixer $UAOL_DB_PCM_NAME Volume' + } + } + } +] + +Object.PCM.pcm [ + { + name $UAOL_DB_PCM_NAME + id $UAOL_DB_PCM_ID + direction playback + playback_compatible_d0i3 $DEEPBUFFER_D0I3_COMPATIBLE + + Object.Base.fe_dai.1 { + name "$UAOL_DB_PCM_NAME" + } + Object.PCM.pcm_caps.1 { + name $UAOL_DB_PCM_NAME + formats 'S16_LE,S24_LE,S32_LE' + # To avoid DMA spinning on a buffer we need bigger + # buffer than the host buffer size, let's say twice as + # big + # (S16_LE, Stereo, 48KHz, DEEPBUFFER_FW_DMA_MS) * 2 + # + # Note: The lower limit for the buffer size is rate + # dependent + buffer_size_min "$[(((2 * $channels_min) * 48) * $DEEPBUFFER_FW_DMA_MS) * 2]" + } + } +] + +Object.Base.route [ + { + source mixin.$UAOL_DB_PIPELINE_ID.1 + sink mixout.$UAOL_PB_DAI_PIPELINE_ID.1 + } + { + source host-copier.$UAOL_DB_PCM_ID.playback + sink gain.$UAOL_DB_PIPELINE_ID.1 + } +] diff --git a/tools/topology/topology2/platform/intel/uaol-deep-buffer1.conf b/tools/topology/topology2/platform/intel/uaol-deep-buffer1.conf new file mode 100644 index 000000000000..242912325a5f --- /dev/null +++ b/tools/topology/topology2/platform/intel/uaol-deep-buffer1.conf @@ -0,0 +1,57 @@ +# Deep buffer playback of the second UAOL stream pair. +# +# Included by platform/intel/uaol-stream1.conf under the same conditions as the +# first pair's deep buffer, platform/intel/uaol-deep-buffer.conf, which this +# repeats on the UAOL_DB1_* variables. + +Object.Pipeline.deepbuffer-playback [ + { + index $UAOL_DB1_PIPELINE_ID + + Object.Widget.host-copier.1 { + stream_name $UAOL_DB1_PCM_NAME + pcm_id $UAOL_DB1_PCM_ID + } + Object.Widget.gain.1 { + Object.Control.mixer.1 { + name 'Pre Mixer $UAOL_DB1_PCM_NAME Volume' + } + } + } +] + +Object.PCM.pcm [ + { + name $UAOL_DB1_PCM_NAME + id $UAOL_DB1_PCM_ID + direction playback + playback_compatible_d0i3 $DEEPBUFFER_D0I3_COMPATIBLE + + Object.Base.fe_dai.1 { + name "$UAOL_DB1_PCM_NAME" + } + Object.PCM.pcm_caps.1 { + name $UAOL_DB1_PCM_NAME + formats 'S16_LE,S24_LE,S32_LE' + # To avoid DMA spinning on a buffer we need bigger + # buffer than the host buffer size, let's say twice as + # big + # (S16_LE, Stereo, 48KHz, DEEPBUFFER_FW_DMA_MS) * 2 + # + # Note: The lower limit for the buffer size is rate + # dependent + buffer_size_min "$[(((2 * $channels_min) * 48) * $DEEPBUFFER_FW_DMA_MS) * 2]" + } + } +] + +Object.Base.route [ + { + source mixin.$UAOL_DB1_PIPELINE_ID.1 + sink mixout.$UAOL_PB1_DAI_PIPELINE_ID.1 + } + { + source host-copier.$UAOL_DB1_PCM_ID.playback + sink gain.$UAOL_DB1_PIPELINE_ID.1 + } +] diff --git a/tools/topology/topology2/platform/intel/uaol-generic.conf b/tools/topology/topology2/platform/intel/uaol-generic.conf index ed7c0f7b625b..41816ca3e369 100644 --- a/tools/topology/topology2/platform/intel/uaol-generic.conf +++ b/tools/topology/topology2/platform/intel/uaol-generic.conf @@ -4,13 +4,23 @@ # # PCM ---------------> gain ---> mixin ---+ # | -# Deepbuffer PCM ----> gain ---> mixin ---+--> mixout --> gain --> UAOL0-Play +# Deepbuffer PCM ----> gain ---> mixin ---+--> mixout --> gain --> UAOL0-Play0 # -# PCM <------------ module-copier <--- eqiir <---------------- UAOL0-Cap +# PCM <------------ module-copier <--- eqiir <---------------- UAOL0-Cap0 # # The capture path carries no mixer, as the number of channels follows the USB # device and a mixer only handles a fixed channel count. # +# A UAOL link runs several streams at a time, and the kernel creates a backend +# for each of them: UAOL-Play and UAOL-Cap, n counting the +# streams of a direction. This file describes the paths of the first stream +# pair, with the PCM, pipeline and backend IDs taken from the UAOL_* variables. +# The second pair, platform/intel/uaol-stream1.conf, is pulled in when +# UAOL_NUM_STREAMS is 2; it is the same paths on the UAOL_*1_* variables, with +# a deep buffer of its own on UAOL_DB1_*. A topology only has to describe the +# streams it wants to expose, a backend the topology leaves out simply stays +# unused. +# # What the endpoint can be run at is decided by the USB device, which is only # known once one is plugged in, so every widget of both paths carries the whole # set of formats a USB device may ask for: S16_LE, S24_LE and S32_LE, 1 to 8 @@ -18,22 +28,19 @@ # goes. The kernel narrows the PCM down to what the connected device actually # supports. # -# The deep buffer PCM is left at 48 kHz stereo, as it comes from the shared -# platform/intel/deep-buffer.conf. It can only join the mixer while the normal +# The deep buffer PCM is left at 48 kHz stereo, the default of the +# deepbuffer-playback pipeline. It can only join the mixer while the normal # playback PCM runs at that format, or is not running at all. -# Deep buffer playback, included when the DMA buffer is 1 - 1000 ms. -# -# It is optional because platform/intel/deep-buffer.conf can only be pulled in -# once per topology: it takes the pipeline and the PCM it creates from the -# DEEP_BUFFER_* variables, and those are global, so a second include which -# redefines them moves the first deep buffer on top of the second one. A -# topology which already has a deep buffer of its own asks for -# UAOL_DEEP_BUFFER false. +# Deep buffer playback, included when UAOL_DEEP_BUFFER is true and the DMA +# buffer is 1 - 1000 ms. The deep buffers of the UAOL streams are instances of +# their own, platform/intel/uaol-deep-buffer.conf and uaol-deep-buffer1.conf on +# the UAOL_DB_* and UAOL_DB1_* variables, so they sit next to the deep buffer a +# jack or speaker of the topology has on the global DEEP_BUFFER_* ones. IncludeByKey.UAOL_DEEP_BUFFER { "true" { IncludeByKey.DEEPBUFFER_FW_DMA_MS { - "([1-9]|[1-9][0-9]|[1-9][0-9][0-9]|1000)" "platform/intel/deep-buffer.conf" + "([1-9]|[1-9][0-9]|[1-9][0-9][0-9]|1000)" "platform/intel/uaol-deep-buffer.conf" } } } @@ -45,7 +52,7 @@ Object.Dai.UAOL [ id $UAOL_PB_BE_ID default_hw_conf_id 0 Object.Base.hw_config.1 { - name "UAOL0-Play" + name $UAOL_PB_DAI_NAME } direction playback } @@ -55,7 +62,7 @@ Object.Dai.UAOL [ id $UAOL_CP_BE_ID default_hw_conf_id 0 Object.Base.hw_config.1 { - name "UAOL0-Cap" + name $UAOL_CP_DAI_NAME } direction capture } @@ -213,3 +220,8 @@ Object.Base.route [ sink "host-copier.$UAOL_PCM_ID.capture" } ] + +# The second stream pair of the link +IncludeByKey.UAOL_NUM_STREAMS { + "2" "platform/intel/uaol-stream1.conf" +} diff --git a/tools/topology/topology2/platform/intel/uaol-stream1.conf b/tools/topology/topology2/platform/intel/uaol-stream1.conf new file mode 100644 index 000000000000..71475300b58a --- /dev/null +++ b/tools/topology/topology2/platform/intel/uaol-stream1.conf @@ -0,0 +1,195 @@ +# Second stream pair of a USB Audio Offload Link (UAOL). +# +# Included by platform/intel/uaol-generic.conf when UAOL_NUM_STREAMS is 2. The +# same paths as the first pair, on the UAOL_*1_* variables, the deep buffer +# from platform/intel/uaol-deep-buffer1.conf on UAOL_DB1_*. +# +# PCM ---------------> gain ---> mixin ---+ +# | +# Deepbuffer PCM ----> gain ---> mixin ---+--> mixout --> gain --> UAOL0-Play1 +# +# PCM <------------ module-copier <--- eqiir <---------------- UAOL0-Cap1 + +IncludeByKey.UAOL_DEEP_BUFFER { + "true" { + IncludeByKey.DEEPBUFFER_FW_DMA_MS { + "([1-9]|[1-9][0-9]|[1-9][0-9][0-9]|1000)" "platform/intel/uaol-deep-buffer1.conf" + } + } +} + +Object.Dai.UAOL [ + { + name $UAOL_PB1_DAI_NAME + dai_index $UAOL_DAI_INDEX + id $UAOL_PB1_BE_ID + default_hw_conf_id 0 + Object.Base.hw_config.1 { + name $UAOL_PB1_DAI_NAME + } + direction playback + } + { + name $UAOL_CP1_DAI_NAME + dai_index $UAOL_DAI_INDEX + id $UAOL_CP1_BE_ID + default_hw_conf_id 0 + Object.Base.hw_config.1 { + name $UAOL_CP1_DAI_NAME + } + direction capture + } +] + +Object.Pipeline { + host-copier-gain-mixin-playback [ + { + index $UAOL_PB1_HOST_PIPELINE_ID + + Object.Widget.host-copier.1 { + stream_name $UAOL_PLAYBACK1_PCM + pcm_id $UAOL_PCM1_ID + + + } + Object.Widget.gain.1 { + Object.Control.mixer.1 { + name 'Pre Mixer $UAOL_PCM1_NAME Playback Volume' + } + + + } + Object.Widget.mixin.1 { + + + } + } + ] + + mixout-gain-dai-copier-playback [ + { + index $UAOL_PB1_DAI_PIPELINE_ID + + Object.Widget.mixout.1 { + + + } + Object.Widget.dai-copier.1 { + node_type $ALH_UAOL_STREAM_LINK_OUTPUT_CLASS + stream_name $UAOL_PB1_DAI_NAME + dai_type "UAOL" + copier_type "UAOL" + + + } + Object.Widget.gain.1 { + Object.Control.mixer.1 { + name 'Post Mixer $UAOL_PCM1_NAME Playback Volume' + } + + + } + } + ] + + host-gateway-capture [ + { + index $UAOL_CP1_HOST_PIPELINE_ID + + Object.Widget.host-copier.1 { + stream_name $UAOL_CAPTURE1_PCM + pcm_id $UAOL_PCM1_ID + + + } + } + ] + + dai-copier-eqiir-module-copier-capture [ + { + index $UAOL_CP1_DAI_PIPELINE_ID + + Object.Widget.dai-copier.1 { + node_type $ALH_UAOL_STREAM_LINK_INPUT_CLASS + stream_name $UAOL_CP1_DAI_NAME + dai_type "UAOL" + type dai_out + copier_type "UAOL" + num_output_pins 1 + + + } + + # The coefficients are designed for 48 kHz, so the corner + # frequency scales with the rate the device is run at + Object.Widget.eqiir.1 { + Object.Control.bytes.1 { + name '$UAOL_PCM1_NAME Capture IIR Eq' + + } + + + } + + Object.Widget.module-copier.2 { + + + } + } + ] +} + +Object.PCM.pcm [ + { + name $UAOL_PCM1_NAME + id $UAOL_PCM1_ID + direction "duplex" + Object.Base.fe_dai.1 { + name $UAOL_PCM1_NAME + } + Object.PCM.pcm_caps.1 { + direction "playback" + name $UAOL_PLAYBACK1_PCM + formats 'S16_LE,S24_LE,S32_LE' + channels_min $UAOL_CHANNELS_MIN + channels_max $UAOL_CHANNELS_MAX + rates $UAOL_RATES + rate_min $UAOL_RATE_MIN + rate_max $UAOL_RATE_MAX + } + Object.PCM.pcm_caps.2 { + direction "capture" + name $UAOL_CAPTURE1_PCM + formats 'S16_LE,S24_LE,S32_LE' + channels_min $UAOL_CHANNELS_MIN + channels_max $UAOL_CHANNELS_MAX + rates $UAOL_RATES + rate_min $UAOL_RATE_MIN + rate_max $UAOL_RATE_MAX + } + } +] + +# top-level pipeline connections +Object.Base.route [ + { + source "host-copier.$UAOL_PCM1_ID.playback" + sink "gain.$UAOL_PB1_HOST_PIPELINE_ID.1" + } + { + source "mixin.$UAOL_PB1_HOST_PIPELINE_ID.1" + sink "mixout.$UAOL_PB1_DAI_PIPELINE_ID.1" + } + { + source "gain.$UAOL_PB1_DAI_PIPELINE_ID.1" + sink "dai-copier.UAOL.$UAOL_PB1_DAI_NAME.playback" + } + { + source "dai-copier.UAOL.$UAOL_CP1_DAI_NAME.capture" + sink "eqiir.$UAOL_CP1_DAI_PIPELINE_ID.1" + } + { + source "module-copier.$UAOL_CP1_DAI_PIPELINE_ID.2" + sink "host-copier.$UAOL_PCM1_ID.capture" + } +] diff --git a/tools/topology/topology2/production/tplg-targets-sdca-generic.cmake b/tools/topology/topology2/production/tplg-targets-sdca-generic.cmake index cbc869e1ff2a..8c4ac9b6bcfd 100644 --- a/tools/topology/topology2/production/tplg-targets-sdca-generic.cmake +++ b/tools/topology/topology2/production/tplg-targets-sdca-generic.cmake @@ -49,18 +49,20 @@ EFX_MIC_TDFB_PARAMS=line4_pass" "cavs-sdw\;sof-hdmi-pcm5-id6\;SDW_JACK=false,HDMI1_ID=6,HDMI2_ID=7,HDMI3_ID=8" "cavs-sdw\;sof-hdmi-pcm5-id7\;SDW_JACK=false,HDMI1_ID=7,HDMI2_ID=8,HDMI3_ID=9" -# USB Audio Offload Link function topology. The UAOL backend is the last one -# sof_sdw creates, so its dai link ID depends on the composition of the board: -# it follows the SoundWire links, the PCH DMIC pair, the three HDMI links and -# the BT link. Each direction is a separate link, so two consecutive IDs are -# taken. The range below covers a jack and amplifier board without DMIC and BT -# (6) up to a jack, amplifier with feedback, PCH DMIC and BT board (10). -# Add a variant here for every further ID that is needed. -"cavs-uaol\;sof-uaol-id6\;UAOL_PB_BE_ID=6,UAOL_CP_BE_ID=7" -"cavs-uaol\;sof-uaol-id7\;UAOL_PB_BE_ID=7,UAOL_CP_BE_ID=8" -"cavs-uaol\;sof-uaol-id8\;UAOL_PB_BE_ID=8,UAOL_CP_BE_ID=9" -"cavs-uaol\;sof-uaol-id9\;UAOL_PB_BE_ID=9,UAOL_CP_BE_ID=10" -"cavs-uaol\;sof-uaol-id10\;UAOL_PB_BE_ID=10,UAOL_CP_BE_ID=11" +# USB Audio Offload Link function topology. The UAOL backends are the last ones +# sof_sdw creates, so their dai link IDs depend on the composition of the board: +# they follow the SoundWire links, the PCH DMIC pair, the three HDMI links and +# the BT link. The link has two streams per direction and each gets a backend, +# in the order Play0, Cap0, Play1, Cap1, so four consecutive IDs are taken and +# the topology exposes a PCM per pair. The range below covers a jack and +# amplifier board without DMIC and BT (6) up to a jack, amplifier with feedback, +# PCH DMIC and BT board (10). Add a variant here for every further ID that is +# needed. +"cavs-uaol\;sof-uaol-id6\;UAOL_PB_BE_ID=6,UAOL_CP_BE_ID=7,UAOL_PB1_BE_ID=8,UAOL_CP1_BE_ID=9" +"cavs-uaol\;sof-uaol-id7\;UAOL_PB_BE_ID=7,UAOL_CP_BE_ID=8,UAOL_PB1_BE_ID=9,UAOL_CP1_BE_ID=10" +"cavs-uaol\;sof-uaol-id8\;UAOL_PB_BE_ID=8,UAOL_CP_BE_ID=9,UAOL_PB1_BE_ID=10,UAOL_CP1_BE_ID=11" +"cavs-uaol\;sof-uaol-id9\;UAOL_PB_BE_ID=9,UAOL_CP_BE_ID=10,UAOL_PB1_BE_ID=11,UAOL_CP1_BE_ID=12" +"cavs-uaol\;sof-uaol-id10\;UAOL_PB_BE_ID=10,UAOL_CP_BE_ID=11,UAOL_PB1_BE_ID=12,UAOL_CP1_BE_ID=13" # Feature topologies which should work with the function topologies above "cavs-sdw\;sof-sdca-amp-ref\;SDW_JACK=false,NUM_HDMIS=0,JACK_RATE=48000,\