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 -----
  • 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

September 2017

  • 8 participants
  • 63 discussions
[Sound-open-firmware] [PATCH] comp: host: Add trace output for buffer size errors
by Liam Girdwood 25 Sep '17

25 Sep '17
Signed-off-by: Liam Girdwood <liam.r.girdwood(a)linux.intel.com> --- src/audio/host.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/audio/host.c b/src/audio/host.c index a1d312a..76124fc 100644 --- a/src/audio/host.c +++ b/src/audio/host.c @@ -415,6 +415,7 @@ static int host_params(struct comp_dev *dev) err = buffer_set_size(hd->dma_buffer, buffer_size); if (err < 0) { trace_host_error("eSz"); + trace_value(buffer_size); return err; } -- 2.11.0
1 1
0 0
[Sound-open-firmware] [PATCH] topology: fix capture pipeline ID for SSP DAI
by Liam Girdwood 24 Sep '17

24 Sep '17
Capture pipeline for SSP DAI should be 2. Signed-off-by: Liam Girdwood <liam.r.girdwood(a)linux.intel.com> --- topology/reef-apl-nocodec.m4 | 2 +- topology/reef-bdw-rt286.m4 | 2 +- topology/reef-bdw-rt5640.m4 | 2 +- topology/reef-bxt-nocodec.m4 | 2 +- topology/reef-byt-nocodec.m4 | 2 +- topology/reef-byt-rt5640.m4 | 2 +- topology/reef-byt-rt5651.m4 | 2 +- topology/reef-cht-nocodec.m4 | 2 +- topology/reef-hsw-rt5640.m4 | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/topology/reef-apl-nocodec.m4 b/topology/reef-apl-nocodec.m4 index f87a4e9..5e497f6 100644 --- a/topology/reef-apl-nocodec.m4 +++ b/topology/reef-apl-nocodec.m4 @@ -93,7 +93,7 @@ DAI_ADD(sof/pipe-dai-playback.m4, # capture DAI is SSP2 using I2S DAPM stream and 2 periods # Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 DAI_ADD(sof/pipe-dai-capture.m4, - 1, SSP, 2, I2S, + 2, SSP, 2, I2S, PIPELINE_SINK_2, 2, s24le, 48, 1000, 0, 0) diff --git a/topology/reef-bdw-rt286.m4 b/topology/reef-bdw-rt286.m4 index eae2065..cb11ad6 100644 --- a/topology/reef-bdw-rt286.m4 +++ b/topology/reef-bdw-rt286.m4 @@ -93,7 +93,7 @@ DAI_ADD(sof/pipe-dai-playback.m4, # capture DAI is SSP0 using I2S DAPM stream and 2 periods # Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 DAI_ADD(sof/pipe-dai-capture.m4, - 1, SSP, 0, I2S, + 2, SSP, 0, I2S, PIPELINE_SINK_2, 2, s24le, 48, 1000, 0, 0) diff --git a/topology/reef-bdw-rt5640.m4 b/topology/reef-bdw-rt5640.m4 index 60feb82..b3c19c2 100644 --- a/topology/reef-bdw-rt5640.m4 +++ b/topology/reef-bdw-rt5640.m4 @@ -93,7 +93,7 @@ DAI_ADD(sof/pipe-dai-playback.m4, # capture DAI is SSP0 using I2S DAPM stream and 2 periods # Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 DAI_ADD(sof/pipe-dai-capture.m4, - 1, SSP, 0, I2S, + 2, SSP, 0, I2S, PIPELINE_SINK_2, 2, s24le, 48, 1000, 0, 0) diff --git a/topology/reef-bxt-nocodec.m4 b/topology/reef-bxt-nocodec.m4 index 744e9b1..58bc6f6 100644 --- a/topology/reef-bxt-nocodec.m4 +++ b/topology/reef-bxt-nocodec.m4 @@ -93,7 +93,7 @@ DAI_ADD(sof/pipe-dai-playback.m4, # capture DAI is SSP2 using I2S DAPM stream and 2 periods # Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 DAI_ADD(sof/pipe-dai-capture.m4, - 1, SSP, 2, I2S, + 2, SSP, 2, I2S, PIPELINE_SINK_2, 2, s24le, 48, 1000, 0, 0) diff --git a/topology/reef-byt-nocodec.m4 b/topology/reef-byt-nocodec.m4 index 05373f9..5f6cd1d 100644 --- a/topology/reef-byt-nocodec.m4 +++ b/topology/reef-byt-nocodec.m4 @@ -82,7 +82,7 @@ DAI_ADD(sof/pipe-dai-playback.m4, # capture DAI is SSP2 using I2S DAPM stream and 2 periods # Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 DAI_ADD(sof/pipe-dai-capture.m4, - 1, SSP, 2, I2S, + 2, SSP, 2, I2S, PIPELINE_SINK_2, 2, s24le, 48, 1000, 0, 0) diff --git a/topology/reef-byt-rt5640.m4 b/topology/reef-byt-rt5640.m4 index 911b4d1..c5e8b52 100644 --- a/topology/reef-byt-rt5640.m4 +++ b/topology/reef-byt-rt5640.m4 @@ -82,7 +82,7 @@ DAI_ADD(sof/pipe-dai-playback.m4, # capture DAI is SSP2 using I2S DAPM stream and 2 periods # Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 DAI_ADD(sof/pipe-dai-capture.m4, - 1, SSP, 2, Audio, + 2, SSP, 2, Audio, PIPELINE_SINK_2, 2, s24le, 48, 1000, 0, 0) diff --git a/topology/reef-byt-rt5651.m4 b/topology/reef-byt-rt5651.m4 index c6f20a4..e335d66 100644 --- a/topology/reef-byt-rt5651.m4 +++ b/topology/reef-byt-rt5651.m4 @@ -82,7 +82,7 @@ DAI_ADD(sof/pipe-dai-playback.m4, # 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 priority 0 DAI_ADD(sof/pipe-dai-capture.m4, - 1, SSP, 2, Audio, + 2, SSP, 2, Audio, PIPELINE_SINK_2, 2, s24le, 48, 1000, 0, 0) diff --git a/topology/reef-cht-nocodec.m4 b/topology/reef-cht-nocodec.m4 index 43e0e6e..ddeb71e 100644 --- a/topology/reef-cht-nocodec.m4 +++ b/topology/reef-cht-nocodec.m4 @@ -82,7 +82,7 @@ DAI_ADD(sof/pipe-dai-playback.m4, # capture DAI is SSP2 using I2S DAPM stream and 2 periods # Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 DAI_ADD(sof/pipe-dai-capture.m4, - 1, SSP, 2, I2S, + 2, SSP, 2, I2S, PIPELINE_SINK_2, 2, s24le, 48, 1000, 0, 0) diff --git a/topology/reef-hsw-rt5640.m4 b/topology/reef-hsw-rt5640.m4 index 3d26149..efd815b 100644 --- a/topology/reef-hsw-rt5640.m4 +++ b/topology/reef-hsw-rt5640.m4 @@ -93,7 +93,7 @@ DAI_ADD(sof/pipe-dai-playback.m4, # capture DAI is SSP0 using I2S DAPM stream and 2 periods # Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 DAI_ADD(sof/pipe-dai-capture.m4, - 1, SSP, 0, I2S, + 2, SSP, 0, I2S, PIPELINE_SINK_2, 2, s24le, 48, 1000, 0, 0) -- 2.11.0
1 0
0 0
[Sound-open-firmware] [PATCH] pipeline: fix timestamp for capture streams.
by Liam Girdwood 24 Sep '17

24 Sep '17
Make sure we timestamp upstream in capture streams Signed-off-by: Liam Girdwood <liam.r.girdwood(a)linux.intel.com> --- src/audio/pipeline.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/audio/pipeline.c b/src/audio/pipeline.c index 62c21b7..4e830c6 100644 --- a/src/audio/pipeline.c +++ b/src/audio/pipeline.c @@ -851,7 +851,7 @@ upstream: continue; /* continue downstream */ - res = timestamp_upstream(start, buffer->sink, posn); + res = timestamp_upstream(start, buffer->source, posn); if (res == 1) break; } -- 2.11.0
1 3
0 0
[Sound-open-firmware] [PATCH] ssp: add missing break in dai format switch
by Pierre-Louis Bossart 23 Sep '17

