[Sound-open-firmware] [PATCH] topology: SRC: Use 4ms for topology scheduling and increase buffers
SRC should be scheduled on at least 4ms tick. Increase buffers to deal with 2 times output rate.
Signed-off-by: Liam Girdwood liam.r.girdwood@linux.intel.com --- topology/reef-bxt-nocodec.m4 | 10 +++++----- topology/reef-byt-nocodec.m4 | 4 ++-- topology/reef-byt-rt5640.m4 | 4 ++-- topology/reef-byt-rt5651.m4 | 4 ++-- topology/reef-cht-nocodec.m4 | 8 ++++---- topology/reef-hsw-rt5640.m4 | 10 +++++----- topology/sof/pipe-pcm-media.m4 | 10 ++++++---- 7 files changed, 26 insertions(+), 24 deletions(-)
diff --git a/topology/reef-bxt-nocodec.m4 b/topology/reef-bxt-nocodec.m4 index 2028323..486d4ea 100644 --- a/topology/reef-bxt-nocodec.m4 +++ b/topology/reef-bxt-nocodec.m4 @@ -40,14 +40,14 @@ PIPELINE_PCM_ADD(sof/pipe-low-latency-playback.m4, 1, 0, 2, s32le, 48, 1000, 0, PIPELINE_PCM_ADD(sof/pipe-low-latency-capture.m4, 2, 1, 2, s32le, 48, 1000, 0, 0, 0, 2)
# PCM Media Playback pipeline 3 on PCM 2 using max 2 channels of s32le. -# Schedule 96 frames per 2000us deadline on core 0 with priority 1 +# Schedule 192 frames per 4000us deadline on core 0 with priority 1 # Use DMAC 0 channel 3 for PCM audio playback data -PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 2, s32le, 96, 2000, 1, 0, 0, 3) +PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 2, s32le, 192, 4000, 1, 0, 0, 3)
# PCM Media Playback pipeline 4 on PCM 3 using max 2 channels of s32le. -# Schedule 96 frames per 2000us deadline on core 0 with priority 1 -# Use DMAC 0 channel 4 for PCM audio playback data -PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 4, 3, 2, s32le, 96, 2000, 1, 0, 0, 4) +# Schedule 192 frames per 4000us deadline on core 0 with priority 1 +# Use DMAC 0 channel 3 for PCM audio playback data +PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 2, s32le, 192, 4000, 1, 0, 0, 4)
# Tone Playback pipeline 5 using max 2 channels of s32le. # Schedule 192 frames per 4000us deadline on core 0 with priority 2 diff --git a/topology/reef-byt-nocodec.m4 b/topology/reef-byt-nocodec.m4 index 1c3cf5f..938666d 100644 --- a/topology/reef-byt-nocodec.m4 +++ b/topology/reef-byt-nocodec.m4 @@ -38,9 +38,9 @@ PIPELINE_PCM_ADD(sof/pipe-low-latency-playback.m4, 1, 0, 2, s32le, 48, 1000, 0, PIPELINE_PCM_ADD(sof/pipe-low-latency-capture.m4, 2, 1, 2, s32le, 48, 1000, 0, 0, 0, 2)
# PCM Media Playback pipeline 3 on PCM 2 using max 2 channels of s32le. -# Schedule 96 frames per 2000us deadline on core 0 with priority 1 +# Schedule 192 frames per 4000us deadline on core 0 with priority 1 # Use DMAC 0 channel 3 for PCM audio playback data -PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 2, s32le, 96, 2000, 1, 0, 0, 3) +PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 2, s32le, 192, 4000, 1, 0, 0, 3)
# Tone Playback pipeline 5 using max 2 channels of s32le. # Schedule 192 frames per 4000us deadline on core 0 with priority 2 diff --git a/topology/reef-byt-rt5640.m4 b/topology/reef-byt-rt5640.m4 index 9855f1a..05743e2 100644 --- a/topology/reef-byt-rt5640.m4 +++ b/topology/reef-byt-rt5640.m4 @@ -38,9 +38,9 @@ PIPELINE_PCM_ADD(sof/pipe-low-latency-playback.m4, 1, 0, 2, s32le, 48, 1000, 0, PIPELINE_PCM_ADD(sof/pipe-low-latency-capture.m4, 2, 1, 2, s32le, 48, 1000, 0, 0, 0, 2)
# PCM Media Playback pipeline 3 on PCM 2 using max 2 channels of s32le. -# Schedule 96 frames per 2000us deadline on core 0 with priority 1 +# Schedule 192 frames per 4000us deadline on core 0 with priority 1 # Use DMAC 0 channel 3 for PCM audio playback data -PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 2, s32le, 96, 2000, 1, 0, 0, 3) +PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 2, s32le, 192, 4000, 1, 0, 0, 3)
# Tone Playback pipeline 5 using max 2 channels of s32le. # Schedule 192 frames per 4000us deadline on core 0 with priority 2 diff --git a/topology/reef-byt-rt5651.m4 b/topology/reef-byt-rt5651.m4 index 1b492b7..cb9dcc2 100644 --- a/topology/reef-byt-rt5651.m4 +++ b/topology/reef-byt-rt5651.m4 @@ -38,9 +38,9 @@ PIPELINE_PCM_ADD(sof/pipe-low-latency-playback.m4, 1, 0, 2, s32le, 48, 1000, 0, PIPELINE_PCM_ADD(sof/pipe-low-latency-capture.m4, 2, 1, 2, s32le, 48, 1000, 0, 0, 0, 2)
# PCM Media Playback pipeline 3 on PCM 2 using max 2 channels of s32le. -# Schedule 96 frames per 2000us deadline on core 0 with priority 1 +# Schedule 192 frames per 4000us deadline on core 0 with priority 1 # Use DMAC 0 channel 3 for PCM audio playback data -PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 2, s32le, 96, 2000, 1, 0, 0, 3) +PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 2, s32le, 192, 4000, 1, 0, 0, 3)
# Tone Playback pipeline 5 using max 2 channels of s32le. # Schedule 192 frames per 4000us deadline on core 0 with priority 2 diff --git a/topology/reef-cht-nocodec.m4 b/topology/reef-cht-nocodec.m4 index ead0f75..52e8d50 100644 --- a/topology/reef-cht-nocodec.m4 +++ b/topology/reef-cht-nocodec.m4 @@ -37,10 +37,10 @@ PIPELINE_PCM_ADD(sof/pipe-low-latency-playback.m4, 1, 0, 2, s32le, 48, 1000, 0, # Use DMAC 0 channel 2 for PCM audio capture data PIPELINE_PCM_ADD(sof/pipe-low-latency-capture.m4, 2, 1, 2, s32le, 48, 1000, 0, 0, 0, 2)
-# PCM Media Playback pipeline 4 on PCM 3 using max 2 channels of s32le. -# Schedule 96 frames per 2000us deadline on core 0 with priority 1 -# Use DMAC 0 channel 4 for PCM audio playback data -PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 4, 3, 2, s32le, 96, 2000, 1, 0, 0, 4) +# PCM Media Playback pipeline 3 on PCM 2 using max 2 channels of s32le. +# Schedule 192 frames per 4000us deadline on core 0 with priority 1 +# Use DMAC 0 channel 3 for PCM audio playback data +PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 2, s32le, 192, 4000, 1, 0, 0, 3)
# Tone Playback pipeline 5 using max 2 channels of s32le. # Schedule 192 frames per 4000us deadline on core 0 with priority 2 diff --git a/topology/reef-hsw-rt5640.m4 b/topology/reef-hsw-rt5640.m4 index e4d9392..af18633 100644 --- a/topology/reef-hsw-rt5640.m4 +++ b/topology/reef-hsw-rt5640.m4 @@ -40,14 +40,14 @@ PIPELINE_PCM_ADD(sof/pipe-low-latency-playback.m4, 1, 0, 2, s32le, 48, 1000, 0, PIPELINE_PCM_ADD(sof/pipe-low-latency-capture.m4, 2, 1, 2, s32le, 48, 1000, 0, 0, 0, 2)
# PCM Media Playback pipeline 3 on PCM 2 using max 2 channels of s32le. -# Schedule 96 frames per 2000us deadline on core 0 with priority 1 +# Schedule 192 frames per 4000us deadline on core 0 with priority 1 # Use DMAC 0 channel 3 for PCM audio playback data -PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 2, s32le, 96, 2000, 1, 0, 0, 3) +PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 2, s32le, 192, 4000, 1, 0, 0, 3)
# PCM Media Playback pipeline 4 on PCM 3 using max 2 channels of s32le. -# Schedule 96 frames per 2000us deadline on core 0 with priority 1 -# Use DMAC 0 channel 4 for PCM audio playback data -PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 4, 3, 2, s32le, 96, 2000, 1, 0, 0, 4) +# Schedule 192 frames per 4000us deadline on core 0 with priority 1 +# Use DMAC 0 channel 3 for PCM audio playback data +PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 2, s32le, 192, 4000, 1, 0, 0, 4)
# Tone Playback pipeline 5 using max 2 channels of s32le. # Schedule 192 frames per 4000us deadline on core 0 with priority 2 diff --git a/topology/sof/pipe-pcm-media.m4 b/topology/sof/pipe-pcm-media.m4 index bde9dd2..97958cd 100644 --- a/topology/sof/pipe-pcm-media.m4 +++ b/topology/sof/pipe-pcm-media.m4 @@ -73,12 +73,14 @@ W_PGA(0, PCM PCM_ID Playback Volume, PIPELINE_FORMAT, 2, 2, 2) # "SRC 0" has 2 sink and source periods. W_SRC(0, PIPELINE_FORMAT, 2, 2, media_src_conf, 2)
-# Media Buffers -W_BUFFER(0, COMP_BUFFER_SIZE(2, +# Media Source Buffers to SRC, make them big enough to deal with 2 * rate. +W_BUFFER(0, COMP_BUFFER_SIZE(4, COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS, SCHEDULE_FRAMES)) -W_BUFFER(1,COMP_BUFFER_SIZE(2, +W_BUFFER(1,COMP_BUFFER_SIZE(4, COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS, SCHEDULE_FRAMES)) -W_BUFFER(2, COMP_BUFFER_SIZE(2, + +# Buffer B2 is on fixed rate sink side of SRC. Set it 1.5 * rate. +W_BUFFER(2, COMP_BUFFER_SIZE(3, COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS, SCHEDULE_FRAMES))
#
On 9/7/17 8:28 AM, Liam Girdwood wrote:
SRC should be scheduled on at least 4ms tick. Increase buffers to deal with 2 times output rate.
It's ok to increase buffer sizes to account for the varying sizes between input/output, but why would the scheduling be impacted? 4ms is a very large tick, this makes no sense to me.
Signed-off-by: Liam Girdwood liam.r.girdwood@linux.intel.com
topology/reef-bxt-nocodec.m4 | 10 +++++----- topology/reef-byt-nocodec.m4 | 4 ++-- topology/reef-byt-rt5640.m4 | 4 ++-- topology/reef-byt-rt5651.m4 | 4 ++-- topology/reef-cht-nocodec.m4 | 8 ++++---- topology/reef-hsw-rt5640.m4 | 10 +++++----- topology/sof/pipe-pcm-media.m4 | 10 ++++++---- 7 files changed, 26 insertions(+), 24 deletions(-)
diff --git a/topology/reef-bxt-nocodec.m4 b/topology/reef-bxt-nocodec.m4 index 2028323..486d4ea 100644 --- a/topology/reef-bxt-nocodec.m4 +++ b/topology/reef-bxt-nocodec.m4 @@ -40,14 +40,14 @@ PIPELINE_PCM_ADD(sof/pipe-low-latency-playback.m4, 1, 0, 2, s32le, 48, 1000, 0, PIPELINE_PCM_ADD(sof/pipe-low-latency-capture.m4, 2, 1, 2, s32le, 48, 1000, 0, 0, 0, 2)
# PCM Media Playback pipeline 3 on PCM 2 using max 2 channels of s32le. -# Schedule 96 frames per 2000us deadline on core 0 with priority 1 +# Schedule 192 frames per 4000us deadline on core 0 with priority 1 # Use DMAC 0 channel 3 for PCM audio playback data -PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 2, s32le, 96, 2000, 1, 0, 0, 3) +PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 2, s32le, 192, 4000, 1, 0, 0, 3)
# PCM Media Playback pipeline 4 on PCM 3 using max 2 channels of s32le. -# Schedule 96 frames per 2000us deadline on core 0 with priority 1 -# Use DMAC 0 channel 4 for PCM audio playback data -PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 4, 3, 2, s32le, 96, 2000, 1, 0, 0, 4) +# Schedule 192 frames per 4000us deadline on core 0 with priority 1 +# Use DMAC 0 channel 3 for PCM audio playback data +PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 2, s32le, 192, 4000, 1, 0, 0, 4)
# Tone Playback pipeline 5 using max 2 channels of s32le. # Schedule 192 frames per 4000us deadline on core 0 with priority 2 diff --git a/topology/reef-byt-nocodec.m4 b/topology/reef-byt-nocodec.m4 index 1c3cf5f..938666d 100644 --- a/topology/reef-byt-nocodec.m4 +++ b/topology/reef-byt-nocodec.m4 @@ -38,9 +38,9 @@ PIPELINE_PCM_ADD(sof/pipe-low-latency-playback.m4, 1, 0, 2, s32le, 48, 1000, 0, PIPELINE_PCM_ADD(sof/pipe-low-latency-capture.m4, 2, 1, 2, s32le, 48, 1000, 0, 0, 0, 2)
# PCM Media Playback pipeline 3 on PCM 2 using max 2 channels of s32le. -# Schedule 96 frames per 2000us deadline on core 0 with priority 1 +# Schedule 192 frames per 4000us deadline on core 0 with priority 1 # Use DMAC 0 channel 3 for PCM audio playback data -PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 2, s32le, 96, 2000, 1, 0, 0, 3) +PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 2, s32le, 192, 4000, 1, 0, 0, 3)
# Tone Playback pipeline 5 using max 2 channels of s32le. # Schedule 192 frames per 4000us deadline on core 0 with priority 2 diff --git a/topology/reef-byt-rt5640.m4 b/topology/reef-byt-rt5640.m4 index 9855f1a..05743e2 100644 --- a/topology/reef-byt-rt5640.m4 +++ b/topology/reef-byt-rt5640.m4 @@ -38,9 +38,9 @@ PIPELINE_PCM_ADD(sof/pipe-low-latency-playback.m4, 1, 0, 2, s32le, 48, 1000, 0, PIPELINE_PCM_ADD(sof/pipe-low-latency-capture.m4, 2, 1, 2, s32le, 48, 1000, 0, 0, 0, 2)
# PCM Media Playback pipeline 3 on PCM 2 using max 2 channels of s32le. -# Schedule 96 frames per 2000us deadline on core 0 with priority 1 +# Schedule 192 frames per 4000us deadline on core 0 with priority 1 # Use DMAC 0 channel 3 for PCM audio playback data -PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 2, s32le, 96, 2000, 1, 0, 0, 3) +PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 2, s32le, 192, 4000, 1, 0, 0, 3)
# Tone Playback pipeline 5 using max 2 channels of s32le. # Schedule 192 frames per 4000us deadline on core 0 with priority 2 diff --git a/topology/reef-byt-rt5651.m4 b/topology/reef-byt-rt5651.m4 index 1b492b7..cb9dcc2 100644 --- a/topology/reef-byt-rt5651.m4 +++ b/topology/reef-byt-rt5651.m4 @@ -38,9 +38,9 @@ PIPELINE_PCM_ADD(sof/pipe-low-latency-playback.m4, 1, 0, 2, s32le, 48, 1000, 0, PIPELINE_PCM_ADD(sof/pipe-low-latency-capture.m4, 2, 1, 2, s32le, 48, 1000, 0, 0, 0, 2)
# PCM Media Playback pipeline 3 on PCM 2 using max 2 channels of s32le. -# Schedule 96 frames per 2000us deadline on core 0 with priority 1 +# Schedule 192 frames per 4000us deadline on core 0 with priority 1 # Use DMAC 0 channel 3 for PCM audio playback data -PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 2, s32le, 96, 2000, 1, 0, 0, 3) +PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 2, s32le, 192, 4000, 1, 0, 0, 3)
# Tone Playback pipeline 5 using max 2 channels of s32le. # Schedule 192 frames per 4000us deadline on core 0 with priority 2 diff --git a/topology/reef-cht-nocodec.m4 b/topology/reef-cht-nocodec.m4 index ead0f75..52e8d50 100644 --- a/topology/reef-cht-nocodec.m4 +++ b/topology/reef-cht-nocodec.m4 @@ -37,10 +37,10 @@ PIPELINE_PCM_ADD(sof/pipe-low-latency-playback.m4, 1, 0, 2, s32le, 48, 1000, 0, # Use DMAC 0 channel 2 for PCM audio capture data PIPELINE_PCM_ADD(sof/pipe-low-latency-capture.m4, 2, 1, 2, s32le, 48, 1000, 0, 0, 0, 2)
-# PCM Media Playback pipeline 4 on PCM 3 using max 2 channels of s32le. -# Schedule 96 frames per 2000us deadline on core 0 with priority 1 -# Use DMAC 0 channel 4 for PCM audio playback data -PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 4, 3, 2, s32le, 96, 2000, 1, 0, 0, 4) +# PCM Media Playback pipeline 3 on PCM 2 using max 2 channels of s32le. +# Schedule 192 frames per 4000us deadline on core 0 with priority 1 +# Use DMAC 0 channel 3 for PCM audio playback data +PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 2, s32le, 192, 4000, 1, 0, 0, 3)
# Tone Playback pipeline 5 using max 2 channels of s32le. # Schedule 192 frames per 4000us deadline on core 0 with priority 2 diff --git a/topology/reef-hsw-rt5640.m4 b/topology/reef-hsw-rt5640.m4 index e4d9392..af18633 100644 --- a/topology/reef-hsw-rt5640.m4 +++ b/topology/reef-hsw-rt5640.m4 @@ -40,14 +40,14 @@ PIPELINE_PCM_ADD(sof/pipe-low-latency-playback.m4, 1, 0, 2, s32le, 48, 1000, 0, PIPELINE_PCM_ADD(sof/pipe-low-latency-capture.m4, 2, 1, 2, s32le, 48, 1000, 0, 0, 0, 2)
# PCM Media Playback pipeline 3 on PCM 2 using max 2 channels of s32le. -# Schedule 96 frames per 2000us deadline on core 0 with priority 1 +# Schedule 192 frames per 4000us deadline on core 0 with priority 1 # Use DMAC 0 channel 3 for PCM audio playback data -PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 2, s32le, 96, 2000, 1, 0, 0, 3) +PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 2, s32le, 192, 4000, 1, 0, 0, 3)
# PCM Media Playback pipeline 4 on PCM 3 using max 2 channels of s32le. -# Schedule 96 frames per 2000us deadline on core 0 with priority 1 -# Use DMAC 0 channel 4 for PCM audio playback data -PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 4, 3, 2, s32le, 96, 2000, 1, 0, 0, 4) +# Schedule 192 frames per 4000us deadline on core 0 with priority 1 +# Use DMAC 0 channel 3 for PCM audio playback data +PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 2, s32le, 192, 4000, 1, 0, 0, 4)
# Tone Playback pipeline 5 using max 2 channels of s32le. # Schedule 192 frames per 4000us deadline on core 0 with priority 2 diff --git a/topology/sof/pipe-pcm-media.m4 b/topology/sof/pipe-pcm-media.m4 index bde9dd2..97958cd 100644 --- a/topology/sof/pipe-pcm-media.m4 +++ b/topology/sof/pipe-pcm-media.m4 @@ -73,12 +73,14 @@ W_PGA(0, PCM PCM_ID Playback Volume, PIPELINE_FORMAT, 2, 2, 2) # "SRC 0" has 2 sink and source periods. W_SRC(0, PIPELINE_FORMAT, 2, 2, media_src_conf, 2)
-# Media Buffers -W_BUFFER(0, COMP_BUFFER_SIZE(2, +# Media Source Buffers to SRC, make them big enough to deal with 2 * rate. +W_BUFFER(0, COMP_BUFFER_SIZE(4, COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS, SCHEDULE_FRAMES)) -W_BUFFER(1,COMP_BUFFER_SIZE(2, +W_BUFFER(1,COMP_BUFFER_SIZE(4, COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS, SCHEDULE_FRAMES)) -W_BUFFER(2, COMP_BUFFER_SIZE(2,
+# Buffer B2 is on fixed rate sink side of SRC. Set it 1.5 * rate. +W_BUFFER(2, COMP_BUFFER_SIZE(3, COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS, SCHEDULE_FRAMES))
#
On 07.09.2017 19:17, Pierre-Louis Bossart wrote:
On 9/7/17 8:28 AM, Liam Girdwood wrote:
SRC should be scheduled on at least 4ms tick. Increase buffers to deal with 2 times output rate.
It's ok to increase buffer sizes to account for the varying sizes between input/output, but why would the scheduling be impacted? 4ms is a very large tick, this makes no sense to me.
Yes, you are right that the scheduling for this pipeline could be kept 2 ms while buffer size would be increased to fit the SRC output block size. For 44.1 kHz to 48 kHz conversion the SRC produces 160 samples blocks at 48 kHz side every ~3.3ms. This change can be restored after the configuration errors check code in SRC params() is improved. I will work with that.
Thanks, Seppo
Signed-off-by: Liam Girdwood liam.r.girdwood@linux.intel.com
topology/reef-bxt-nocodec.m4 | 10 +++++----- topology/reef-byt-nocodec.m4 | 4 ++-- topology/reef-byt-rt5640.m4 | 4 ++-- topology/reef-byt-rt5651.m4 | 4 ++-- topology/reef-cht-nocodec.m4 | 8 ++++---- topology/reef-hsw-rt5640.m4 | 10 +++++----- topology/sof/pipe-pcm-media.m4 | 10 ++++++---- 7 files changed, 26 insertions(+), 24 deletions(-)
diff --git a/topology/reef-bxt-nocodec.m4 b/topology/reef-bxt-nocodec.m4 index 2028323..486d4ea 100644 --- a/topology/reef-bxt-nocodec.m4 +++ b/topology/reef-bxt-nocodec.m4 @@ -40,14 +40,14 @@ PIPELINE_PCM_ADD(sof/pipe-low-latency-playback.m4, 1, 0, 2, s32le, 48, 1000, 0, PIPELINE_PCM_ADD(sof/pipe-low-latency-capture.m4, 2, 1, 2, s32le, 48, 1000, 0, 0, 0, 2) # PCM Media Playback pipeline 3 on PCM 2 using max 2 channels of s32le. -# Schedule 96 frames per 2000us deadline on core 0 with priority 1 +# Schedule 192 frames per 4000us deadline on core 0 with priority 1 # Use DMAC 0 channel 3 for PCM audio playback data -PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 2, s32le, 96, 2000, 1, 0, 0, 3) +PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 2, s32le, 192, 4000, 1, 0, 0, 3) # PCM Media Playback pipeline 4 on PCM 3 using max 2 channels of s32le. -# Schedule 96 frames per 2000us deadline on core 0 with priority 1 -# Use DMAC 0 channel 4 for PCM audio playback data -PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 4, 3, 2, s32le, 96, 2000, 1, 0, 0, 4) +# Schedule 192 frames per 4000us deadline on core 0 with priority 1 +# Use DMAC 0 channel 3 for PCM audio playback data +PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 2, s32le, 192, 4000, 1, 0, 0, 4) # Tone Playback pipeline 5 using max 2 channels of s32le. # Schedule 192 frames per 4000us deadline on core 0 with priority 2 diff --git a/topology/reef-byt-nocodec.m4 b/topology/reef-byt-nocodec.m4 index 1c3cf5f..938666d 100644 --- a/topology/reef-byt-nocodec.m4 +++ b/topology/reef-byt-nocodec.m4 @@ -38,9 +38,9 @@ PIPELINE_PCM_ADD(sof/pipe-low-latency-playback.m4, 1, 0, 2, s32le, 48, 1000, 0, PIPELINE_PCM_ADD(sof/pipe-low-latency-capture.m4, 2, 1, 2, s32le, 48, 1000, 0, 0, 0, 2) # PCM Media Playback pipeline 3 on PCM 2 using max 2 channels of s32le. -# Schedule 96 frames per 2000us deadline on core 0 with priority 1 +# Schedule 192 frames per 4000us deadline on core 0 with priority 1 # Use DMAC 0 channel 3 for PCM audio playback data -PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 2, s32le, 96, 2000, 1, 0, 0, 3) +PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 2, s32le, 192, 4000, 1, 0, 0, 3) # Tone Playback pipeline 5 using max 2 channels of s32le. # Schedule 192 frames per 4000us deadline on core 0 with priority 2 diff --git a/topology/reef-byt-rt5640.m4 b/topology/reef-byt-rt5640.m4 index 9855f1a..05743e2 100644 --- a/topology/reef-byt-rt5640.m4 +++ b/topology/reef-byt-rt5640.m4 @@ -38,9 +38,9 @@ PIPELINE_PCM_ADD(sof/pipe-low-latency-playback.m4, 1, 0, 2, s32le, 48, 1000, 0, PIPELINE_PCM_ADD(sof/pipe-low-latency-capture.m4, 2, 1, 2, s32le, 48, 1000, 0, 0, 0, 2) # PCM Media Playback pipeline 3 on PCM 2 using max 2 channels of s32le. -# Schedule 96 frames per 2000us deadline on core 0 with priority 1 +# Schedule 192 frames per 4000us deadline on core 0 with priority 1 # Use DMAC 0 channel 3 for PCM audio playback data -PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 2, s32le, 96, 2000, 1, 0, 0, 3) +PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 2, s32le, 192, 4000, 1, 0, 0, 3) # Tone Playback pipeline 5 using max 2 channels of s32le. # Schedule 192 frames per 4000us deadline on core 0 with priority 2 diff --git a/topology/reef-byt-rt5651.m4 b/topology/reef-byt-rt5651.m4 index 1b492b7..cb9dcc2 100644 --- a/topology/reef-byt-rt5651.m4 +++ b/topology/reef-byt-rt5651.m4 @@ -38,9 +38,9 @@ PIPELINE_PCM_ADD(sof/pipe-low-latency-playback.m4, 1, 0, 2, s32le, 48, 1000, 0, PIPELINE_PCM_ADD(sof/pipe-low-latency-capture.m4, 2, 1, 2, s32le, 48, 1000, 0, 0, 0, 2) # PCM Media Playback pipeline 3 on PCM 2 using max 2 channels of s32le. -# Schedule 96 frames per 2000us deadline on core 0 with priority 1 +# Schedule 192 frames per 4000us deadline on core 0 with priority 1 # Use DMAC 0 channel 3 for PCM audio playback data -PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 2, s32le, 96, 2000, 1, 0, 0, 3) +PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 2, s32le, 192, 4000, 1, 0, 0, 3) # Tone Playback pipeline 5 using max 2 channels of s32le. # Schedule 192 frames per 4000us deadline on core 0 with priority 2 diff --git a/topology/reef-cht-nocodec.m4 b/topology/reef-cht-nocodec.m4 index ead0f75..52e8d50 100644 --- a/topology/reef-cht-nocodec.m4 +++ b/topology/reef-cht-nocodec.m4 @@ -37,10 +37,10 @@ PIPELINE_PCM_ADD(sof/pipe-low-latency-playback.m4, 1, 0, 2, s32le, 48, 1000, 0, # Use DMAC 0 channel 2 for PCM audio capture data PIPELINE_PCM_ADD(sof/pipe-low-latency-capture.m4, 2, 1, 2, s32le, 48, 1000, 0, 0, 0, 2) -# PCM Media Playback pipeline 4 on PCM 3 using max 2 channels of s32le. -# Schedule 96 frames per 2000us deadline on core 0 with priority 1 -# Use DMAC 0 channel 4 for PCM audio playback data -PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 4, 3, 2, s32le, 96, 2000, 1, 0, 0, 4) +# PCM Media Playback pipeline 3 on PCM 2 using max 2 channels of s32le. +# Schedule 192 frames per 4000us deadline on core 0 with priority 1 +# Use DMAC 0 channel 3 for PCM audio playback data +PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 2, s32le, 192, 4000, 1, 0, 0, 3) # Tone Playback pipeline 5 using max 2 channels of s32le. # Schedule 192 frames per 4000us deadline on core 0 with priority 2 diff --git a/topology/reef-hsw-rt5640.m4 b/topology/reef-hsw-rt5640.m4 index e4d9392..af18633 100644 --- a/topology/reef-hsw-rt5640.m4 +++ b/topology/reef-hsw-rt5640.m4 @@ -40,14 +40,14 @@ PIPELINE_PCM_ADD(sof/pipe-low-latency-playback.m4, 1, 0, 2, s32le, 48, 1000, 0, PIPELINE_PCM_ADD(sof/pipe-low-latency-capture.m4, 2, 1, 2, s32le, 48, 1000, 0, 0, 0, 2) # PCM Media Playback pipeline 3 on PCM 2 using max 2 channels of s32le. -# Schedule 96 frames per 2000us deadline on core 0 with priority 1 +# Schedule 192 frames per 4000us deadline on core 0 with priority 1 # Use DMAC 0 channel 3 for PCM audio playback data -PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 2, s32le, 96, 2000, 1, 0, 0, 3) +PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 2, s32le, 192, 4000, 1, 0, 0, 3) # PCM Media Playback pipeline 4 on PCM 3 using max 2 channels of s32le. -# Schedule 96 frames per 2000us deadline on core 0 with priority 1 -# Use DMAC 0 channel 4 for PCM audio playback data -PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 4, 3, 2, s32le, 96, 2000, 1, 0, 0, 4) +# Schedule 192 frames per 4000us deadline on core 0 with priority 1 +# Use DMAC 0 channel 3 for PCM audio playback data +PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 2, s32le, 192, 4000, 1, 0, 0, 4) # Tone Playback pipeline 5 using max 2 channels of s32le. # Schedule 192 frames per 4000us deadline on core 0 with priority 2 diff --git a/topology/sof/pipe-pcm-media.m4 b/topology/sof/pipe-pcm-media.m4 index bde9dd2..97958cd 100644 --- a/topology/sof/pipe-pcm-media.m4 +++ b/topology/sof/pipe-pcm-media.m4 @@ -73,12 +73,14 @@ W_PGA(0, PCM PCM_ID Playback Volume, PIPELINE_FORMAT, 2, 2, 2) # "SRC 0" has 2 sink and source periods. W_SRC(0, PIPELINE_FORMAT, 2, 2, media_src_conf, 2) -# Media Buffers -W_BUFFER(0, COMP_BUFFER_SIZE(2, +# Media Source Buffers to SRC, make them big enough to deal with 2 * rate. +W_BUFFER(0, COMP_BUFFER_SIZE(4, COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS, SCHEDULE_FRAMES)) -W_BUFFER(1,COMP_BUFFER_SIZE(2, +W_BUFFER(1,COMP_BUFFER_SIZE(4, COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS, SCHEDULE_FRAMES)) -W_BUFFER(2, COMP_BUFFER_SIZE(2,
+# Buffer B2 is on fixed rate sink side of SRC. Set it 1.5 * rate. +W_BUFFER(2, COMP_BUFFER_SIZE(3, COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS, SCHEDULE_FRAMES)) #
Sound-open-firmware mailing list Sound-open-firmware@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/sound-open-firmware
On 9/8/17 1:37 AM, Seppo Ingalsuo wrote:
On 07.09.2017 19:17, Pierre-Louis Bossart wrote:
On 9/7/17 8:28 AM, Liam Girdwood wrote:
SRC should be scheduled on at least 4ms tick. Increase buffers to deal with 2 times output rate.
It's ok to increase buffer sizes to account for the varying sizes between input/output, but why would the scheduling be impacted? 4ms is a very large tick, this makes no sense to me.
Yes, you are right that the scheduling for this pipeline could be kept 2 ms while buffer size would be increased to fit the SRC output block size. For 44.1 kHz to 48 kHz conversion the SRC produces 160 samples blocks at 48 kHz side every ~3.3ms. This change can be restored after the configuration errors check code in SRC params() is improved. I will work with that.
temporary fixes are just fine. I was just trying to figure out if there is a minimum block or scheduling assumption here. I probably need more coffee this morning but does the implementation wait for 147 input samples to be available before being able to generate an output so as to have predictable scheduling? if we tolerated more variability on the number of cycles, could we not reduce this block size?
On 08.09.2017 17:48, Pierre-Louis Bossart wrote:
On 9/8/17 1:37 AM, Seppo Ingalsuo wrote:
On 07.09.2017 19:17, Pierre-Louis Bossart wrote:
On 9/7/17 8:28 AM, Liam Girdwood wrote:
SRC should be scheduled on at least 4ms tick. Increase buffers to deal with 2 times output rate.
It's ok to increase buffer sizes to account for the varying sizes between input/output, but why would the scheduling be impacted? 4ms is a very large tick, this makes no sense to me.
Yes, you are right that the scheduling for this pipeline could be kept 2 ms while buffer size would be increased to fit the SRC output block size. For 44.1 kHz to 48 kHz conversion the SRC produces 160 samples blocks at 48 kHz side every ~3.3ms. This change can be restored after the configuration errors check code in SRC params() is improved. I will work with that.
temporary fixes are just fine. I was just trying to figure out if there is a minimum block or scheduling assumption here. I probably need more coffee this morning but does the implementation wait for 147 input samples to be available before being able to generate an output so as to have predictable scheduling? if we tolerated more variability on the number of cycles, could we not reduce this block size?
The current SRC implementation is such that it executes the whole polyphase filter matrix in a single run when sufficient amount of data is available. That simplifies filter core and improves computation performance with avoiding of control code but it increases latency.
That may need be revisited (it's not that complicated but the jitter in number of samples in/out happens - it shouldn't be an issue for SOF) since for 11025 Hz to 48 kHz the used fraction is 640/147. It would cause much longer buffers need and delay.
In 48 kHz family fractional conversions with easier fractions the min. buffer needs are much shorter. It might be useful to make two variants of filters core.
Sound-open-firmware mailing list Sound-open-firmware@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/sound-open-firmware
On 09/08/2017 01:01 PM, Seppo Ingalsuo wrote:
On 08.09.2017 17:48, Pierre-Louis Bossart wrote:
On 9/8/17 1:37 AM, Seppo Ingalsuo wrote:
On 07.09.2017 19:17, Pierre-Louis Bossart wrote:
On 9/7/17 8:28 AM, Liam Girdwood wrote:
SRC should be scheduled on at least 4ms tick. Increase buffers to deal with 2 times output rate.
It's ok to increase buffer sizes to account for the varying sizes between input/output, but why would the scheduling be impacted? 4ms is a very large tick, this makes no sense to me.
Yes, you are right that the scheduling for this pipeline could be kept 2 ms while buffer size would be increased to fit the SRC output block size. For 44.1 kHz to 48 kHz conversion the SRC produces 160 samples blocks at 48 kHz side every ~3.3ms. This change can be restored after the configuration errors check code in SRC params() is improved. I will work with that.
temporary fixes are just fine. I was just trying to figure out if there is a minimum block or scheduling assumption here. I probably need more coffee this morning but does the implementation wait for 147 input samples to be available before being able to generate an output so as to have predictable scheduling? if we tolerated more variability on the number of cycles, could we not reduce this block size?
The current SRC implementation is such that it executes the whole polyphase filter matrix in a single run when sufficient amount of data is available. That simplifies filter core and improves computation performance with avoiding of control code but it increases latency.
That may need be revisited (it's not that complicated but the jitter in number of samples in/out happens - it shouldn't be an issue for SOF) since for 11025 Hz to 48 kHz the used fraction is 640/147. It would cause much longer buffers need and delay.
In 48 kHz family fractional conversions with easier fractions the min. buffer needs are much shorter. It might be useful to make two variants of filters core.
For the 48khz and integer resampling, why do we even have a min buffer? Apart from the downsampling case where you need N samples before being able to generate a new one, for upsampling you could work at the sample level. If you push the input into a delay line and work from there you are good to go. what am I missing?
On 08.09.2017 21:29, Pierre-Louis Bossart wrote:
On 09/08/2017 01:01 PM, Seppo Ingalsuo wrote:
On 08.09.2017 17:48, Pierre-Louis Bossart wrote:
On 9/8/17 1:37 AM, Seppo Ingalsuo wrote:
On 07.09.2017 19:17, Pierre-Louis Bossart wrote:
On 9/7/17 8:28 AM, Liam Girdwood wrote:
SRC should be scheduled on at least 4ms tick. Increase buffers to deal with 2 times output rate.
It's ok to increase buffer sizes to account for the varying sizes between input/output, but why would the scheduling be impacted? 4ms is a very large tick, this makes no sense to me.
Yes, you are right that the scheduling for this pipeline could be kept 2 ms while buffer size would be increased to fit the SRC output block size. For 44.1 kHz to 48 kHz conversion the SRC produces 160 samples blocks at 48 kHz side every ~3.3ms. This change can be restored after the configuration errors check code in SRC params() is improved. I will work with that.
temporary fixes are just fine. I was just trying to figure out if there is a minimum block or scheduling assumption here. I probably need more coffee this morning but does the implementation wait for 147 input samples to be available before being able to generate an output so as to have predictable scheduling? if we tolerated more variability on the number of cycles, could we not reduce this block size?
The current SRC implementation is such that it executes the whole polyphase filter matrix in a single run when sufficient amount of data is available. That simplifies filter core and improves computation performance with avoiding of control code but it increases latency.
That may need be revisited (it's not that complicated but the jitter in number of samples in/out happens - it shouldn't be an issue for SOF) since for 11025 Hz to 48 kHz the used fraction is 640/147. It would cause much longer buffers need and delay.
In 48 kHz family fractional conversions with easier fractions the min. buffer needs are much shorter. It might be useful to make two variants of filters core.
For the 48khz and integer resampling, why do we even have a min buffer? Apart from the downsampling case where you need N samples before being able to generate a new one, for upsampling you could work at the sample level. If you push the input into a delay line and work from there you are good to go. what am I missing?
There are some easy fractional conversions like 32 <-> 48 (3/2) and 48 <-> 64 kHz (3/4). For simplest 1/N or N/1 conversion there's no framing delay for the side that produces or consumes single samples.
Sound-open-firmware mailing list Sound-open-firmware@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/sound-open-firmware
On Thu, 2017-09-07 at 11:17 -0500, Pierre-Louis Bossart wrote:
On 9/7/17 8:28 AM, Liam Girdwood wrote:
SRC should be scheduled on at least 4ms tick. Increase buffers to deal with 2 times output rate.
It's ok to increase buffer sizes to account for the varying sizes between input/output, but why would the scheduling be impacted? 4ms is a very large tick, this makes no sense to me.
Sorry, It's temporary integration setting until we can fine tune it.
Liam
participants (3)
-
Liam Girdwood
-
Pierre-Louis Bossart
-
Seppo Ingalsuo