mailman.alsa-project.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

Sound-open-firmware

Thread Start a new thread
Download
Threads by month
  • ----- 2025 -----
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2021 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2020 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2019 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2018 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2017 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2016 -----
  • December
  • November
  • October
sound-open-firmware@alsa-project.org

  • 4 participants
  • 1576 discussions
[Sound-open-firmware] [PATCH] topology: SRC: Use 4ms for topology scheduling and increase buffers
by Liam Girdwood 11 Sep '17

11 Sep '17
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(a)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)) # -- 2.11.0
3 7
0 0
[Sound-open-firmware] [PATCH] topology: SRC testing passthrough pipeline.
by Liam Girdwood 11 Sep '17

11 Sep '17
The testing pipline for 24 bit SRC 48kHz output. Signed-off-by: Liam Girdwood <liam.r.girdwood(a)linux.intel.com> --- topology/sof/pipe-passthrough-src-playback.m4 | 109 ++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 topology/sof/pipe-passthrough-src-playback.m4 diff --git a/topology/sof/pipe-passthrough-src-playback.m4 b/topology/sof/pipe-passthrough-src-playback.m4 new file mode 100644 index 0000000..0ffc2a4 --- /dev/null +++ b/topology/sof/pipe-passthrough-src-playback.m4 @@ -0,0 +1,109 @@ +# Low Latency Passthrough with volume Pipeline and PCM +# +# Pipeline Endpoints for connection are :- +# +# host PCM_P --> SRC --> sink DAI0 + +# Include topology builder +include(`local.m4') + + +# +# Components and Buffers +# + +# Host "Passthrough Playback" PCM uses pipeline DMAC and channel +# with 4 sink and 0 source periods +W_PCM_PLAYBACK(Passthrough Playback, PIPELINE_DMAC, PIPELINE_DMAC_CHAN, 4, 0, 2) + +# +# SRC Configuration +# + +SectionVendorTuples."media_src_tokens" { + tokens "sof_src_tokens" + + tuples."word" { + SOF_TKN_SRC_RATE_OUT "48000" + } +} + +SectionData."media_src_conf" { + tuples "media_src_tokens" +} + +# "SRC" has 4 source and 4 sink periods +W_SRC(0, PIPELINE_FORMAT, 4, 4, media_src_conf, 2) + +# Playback Buffers +W_BUFFER(0, COMP_BUFFER_SIZE(4, + COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS, SCHEDULE_FRAMES)) +W_BUFFER(1, COMP_BUFFER_SIZE(4, + COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS, SCHEDULE_FRAMES)) + +# +# DAI definitions +# +W_DAI_OUT(DAI_SNAME, DAI_TYPE, DAI_INDEX, DAI_FORMAT, 0, DAI_PERIODS, + DAI_PERIODS, dai0p_plat_conf) + +# +# DAI pipeline +# +W_PIPELINE(N_DAI_OUT, SCHEDULE_DEADLINE, SCHEDULE_PRIORITY, SCHEDULE_FRAMES, + SCHEDULE_CORE, 0, pipe_dai_schedule_plat) + +# +# Pipeline Graph +# +# host PCM_P --> B0 --> SRC 0 --> B1 --> sink DAI0 + +SectionGraph."pipe-pass-src-playback-PIPELINE_ID" { + index STR(PIPELINE_ID) + + lines [ + dapm(N_PCM, Passthrough Playback PCM_ID) + dapm(N_BUFFER(0), N_PCM) + dapm(N_SRC(0), N_BUFFER(0)) + dapm(N_BUFFER(1), N_SRC(0)) + dapm(N_DAI_OUT, N_BUFFER(1)) + ] +} + + +# +# PCM Configuration +# + +SectionPCMCapabilities.STR(Passthrough Playback PCM_ID) { + + formats "S32_LE,S24_LE,S16_LE" + rate_min "8000" + rate_max "96000" + channels_min "2" + channels_max "4" + periods_min "2" + periods_max "16" + period_size_min "192" + period_size_max "16384" + buffer_size_min "65536" + buffer_size_max "65536" +} + +# PCM Passthrough Playback +SectionPCM.STR(PCM PCM_ID) { + + index STR(PIPELINE_ID) + + # used for binding to the PCM + id STR(PCM_ID) + + dai.STR(Passthrough Playback PCM_ID) { + id STR(PCM_ID) + } + + pcm."playback" { + + capabilities STR(Passthrough Playback PCM_ID) + } +} -- 2.11.0
1 0
0 0
[Sound-open-firmware] [PATCH] topology: Add support for DAI pipeline ID config
by Liam Girdwood 11 Sep '17