23 Sep '17
Support for DSP_A is obviously broken. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart(a)linux.intel.com> --- src/drivers/ssp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/drivers/ssp.c b/src/drivers/ssp.c index c97b60e..a472974 100644 --- a/src/drivers/ssp.c +++ b/src/drivers/ssp.c @@ -224,6 +224,7 @@ static inline int ssp_set_config(struct dai *dai, sscr0 |= SSCR0_PSP | SSCR0_MOD | SSCR0_FRDC(config->num_slots); sscr1 |= SSCR1_TRAIL; sspsp |= SSPSP_SFRMWDTH(1) | SSPSP_SFRMDLY(2); + break; case SOF_DAI_FMT_DSP_B: sscr0 |= SSCR0_PSP | SSCR0_MOD | SSCR0_FRDC(config->num_slots); sscr1 |= SSCR1_TRAIL; -- 2.11.0
2 1
0 0
[Sound-open-firmware] [PATCH 1/4] SRC: Add checks for number of channels when initializing from params
by Seppo Ingalsuo 22 Sep '17

22 Sep '17
This patch prevents SRCs init to loop past PLATFORM_MAX_CHANNELS. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo(a)linux.intel.com> --- src/audio/src.c | 5 +++-- src/audio/src_core.h | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/audio/src.c b/src/audio/src.c index 1f84a5a..203e802 100644 --- a/src/audio/src.c +++ b/src/audio/src.c @@ -322,7 +322,7 @@ static int src_params(struct comp_dev *dev) size_t delay_lines_size; uint32_t source_rate, sink_rate; int32_t *buffer_start; - int n = 0, i, err, frames_is_for_source, q; + int n = 0, i, err, frames_is_for_source, nch, q; trace_src("par"); @@ -392,7 +392,8 @@ static int src_params(struct comp_dev *dev) buffer_start = cd->delay_lines + need.scratch; /* Initize SRC for actual sample rate */ - for (i = 0; i < params->channels; i++) { + nch = MIN(params->channels, PLATFORM_MAX_CHANNELS); + for (i = 0; i < nch; i++) { n = src_polyphase_init(&cd->src[i], source_rate, sink_rate, &need, buffer_start); buffer_start += need.single_src; diff --git a/src/audio/src_core.h b/src/audio/src_core.h index 5977421..886cc23 100644 --- a/src/audio/src_core.h +++ b/src/audio/src_core.h @@ -33,6 +33,7 @@ #define SRC_CORE_H #define MAX(a, b) (((a) > (b)) ? (a) : (b)) +#define MIN(a, b) (((a) < (b)) ? (a) : (b)) struct src_alloc { int fir_s1; -- 2.11.0
2 4
0 0
[Sound-open-firmware] [PATCH 1/3] ipc: add support for timer topology scheduling source.
by Liam Girdwood 22 Sep '17

22 Sep '17
Add an option to schedule based on timer or on DAI/DMA IRQ Signed-off-by: Liam Girdwood <liam.r.girdwood(a)linux.intel.com> --- src/include/uapi/ipc.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/include/uapi/ipc.h b/src/include/uapi/ipc.h index acfa05e..472fb41 100644 --- a/src/include/uapi/ipc.h +++ b/src/include/uapi/ipc.h @@ -678,6 +678,7 @@ struct sof_ipc_pipe_new { uint32_t mips; /* worst case instruction count per period */ uint32_t frames_per_sched; /* output frames of pipeline, 0 is variable */ uint32_t xrun_limit_usecs; /* report xruns greater than limit */ + uint32_t timer; /* non zero if timer scheduled otherwise DAI scheduled */ } __attribute__((packed)); /* pipeline construction complete - SOF_IPC_TPLG_PIPE_COMPLETE */ -- 2.11.0
1 2
0 0
[Sound-open-firmware] [PATCH] comp: enforce state transition checking for each component.
by Liam Girdwood 21 Sep '17

21 Sep '17
Make sure each component checks the state transition prior to performing any action for the new state. This ensure that only supported transitions are used and any non supported transition is flagged as an error. This also removes DRAIN state and performs some cleanup on mixer state handling. Signed-off-by: Liam Girdwood <liam.r.girdwood(a)linux.intel.com> --- src/audio/component.c | 7 +++--- src/audio/dai.c | 16 ++++-------- src/audio/eq_fir.c | 10 +++++--- src/audio/eq_iir.c | 28 ++++----------------- src/audio/host.c | 15 +++++------ src/audio/mixer.c | 51 +++++++++++++++++++++----------------- src/audio/src.c | 14 +++++------ src/audio/tone.c | 14 +++++------ src/audio/volume.c | 15 +++++------ src/include/reef/audio/component.h | 1 - src/ipc/intel-ipc.c | 3 --- 11 files changed, 74 insertions(+), 100 deletions(-) diff --git a/src/audio/component.c b/src/audio/component.c index 1cf4799..ec170c6 100644 --- a/src/audio/component.c +++ b/src/audio/component.c @@ -126,6 +126,7 @@ int comp_set_state(struct comp_dev *dev, int cmd) dev->state = COMP_STATE_ACTIVE; } else { trace_comp_error("CES"); + trace_value(dev->state); ret = -EINVAL; } break; @@ -134,6 +135,7 @@ int comp_set_state(struct comp_dev *dev, int cmd) dev->state = COMP_STATE_ACTIVE; } else { trace_comp_error("CEr"); + trace_value(dev->state); ret = -EINVAL; } break; @@ -142,6 +144,7 @@ int comp_set_state(struct comp_dev *dev, int cmd) dev->state = COMP_STATE_READY; } else { trace_comp_error("CEs"); + trace_value(dev->state); ret = -EINVAL; } break; @@ -151,13 +154,11 @@ int comp_set_state(struct comp_dev *dev, int cmd) dev->state = COMP_STATE_PAUSED; else { trace_comp_error("CEp"); + trace_value(dev->state); ret = -EINVAL; } break; default: - trace_comp_error("CEd"); - trace_value(cmd); - ret = -EINVAL; break; } diff --git a/src/audio/dai.c b/src/audio/dai.c index cf8de72..e22d21d 100644 --- a/src/audio/dai.c +++ b/src/audio/dai.c @@ -444,20 +444,18 @@ static int dai_reset(struct comp_dev *dev) static int dai_cmd(struct comp_dev *dev, int cmd, void *data) { struct dai_data *dd = comp_get_drvdata(dev); -// struct sof_ipc_ctrl_values *ctrl = data; int ret; trace_dai("cmd"); tracev_value(cmd); + ret = comp_set_state(dev, cmd); + if (ret < 0) + return ret; + switch (cmd) { - case COMP_CMD_PAUSE: - case COMP_CMD_STOP: - dev->state = COMP_STATE_PAUSED; - break; case COMP_CMD_RELEASE: case COMP_CMD_START: - ret = dma_start(dd->dma, dd->chan); if (ret < 0) return ret; @@ -465,16 +463,12 @@ static int dai_cmd(struct comp_dev *dev, int cmd, void *data) /* update starting wallclock */ platform_dai_wallclock(dev, &dd->wallclock); - dev->state = COMP_STATE_ACTIVE; - break; - case COMP_CMD_SUSPEND: - case COMP_CMD_RESUME: break; default: break; } - return 0; + return ret; } /* copy and process stream data from source to sink buffers */ diff --git a/src/audio/eq_fir.c b/src/audio/eq_fir.c index ef3b7d2..ba42643 100644 --- a/src/audio/eq_fir.c +++ b/src/audio/eq_fir.c @@ -389,16 +389,18 @@ static int eq_fir_cmd(struct comp_dev *dev, int cmd, void *data) trace_src("cmd"); + ret = comp_set_state(dev, cmd); + if (ret < 0) + return ret; + switch (cmd) { case COMP_CMD_SET_DATA: ret = fir_cmd(dev, cdata); break; - case COMP_CMD_START: case COMP_CMD_STOP: - case COMP_CMD_PAUSE: - case COMP_CMD_RELEASE: + comp_buffer_reset(dev); + break; default: - ret = comp_set_state(dev, cmd); break; } diff --git a/src/audio/eq_iir.c b/src/audio/eq_iir.c index 4a4cff1..995721b 100644 --- a/src/audio/eq_iir.c +++ b/src/audio/eq_iir.c @@ -392,36 +392,18 @@ static int eq_iir_cmd(struct comp_dev *dev, int cmd, void *data) trace_eq_iir("cmd"); + ret = comp_set_state(dev, cmd); + if (ret < 0) + return ret; + switch (cmd) { case COMP_CMD_SET_DATA: ret = iir_cmd(dev, cdata); break; - case COMP_CMD_START: - trace_eq_iir("EFs"); - dev->state = COMP_STATE_ACTIVE; - break; case COMP_CMD_STOP: - trace_eq_iir("ESp"); - if (dev->state == COMP_STATE_ACTIVE || - dev->state == COMP_STATE_PAUSED) { - comp_buffer_reset(dev); - dev->state = COMP_STATE_READY; - } - break; - case COMP_CMD_PAUSE: - trace_eq_iir("EPe"); - /* only support pausing for running */ - if (dev->state == COMP_STATE_ACTIVE) - dev->state = COMP_STATE_PAUSED; - - break; - case COMP_CMD_RELEASE: - trace_eq_iir("ERl"); - dev->state = COMP_STATE_ACTIVE; + comp_buffer_reset(dev); break; default: - trace_eq_iir("EDf"); - ret = -EINVAL; break; } diff --git a/src/audio/host.c b/src/audio/host.c index 8aa29ad..a1d312a 100644 --- a/src/audio/host.c +++ b/src/audio/host.c @@ -278,7 +278,7 @@ static struct comp_dev *host_new(struct sof_ipc_comp *comp) /* init posn data. TODO: other fields */ hd->posn.comp_id = comp->id; - + dev->state = COMP_STATE_READY; return dev; error: @@ -549,19 +549,16 @@ static int host_cmd(struct comp_dev *dev, int cmd, void *data) trace_host("cmd"); + ret = comp_set_state(dev, cmd); + if (ret < 0) + return ret; + switch (cmd) { case COMP_CMD_PAUSE: case COMP_CMD_STOP: - if (dev->state == COMP_STATE_ACTIVE) - ret = host_stop(dev); - break; - case COMP_CMD_SUSPEND: - case COMP_CMD_RESUME: + ret = host_stop(dev); break; - case COMP_CMD_START: - case COMP_CMD_RELEASE: default: - ret = comp_set_state(dev, cmd); break; } diff --git a/src/audio/mixer.c b/src/audio/mixer.c index 85aa601..3861b7c 100644 --- a/src/audio/mixer.c +++ b/src/audio/mixer.c @@ -151,55 +151,60 @@ static int mixer_params(struct comp_dev *dev) return 0; } -static int mixer_status_change(struct comp_dev *dev/* , uint32_t target_state */) +static int mixer_source_status_count(struct comp_dev *mixer, uint32_t status) { - int finish = 0; struct comp_buffer *source; struct list_item * blist; - uint32_t stream_target = COMP_STATE_INIT; + int count = 0; - /* calculate the highest status between input streams */ - list_for_item(blist, &dev->bsource_list) { + /* count source with state == status */ + list_for_item(blist, &mixer->bsource_list) { source = container_of(blist, struct comp_buffer, sink_list); - if (source->source->state > stream_target) - stream_target = source->source->state; + if (source->source->state == status) + count++; } - if (dev->state == stream_target) - finish = 1; - else - dev->state = stream_target; + return count; +} + +static inline int mixer_sink_status(struct comp_dev *mixer) +{ + struct comp_buffer *sink; - return finish; + sink = list_first_item(&mixer->bsink_list, struct comp_buffer, + source_list); + return sink->sink->state; } /* used to pass standard and bespoke commands (with data) to component */ static int mixer_cmd(struct comp_dev *dev, int cmd, void *data) { - int finish = 0; + int ret; trace_mixer("cmd"); + ret = comp_set_state(dev, cmd); + if (ret < 0) + return ret; + switch(cmd) { case COMP_CMD_START: - trace_mixer("MSa"); - case COMP_CMD_PAUSE: case COMP_CMD_RELEASE: - case COMP_CMD_DRAIN: - case COMP_CMD_SUSPEND: - case COMP_CMD_RESUME: - finish = mixer_status_change(dev); + if (mixer_sink_status(dev) == COMP_STATE_ACTIVE) + return 1; /* no need to go downstream */ break; + case COMP_CMD_PAUSE: case COMP_CMD_STOP: - finish = mixer_status_change(dev); - if (finish == 0) - comp_buffer_reset(dev); + if (mixer_source_status_count(dev, COMP_STATE_ACTIVE) > 0) { + dev->state = COMP_STATE_ACTIVE; + return 1; /* no need to go downstream */ + } break; default: break; } - return finish; + return 0; /* send cmd downstream */ } /* diff --git a/src/audio/src.c b/src/audio/src.c index bc32f95..1f84a5a 100644 --- a/src/audio/src.c +++ b/src/audio/src.c @@ -292,6 +292,7 @@ static struct comp_dev *src_new(struct sof_ipc_comp *comp) for (i = 0; i < PLATFORM_MAX_CHANNELS; i++) src_polyphase_reset(&cd->src[i]); + dev->state = COMP_STATE_READY; return dev; } @@ -489,17 +490,16 @@ 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"); + trace_src("cmd"); + + ret = comp_set_state(dev, cmd); + if (ret < 0) + return ret; switch (cmd) { case COMP_CMD_SET_VALUE: return src_ctrl_cmd(dev, cdata); - case COMP_CMD_START: - case COMP_CMD_STOP: - case COMP_CMD_PAUSE: - case COMP_CMD_RELEASE: default: - ret = comp_set_state(dev, cmd); break; } @@ -564,7 +564,7 @@ static int src_reset(struct comp_dev *dev) for (i = 0; i < PLATFORM_MAX_CHANNELS; i++) src_polyphase_reset(&cd->src[i]); - dev->state = COMP_STATE_INIT; + dev->state = COMP_STATE_READY; return 0; } diff --git a/src/audio/tone.c b/src/audio/tone.c index aec8a72..94d9aa7 100644 --- a/src/audio/tone.c +++ b/src/audio/tone.c @@ -395,6 +395,7 @@ static struct comp_dev *tone_new(struct sof_ipc_comp *comp) /* Reset tone generator and set channels volumes to default */ tonegen_reset(&cd->sg); + dev->state = COMP_STATE_READY; return dev; } @@ -472,17 +473,16 @@ 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"); + trace_tone("cmd"); + + ret = comp_set_state(dev, cmd); + if (ret < 0) + return ret; switch (cmd) { case COMP_CMD_SET_VALUE: return tone_ctrl_cmd(dev, cdata); - case COMP_CMD_START: - case COMP_CMD_STOP: - case COMP_CMD_PAUSE: - case COMP_CMD_RELEASE: default: - ret = comp_set_state(dev, cmd); break; } @@ -550,7 +550,7 @@ static int tone_reset(struct comp_dev *dev) /* Initialize with the defaults */ tonegen_reset(&cd->sg); - dev->state = COMP_STATE_INIT; + dev->state = COMP_STATE_READY; return 0; } diff --git a/src/audio/volume.c b/src/audio/volume.c index 45bbe27..960a144 100644 --- a/src/audio/volume.c +++ b/src/audio/volume.c @@ -466,25 +466,22 @@ static int volume_ctrl_get_cmd(struct comp_dev *dev, struct sof_ipc_ctrl_data *c static int volume_cmd(struct comp_dev *dev, int cmd, void *data) { struct sof_ipc_ctrl_data *cdata = data; - int ret = 0; + int ret; trace_volume("cmd"); + ret = comp_set_state(dev, cmd); + if (ret < 0) + return ret; + switch (cmd) { case COMP_CMD_SET_VALUE: return volume_ctrl_set_cmd(dev, cdata); case COMP_CMD_GET_VALUE: return volume_ctrl_get_cmd(dev, cdata); - case COMP_CMD_START: - case COMP_CMD_STOP: - case COMP_CMD_PAUSE: - case COMP_CMD_RELEASE: default: - ret = comp_set_state(dev, cmd); - break; + return ret; } - - 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 d092210..5ae8084 100644 --- a/src/include/reef/audio/component.h +++ b/src/include/reef/audio/component.h @@ -76,7 +76,6 @@ #define COMP_CMD_START 1 /* start component stream */ #define COMP_CMD_PAUSE 2 /* immediately pause the component stream */ #define COMP_CMD_RELEASE 3 /* release paused component stream */ -#define COMP_CMD_DRAIN 4 /* drain component buffers */ #define COMP_CMD_SUSPEND 5 /* suspend component */ #define COMP_CMD_RESUME 6 /* resume component */ diff --git a/src/ipc/intel-ipc.c b/src/ipc/intel-ipc.c index 752ea0c..92dfd73 100644 --- a/src/ipc/intel-ipc.c +++ b/src/ipc/intel-ipc.c @@ -394,9 +394,6 @@ static int ipc_stream_trigger(uint32_t header) case iCS(SOF_IPC_STREAM_TRIG_RELEASE): cmd = COMP_CMD_RELEASE; break; - case iCS(SOF_IPC_STREAM_TRIG_DRAIN): - cmd = COMP_CMD_DRAIN; - break; /* XRUN is special case- TODO */ case iCS(SOF_IPC_STREAM_TRIG_XRUN): return 0; -- 2.11.0
1 0
0 0
[Sound-open-firmware] [PATCH] comps: make sure correct state transitions are used and verified.
by Liam Girdwood 21 Sep '17

21 Sep '17
Use the correct component states and verify this at runtime. Signed-off-by: Liam Girdwood <liam.r.girdwood(a)linux.intel.com> --- src/audio/component.c | 18 ++++++++++++++---- src/audio/host.c | 10 ++++------ src/audio/mixer.c | 6 ++++-- src/audio/volume.c | 3 ++- 4 files changed, 24 insertions(+), 13 deletions(-) diff --git a/src/audio/component.c b/src/audio/component.c index fd0d65e..1cf4799 100644 --- a/src/audio/component.c +++ b/src/audio/component.c @@ -122,13 +122,23 @@ int comp_set_state(struct comp_dev *dev, int cmd) switch (cmd) { case COMP_CMD_START: + if (dev->state == COMP_STATE_PREPARE) { + dev->state = COMP_STATE_ACTIVE; + } else { + trace_comp_error("CES"); + ret = -EINVAL; + } + break; case COMP_CMD_RELEASE: - dev->state = COMP_STATE_ACTIVE; + if (dev->state == COMP_STATE_PAUSED) { + dev->state = COMP_STATE_ACTIVE; + } else { + trace_comp_error("CEr"); + ret = -EINVAL; + } break; case COMP_CMD_STOP: - if (dev->state == COMP_STATE_ACTIVE || - dev->state == COMP_STATE_PAUSED) { - comp_buffer_reset(dev); + if (dev->state == COMP_STATE_ACTIVE) { dev->state = COMP_STATE_READY; } else { trace_comp_error("CEs"); diff --git a/src/audio/host.c b/src/audio/host.c index 36e4c29..8aa29ad 100644 --- a/src/audio/host.c +++ b/src/audio/host.c @@ -527,7 +527,7 @@ static int host_stop(struct comp_dev *dev) /* now reset downstream buffer */ comp_buffer_reset(dev); - dev->state = COMP_STATE_READY; + dev->state = COMP_STATE_PAUSED; return 0; } @@ -549,18 +549,16 @@ static int host_cmd(struct comp_dev *dev, int cmd, void *data) trace_host("cmd"); - // TODO: align cmd macros. switch (cmd) { + case COMP_CMD_PAUSE: case COMP_CMD_STOP: - if (dev->state == COMP_STATE_ACTIVE || - dev->state == COMP_STATE_PAUSED) + if (dev->state == COMP_STATE_ACTIVE) ret = host_stop(dev); 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); @@ -616,7 +614,7 @@ static int host_reset(struct comp_dev *dev) hd->host_pos = NULL; hd->source = NULL; hd->sink = NULL; - dev->state = COMP_STATE_INIT; + dev->state = COMP_STATE_READY; return 0; } diff --git a/src/audio/mixer.c b/src/audio/mixer.c index 30ac8cc..85aa601 100644 --- a/src/audio/mixer.c +++ b/src/audio/mixer.c @@ -99,7 +99,7 @@ static struct comp_dev *mixer_new(struct sof_ipc_comp *comp) } comp_set_drvdata(dev, md); - + dev->state = COMP_STATE_READY; return dev; } @@ -274,7 +274,7 @@ static int mixer_reset(struct comp_dev *dev) return 1; /* should not reset the downstream components */ } - dev->state = COMP_STATE_INIT; + dev->state = COMP_STATE_READY; return 0; } @@ -312,6 +312,8 @@ static int mixer_prepare(struct comp_dev *dev) } } + dev->state = COMP_STATE_PREPARE; + /* prepare downstream */ return downstream; } diff --git a/src/audio/volume.c b/src/audio/volume.c index 13cba42..45bbe27 100644 --- a/src/audio/volume.c +++ b/src/audio/volume.c @@ -332,6 +332,7 @@ static struct comp_dev *volume_new(struct sof_ipc_comp *comp) cd->tvolume[i] = VOL_MAX; } + dev->state = COMP_STATE_READY; return dev; } @@ -649,7 +650,7 @@ static int volume_reset(struct comp_dev *dev) { trace_volume("res"); - dev->state = COMP_STATE_INIT; + dev->state = COMP_STATE_READY; return 0; } -- 2.11.0
1 0
0 0
[Sound-open-firmware] [PATCH] timer: use 64 bit timestamps
by Liam Girdwood 21 Sep '17

21 Sep '17
Use 64bit timestamps now that 64 bit timers are implemented. Signed-off-by: Liam Girdwood <liam.r.girdwood(a)linux.intel.com> --- src/platform/baytrail/timer.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/platform/baytrail/timer.c b/src/platform/baytrail/timer.c index 17c1f0b..ce58fc5 100644 --- a/src/platform/baytrail/timer.c +++ b/src/platform/baytrail/timer.c @@ -172,7 +172,7 @@ void platform_host_timestamp(struct comp_dev *host, /* get host postion */ err = comp_position(host, posn); if (err == 0) - posn->flags |= SOF_TIME_HOST_VALID; + posn->flags |= SOF_TIME_HOST_VALID | SOF_TIME_HOST_64; } /* get timestamp for DAI stream DMA position */ @@ -187,15 +187,15 @@ void platform_dai_timestamp(struct comp_dev *dai, posn->flags |= SOF_TIME_DAI_VALID; /* get SSP wallclock - DAI sets this to stream start value */ - posn->wallclock = shim_read(SHIM_EXT_TIMER_STAT) - posn->wallclock; - posn->flags |= SOF_TIME_WALL_VALID; + posn->wallclock = platform_timer_get(platform_timer) - posn->wallclock; + posn->flags |= SOF_TIME_WALL_VALID | SOF_TIME_WALL_64; } /* get current wallclock for componnent */ void platform_dai_wallclock(struct comp_dev *dai, uint64_t *wallclock) { /* only 1 wallclock on BYT */ - *wallclock = shim_read(SHIM_EXT_TIMER_STAT); + *wallclock = platform_timer_get(platform_timer); } static int platform_timer_register(struct timer *timer, -- 2.11.0
1 0
0 0
[Sound-open-firmware] [PATCH] ssp: irq: fix handler comment and remove FIFO empty loop
by Liam Girdwood 21 Sep '17

21 Sep '17
Comment is wrong and FIFO empty not needed in IRQ handler. Signed-off-by: Liam Girdwood <liam.r.girdwood(a)linux.intel.com> --- src/drivers/ssp.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/drivers/ssp.c b/src/drivers/ssp.c index b87806e..7538edd 100644 --- a/src/drivers/ssp.c +++ b/src/drivers/ssp.c @@ -370,19 +370,14 @@ static int ssp_trigger(struct dai *dai, int cmd, int direction) return 0; } -/* The IRQ handler allows the SSP port to drain the playback FIFO to make sure - * every sample has been played */ +/* clear IRQ sources atm */ static void ssp_irq_handler(void *data) { struct dai *dai = data; - int i; + trace_ssp("irq"); trace_value(ssp_read(dai, SSSR)); - /* empty Rx FIFO */ - for (i = 0; i < 16; i++) - ssp_read(dai, SSDR); - /* clear IRQ */ ssp_write(dai, SSSR, ssp_read(dai, SSSR)); platform_interrupt_clear(ssp_irq(dai), 1); -- 2.11.0
1 0
0 0
  • ← Newer
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • Older →

HyperKitty Powered by HyperKitty version 1.3.8.