From: Mark Brown <broonie@opensource•wolfsonmicro.com>
To: Grant Likely <grant.likely@secretlab•ca>
Cc: John Bonesio <bones@secretlab•ca>,
alsa-devel@alsa-project•org, linuxppc-dev@lists•ozlabs.org,
lrg@slimlogic•co.uk
Subject: Re: [alsa-devel] [PATCH 2/6] ASoC/mpc5200: get rid of the appl_ptr tracking nonsense
Date: Sat, 7 Nov 2009 20:12:33 +0000 [thread overview]
Message-ID: <20091107201233.GC31789@sirena.org.uk> (raw)
In-Reply-To: <fa686aa40911071051y3cf63e55ibe7fbc65c30bd15e@mail.gmail.com>
On Sat, Nov 07, 2009 at 11:51:16AM -0700, Grant Likely wrote:
> On Sat, Nov 7, 2009 at 5:51 AM, Jon Smirl <jonsmirl@gmail•com> wrote:
> current period. My understanding of ALSA is that the application is
> supposed to make sure there is enough silence in the buffer to handle
> the lag between notification that the last period with valid data has
> been played out and the stop trigger.
This is certainly the most robust approach for applications. For a
large proportion of hardware it won't matter too much since they're able
to shut down the audio very quickly but that can't be entirely relied
upon, especially at higher rates on slower machines.
> occur. That says to me that the real problem is an unbounded latency
> caused by another part of the kernel (the tty console in this case).
That's certainly not going to help anything here - if a delay is
introduced in telling the hardware to shut down the DMA then that
increases the chance for the DMA controller to start pushing valid audio
data from the buffer to the audio interface.
> > A much cleaner solution would be for ALSA to provide a field that
> > indicates the last valid address in the ring buffer system. Then in
> > the driver's buffer complete callback I could get that value and
> > reprogram the DMA engine not to run off the end of valid data. As each
> > buffer completes I would reread the value and update the DMA stop
> > address. You also need the last valid address field when DMA is first
> > started.
> ... assuming that audio needs to stop exactly at the end of valid
> data. But if the last few periods are silence, then this assumption
> isn't true.
Indeed, it makes the whole thing much more reliable.
Providing a final valid data point to the driver would possibly even
make things worse since if it were used then you'd have the equivalent
race where the application has initialised some data but not yet managed
to update the driver to tell it it's being handed over; if the driver
just carries on running through the data there's a reasonable chance
nobody will notice that case.
next prev parent reply other threads:[~2009-11-07 20:12 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
2009-11-07 18:51 ` Grant Likely
2009-11-07 20:12 ` Mark Brown [this message]
2009-11-11 16:38 ` [alsa-devel] " 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=20091107201233.GC31789@sirena.org.uk \
--to=broonie@opensource$(echo .)wolfsonmicro.com \
--cc=alsa-devel@alsa-project$(echo .)org \
--cc=bones@secretlab$(echo .)ca \
--cc=grant.likely@secretlab$(echo .)ca \
--cc=linuxppc-dev@lists$(echo .)ozlabs.org \
--cc=lrg@slimlogic$(echo .)co.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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