From: Grant Likely <grant.likely@secretlab.ca>
To: Jon Smirl <jonsmirl@gmail.com>
Cc: alsa-devel@alsa-project.org, broonie@opensource.wolfsonmicro.com,
linuxppc-dev@lists.ozlabs.org, lrg@slimlogic.co.uk
Subject: Re: [PATCH 2/6] ASoC/mpc5200: get rid of the appl_ptr tracking nonsense
Date: Sat, 7 Nov 2009 11:53:30 -0700 [thread overview]
Message-ID: <fa686aa40911071053s42428f9bi716a0efedb31c8f@mail.gmail.com> (raw)
In-Reply-To: <9e4733910911070504g13bce539w92120b8124e3e8e9@mail.gmail.com>
On Sat, Nov 7, 2009 at 6:04 AM, Jon Smirl <jonsmirl@gmail.com> wrote:
> On Sat, Nov 7, 2009 at 7:51 AM, Jon Smirl <jonsmirl@gmail.com> wrote:
>> On Sat, Nov 7, 2009 at 3:34 AM, Grant Likely <grant.likely@secretlab.ca>=
wrote:
>>> Sound drivers PCM DMA is supposed to free-run until told to stop
>>> by the trigger callback. =A0The current code tries to track appl_ptr,
>>> to avoid stale buffer data getting played out at the end of the
>>> data stream. =A0Unfortunately it also results in race conditions
>>> which can cause the audio to stall.
>>
>> I leave in an hour and I will be off net for a week so I can't look at t=
hese.
>
> There is a surefire way to fix this but I have resisted doing it
> because it is fixing a symptom not a cause.
>
> Simply have the driver zero out the buffer in the completion interrupt
> before handing it back to ALSA. Then if ALSA lets us play invalid data
> the invalid data will be silence. I implemented this and it works
> every time.
>
> Downside is a big memset() in an IRQ handler.
... and then the driver may as well manually copy the audio data from
the buffer into the PSC FIFO. No win here.
The other option (which I think is how ALSA is designed) is for
userspace to insert silence at the end of playback data so that the
stop trigger lands in a safe place.
g.
next prev parent reply other threads:[~2009-11-07 18:53 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-07 8:33 [PATCH 0/6] Fixups to MPC5200 ASoC drivers Grant Likely
2009-11-07 8:33 ` [PATCH 1/6] ASoC/mpc5200: Track DMA position by period number instead of bytes Grant Likely
2009-11-07 10:35 ` [alsa-devel] " Liam Girdwood
2009-11-07 16:50 ` Grant Likely
2009-11-07 8:34 ` [PATCH 2/6] ASoC/mpc5200: get rid of the appl_ptr tracking nonsense Grant Likely
2009-11-07 12:51 ` Jon Smirl
2009-11-07 13:04 ` Jon Smirl
2009-11-07 18:53 ` Grant Likely [this message]
2009-11-07 18:51 ` Grant Likely
2009-11-07 20:12 ` [alsa-devel] " Mark Brown
2009-11-11 16:38 ` Jon Smirl
2009-11-11 18:37 ` Mark Brown
2009-11-11 19:24 ` Grant Likely
2009-11-11 20:03 ` Mark Brown
2009-11-11 21:34 ` Jon Smirl
2009-11-11 21:57 ` Grant Likely
2009-11-11 23:13 ` Jon Smirl
2009-11-12 12:10 ` Mark Brown
2009-11-11 21:26 ` Jon Smirl
2009-11-07 8:34 ` [PATCH 3/6] ASoC/mpc5200: Improve printk debug output for trigger Grant Likely
2009-11-07 8:34 ` [PATCH 4/6] ASoC/mpc5200: add to_psc_dma_stream() helper Grant Likely
2009-11-07 12:33 ` [alsa-devel] " Mark Brown
2009-11-07 8:34 ` [PATCH 5/6] ASoC/mpc5200: fix enable/disable of AC97 slots Grant Likely
2009-11-07 8:34 ` [PATCH 6/6] ASoC/mpc5200: Add fudge factor to value reported by .pointer() Grant Likely
2009-11-07 18:11 ` [alsa-devel] " Mark Brown
2009-11-07 18:19 ` Grant Likely
2009-11-07 19:33 ` Mark Brown
2009-11-07 19:46 ` Grant Likely
2009-11-07 12:57 ` [alsa-devel] [PATCH 0/6] Fixups to MPC5200 ASoC drivers Mark Brown
2009-11-07 16:52 ` Grant Likely
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=fa686aa40911071053s42428f9bi716a0efedb31c8f@mail.gmail.com \
--to=grant.likely@secretlab.ca \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=jonsmirl@gmail.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=lrg@slimlogic.co.uk \
/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 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).