Lines Matching +full:be +full:- +full:dai +full:- +full:link
18 DPCM re-uses all the existing component codec, platform and DAI drivers without
23 -------------------------------------
25 Consider the following phone audio subsystem. This will be used in this
26 document for all examples :-
32 PCM0 <------------> * * <----DAI0-----> Codec Headset
34 PCM1 <------------> * * <----DAI1-----> Codec Speakers
36 PCM2 <------------> * * <----DAI2-----> MODEM
38 PCM3 <------------> * * <----DAI3-----> BT
40 * * <----DAI4-----> DMIC
42 * * <----DAI5-----> FM
48 supports 6 back end (BE) DAIs. Each FE PCM can digitally route audio data to any
49 of the BE DAIs. The FE PCM devices can also route audio to more than 1 BE DAI.
53 Example - DPCM Switching playback from DAI0 to DAI1
54 ---------------------------------------------------
59 Playback on PCM0 to Headset would look like :-
65 PCM1 <------------> * * <----DAI1-----> Codec Speakers
67 PCM2 <------------> * * <----DAI2-----> MODEM
69 PCM3 <------------> * * <----DAI3-----> BT
71 * * <----DAI4-----> DMIC
73 * * <----DAI5-----> FM
76 The headset is removed from the jack by user so the speakers must now be used :-
80 PCM0 <============> * * <----DAI0-----> Codec Headset
82 PCM1 <------------> * * <====DAI1=====> Codec Speakers
84 PCM2 <------------> * * <----DAI2-----> MODEM
86 PCM3 <------------> * * <----DAI3-----> BT
88 * * <----DAI4-----> DMIC
90 * * <----DAI5-----> FM
93 The audio driver processes this as follows :-
108 and then DPCM will take care of managing the DAI PCM operations to either bring
109 the link up or down. Audio playback does not stop during this transition.
117 except that we also have to :-
119 1. Define the FE and BE DAI links.
121 2. Define any FE/BE PCM operations.
126 FE and BE DAI links
127 -------------------
133 PCM0 <------------> * * <----DAI0-----> Codec Headset
135 PCM1 <------------> * * <----DAI1-----> Codec Speakers
137 PCM2 <------------> * * <----DAI2-----> MODEM
139 PCM3 <------------> * * <----DAI3-----> BT
141 * * <----DAI4-----> DMIC
143 * * <----DAI5-----> FM
146 For the example above we have to define 4 FE DAI links and 6 BE DAI links. The
147 FE DAI links are defined as follows :-
155 .platform_name = "dsp-audio",
156 .codec_name = "snd-soc-dummy",
157 .codec_dai_name = "snd-soc-dummy-dai",
162 .....< other FE and BE DAI links here >
165 This FE DAI link is pretty similar to a regular DAI link except that we also
166 set the DAI link to a DPCM FE with the ``dynamic = 1``. The supported FE stream
167 directions should also be set with the ``dpcm_playback`` and ``dpcm_capture``
170 components (as some DSPs have strong requirements for the ordering DAI/DSP
173 The FE DAI above sets the codec and code DAIs to dummy devices since the BE is
176 The BE DAIs are configured as follows :-
180 .....< FE DAI links here >
183 .cpu_dai_name = "ssp-dai.0",
184 .platform_name = "snd-soc-dummy",
186 .codec_name = "rt5640.0-001c",
187 .codec_dai_name = "rt5640-aif1",
195 .....< other BE DAI links here >
198 This BE DAI link connects DAI0 to the codec (in this case RT5460 AIF1). It sets
199 the ``no_pcm`` flag to mark it has a BE and sets flags for supported stream
202 The BE has also flags set for ignoring suspend and PM down time. This allows
203 the BE to work in a hostless mode where the host CPU is not transferring data
204 like a BT phone call :-
208 PCM0 <------------> * * <----DAI0-----> Codec Headset
210 PCM1 <------------> * * <----DAI1-----> Codec Speakers
212 PCM2 <------------> * * <====DAI2=====> MODEM
214 PCM3 <------------> * * <====DAI3=====> BT
216 * * <----DAI4-----> DMIC
218 * * <----DAI5-----> FM
221 This allows the host CPU to sleep while the DSP, MODEM DAI and the BT DAI are
224 A BE DAI link can also set the codec to a dummy device if the codec is a device
227 Likewise a BE DAI can also set a dummy cpu DAI if the CPU DAI is managed by the
231 FE/BE PCM operations
232 --------------------
234 The BE above also exports some PCM operations and a ``fixup`` callback. The fixup
235 callback is used by the machine driver to (re)configure the DAI based upon the
236 FE hw params. i.e. the DSP may perform SRC or ASRC from the FE to BE.
239 DAI0. This means all FE hw_params have to be fixed in the machine driver for
240 DAI0 so that the DAI is running at desired configuration regardless of the FE
253 rate->min = rate->max = 48000;
254 channels->min = channels->max = 2;
261 The other PCM operation are the same as for regular DAI links. Use as necessary.
265 ------------------------
267 The BE DAI links will normally be connected to the graph at initialisation time
268 by the ASoC DAPM core. However, if the BE codec or BE DAI is a dummy then this
269 has to be set explicitly in the driver :-
272 /* BE for codec Headset - DAI0 is dummy and managed by DSP FW */
282 implement :-
284 1. Front End PCM DAIs - i.e. struct snd_soc_dai_driver.
294 6. BE AIF widgets.
296 Items 6 is important for routing the audio outside of the DSP. AIF need to be
297 defined for each BE and each stream direction. e.g for BE DAI0 above we would
298 have :-
304 The BE AIF are used to connect the DSP graph to the graphs for the other
312 example of this would be a phone call from handset to modem.
316 PCM0 <------------> * * <----DAI0-----> Codec Headset
318 PCM1 <------------> * * <====DAI1=====> Codec Speakers/Mic
320 PCM2 <------------> * * <====DAI2=====> MODEM
322 PCM3 <------------> * * <----DAI3-----> BT
324 * * <----DAI4-----> DMIC
326 * * <----DAI5-----> FM
332 The host can control the hostless link either by :-
334 1. Configuring the link as a CODEC <-> CODEC style link. In this case the link
336 there is a mixer control that can be used to connect or disconnect the path
339 2. Hostless FE. This FE has a virtual connection to the BE DAI links on the DAPM
341 This method gives more control over the DAI links, but requires much more
342 userspace code to control the link. Its recommended to use CODEC<->CODEC
346 CODEC <-> CODEC link
347 --------------------
349 This DAI link is enabled when DAPM detects a valid path within the DAPM graph.
350 The machine driver sets some additional parameters to the DAI link i.e.
362 < ... more DAI links above ... >
367 .codec_dai_name = "modem-aif1",
374 < ... more DAI links here ... >
376 These parameters are used to configure the DAI hw_params() when DAPM detects a
377 valid path and then calls the PCM operations to start the link. DAPM will also
378 call the appropriate PCM operations to disable the DAI when the path is no
383 -----------
385 The DAI link(s) are enabled by a FE that does not read or write any PCM data.
387 DAI links. The DAI links will be started when the FE PCM is started and stopped