* [PATCH] ASoC: samsung dma - prepare dma in start/resume trigger path
@ 2012-08-23 20:51 Dylan Reid
2012-08-23 20:54 ` Dylan Reid
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Dylan Reid @ 2012-08-23 20:51 UTC (permalink / raw)
To: linux-arm-kernel
On suspend all dma transactions are terminated (by the stop/suspend
trigger calling ops->stop), they need to be set up again during resume.
Move the prepare op to the start/resume/unpause trigger path so that dma
and audio will restart on resume/unpause.
Signed-off-by: Dylan Reid <dgreid@chromium.org>
---
sound/soc/samsung/dma.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/sound/soc/samsung/dma.c b/sound/soc/samsung/dma.c
index f3ebc38..5772762 100644
--- a/sound/soc/samsung/dma.c
+++ b/sound/soc/samsung/dma.c
@@ -250,6 +250,7 @@ static int dma_trigger(struct snd_pcm_substream *substream, int cmd)
case SNDRV_PCM_TRIGGER_START:
case SNDRV_PCM_TRIGGER_RESUME:
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
+ dma_prepare(substream);
prtd->state |= ST_RUNNING;
prtd->params->ops->trigger(prtd->params->ch);
break;
@@ -352,7 +353,6 @@ static struct snd_pcm_ops dma_ops = {
.ioctl = snd_pcm_lib_ioctl,
.hw_params = dma_hw_params,
.hw_free = dma_hw_free,
- .prepare = dma_prepare,
.trigger = dma_trigger,
.pointer = dma_pointer,
.mmap = dma_mmap,
--
1.7.7.3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH] ASoC: samsung dma - prepare dma in start/resume trigger path
2012-08-23 20:51 [PATCH] ASoC: samsung dma - prepare dma in start/resume trigger path Dylan Reid
@ 2012-08-23 20:54 ` Dylan Reid
2012-08-24 7:15 ` [alsa-devel] " Clemens Ladisch
2012-08-24 7:41 ` Sangbeom Kim
2 siblings, 0 replies; 7+ messages in thread
From: Dylan Reid @ 2012-08-23 20:54 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Aug 23, 2012 at 1:51 PM, Dylan Reid <dgreid@chromium.org> wrote:
> On suspend all dma transactions are terminated (by the stop/suspend
> trigger calling ops->stop), they need to be set up again during resume.
> Move the prepare op to the start/resume/unpause trigger path so that dma
> and audio will restart on resume/unpause.
>
> Signed-off-by: Dylan Reid <dgreid@chromium.org>
> ---
> sound/soc/samsung/dma.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/sound/soc/samsung/dma.c b/sound/soc/samsung/dma.c
> index f3ebc38..5772762 100644
> --- a/sound/soc/samsung/dma.c
> +++ b/sound/soc/samsung/dma.c
> @@ -250,6 +250,7 @@ static int dma_trigger(struct snd_pcm_substream *substream, int cmd)
> case SNDRV_PCM_TRIGGER_START:
> case SNDRV_PCM_TRIGGER_RESUME:
> case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
> + dma_prepare(substream);
> prtd->state |= ST_RUNNING;
> prtd->params->ops->trigger(prtd->params->ch);
> break;
> @@ -352,7 +353,6 @@ static struct snd_pcm_ops dma_ops = {
> .ioctl = snd_pcm_lib_ioctl,
> .hw_params = dma_hw_params,
> .hw_free = dma_hw_free,
> - .prepare = dma_prepare,
> .trigger = dma_trigger,
> .pointer = dma_pointer,
> .mmap = dma_mmap,
> --
> 1.7.7.3
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [alsa-devel] [PATCH] ASoC: samsung dma - prepare dma in start/resume trigger path
2012-08-23 20:51 [PATCH] ASoC: samsung dma - prepare dma in start/resume trigger path Dylan Reid
2012-08-23 20:54 ` Dylan Reid
@ 2012-08-24 7:15 ` Clemens Ladisch
2012-08-24 7:41 ` Sangbeom Kim
2 siblings, 0 replies; 7+ messages in thread
From: Clemens Ladisch @ 2012-08-24 7:15 UTC (permalink / raw)
To: linux-arm-kernel
Dylan Reid wrote:
> On suspend all dma transactions are terminated (by the stop/suspend
> trigger calling ops->stop), they need to be set up again during resume.
> Move the prepare op to the start/resume/unpause trigger path so that dma
> and audio will restart on resume/unpause.
TRIGGER_RESUME must restart the stream at the buffer position at which
it was suspended. If the driver is not capable of that, it must not
support TRIGGER_SUSPEND/RESUME in the first place (i.e., remove
SNDRV_PCM_INFO_RESUME).
Regards,
Clemens
^ permalink raw reply [flat|nested] 7+ messages in thread
* [alsa-devel] [PATCH] ASoC: samsung dma - prepare dma in start/resume trigger path
2012-08-23 20:51 [PATCH] ASoC: samsung dma - prepare dma in start/resume trigger path Dylan Reid
2012-08-23 20:54 ` Dylan Reid
2012-08-24 7:15 ` [alsa-devel] " Clemens Ladisch
@ 2012-08-24 7:41 ` Sangbeom Kim
2012-08-24 7:52 ` Dylan Reid
2 siblings, 1 reply; 7+ messages in thread
From: Sangbeom Kim @ 2012-08-24 7:41 UTC (permalink / raw)
To: linux-arm-kernel
Hi!
On Thu, Aug 24, 2012 at 5:51 AM, Dylan Reid wrote:
> On suspend all dma transactions are terminated (by the stop/suspend
> trigger calling ops->stop), they need to be set up again during resume.
> Move the prepare op to the start/resume/unpause trigger path so that dma
> and audio will restart on resume/unpause.
Do you mean that currently, suspend/resume can't be supported?
Thanks,
Sangbeom.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [alsa-devel] [PATCH] ASoC: samsung dma - prepare dma in start/resume trigger path
2012-08-24 7:41 ` Sangbeom Kim
@ 2012-08-24 7:52 ` Dylan Reid
2012-08-24 10:06 ` Sangbeom Kim
0 siblings, 1 reply; 7+ messages in thread
From: Dylan Reid @ 2012-08-24 7:52 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Aug 24, 2012 at 12:41 AM, Sangbeom Kim <sbkim73@samsung.com> wrote:
> Hi!
>
> On Thu, Aug 24, 2012 at 5:51 AM, Dylan Reid wrote:
>> On suspend all dma transactions are terminated (by the stop/suspend
>> trigger calling ops->stop), they need to be set up again during resume.
>> Move the prepare op to the start/resume/unpause trigger path so that dma
>> and audio will restart on resume/unpause.
> Do you mean that currently, suspend/resume can't be supported?
Yes. Currently, if I suspend while playing, after resume it won't work
until I close and reopen the device. the call to snd_pcm_resume is
not indicating an error, but a write error comes from snd_pcm_write a
little later.
The suspend trigger calls ops->stop, which in turn sends
DMA_TERMINATE_ALL to the pl330. I think this causes resume's call to
ops->trigger to fail because there is nothing enqueued, but I'm pretty
new to this system.
Thanks for the help!
Dylan
>
> Thanks,
> Sangbeom.
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [alsa-devel] [PATCH] ASoC: samsung dma - prepare dma in start/resume trigger path
2012-08-24 7:52 ` Dylan Reid
@ 2012-08-24 10:06 ` Sangbeom Kim
2012-08-24 17:29 ` Dylan Reid
0 siblings, 1 reply; 7+ messages in thread
From: Sangbeom Kim @ 2012-08-24 10:06 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Aug 24, 2012 at 4:52 PM, Dylan Reid wrote:
> Yes. Currently, if I suspend while playing, after resume it won't work
> until I close and reopen the device. the call to snd_pcm_resume is
> not indicating an error, but a write error comes from snd_pcm_write a
> little later.
Ok,
Please let me know your test environment.
Thanks,
Sangbeom.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [alsa-devel] [PATCH] ASoC: samsung dma - prepare dma in start/resume trigger path
2012-08-24 10:06 ` Sangbeom Kim
@ 2012-08-24 17:29 ` Dylan Reid
0 siblings, 0 replies; 7+ messages in thread
From: Dylan Reid @ 2012-08-24 17:29 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Aug 24, 2012 at 3:06 AM, Sangbeom Kim <sbkim73@samsung.com> wrote:
> On Thu, Aug 24, 2012 at 4:52 PM, Dylan Reid wrote:
>> Yes. Currently, if I suspend while playing, after resume it won't work
>> until I close and reopen the device. the call to snd_pcm_resume is
>> not indicating an error, but a write error comes from snd_pcm_write a
>> little later.
>
> Ok,
> Please let me know your test environment.
I'm using a 5250 evaluation board with a max98095 codec.
>
> Thanks,
> Sangbeom.
>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-08-24 17:29 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-23 20:51 [PATCH] ASoC: samsung dma - prepare dma in start/resume trigger path Dylan Reid
2012-08-23 20:54 ` Dylan Reid
2012-08-24 7:15 ` [alsa-devel] " Clemens Ladisch
2012-08-24 7:41 ` Sangbeom Kim
2012-08-24 7:52 ` Dylan Reid
2012-08-24 10:06 ` Sangbeom Kim
2012-08-24 17:29 ` Dylan Reid
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).