From: Johannes Berg <johannes@sipsolutions.net>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org, Paul Mackerras <paulus@samba.org>,
benjamin@sipsolutions.net
Subject: Re: [RFC/PATCH] Stop Apple i2s DMA gracefully
Date: Mon, 06 Nov 2006 11:47:39 +0100 [thread overview]
Message-ID: <1162810059.2762.14.camel@ux156> (raw)
In-Reply-To: <s5hy7qosvv6.wl%tiwai@suse.de>
On Mon, 2006-11-06 at 11:38 +0100, Takashi Iwai wrote:
> The trigger callback cannot sleep in design. It's always atomic.
Alright.
> Usually, the driver calls snd_pcm_suspend_all() in suspend callback,
> which triggers with SNDRV_PCM_TRIGGER_SUSPEND. In your case, this
> should terminate the DMA while SNDRV_PCM_TRIGGER_STOP continues the
> DMA. Or, put a sync call after snd_pcm_suspend_all() in the suspend
> callback.
Yeah, I think the latter is preferable.
> The implementation of resume depends on the hardware, BTW.
> In short, there is no snd_pcm_resume*() function.
Ok.
> If your hardware supports the real resume (i.e. can restart the stream
> as it was), set SNDRV_PCM_INFO_RESUME flag in snd_pcm_hardware info
> field, and do the right thing in resume callback.
> If not (in many cases), the usual reset procedure is done (prepare,
> trigger-start), so the resume callback doesn't have to do any special
> thing about PCM. SNDRV_PCM_TRIGGER_SUSPEND should be handled just like
> a normal STOP trigger, in such a case.
We can restart the stream as it was by just rewriting the dbdma command
register to point it where we were during suspend, since the dma command
ring will have been kept intact in memory over suspend. Hence, I think
we can actually support SNDRV_PCM_INFO_RESUME easily by doing the
regular stop, storing the command pointer, and starting back where we
were by reprogramming the dma engine properly.
However, this would also require reprogramming the i2s chip to the
correct format etc, so it will be a lot easier to just do the regular
prepare sequence.
Thanks,
johannes
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
next prev parent reply other threads:[~2006-11-06 10:46 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-29 4:19 [RFC/PATCH] Stop Apple i2s DMA gracefully Paul Mackerras
2006-10-29 8:49 ` Johannes Berg
2006-10-29 10:47 ` Paul Mackerras
2006-10-29 12:23 ` Johannes Berg
2006-10-31 14:14 ` Takashi Iwai
2006-11-01 1:05 ` Paul Mackerras
2006-11-02 8:29 ` Johannes Berg
2006-11-02 21:54 ` Paul Mackerras
2006-11-02 22:59 ` Johannes Berg
2006-11-06 10:38 ` Takashi Iwai
2006-11-06 10:41 ` Paul Mackerras
2006-11-06 10:50 ` Johannes Berg
2006-11-28 12:03 ` Takashi Iwai
2006-11-06 10:47 ` Johannes Berg [this message]
2007-02-08 13:12 ` [PATCH] aoa i2sbus: " Johannes Berg
2007-02-08 13:12 ` Johannes Berg
2007-02-08 14:07 ` Takashi Iwai
2007-02-08 14:07 ` Takashi Iwai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1162810059.2762.14.camel@ux156 \
--to=johannes@sipsolutions.net \
--cc=alsa-devel@alsa-project.org \
--cc=benjamin@sipsolutions.net \
--cc=paulus@samba.org \
--cc=tiwai@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.