Skip to content

Commit 91318ce

Browse files
committed
topology2: sdw-jack-generic: Make BE DAI and copiers honor SDW_JACK_CAPTURE_CH
The BE DAI, alh-copier and host-copier for capture should honor the number of capture channels set by SDW_JACK_CAPTURE_CH. Before this change, the value of SDW_JACK_CAPTURE_CH only affected the min/max channels of the FE DAI but all the other objects in the pipeline were defaulting to 2-channel. Because of this, the codec DAI was always asked for a 2-channel capture, which won't work on codecs that only support 1 channel. And the host-copier output was 2-channel audio that could not be connected to the 1-channel DAI. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
1 parent 8c0c11b commit 91318ce

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

tools/topology/topology2/platform/intel/sdw-jack-generic.conf

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ Object.Dai.ALH [
3838
name $SDW_JACK_IN_STREAM
3939
default_hw_conf_id 0
4040
rate $JACK_RATE
41-
channels 2
41+
channels $SDW_JACK_CAPTURE_CH
42+
4243

4344
Object.Base.hw_config.1 {
4445
id 0
@@ -354,30 +355,40 @@ Object.Pipeline.host-gateway-capture [
354355
Object.Base.output_audio_format [
355356
{
356357
out_rate $JACK_RATE
358+
out_channels $SDW_JACK_CAPTURE_CH
357359
out_bit_depth 16
358360
out_valid_bit_depth 16
361+
out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256))]"
359362
}
360363
{
361364
out_rate $JACK_RATE
365+
out_channels $SDW_JACK_CAPTURE_CH
362366
out_bit_depth 32
363367
out_valid_bit_depth 24
368+
out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256))]"
364369
}
365370
{
366371
out_rate $JACK_RATE
372+
out_channels $SDW_JACK_CAPTURE_CH
367373
out_bit_depth 32
368374
out_valid_bit_depth 32
375+
out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256))]"
369376
}
370377
{
371378
out_rate $JACK_RATE
379+
out_channels $SDW_JACK_CAPTURE_CH
372380
out_bit_depth 32
373381
out_valid_bit_depth 32
374382
out_sample_type $SAMPLE_TYPE_FLOAT
383+
out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256))]"
375384
}
376385
{
377386
out_rate $JACK_RATE
387+
out_channels $SDW_JACK_CAPTURE_CH
378388
out_bit_depth 8
379389
out_valid_bit_depth 8
380390
out_sample_type $SAMPLE_TYPE_UNSIGNED_INTEGER
391+
out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256))]"
381392
}
382393
]
383394
}
@@ -386,18 +397,24 @@ Object.Pipeline.host-gateway-capture [
386397
Object.Base.output_audio_format [
387398
{
388399
out_rate $JACK_RATE
400+
out_channels $SDW_JACK_CAPTURE_CH
389401
out_bit_depth 16
390402
out_valid_bit_depth 16
403+
out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256))]"
391404
}
392405
{
393406
out_rate $JACK_RATE
407+
out_channels $SDW_JACK_CAPTURE_CH
394408
out_bit_depth 32
395409
out_valid_bit_depth 24
410+
out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256))]"
396411
}
397412
{
398413
out_rate $JACK_RATE
414+
out_channels $SDW_JACK_CAPTURE_CH
399415
out_bit_depth 32
400416
out_valid_bit_depth 32
417+
out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256))]"
401418
}
402419
]
403420
}
@@ -444,6 +461,7 @@ Object.Widget {
444461
Object.Base.input_audio_format [
445462
{
446463
in_rate $JACK_RATE
464+
in_channels $SDW_JACK_CAPTURE_CH
447465
in_bit_depth 32
448466
in_valid_bit_depth $SDW_LINK_VALID_BITS
449467
in_sample_type $SAMPLE_TYPE_MSB_INTEGER

0 commit comments

Comments
 (0)