From ff9f7157af0000a777ba42426a4cf06bed94f220 Mon Sep 17 00:00:00 2001 From: Bard Liao Date: Mon, 23 Mar 2020 11:54:12 +0800 Subject: [PATCH 1/2] Topology: sof-icl-rt711-rt1308-rt715-hdmi: Use demux for platforms with multiple speakers We only need demux for two speaker dais case. Fixes: 5e8de9fd52e6 "topology: sof-icl-rt711-rt1308-rt715-hdmi: Merge two pipeline with demux" Signed-off-by: Bard Liao --- .../topology/sof-icl-rt711-rt1308-rt715-hdmi.m4 | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/tools/topology/sof-icl-rt711-rt1308-rt715-hdmi.m4 b/tools/topology/sof-icl-rt711-rt1308-rt715-hdmi.m4 index e8265820f2ac..0b80b46ed494 100644 --- a/tools/topology/sof-icl-rt711-rt1308-rt715-hdmi.m4 +++ b/tools/topology/sof-icl-rt711-rt1308-rt715-hdmi.m4 @@ -51,6 +51,16 @@ PIPELINE_PCM_ADD(sof/pipe-volume-capture.m4, 1000, 0, 0, 48000, 48000, 48000) +ifdef(`MONO', +` +# Low Latency playback pipeline 3 on PCM 2 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, + 3, 2, 2, s32le, + 1000, 0, 0, + 48000, 48000, 48000) +', +` # Low Latency playback pipeline 3 on PCM 2 using max 2 channels of s32le. # Schedule 48 frames per 1000us deadline on core 0 with priority 0 PIPELINE_PCM_ADD(sof/pipe-volume-demux-playback.m4, @@ -58,13 +68,13 @@ PIPELINE_PCM_ADD(sof/pipe-volume-demux-playback.m4, 1000, 0, 0, 48000, 48000, 48000) -ifdef(`MONO', `', -`# Low Latency playback pipeline 4 on PCM 3 using max 2 channels of s32le. +# Low Latency playback pipeline 4 on PCM 3 using max 2 channels of s32le. # Schedule 48 frames per 1000us deadline on core 0 with priority 0 PIPELINE_PCM_ADD(sof/pipe-dai-endpoint.m4, 4, 3, 2, s32le, 1000, 0, 0, - 48000, 48000, 48000)') + 48000, 48000, 48000) +') # Low Latency capture pipeline 5 on PCM 4 using max 2 channels of s32le. # Schedule 48 frames per 1000us deadline on core 0 with priority 0 From 3b6fd86e81b40fa6b6e8f0d073ff2c2ef4931ab9 Mon Sep 17 00:00:00 2001 From: Bard Liao Date: Wed, 11 Mar 2020 15:30:59 +0800 Subject: [PATCH 2/2] topology: sof-icl-rt711-rt1308-rt715-hdmi: define NO_AGGREGATION mode We will create individual PCM for each speaker when NO_AGGREGATION is defined Signed-off-by: Bard Liao --- .../sof-icl-rt711-rt1308-rt715-hdmi.m4 | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/tools/topology/sof-icl-rt711-rt1308-rt715-hdmi.m4 b/tools/topology/sof-icl-rt711-rt1308-rt715-hdmi.m4 index 0b80b46ed494..a60710b11a8f 100644 --- a/tools/topology/sof-icl-rt711-rt1308-rt715-hdmi.m4 +++ b/tools/topology/sof-icl-rt711-rt1308-rt715-hdmi.m4 @@ -63,14 +63,16 @@ PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, ` # Low Latency playback pipeline 3 on PCM 2 using max 2 channels of s32le. # Schedule 48 frames per 1000us deadline on core 0 with priority 0 -PIPELINE_PCM_ADD(sof/pipe-volume-demux-playback.m4, +PIPELINE_PCM_ADD(ifdef(`NO_AGGREGATION',`sof/pipe-volume-playback.m4', + `sof/pipe-volume-demux-playback.m4'), 3, 2, 2, s32le, 1000, 0, 0, 48000, 48000, 48000) # Low Latency playback pipeline 4 on PCM 3 using max 2 channels of s32le. # Schedule 48 frames per 1000us deadline on core 0 with priority 0 -PIPELINE_PCM_ADD(sof/pipe-dai-endpoint.m4, +PIPELINE_PCM_ADD(ifdef(`NO_AGGREGATION', `sof/pipe-volume-playback.m4', + `sof/pipe-dai-endpoint.m4'), 4, 3, 2, s32le, 1000, 0, 0, 48000, 48000, 48000) @@ -134,10 +136,15 @@ DAI_ADD(sof/pipe-dai-playback.m4, PIPELINE_SOURCE_3, 2, s24le, 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) -ifdef(`MONO', `', +ifdef(`NO_AGGREGATION', `# playback DAI is ALH(SDW2 PIN2) using 2 periods # Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD_SCHED(sof/pipe-dai-sched-playback.m4, +DAI_ADD(sof/pipe-dai-playback.m4, + 4, ALH, 0x202, SDW2-Playback, + PIPELINE_SOURCE_4, 2, s24le, + 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER)', +`ifdef(`MONO', `', +`DAI_ADD_SCHED(sof/pipe-dai-sched-playback.m4, 4, ALH, 0x202, SDW1-Playback, PIPELINE_SOURCE_4, 2, s24le, 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER, @@ -152,7 +159,7 @@ SectionGraph."PIPE_DEMUX" { dapm(PIPELINE_SOURCE_4, PIPELINE_DEMUX_3) ] } -') +')') # capture DAI is ALH(SDW3 PIN2) using 2 periods # Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 @@ -187,6 +194,7 @@ dnl PCM_PLAYBACK_ADD(name, pcm_id, playback) PCM_PLAYBACK_ADD(Headphone, 0, PIPELINE_PCM_1) PCM_CAPTURE_ADD(Headset mic, 1, PIPELINE_PCM_2) PCM_PLAYBACK_ADD(SDW1-speakers, 2, PIPELINE_PCM_3) +ifdef(`NO_AGGREGATION', `PCM_PLAYBACK_ADD(SDW2-speakers, 3, PIPELINE_PCM_4)',`') PCM_CAPTURE_ADD(Microphones, 4, PIPELINE_PCM_5) PCM_PLAYBACK_ADD(HDMI1, 5, PIPELINE_PCM_6) PCM_PLAYBACK_ADD(HDMI2, 6, PIPELINE_PCM_7) @@ -206,6 +214,11 @@ DAI_CONFIG(ALH, 3, 1, SDW0-Capture) #ALH SDW1 Pin2 (ID: 2) DAI_CONFIG(ALH, 0x102, 2, SDW1-Playback) +ifdef(`NO_AGGREGATION', +`#ALH SDW2 Pin2 (ID: 3) +DAI_CONFIG(ALH, 0x202, 3, SDW2-Playback)', +`') + #ALH SDW3 Pin2 (ID: 4) DAI_CONFIG(ALH, 0x302, 4, SDW3-Capture)