@@ -21,6 +21,17 @@ Define {
2121 EFX_IIR_PARAMS 'passthrough'
2222 EFX_DRC_PARAMS 'passthrough'
2323 HDA_MIC_ENHANCED_CAPTURE 'false'
24+
25+ # Compress capture (encode) via the FFmpeg encoder (ffmpeg_enc). The PCM
26+ # name overrides the generic compr-default.conf default. COMPR_ENC_SOURCE
27+ # is the capture-BE fan-out tap: when COMPR_FFMPEG_ENC is enabled the
28+ # capture path is rebuilt around a mixin (mixin.4.1) that fans out - via the
29+ # proven mixer path - to both the normal analog capture FE (mixout.3.1) and
30+ # the encoder FE (mixout.93.1). A copier's 2nd output pin does not deliver
31+ # data across a pipeline boundary, which starved the encoder; mixin->mixout
32+ # does.
33+ COMPR_ENC_PCM_NAME 'Compress Capture HDA Analog'
34+ COMPR_ENC_SOURCE 'mixin.4.1'
2435}
2536
2637# include deep buffer config if buffer size is in 1 - 1000 ms.
@@ -36,6 +47,12 @@ IncludeByKey.COMPR_FFMPEG {
3647 "true" "platform/intel/compr-ffmpeg.conf"
3748}
3849
50+ IncludeByKey.COMPR_FFMPEG_ENC {
51+ "true" {
52+ <platform/intel/compr-capture-ffmpeg.conf>
53+ }
54+ }
55+
3956Object.Dai.HDA [
4057 {
4158 name $HDA_ANALOG_DAI_NAME
@@ -178,114 +195,164 @@ Object.Pipeline {
178195 }
179196 }
180197 ]
198+ }
181199
182- host-gateway-capture [
183- {
184- index 3
185- Object.Widget.host-copier.1 {
186- stream_name $ANALOG_CAPTURE_PCM
187- pcm_id 0
188- num_input_audio_formats 1
189- num_output_audio_formats 3
190- Object.Base.input_audio_format [
191- {
192- in_rate $HDA_ANALOG_CAPTURE_RATE
193- in_bit_depth 32
194- in_valid_bit_depth 32
195- }
196- ]
197- Object.Base.output_audio_format [
198- {
199- out_rate $HDA_ANALOG_CAPTURE_RATE
200- out_bit_depth 16
201- out_valid_bit_depth 16
202- }
203- {
204- out_rate $HDA_ANALOG_CAPTURE_RATE
205- out_bit_depth 32
206- out_valid_bit_depth 24
207- }
208- {
209- out_rate $HDA_ANALOG_CAPTURE_RATE
210- out_bit_depth 32
211- out_valid_bit_depth 32
212- }
213- ]
200+ # Capture path. Default (COMPR_FFMPEG_ENC=false) keeps the stock
201+ # dai-copier -> eqiir -> module-copier -> host-copier.0 chain. When the FFmpeg
202+ # encoder FE is enabled the capture is rebuilt around the mixer so a single
203+ # mixin (mixin.4.1) fans out to both the normal capture FE (mixout.3.1) and the
204+ # encoder FE (mixout.93.1): a module-copier 2nd output pin does not deliver data
205+ # across a pipeline boundary, whereas mixin->mixout (the playback mix path) does.
206+ IncludeByKey.COMPR_FFMPEG_ENC {
207+ "false" {
208+ Object.Pipeline {
209+ host-gateway-capture [
210+ {
211+ index 3
212+ Object.Widget.host-copier.1 {
213+ stream_name $ANALOG_CAPTURE_PCM
214+ pcm_id 0
215+ num_input_audio_formats 1
216+ num_output_audio_formats 3
217+ Object.Base.input_audio_format [
218+ {
219+ in_rate $HDA_ANALOG_CAPTURE_RATE
220+ in_bit_depth 32
221+ in_valid_bit_depth 32
222+ }
223+ ]
224+ Object.Base.output_audio_format [
225+ {
226+ out_rate $HDA_ANALOG_CAPTURE_RATE
227+ out_bit_depth 16
228+ out_valid_bit_depth 16
229+ }
230+ {
231+ out_rate $HDA_ANALOG_CAPTURE_RATE
232+ out_bit_depth 32
233+ out_valid_bit_depth 24
234+ }
235+ {
236+ out_rate $HDA_ANALOG_CAPTURE_RATE
237+ out_bit_depth 32
238+ out_valid_bit_depth 32
239+ }
240+ ]
241+ }
214242 }
215- }
216- ]
243+ ]
217244
218- dai-copier-eqiir-module-copier-capture [
219- {
220- index 4
245+ dai-copier-eqiir-module-copier-capture [
246+ {
247+ index 4
221248
222- Object.Widget.dai-copier."1" {
223- dai_type "HDA"
224- type "dai_out"
225- copier_type "HDA"
226- stream_name $HDA_ANALOG_DAI_NAME
227- node_type $HDA_LINK_INPUT_CLASS
228- num_output_pins 1
229- num_input_audio_formats 1
230- num_output_audio_formats 1
231- Object.Base.input_audio_format [
232- {
233- in_rate $HDA_ANALOG_CAPTURE_RATE
234- in_bit_depth 32
235- in_valid_bit_depth 32
249+ Object.Widget.dai-copier."1" {
250+ dai_type "HDA"
251+ type "dai_out"
252+ copier_type "HDA"
253+ stream_name $HDA_ANALOG_DAI_NAME
254+ node_type $HDA_LINK_INPUT_CLASS
255+ num_output_pins 1
256+ num_input_audio_formats 1
257+ num_output_audio_formats 1
258+ Object.Base.input_audio_format [
259+ {
260+ in_rate $HDA_ANALOG_CAPTURE_RATE
261+ in_bit_depth 32
262+ in_valid_bit_depth 32
263+ }
264+ ]
265+ Object.Base.output_audio_format [
266+ {
267+ out_rate $HDA_ANALOG_CAPTURE_RATE
268+ out_bit_depth 32
269+ out_valid_bit_depth 32
270+ }
271+ ]
272+ }
273+ Object.Widget.eqiir.1 {
274+ Object.Control.bytes."1" {
275+ name '$ANALOG_CAPTURE_PCM IIR Eq'
276+ <include/components/eqiir/highpass_40hz_0db_48khz.conf>
236277 }
237- ]
238- Object.Base.output_audio_format [
239- {
240- out_rate $HDA_ANALOG_CAPTURE_RATE
241- out_bit_depth 32
242- out_valid_bit_depth 32
278+ num_input_audio_formats 1
279+ num_output_audio_formats 1
280+ Object.Base.input_audio_format [
281+ {
282+ in_rate $HDA_ANALOG_CAPTURE_RATE
283+ in_bit_depth 32
284+ in_valid_bit_depth 32
285+ }
286+ ]
287+ Object.Base.output_audio_format [
288+ {
289+ out_rate $HDA_ANALOG_CAPTURE_RATE
290+ out_bit_depth 32
291+ out_valid_bit_depth 32
292+ }
293+ ]
294+ }
295+ Object.Widget.module-copier."2" {
296+ stream_name $HDA_ANALOG_DAI_NAME
297+ num_input_audio_formats 1
298+ num_output_audio_formats 1
299+ Object.Base.input_audio_format [
300+ {
301+ in_rate $HDA_ANALOG_CAPTURE_RATE
302+ in_bit_depth 32
303+ in_valid_bit_depth 32
304+ }
305+ ]
306+ Object.Base.output_audio_format [
307+ {
308+ out_rate $HDA_ANALOG_CAPTURE_RATE
309+ out_bit_depth 32
310+ out_valid_bit_depth 32
311+ }
312+ ]
313+ }
314+ }
315+ ]
316+ }
317+ }
318+ "true" {
319+ # BE: HDA analog capture -> gain -> mixin.4.1 (the fan-out point).
320+ # FE1 (normal analog capture, pcm0c): mixout.3.1 -> gain -> host-copier.0.
321+ # FE2 (encoder, pcm51): mixin.4.1 -> mixout.93.1 -> ffmpeg_enc -> host-copier.51,
322+ # declared in platform/intel/compr-capture-ffmpeg.conf.
323+ Object.Pipeline {
324+ mixout-gain-host-copier-capture [
325+ {
326+ index 3
327+ Object.Widget.host-copier.1 {
328+ stream_name $ANALOG_CAPTURE_PCM
329+ pcm_id 0
330+ }
331+ Object.Widget.gain.1 {
332+ Object.Control.mixer.1 {
333+ name 'Analog Capture Post Mixer Volume'
243334 }
244- ]
335+ }
245336 }
246- Object.Widget.eqiir.1 {
247- Object.Control.bytes."1" {
248- name '$ANALOG_CAPTURE_PCM IIR Eq'
249- <include/components/eqiir/highpass_40hz_0db_48khz.conf>
250- }
251- num_input_audio_formats 1
252- num_output_audio_formats 1
253- Object.Base.input_audio_format [
254- {
255- in_rate $HDA_ANALOG_CAPTURE_RATE
256- in_bit_depth 32
257- in_valid_bit_depth 32
258- }
259- ]
260- Object.Base.output_audio_format [
261- {
262- out_rate $HDA_ANALOG_CAPTURE_RATE
263- out_bit_depth 32
264- out_valid_bit_depth 32
265- }
266- ]
267- }
268- Object.Widget.module-copier."2" {
269- stream_name $HDA_ANALOG_DAI_NAME
270- num_input_audio_formats 1
271- num_output_audio_formats 1
272- Object.Base.input_audio_format [
273- {
274- in_rate $HDA_ANALOG_CAPTURE_RATE
275- in_bit_depth 32
276- in_valid_bit_depth 32
277- }
278- ]
279- Object.Base.output_audio_format [
280- {
281- out_rate $HDA_ANALOG_CAPTURE_RATE
282- out_bit_depth 32
283- out_valid_bit_depth 32
284- }
285- ]
286- }
287- }
288- ]
337+ ]
338+
339+ dai-copier-gain-mixin-capture [
340+ {
341+ index 4
342+ Object.Widget.dai-copier.1 {
343+ dai_type "HDA"
344+ copier_type "HDA"
345+ stream_name $HDA_ANALOG_DAI_NAME
346+ }
347+ Object.Widget.gain.1 {
348+ Object.Control.mixer.1 {
349+ name 'Analog Capture Pre Mixer Volume'
350+ }
351+ }
352+ }
353+ ]
354+ }
355+ }
289356}
290357
291358IncludeByKey.HDA_MIC_ENHANCED_CAPTURE {
@@ -407,39 +474,70 @@ Object.Base.route [
407474 source 'mixin.1.1'
408475 sink 'mixout.2.1'
409476 }
410- {
411- source 'dai-copier.HDA.$HDA_ANALOG_DAI_NAME.capture'
412- sink 'eqiir.4.1'
413- }
414477 {
415478 source 'host-copier.0.playback'
416479 sink 'gain.1.1'
417480 }
418481]
419482
420- IncludeByKey.HDA_MIC_ENHANCED_CAPTURE {
421- "true" {
422- Object.Base.route [
423- {
424- source 'module-copier.4.2'
425- sink 'tdfb.3.1'
426- }
427- {
428- source 'tdfb.3.1'
429- sink 'drc.3.1'
430- }
431- {
432- source 'drc.3.1'
433- sink 'host-copier.0.capture'
434- }
435- ]
436- }
437- "false" {
438- Object.Base.route [
439- {
440- source 'module-copier.4.2'
441- sink 'host-copier.0.capture'
442- }
443- ]
444- }
483+ IncludeByKey.COMPR_FFMPEG_ENC {
484+ "false" {
485+ # stock capture BE processing chain feeding the normal analog capture FE
486+ Object.Base.route [
487+ {
488+ source 'dai-copier.HDA.$HDA_ANALOG_DAI_NAME.capture'
489+ sink 'eqiir.4.1'
490+ }
491+ ]
492+ IncludeByKey.HDA_MIC_ENHANCED_CAPTURE {
493+ "true" {
494+ Object.Base.route [
495+ {
496+ source 'module-copier.4.2'
497+ sink 'tdfb.3.1'
498+ }
499+ {
500+ source 'tdfb.3.1'
501+ sink 'drc.3.1'
502+ }
503+ {
504+ source 'drc.3.1'
505+ sink 'host-copier.0.capture'
506+ }
507+ ]
508+ }
509+ "false" {
510+ Object.Base.route [
511+ {
512+ source 'module-copier.4.2'
513+ sink 'host-copier.0.capture'
514+ }
515+ ]
516+ }
517+ }
518+ }
519+ "true" {
520+ # BE dai -> gain -> mixin.4.1; the mixin fans out to mixout.3.1 (normal FE)
521+ # and to mixout.93.1 (encoder FE - that tap is in compr-capture-ffmpeg.conf).
522+ # The gain->mixin (BE) and mixout->gain->host-copier.0 (FE) hops are provided
523+ # by the dai-copier-gain-mixin-capture / mixout-gain-host-copier-capture classes.
524+ Object.Base.route [
525+ {
526+ source 'dai-copier.HDA.$HDA_ANALOG_DAI_NAME.capture'
527+ sink 'gain.4.1'
528+ }
529+ {
530+ source 'mixin.4.1'
531+ sink 'mixout.3.1'
532+ }
533+ {
534+ source 'mixout.3.1'
535+ sink 'gain.3.1'
536+ }
537+ {
538+ source 'gain.3.1'
539+ sink 'host-copier.0.capture'
540+ }
541+ ]
542+ }
445543}
0 commit comments