* [RFC 0/2] ASoC: core: Ignoring pmdown_time for playback stream power down
@ 2011-10-13 13:23 Peter Ujfalusi
2011-10-13 13:23 ` [RFC 1/2] ASoC: soc-pcm: Add flag to ignore pmdown_time at pcm_close Peter Ujfalusi
2011-10-13 13:23 ` [RFC 2/2] ASoC: sdp4430: Request core to inline the DAPM sequence Peter Ujfalusi
0 siblings, 2 replies; 7+ messages in thread
From: Peter Ujfalusi @ 2011-10-13 13:23 UTC (permalink / raw)
To: Mark Brown, Liam Girdwood; +Cc: alsa-devel, Misael Lopez Cruz
Hello Mark,
Add support in core to ignore the pmdown_time when stopping the playback stream.
This will inline the DAPM stream stop event, so it is going to be executed
without delay at stream close time (for playback stream).
Backround: with the McPDM protocol we are sendning not only
the pure audio stream, but OMAP McPDM also transmits
additional information (for example offset cancellation).
If McPDM is stopped prior to the DAC this information will
be not sent to the codec, which can result noise rendered
by the twl6040 codec.
Is this something that you were suggesting?
Regards,
Peter
---
Peter Ujfalusi (2):
ASoC: soc-pcm: Add flag to ignore pmdown_time at pcm_close
ASoC: sdp4430: Request core to inline the DAPM sequence
include/sound/soc.h | 3 +++
sound/soc/omap/sdp4430.c | 1 +
sound/soc/soc-pcm.c | 15 +++++++++++----
3 files changed, 15 insertions(+), 4 deletions(-)
--
1.7.7
^ permalink raw reply [flat|nested] 7+ messages in thread
* [RFC 1/2] ASoC: soc-pcm: Add flag to ignore pmdown_time at pcm_close
2011-10-13 13:23 [RFC 0/2] ASoC: core: Ignoring pmdown_time for playback stream power down Peter Ujfalusi
@ 2011-10-13 13:23 ` Peter Ujfalusi
2011-10-13 14:00 ` Mark Brown
2011-10-13 13:23 ` [RFC 2/2] ASoC: sdp4430: Request core to inline the DAPM sequence Peter Ujfalusi
1 sibling, 1 reply; 7+ messages in thread
From: Peter Ujfalusi @ 2011-10-13 13:23 UTC (permalink / raw)
To: Mark Brown, Liam Girdwood; +Cc: alsa-devel, Misael Lopez Cruz
With this flag machine drivers can indicate that it is desired
to ignore the pmdown_time for DAPM shutdown sequence when
playback stream is stopped.
The DAPM sequence will be executed without delay in this case.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
include/sound/soc.h | 3 +++
sound/soc/soc-pcm.c | 15 +++++++++++----
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 858291d..7b75b68 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -717,6 +717,9 @@ struct snd_soc_dai_link {
/* Symmetry requirements */
unsigned int symmetric_rates:1;
+ /* Will ingore the pmdown_time for playback stream */
+ unsigned int ignore_pmdown_time:1;
+
/* codec/machine specific init - e.g. add machine controls */
int (*init)(struct snd_soc_pcm_runtime *rtd);
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index 8eb0f07..faac256 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -319,10 +319,17 @@ static int soc_pcm_close(struct snd_pcm_substream *substream)
cpu_dai->runtime = NULL;
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
- /* start delayed pop wq here for playback streams */
- codec_dai->pop_wait = 1;
- schedule_delayed_work(&rtd->delayed_work,
- msecs_to_jiffies(rtd->pmdown_time));
+ if (unlikely(rtd->dai_link->ignore_pmdown_time)) {
+ /* powered down playback stream now */
+ snd_soc_dapm_stream_event(rtd,
+ codec_dai->driver->playback.stream_name,
+ SND_SOC_DAPM_STREAM_STOP);
+ } else {
+ /* start delayed pop wq here for playback streams */
+ codec_dai->pop_wait = 1;
+ schedule_delayed_work(&rtd->delayed_work,
+ msecs_to_jiffies(rtd->pmdown_time));
+ }
} else {
/* capture streams can be powered down now */
snd_soc_dapm_stream_event(rtd,
--
1.7.7
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [RFC 1/2] ASoC: soc-pcm: Add flag to ignore pmdown_time at pcm_close
2011-10-13 13:23 ` [RFC 1/2] ASoC: soc-pcm: Add flag to ignore pmdown_time at pcm_close Peter Ujfalusi
@ 2011-10-13 14:00 ` Mark Brown
2011-10-14 9:24 ` Péter Ujfalusi
0 siblings, 1 reply; 7+ messages in thread
From: Mark Brown @ 2011-10-13 14:00 UTC (permalink / raw)
To: Peter Ujfalusi; +Cc: alsa-devel, Liam Girdwood, Misael Lopez Cruz
On Thu, Oct 13, 2011 at 04:23:34PM +0300, Peter Ujfalusi wrote:
> With this flag machine drivers can indicate that it is desired
> to ignore the pmdown_time for DAPM shutdown sequence when
> playback stream is stopped.
> The DAPM sequence will be executed without delay in this case.
Why make this a per-machine control? This seems like it'd be a property
of the CODEC or possibly other chips rather than a machine specific thing?
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFC 1/2] ASoC: soc-pcm: Add flag to ignore pmdown_time at pcm_close
2011-10-13 14:00 ` Mark Brown
@ 2011-10-14 9:24 ` Péter Ujfalusi
2011-10-14 9:38 ` Mark Brown
0 siblings, 1 reply; 7+ messages in thread
From: Péter Ujfalusi @ 2011-10-14 9:24 UTC (permalink / raw)
To: Mark Brown; +Cc: alsa-devel, Liam Girdwood, Misael Lopez Cruz
On Thursday 13 October 2011 15:00:03 Mark Brown wrote:
> On Thu, Oct 13, 2011 at 04:23:34PM +0300, Peter Ujfalusi wrote:
> > With this flag machine drivers can indicate that it is desired
> > to ignore the pmdown_time for DAPM shutdown sequence when
> > playback stream is stopped.
> > The DAPM sequence will be executed without delay in this case.
>
> Why make this a per-machine control? This seems like it'd be a property
> of the CODEC or possibly other chips rather than a machine specific thing?
I thought that depending on the environment we might need this or not for the
same component, and the best place for this is to be able to define it per dai
link.
However I can move the flag as per codec configuration (within snd_soc_codec
struct). Would that be better?
--
Péter
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFC 1/2] ASoC: soc-pcm: Add flag to ignore pmdown_time at pcm_close
2011-10-14 9:24 ` Péter Ujfalusi
@ 2011-10-14 9:38 ` Mark Brown
2011-10-14 10:27 ` Péter Ujfalusi
0 siblings, 1 reply; 7+ messages in thread
From: Mark Brown @ 2011-10-14 9:38 UTC (permalink / raw)
To: P?ter Ujfalusi; +Cc: alsa-devel, Liam Girdwood, Misael Lopez Cruz
On Fri, Oct 14, 2011 at 12:24:01PM +0300, P?ter Ujfalusi wrote:
> I thought that depending on the environment we might need this or not for the
> same component, and the best place for this is to be able to define it per dai
> link.
> However I can move the flag as per codec configuration (within snd_soc_codec
> struct). Would that be better?
I'd expect that it's likely to follow the device a lot of the time - for
example, in the case that motivated this it seems that every system
using twl6040 is going to need to work around the DC servo issue.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFC 1/2] ASoC: soc-pcm: Add flag to ignore pmdown_time at pcm_close
2011-10-14 9:38 ` Mark Brown
@ 2011-10-14 10:27 ` Péter Ujfalusi
0 siblings, 0 replies; 7+ messages in thread
From: Péter Ujfalusi @ 2011-10-14 10:27 UTC (permalink / raw)
To: Mark Brown; +Cc: alsa-devel, Liam Girdwood, Misael Lopez Cruz
On Friday 14 October 2011 10:38:41 Mark Brown wrote:
> I'd expect that it's likely to follow the device a lot of the time - for
> example, in the case that motivated this it seems that every system
> using twl6040 is going to need to work around the DC servo issue.
Fair enough. I'll move the flag to snd_soc_codec.
--
Péter
^ permalink raw reply [flat|nested] 7+ messages in thread
* [RFC 2/2] ASoC: sdp4430: Request core to inline the DAPM sequence
2011-10-13 13:23 [RFC 0/2] ASoC: core: Ignoring pmdown_time for playback stream power down Peter Ujfalusi
2011-10-13 13:23 ` [RFC 1/2] ASoC: soc-pcm: Add flag to ignore pmdown_time at pcm_close Peter Ujfalusi
@ 2011-10-13 13:23 ` Peter Ujfalusi
1 sibling, 0 replies; 7+ messages in thread
From: Peter Ujfalusi @ 2011-10-13 13:23 UTC (permalink / raw)
To: Mark Brown, Liam Girdwood; +Cc: alsa-devel, Misael Lopez Cruz
We need to have as less time between OMAP McPDM shutdown,
and power down of the DAC on the twl6040 codec as possible.
Request core to ignore the pmdown_time for the playback
stream.
Backround: with the McPDM protocol we are sendning not only
the pure audio stream, but OMAP McPDM also transmits
additional information (for example offset cancellation).
If McPDM is stopped prior to the DAC this information will
be not sent to the codec, which can result noise rendered
by the twl6040 codec.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
sound/soc/omap/sdp4430.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/sound/soc/omap/sdp4430.c b/sound/soc/omap/sdp4430.c
index cc3d792..e2f93e8 100644
--- a/sound/soc/omap/sdp4430.c
+++ b/sound/soc/omap/sdp4430.c
@@ -155,6 +155,7 @@ static struct snd_soc_dai_link sdp4430_dai = {
.codec_dai_name = "twl6040-legacy",
.platform_name = "omap-pcm-audio",
.codec_name = "twl6040-codec",
+ .ignore_pmdown_time = 1,
.init = sdp4430_twl6040_init,
.ops = &sdp4430_ops,
};
--
1.7.7
^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2011-10-14 10:27 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-13 13:23 [RFC 0/2] ASoC: core: Ignoring pmdown_time for playback stream power down Peter Ujfalusi
2011-10-13 13:23 ` [RFC 1/2] ASoC: soc-pcm: Add flag to ignore pmdown_time at pcm_close Peter Ujfalusi
2011-10-13 14:00 ` Mark Brown
2011-10-14 9:24 ` Péter Ujfalusi
2011-10-14 9:38 ` Mark Brown
2011-10-14 10:27 ` Péter Ujfalusi
2011-10-13 13:23 ` [RFC 2/2] ASoC: sdp4430: Request core to inline the DAPM sequence Peter Ujfalusi
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.