11 Sep '17
Allow topology to configure the pipeline ID of any DAI specific pipeline instead of using 0. Signed-off-by: Liam Girdwood <liam.r.girdwood(a)linux.intel.com> --- topology/m4/build.m4 | 26 +++++++++++++------------- topology/reef-apl-nocodec.m4 | 4 ++-- topology/reef-bdw-rt286.m4 | 4 ++-- topology/reef-bdw-rt5640.m4 | 4 ++-- topology/reef-bxt-nocodec.m4 | 4 ++-- topology/reef-byt-nocodec.m4 | 4 ++-- topology/reef-byt-rt5640.m4 | 4 ++-- topology/reef-byt-rt5651.m4 | 4 ++-- topology/reef-cht-nocodec.m4 | 4 ++-- topology/reef-hsw-rt5640.m4 | 4 ++-- 10 files changed, 31 insertions(+), 31 deletions(-) diff --git a/topology/m4/build.m4 b/topology/m4/build.m4 index 7d248da..273e6b4 100644 --- a/topology/m4/build.m4 +++ b/topology/m4/build.m4 @@ -81,7 +81,7 @@ define(`PIPELINE_ADD', `include($1)' ) -dnl DAI_ADD(pipeline, dai type, dai_index, stream_name, buffer, periods, format, frames, deadline, priority, core) +dnl DAI_ADD(pipeline, pipeline id, dai type, dai_index, stream_name, buffer, periods, format, frames, deadline, priority, core) define(`DAI_ADD', `undefine(`PIPELINE_ID')' `undefine(`DAI_TYPE')' @@ -94,18 +94,18 @@ define(`DAI_ADD', `undefine(`SCHEDULE_DEADLINE')' `undefine(`SCHEDULE_PRIORITY')' `undefine(`SCHEDULE_CORE')' -`define(`PIPELINE_ID', 0)' -`define(`DAI_TYPE', STR($2))' -`define(`DAI_INDEX', STR($3))' -`define(`DAI_SNAME', $4)' -`define(`DAI_BUF', $5)' -`define(`DAI_NAME', $2$3)' -`define(`DAI_PERIODS', $6)' -`define(`DAI_FORMAT', $7)' -`define(`SCHEDULE_FRAMES', $8)' -`define(`SCHEDULE_DEADLINE', $9)' -`define(`SCHEDULE_PRIORITY', $10)' -`define(`SCHEDULE_CORE', $11)' +`define(`PIPELINE_ID', $2)' +`define(`DAI_TYPE', STR($3))' +`define(`DAI_INDEX', STR($4))' +`define(`DAI_SNAME', $5)' +`define(`DAI_BUF', $6)' +`define(`DAI_NAME', $3$4)' +`define(`DAI_PERIODS', $7)' +`define(`DAI_FORMAT', $8)' +`define(`SCHEDULE_FRAMES', $9)' +`define(`SCHEDULE_DEADLINE', $10)' +`define(`SCHEDULE_PRIORITY', $11)' +`define(`SCHEDULE_CORE', $12)' `include($1)' ) diff --git a/topology/reef-apl-nocodec.m4 b/topology/reef-apl-nocodec.m4 index ef80fd3..068c06b 100644 --- a/topology/reef-apl-nocodec.m4 +++ b/topology/reef-apl-nocodec.m4 @@ -75,11 +75,11 @@ SectionGraph."pipe-apl-nocodec" { # playback DAI is SSP2 using I2S DAPM stream and 2 periods # Buffers use s24le format, with 48 frame per 1000us on core 0 with priorty 0 -DAI_ADD(sof/pipe-dai-playback.m4, SSP, 2, I2S, PIPELINE_SOURCE_1, 2, s24le, 48, 1000, 0, 0) +DAI_ADD(sof/pipe-dai-playback.m4, 1, SSP, 2, I2S, PIPELINE_SOURCE_1, 2, s24le, 48, 1000, 0, 0) # capture DAI is SSP2 using I2S DAPM stream and 2 periods # Buffers use s24le format, with 48 frame per 1000us on core 0 with priorty 0 -DAI_ADD(sof/pipe-dai-capture.m4, SSP, 2, I2S, PIPELINE_SINK_2, 2, s24le, 48, 1000, 0, 0) +DAI_ADD(sof/pipe-dai-capture.m4, 1, SSP, 2, I2S, PIPELINE_SINK_2, 2, s24le, 48, 1000, 0, 0) # # BE configurations - overrides config in ACPI if present diff --git a/topology/reef-bdw-rt286.m4 b/topology/reef-bdw-rt286.m4 index e3f8dd9..1a6042a 100644 --- a/topology/reef-bdw-rt286.m4 +++ b/topology/reef-bdw-rt286.m4 @@ -75,11 +75,11 @@ SectionGraph."pipe-bdw-rt286" { # playback DAI is SSP0 using I2S DAPM stream and 2 periods # Buffers use s24le format, with 48 frame per 1000us on core 0 with priorty 0 -DAI_ADD(sof/pipe-dai-playback.m4, SSP, 0, I2S, PIPELINE_SOURCE_1, 2, s24le, 48, 1000, 0, 0) +DAI_ADD(sof/pipe-dai-playback.m4, 1, SSP, 0, I2S, PIPELINE_SOURCE_1, 2, s24le, 48, 1000, 0, 0) # capture DAI is SSP0 using I2S DAPM stream and 2 periods # Buffers use s24le format, with 48 frame per 1000us on core 0 with priorty 0 -DAI_ADD(sof/pipe-dai-capture.m4, SSP, 0, I2S, PIPELINE_SINK_2, 2, s24le, 48, 1000, 0, 0) +DAI_ADD(sof/pipe-dai-capture.m4, 1, SSP, 0, I2S, PIPELINE_SINK_2, 2, s24le, 48, 1000, 0, 0) # # BE configurations - overrides config in ACPI if present diff --git a/topology/reef-bdw-rt5640.m4 b/topology/reef-bdw-rt5640.m4 index 4344605..2453103 100644 --- a/topology/reef-bdw-rt5640.m4 +++ b/topology/reef-bdw-rt5640.m4 @@ -75,11 +75,11 @@ SectionGraph."pipe-bdw-rt5640" { # playback DAI is SSP0 using I2S DAPM stream and 2 periods # Buffers use s24le format, with 48 frame per 1000us on core 0 with priorty 0 -DAI_ADD(sof/pipe-dai-playback.m4, SSP, 0, I2S, PIPELINE_SOURCE_1, 2, s24le, 48, 1000, 0, 0) +DAI_ADD(sof/pipe-dai-playback.m4, 1, SSP, 0, I2S, PIPELINE_SOURCE_1, 2, s24le, 48, 1000, 0, 0) # capture DAI is SSP0 using I2S DAPM stream and 2 periods # Buffers use s24le format, with 48 frame per 1000us on core 0 with priorty 0 -DAI_ADD(sof/pipe-dai-capture.m4, SSP, 0, I2S, PIPELINE_SINK_2, 2, s24le, 48, 1000, 0, 0) +DAI_ADD(sof/pipe-dai-capture.m4, 1, SSP, 0, I2S, PIPELINE_SINK_2, 2, s24le, 48, 1000, 0, 0) # # BE configurations - overrides config in ACPI if present diff --git a/topology/reef-bxt-nocodec.m4 b/topology/reef-bxt-nocodec.m4 index 486d4ea..e86b30f 100644 --- a/topology/reef-bxt-nocodec.m4 +++ b/topology/reef-bxt-nocodec.m4 @@ -75,11 +75,11 @@ SectionGraph."pipe-bxt-nocodec" { # playback DAI is SSP2 using I2S DAPM stream and 2 periods # Buffers use s24le format, with 48 frame per 1000us on core 0 with priorty 0 -DAI_ADD(sof/pipe-dai-playback.m4, SSP, 2, I2S, PIPELINE_SOURCE_1, 2, s24le, 48, 1000, 0, 0) +DAI_ADD(sof/pipe-dai-playback.m4, 1, SSP, 2, I2S, PIPELINE_SOURCE_1, 2, s24le, 48, 1000, 0, 0) # capture DAI is SSP2 using I2S DAPM stream and 2 periods # Buffers use s24le format, with 48 frame per 1000us on core 0 with priorty 0 -DAI_ADD(sof/pipe-dai-capture.m4, SSP, 2, I2S, PIPELINE_SINK_2, 2, s24le, 48, 1000, 0, 0) +DAI_ADD(sof/pipe-dai-capture.m4, 1, SSP, 2, I2S, PIPELINE_SINK_2, 2, s24le, 48, 1000, 0, 0) # # BE configurations - overrides config in ACPI if present diff --git a/topology/reef-byt-nocodec.m4 b/topology/reef-byt-nocodec.m4 index 938666d..27e7468 100644 --- a/topology/reef-byt-nocodec.m4 +++ b/topology/reef-byt-nocodec.m4 @@ -66,11 +66,11 @@ SectionGraph."pipe-byt-nocodec" { # playback DAI is SSP2 using I2S DAPM stream and 2 periods # Buffers use s24le format, with 48 frame per 1000us on core 0 with priorty 0 -DAI_ADD(sof/pipe-dai-playback.m4, SSP, 2, I2S, PIPELINE_SOURCE_1, 2, s24le, 48, 1000, 0, 0) +DAI_ADD(sof/pipe-dai-playback.m4, 1, SSP, 2, I2S, PIPELINE_SOURCE_1, 2, s24le, 48, 1000, 0, 0) # capture DAI is SSP2 using I2S DAPM stream and 2 periods # Buffers use s24le format, with 48 frame per 1000us on core 0 with priorty 0 -DAI_ADD(sof/pipe-dai-capture.m4, SSP, 2, I2S, PIPELINE_SINK_2, 2, s24le, 48, 1000, 0, 0) +DAI_ADD(sof/pipe-dai-capture.m4, 1, SSP, 2, I2S, PIPELINE_SINK_2, 2, s24le, 48, 1000, 0, 0) # # BE configurations - overrides config in ACPI if present diff --git a/topology/reef-byt-rt5640.m4 b/topology/reef-byt-rt5640.m4 index 05743e2..8d70e52 100644 --- a/topology/reef-byt-rt5640.m4 +++ b/topology/reef-byt-rt5640.m4 @@ -66,11 +66,11 @@ SectionGraph."pipe-byt-rt5640" { # playback DAI is SSP2 using I2S DAPM stream and 2 periods # Buffers use s24le format, with 48 frame per 1000us on core 0 with priorty 0 -DAI_ADD(sof/pipe-dai-playback.m4, SSP, 2, Audio, PIPELINE_SOURCE_1, 2, s24le, 48, 1000, 0, 0) +DAI_ADD(sof/pipe-dai-playback.m4, 1, SSP, 2, Audio, PIPELINE_SOURCE_1, 2, s24le, 48, 1000, 0, 0) # capture DAI is SSP2 using I2S DAPM stream and 2 periods # Buffers use s24le format, with 48 frame per 1000us on core 0 with priorty 0 -DAI_ADD(sof/pipe-dai-capture.m4, SSP, 2, Audio, PIPELINE_SINK_2, 2, s24le, 48, 1000, 0, 0) +DAI_ADD(sof/pipe-dai-capture.m4, 1, SSP, 2, Audio, PIPELINE_SINK_2, 2, s24le, 48, 1000, 0, 0) # # BE configurations - overrides config in ACPI if present diff --git a/topology/reef-byt-rt5651.m4 b/topology/reef-byt-rt5651.m4 index cb9dcc2..b759137 100644 --- a/topology/reef-byt-rt5651.m4 +++ b/topology/reef-byt-rt5651.m4 @@ -66,11 +66,11 @@ SectionGraph."pipe-byt-rt5651" { # playback DAI is SSP2 using "Audio" DAPM stream name and 2 periods # Buffers use s24le format, with 48 frame per 1000us on core 0 with priorty 0 -DAI_ADD(sof/pipe-dai-playback.m4, SSP, 2, Audio, PIPELINE_SOURCE_1, 2, s24le, 48, 1000, 0, 0) +DAI_ADD(sof/pipe-dai-playback.m4, 1, SSP, 2, Audio, PIPELINE_SOURCE_1, 2, s24le, 48, 1000, 0, 0) # capture DAI is SSP2 using "Audio" DAPM stream name and 2 periods # Buffers use s24le format, with 48 frame per 1000us on core 0 with priorty 0 -DAI_ADD(sof/pipe-dai-capture.m4, SSP, 2, Audio, PIPELINE_SINK_2, 2, s24le, 48, 1000, 0, 0) +DAI_ADD(sof/pipe-dai-capture.m4, 1, SSP, 2, Audio, PIPELINE_SINK_2, 2, s24le, 48, 1000, 0, 0) # # BE configurations - overrides config in ACPI if present diff --git a/topology/reef-cht-nocodec.m4 b/topology/reef-cht-nocodec.m4 index 52e8d50..5f2be4c 100644 --- a/topology/reef-cht-nocodec.m4 +++ b/topology/reef-cht-nocodec.m4 @@ -66,11 +66,11 @@ SectionGraph."pipe-cht-nocodec" { # playback DAI is SSP2 using I2S DAPM stream and 2 periods # Buffers use s24le format, with 48 frame per 1000us on core 0 with priorty 0 -DAI_ADD(sof/pipe-dai-playback.m4, SSP, 2, I2S, PIPELINE_SOURCE_1, 2, s24le, 48, 1000, 0, 0) +DAI_ADD(sof/pipe-dai-playback.m4, 1, SSP, 2, I2S, PIPELINE_SOURCE_1, 2, s24le, 48, 1000, 0, 0) # capture DAI is SSP2 using I2S DAPM stream and 2 periods # Buffers use s24le format, with 48 frame per 1000us on core 0 with priorty 0 -DAI_ADD(sof/pipe-dai-capture.m4, SSP, 2, I2S, PIPELINE_SINK_2, 2, s24le, 48, 1000, 0, 0) +DAI_ADD(sof/pipe-dai-capture.m4, 1, SSP, 2, I2S, PIPELINE_SINK_2, 2, s24le, 48, 1000, 0, 0) # # BE configurations - overrides config in ACPI if present diff --git a/topology/reef-hsw-rt5640.m4 b/topology/reef-hsw-rt5640.m4 index af18633..f64d36b 100644 --- a/topology/reef-hsw-rt5640.m4 +++ b/topology/reef-hsw-rt5640.m4 @@ -75,11 +75,11 @@ SectionGraph."pipe-hsw-rt5640" { # playback DAI is SSP0 using I2S DAPM stream and 2 periods # Buffers use s24le format, with 48 frame per 1000us on core 0 with priorty 0 -DAI_ADD(sof/pipe-dai-playback.m4, SSP, 0, I2S, PIPELINE_SOURCE_1, 2, s24le, 48, 1000, 0, 0) +DAI_ADD(sof/pipe-dai-playback.m4, 1, SSP, 0, I2S, PIPELINE_SOURCE_1, 2, s24le, 48, 1000, 0, 0) # capture DAI is SSP0 using I2S DAPM stream and 2 periods # Buffers use s24le format, with 48 frame per 1000us on core 0 with priorty 0 -DAI_ADD(sof/pipe-dai-capture.m4, SSP, 0, I2S, PIPELINE_SINK_2, 2, s24le, 48, 1000, 0, 0) +DAI_ADD(sof/pipe-dai-capture.m4, 1, SSP, 0, I2S, PIPELINE_SINK_2, 2, s24le, 48, 1000, 0, 0) # # BE configurations - overrides config in ACPI if present -- 2.11.0
1 2
0 0
[Sound-open-firmware] [PATCH] core: make sure we emit trace errors for when returning error values.
by Liam Girdwood 08 Sep '17

08 Sep '17
Makes debug easier. Signed-off-by: Liam Girdwood <liam.r.girdwood(a)linux.intel.com> --- src/audio/component.c | 1 + src/audio/pipeline.c | 21 ++++++++++++++------- src/ipc/intel-ipc.c | 1 + 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/audio/component.c b/src/audio/component.c index 232ef02..2a397d7 100644 --- a/src/audio/component.c +++ b/src/audio/component.c @@ -148,6 +148,7 @@ int comp_set_state(struct comp_dev *dev, int cmd) break; default: trace_comp_error("CEd"); + trace_value(cmd); ret = -EINVAL; break; } diff --git a/src/audio/pipeline.c b/src/audio/pipeline.c index 9aedc21..687efe9 100644 --- a/src/audio/pipeline.c +++ b/src/audio/pipeline.c @@ -465,7 +465,7 @@ static int preload_downstream(struct comp_dev *start, struct comp_dev *current) struct list_item *clist; int i, total = 0, count = 0; - trace_pipe("PR-"); + tracev_pipe("PR-"); tracev_value(current->comp.id); /* reached endpoint ? */ @@ -574,8 +574,11 @@ int pipeline_cmd(struct pipeline *p, struct comp_dev *host, int cmd, ret = component_op_upstream(&op_data, host, host, NULL); } - if (ret < 0) - trace_ipc_error("pae"); + if (ret < 0) { + trace_ipc_error("pc0"); + trace_value(host->comp.id); + trace_value(cmd); + } spin_unlock(&p->lock); return ret; @@ -617,8 +620,10 @@ int pipeline_params(struct pipeline *p, struct comp_dev *host, ret = component_op_upstream(&op_data, host, host, NULL); } - if (ret < 0) - trace_ipc_error("pae"); + if (ret < 0) { + trace_ipc_error("pp0"); + trace_value(host->comp.id); + } spin_unlock(&p->lock); return ret; @@ -645,8 +650,10 @@ int pipeline_reset(struct pipeline *p, struct comp_dev *host) ret = component_op_upstream(&op_data, host, host, NULL); } - if (ret < 0) - trace_ipc_error("pae"); + if (ret < 0) { + trace_ipc_error("pr0"); + trace_value(host->comp.id); + } spin_unlock(&p->lock); return ret; diff --git a/src/ipc/intel-ipc.c b/src/ipc/intel-ipc.c index 3912174..18d8732 100644 --- a/src/ipc/intel-ipc.c +++ b/src/ipc/intel-ipc.c @@ -567,6 +567,7 @@ static int ipc_comp_value(uint32_t header, uint32_t cmd) stream_dev = ipc_get_comp(_ipc, data->comp_id); if (stream_dev == NULL){ trace_ipc_error("eVg"); + trace_value(data->comp_id); return -ENODEV; } -- 2.11.0
1 2
0 0
[Sound-open-firmware] [PATCH] topology: Add support for 32bit data to playback and capture PCMs
by Liam Girdwood 08 Sep '17

08 Sep '17
Add S32_LE data support to the PCMs Signed-off-by: Liam Girdwood <liam.r.girdwood(a)linux.intel.com> --- topology/sof/pipe-low-latency-capture.m4 | 2 +- topology/sof/pipe-low-latency-playback.m4 | 2 +- topology/sof/pipe-passthrough-playback.m4 | 2 +- topology/sof/pipe-passthrough-vol-playback.m4 | 2 +- topology/sof/pipe-pcm-media.m4 | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/topology/sof/pipe-low-latency-capture.m4 b/topology/sof/pipe-low-latency-capture.m4 index 111aa86..d041dca 100644 --- a/topology/sof/pipe-low-latency-capture.m4 +++ b/topology/sof/pipe-low-latency-capture.m4 @@ -89,7 +89,7 @@ W_PIPELINE(N_PGA(0), SCHEDULE_DEADLINE, SCHEDULE_PRIORITY, SCHEDULE_FRAMES, SCHE SectionPCMCapabilities.STR(Low Latency Capture PCM_ID) { - formats "S24_LE,S16_LE" + formats "S32_LE,S24_LE,S16_LE" rate_min "48000" rate_max "48000" channels_min "2" diff --git a/topology/sof/pipe-low-latency-playback.m4 b/topology/sof/pipe-low-latency-playback.m4 index a860c82..3db55cf 100644 --- a/topology/sof/pipe-low-latency-playback.m4 +++ b/topology/sof/pipe-low-latency-playback.m4 @@ -155,7 +155,7 @@ W_PIPELINE(N_PGA(1), SCHEDULE_DEADLINE, SCHEDULE_PRIORITY, SCHEDULE_FRAMES, SCHE # PCM capabilities supported by FW SectionPCMCapabilities.STR(Low Latency Playback PCM_ID) { - formats "S24_LE,S16_LE" + formats "S32_LE,S24_LE,S16_LE" rate_min "48000" rate_max "48000" channels_min "2" diff --git a/topology/sof/pipe-passthrough-playback.m4 b/topology/sof/pipe-passthrough-playback.m4 index a6ecb32..732e173 100644 --- a/topology/sof/pipe-passthrough-playback.m4 +++ b/topology/sof/pipe-passthrough-playback.m4 @@ -52,7 +52,7 @@ SectionGraph."pipe-pass-playback-PIPELINE_ID" { SectionPCMCapabilities.STR(Passthrough Playback PCM_ID) { - formats "S24_LE,S16_LE" + formats "S32_LE,S24_LE,S16_LE" rate_min "48000" rate_max "48000" channels_min "2" diff --git a/topology/sof/pipe-passthrough-vol-playback.m4 b/topology/sof/pipe-passthrough-vol-playback.m4 index bf131c3..be3f9ec 100644 --- a/topology/sof/pipe-passthrough-vol-playback.m4 +++ b/topology/sof/pipe-passthrough-vol-playback.m4 @@ -91,7 +91,7 @@ SectionGraph."pipe-pass-vol-playback-PIPELINE_ID" { SectionPCMCapabilities.STR(Passthrough Playback PCM_ID) { - formats "S24_LE,S16_LE" + formats "S32_LE,S24_LE,S16_LE" rate_min "48000" rate_max "48000" channels_min "2" diff --git a/topology/sof/pipe-pcm-media.m4 b/topology/sof/pipe-pcm-media.m4 index 97958cd..b766e23 100644 --- a/topology/sof/pipe-pcm-media.m4 +++ b/topology/sof/pipe-pcm-media.m4 @@ -120,7 +120,7 @@ W_PIPELINE(N_SRC(0), SCHEDULE_DEADLINE, SCHEDULE_PRIORITY, SCHEDULE_FRAMES, SCHE # PCM capabilities supported by FW SectionPCMCapabilities.STR(Media Playback PCM_ID) { - formats "S24_LE,S16_LE" + formats "S32_LE,S24_LE,S16_LE" rate_min "8000" rate_max "192000" channels_min "2" -- 2.11.0
1 0
0 0
[Sound-open-firmware] [PATCH v4 1/5] Makefile and configure changes to add testbench
by Ranjani Sridharan 07 Sep '17

07 Sep '17
This patch adds the changes to configure.ac and Makefile to add the testbench directories Signed-off-by: Ranjani Sridharan <ranjani.sridharan(a)linux.intel.com> --- Makefile.am | 2 +- configure.ac | 5 +++++ tune/Makefile.am | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 tune/Makefile.am diff --git a/Makefile.am b/Makefile.am index ea01286..4f359ea 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1 +1 @@ -SUBDIRS = rimage rmbox topology +SUBDIRS = rimage rmbox topology tune diff --git a/configure.ac b/configure.ac index 87c7519..d5e4f48 100644 --- a/configure.ac +++ b/configure.ac @@ -17,6 +17,11 @@ AC_OUTPUT([ rimage/Makefile rmbox/Makefile topology/Makefile + tune/Makefile + tune/src/Makefile + tune/mux/Makefile + tune/passthrough/Makefile + tune/eq/Makefile ]) echo " diff --git a/tune/Makefile.am b/tune/Makefile.am new file mode 100644 index 0000000..b2dc2d9 --- /dev/null +++ b/tune/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = src eq mux passthrough -- 2.9.3
1 4
0 0
[Sound-open-firmware] [PATCH 1/2] comp: buffer: reject buffer size 0 requests.
by Liam Girdwood 07 Sep '17

07 Sep '17
Signed-off-by: Liam Girdwood <liam.r.girdwood(a)linux.intel.com> --- src/include/reef/audio/buffer.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/include/reef/audio/buffer.h b/src/include/reef/audio/buffer.h index e708ee2..ea9bd9c 100644 --- a/src/include/reef/audio/buffer.h +++ b/src/include/reef/audio/buffer.h @@ -183,6 +183,8 @@ static inline int buffer_set_size(struct comp_buffer *buffer, uint32_t size) { if (size > buffer->alloc_size) return -ENOMEM; + if (size == 0) + return -EINVAL; buffer->end_addr = buffer->addr + size; buffer->size = size; -- 2.11.0
1 1
0 0
[Sound-open-firmware] [PATCH v4 1/3] comp: default function to set comp state
by Ranjani Sridharan 07 Sep '17

07 Sep '17
This patch adds a the comp_set_state() used for the mandatory pipeline commands, START, STOP, PAUSE and RELEASE. It also updates the cmd method in existing components to use comp_set_state(). Signed-off-by: Ranjani Sridharan <ranjani.sridharan(a)linux.intel.com> --- src/audio/component.c | 38 ++++++++++++++++++++++++++++++++++++++ src/audio/eq_fir.c | 23 +---------------------- src/audio/host.c | 16 ++++------------ src/audio/src.c | 25 +++---------------------- src/audio/tone.c | 28 +++++----------------------- src/audio/volume.c | 19 +++---------------- src/include/reef/audio/component.h | 3 +++ 7 files changed, 57 insertions(+), 95 deletions(-) diff --git a/src/audio/component.c b/src/audio/component.c index 6369e2e..232ef02 100644 --- a/src/audio/component.c +++ b/src/audio/component.c @@ -117,6 +117,44 @@ void comp_unregister(struct comp_driver *drv) spin_unlock(&cd->lock); } +int comp_set_state(struct comp_dev *dev, int cmd) +{ + int ret = 0; + + switch (cmd) { + case COMP_CMD_START: + case COMP_CMD_RELEASE: + dev->state = COMP_STATE_RUNNING; + break; + case COMP_CMD_STOP: + if (dev->state == COMP_STATE_RUNNING || + dev->state == COMP_STATE_DRAINING || + dev->state == COMP_STATE_PAUSED) { + comp_buffer_reset(dev); + dev->state = COMP_STATE_SETUP; + } else { + trace_comp_error("CEs"); + ret = -EINVAL; + } + break; + case COMP_CMD_PAUSE: + /* only support pausing for running */ + if (dev->state == COMP_STATE_RUNNING) + dev->state = COMP_STATE_PAUSED; + else { + trace_comp_error("CEp"); + ret = -EINVAL; + } + break; + default: + trace_comp_error("CEd"); + ret = -EINVAL; + break; + } + + return ret; +} + void sys_comp_init(void) { cd = rzalloc(RZONE_SYS, RFLAGS_NONE, sizeof(*cd)); diff --git a/src/audio/eq_fir.c b/src/audio/eq_fir.c index 540c68f..98cd43e 100644 --- a/src/audio/eq_fir.c +++ b/src/audio/eq_fir.c @@ -382,32 +382,11 @@ static int eq_fir_cmd(struct comp_dev *dev, int cmd, void *data) ret = fir_cmd(dev, cdata); break; case COMP_CMD_START: - trace_src("EFs"); - dev->state = COMP_STATE_RUNNING; - break; case COMP_CMD_STOP: - trace_src("ESp"); - if (dev->state == COMP_STATE_RUNNING || - dev->state == COMP_STATE_DRAINING || - dev->state == COMP_STATE_PAUSED) { - comp_buffer_reset(dev); - dev->state = COMP_STATE_SETUP; - } - break; case COMP_CMD_PAUSE: - trace_src("EPe"); - /* only support pausing for running */ - if (dev->state == COMP_STATE_RUNNING) - dev->state = COMP_STATE_PAUSED; - - break; case COMP_CMD_RELEASE: - trace_src("ERl"); - dev->state = COMP_STATE_RUNNING; - break; default: - trace_src("EDf"); - ret = -EINVAL; + ret = comp_set_state(dev, cmd); break; } diff --git a/src/audio/host.c b/src/audio/host.c index e71e95f..f81fd66 100644 --- a/src/audio/host.c +++ b/src/audio/host.c @@ -553,28 +553,20 @@ static int host_cmd(struct comp_dev *dev, int cmd, void *data) // TODO: align cmd macros. switch (cmd) { - case COMP_CMD_PAUSE: - /* only support pausing for running, channel is paused by DAI */ - if (dev->state == COMP_STATE_RUNNING) - dev->state = COMP_STATE_PAUSED; - break; case COMP_CMD_STOP: if (dev->state == COMP_STATE_RUNNING || dev->state == COMP_STATE_DRAINING || dev->state == COMP_STATE_PAUSED) ret = host_stop(dev); break; - case COMP_CMD_RELEASE: - /* channel is released by DAI */ - dev->state = COMP_STATE_RUNNING; - break; - case COMP_CMD_START: - dev->state = COMP_STATE_RUNNING; - break; case COMP_CMD_SUSPEND: case COMP_CMD_RESUME: break; + case COMP_CMD_START: + case COMP_CMD_PAUSE: + case COMP_CMD_RELEASE: default: + ret = comp_set_state(dev, cmd); break; } diff --git a/src/audio/src.c b/src/audio/src.c index c11ef3f..34cab7a 100644 --- a/src/audio/src.c +++ b/src/audio/src.c @@ -431,6 +431,7 @@ static int src_ctrl_cmd(struct comp_dev *dev, struct sof_ipc_ctrl_data *cdata) static int src_cmd(struct comp_dev *dev, int cmd, void *data) { struct sof_ipc_ctrl_data *cdata = data; + int ret = 0; trace_src("SCm"); @@ -438,35 +439,15 @@ static int src_cmd(struct comp_dev *dev, int cmd, void *data) case COMP_CMD_SET_VALUE: return src_ctrl_cmd(dev, cdata); case COMP_CMD_START: - trace_src("SSt"); - dev->state = COMP_STATE_RUNNING; - break; case COMP_CMD_STOP: - trace_src("SSp"); - if (dev->state == COMP_STATE_RUNNING || - dev->state == COMP_STATE_DRAINING || - dev->state == COMP_STATE_PAUSED) { - comp_buffer_reset(dev); - dev->state = COMP_STATE_SETUP; - } - break; case COMP_CMD_PAUSE: - trace_src("SPe"); - /* only support pausing for running */ - if (dev->state == COMP_STATE_RUNNING) - dev->state = COMP_STATE_PAUSED; - - break; case COMP_CMD_RELEASE: - trace_src("SRl"); - dev->state = COMP_STATE_RUNNING; - break; default: - trace_src("SDf"); + ret = comp_set_state(dev, cmd); break; } - return 0; + return ret; } /* copy and process stream data from source to sink buffers */ diff --git a/src/audio/tone.c b/src/audio/tone.c index 448c472..aec8a72 100644 --- a/src/audio/tone.c +++ b/src/audio/tone.c @@ -434,6 +434,8 @@ static int tone_ctrl_cmd(struct comp_dev *dev, struct sof_ipc_ctrl_data *cdata) { struct comp_data *cd = comp_get_drvdata(dev); + trace_tone("tri"); + switch (cdata->cmd) { case SOF_CTRL_CMD_MUTE: trace_tone("TMu"); @@ -468,6 +470,7 @@ static int tone_ctrl_cmd(struct comp_dev *dev, struct sof_ipc_ctrl_data *cdata) static int tone_cmd(struct comp_dev *dev, int cmd, void *data) { struct sof_ipc_ctrl_data *cdata = data; + int ret = 0; trace_tone("tri"); @@ -475,36 +478,15 @@ static int tone_cmd(struct comp_dev *dev, int cmd, void *data) case COMP_CMD_SET_VALUE: return tone_ctrl_cmd(dev, cdata); case COMP_CMD_START: - trace_tone("TSt"); - dev->state = COMP_STATE_RUNNING; - break; case COMP_CMD_STOP: - trace_tone("TSp"); - if (dev->state == COMP_STATE_RUNNING || - dev->state == COMP_STATE_DRAINING || - dev->state == COMP_STATE_PAUSED) { - comp_buffer_reset(dev); - dev->state = COMP_STATE_SETUP; - } - break; case COMP_CMD_PAUSE: - trace_tone("TPe"); - /* only support pausing for running */ - if (dev->state == COMP_STATE_RUNNING) - dev->state = COMP_STATE_PAUSED; - - break; case COMP_CMD_RELEASE: - trace_tone("TRl"); - dev->state = COMP_STATE_RUNNING; - break; default: - trace_tone("TDf"); - + ret = comp_set_state(dev, cmd); break; } - return 0; + return ret; } /* copy and process stream data from source to sink buffers */ diff --git a/src/audio/volume.c b/src/audio/volume.c index c88f9d2..d642320 100644 --- a/src/audio/volume.c +++ b/src/audio/volume.c @@ -429,6 +429,7 @@ static int volume_ctrl_cmd(struct comp_dev *dev, struct sof_ipc_ctrl_data *cdata static int volume_cmd(struct comp_dev *dev, int cmd, void *data) { struct sof_ipc_ctrl_data *cdata = data; + int ret = 0; trace_volume("cmd"); @@ -436,29 +437,15 @@ static int volume_cmd(struct comp_dev *dev, int cmd, void *data) case COMP_CMD_SET_VALUE: return volume_ctrl_cmd(dev, cdata); case COMP_CMD_START: - dev->state = COMP_STATE_RUNNING; - break; case COMP_CMD_STOP: - if (dev->state == COMP_STATE_RUNNING || - dev->state == COMP_STATE_DRAINING || - dev->state == COMP_STATE_PAUSED) { - comp_buffer_reset(dev); - dev->state = COMP_STATE_SETUP; - } - break; case COMP_CMD_PAUSE: - /* only support pausing for running */ - if (dev->state == COMP_STATE_RUNNING) - dev->state = COMP_STATE_PAUSED; - break; case COMP_CMD_RELEASE: - dev->state = COMP_STATE_RUNNING; - break; default: + ret = comp_set_state(dev, cmd); break; } - return 0; + return ret; } /* copy and process stream data from source to sink buffers */ diff --git a/src/include/reef/audio/component.h b/src/include/reef/audio/component.h index 9793c36..d7ea29a 100644 --- a/src/include/reef/audio/component.h +++ b/src/include/reef/audio/component.h @@ -214,6 +214,9 @@ static inline void comp_free(struct comp_dev *dev) dev->drv->ops.free(dev); } +/* component state set */ +int comp_set_state(struct comp_dev *dev, int cmd); + /* component parameter init - mandatory */ static inline int comp_params(struct comp_dev *dev) { -- 2.9.3
2 1
0 0
[Sound-open-firmware] [PATCH] comp: dai: drain and stop notifications come from host.
by Liam Girdwood 07 Sep '17

07 Sep '17
Make sure all stop/drain notification come from host and not DAI component. Signed-off-by: Liam Girdwood <liam.r.girdwood(a)linux.intel.com> --- src/audio/dai.c | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/src/audio/dai.c b/src/audio/dai.c index e085096..30d3ae9 100644 --- a/src/audio/dai.c +++ b/src/audio/dai.c @@ -121,38 +121,9 @@ static void dai_dma_cb(void *data, uint32_t type, struct dma_sg_elem *next) } } - if (dev->params.direction == SOF_IPC_STREAM_PLAYBACK && - dma_buffer->avail < dd->period_bytes) { - /* end of stream, finish */ - if (dma_buffer->avail == 0) { - dai_cmd(dev, COMP_CMD_STOP, NULL); - - /* stop dma immediately */ - next->size = DMA_RELOAD_END; - - /* let any waiters know we have completed */ - //wait_completed(&dev->pipeline->complete); - - return; - } else { - /* drain the last bytes */ - next->src = (uint32_t)dma_buffer->r_ptr; - next->dest = dai_fifo(dd->dai, SOF_IPC_STREAM_PLAYBACK); - next->size = dma_buffer->avail; - - dd->last_bytes = next->size; - - goto next_copy; - - } - - } - /* notify pipeline that DAI needs it's buffer processed */ pipeline_schedule_copy(dev->pipeline, dev); -next_copy: - return; } -- 2.11.0
1 0
0 0
[Sound-open-firmware] [PATCH] comp: buffer: add support for non period aligned buffers
by Liam Girdwood 07 Sep '17

07 Sep '17
Add support for non period aligned buffers to the buffer free/avail calculation. Signed-off-by: Liam Girdwood <liam.r.girdwood(a)linux.intel.com> --- src/include/reef/audio/buffer.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/include/reef/audio/buffer.h b/src/include/reef/audio/buffer.h index 54978a8..83fcd57 100644 --- a/src/include/reef/audio/buffer.h +++ b/src/include/reef/audio/buffer.h @@ -93,7 +93,7 @@ static inline void comp_update_buffer_produce(struct comp_buffer *buffer, /* check for pointer wrap */ if (buffer->w_ptr >= buffer->end_addr) - buffer->w_ptr = buffer->addr; + buffer->w_ptr = buffer->addr + (buffer->w_ptr - buffer->end_addr); /* calculate available bytes */ if (buffer->r_ptr < buffer->w_ptr) @@ -127,7 +127,7 @@ static inline void comp_update_buffer_consume(struct comp_buffer *buffer, /* check for pointer wrap */ if (buffer->r_ptr >= buffer->end_addr) - buffer->r_ptr = buffer->addr; + buffer->r_ptr = buffer->addr + (buffer->r_ptr - buffer->end_addr); /* calculate available bytes */ if (buffer->r_ptr < buffer->w_ptr) -- 2.11.0
1 3
0 0
  • ← Newer
  • 1
  • ...
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • ...
  • 158
  • Older →

HyperKitty Powered by HyperKitty version 1.3.8.