From 112962b7acc2b53e6289d89db292eed47a019cb8 Mon Sep 17 00:00:00 2001 From: Rander Wang Date: Fri, 30 Aug 2019 09:47:45 +0800 Subject: [PATCH 1/2] alh: fix playback & capture issue with 16/24bit pipeline Now the sdw HW FIFO only accept 32bit sample, so force dai format to 32bit to let volume component do the conversion. Signed-off-by: Rander Wang --- src/audio/dai.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/audio/dai.c b/src/audio/dai.c index e39d5c89161c..e1c1fa3a18e5 100644 --- a/src/audio/dai.c +++ b/src/audio/dai.c @@ -676,6 +676,7 @@ static int dai_position(struct comp_dev *dev, struct sof_ipc_stream_posn *posn) static int dai_config(struct comp_dev *dev, struct sof_ipc_dai_config *config) { + struct sof_ipc_comp_config *dconfig = COMP_GET_CONFIG(dev); struct dai_data *dd = comp_get_drvdata(dev); int channel = 0; int i; @@ -774,6 +775,12 @@ static int dai_config(struct comp_dev *dev, struct sof_ipc_dai_config *config) */ dd->frame_bytes = 4; + /* SDW HW FIFO requires 32bit MSB aligned sample data for + * all formats, such as 8/16/24/32 bits. Now set frame_fmt + * to S32_LE to let volume component do the conversion. + */ + dconfig->frame_fmt = SOF_IPC_FRAME_S32_LE; + /* As with HDA, the DMA channel is assigned in runtime, * not during topology parsing. */ From 49b5506513f6b751f4839c325e7901494404c224 Mon Sep 17 00:00:00 2001 From: Rander Wang Date: Fri, 30 Aug 2019 09:52:30 +0800 Subject: [PATCH 2/2] topology: sdw: fix pulse audio timeout issue on sdw platform Pulse audio tests playback and capture simultaneously, and some boards can't support this bandwidth for two 32bit streams, So now change 32bit to 24bit to make life easier. Signed-off-by: Rander Wang --- tools/topology/sof-cml-rt700.m4 | 8 ++++---- tools/topology/sof-icl-rt700.m4 | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tools/topology/sof-cml-rt700.m4 b/tools/topology/sof-cml-rt700.m4 index 21c4bd1f3359..9b79cfc6cf5d 100644 --- a/tools/topology/sof-cml-rt700.m4 +++ b/tools/topology/sof-cml-rt700.m4 @@ -35,14 +35,14 @@ dnl frames, deadline, priority, core) # Low Latency playback pipeline 1 on PCM 0 using max 2 channels of s32le. # Schedule 48 frames per 1000us deadline on core 0 with priority 0 PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 1, 0, 2, s32le, + 1, 0, 2, s24le, 1000, 0, 0, 48000, 48000, 48000) # Low Latency capture pipeline 2 on PCM 1 using max 2 channels of s32le. # Schedule 48 frames per 1000us deadline on core 0 with priority 0 PIPELINE_PCM_ADD(sof/pipe-volume-capture.m4, - 2, 1, 2, s32le, + 2, 1, 2, s24le, 1000, 0, 0, 48000, 48000, 48000) @@ -73,14 +73,14 @@ dnl frames, deadline, priority, core) # Buffers use s32le format, with 48 frame per 1000us on core 0 with priority 0 DAI_ADD(sof/pipe-dai-playback.m4, 1, ALH, 0x102, SDW1-Playback, - PIPELINE_SOURCE_1, 2, s32le, + PIPELINE_SOURCE_1, 2, s24le, 1000, 0, 0) # capture DAI is ALH(SDW1 PIN3) using 2 periods # Buffers use s32le format, with 48 frame per 1000us on core 0 with priority 0 DAI_ADD(sof/pipe-dai-capture.m4, 2, ALH, 0x103, SDW1-Capture, - PIPELINE_SINK_2, 2, s32le, + PIPELINE_SINK_2, 2, s24le, 1000, 0, 0) # capture DAI is DMIC01 using 2 periods diff --git a/tools/topology/sof-icl-rt700.m4 b/tools/topology/sof-icl-rt700.m4 index a643b5d90d4c..6c4a50178bd2 100644 --- a/tools/topology/sof-icl-rt700.m4 +++ b/tools/topology/sof-icl-rt700.m4 @@ -35,14 +35,14 @@ dnl frames, deadline, priority, core) # Low Latency playback pipeline 1 on PCM 0 using max 2 channels of s32le. # Schedule 48 frames per 1000us deadline on core 0 with priority 0 PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 1, 0, 2, s32le, + 1, 0, 2, s24le, 1000, 0, 0, 48000, 48000, 48000) # Low Latency capture pipeline 2 on PCM 1 using max 2 channels of s32le. # Schedule 48 frames per 1000us deadline on core 0 with priority 0 PIPELINE_PCM_ADD(sof/pipe-volume-capture.m4, - 2, 1, 2, s32le, + 2, 1, 2, s24le, 1000, 0, 0, 48000, 48000, 48000) @@ -73,14 +73,14 @@ dnl frames, deadline, priority, core) # Buffers use s32le format, with 48 frame per 1000us on core 0 with priority 0 DAI_ADD(sof/pipe-dai-playback.m4, 1, ALH, 2, SDW0-Playback, - PIPELINE_SOURCE_1, 2, s32le, + PIPELINE_SOURCE_1, 2, s24le, 1000, 0, 0) # capture DAI is ALH(SDW0 PIN2) using 2 periods # Buffers use s32le format, with 48 frame per 1000us on core 0 with priority 0 DAI_ADD(sof/pipe-dai-capture.m4, 2, ALH, 3, SDW0-Capture, - PIPELINE_SINK_2, 2, s32le, + PIPELINE_SINK_2, 2, s24le, 1000, 0, 0) # capture DAI is DMIC01 using 2 periods