From: Raymond Yau <superquad.vortex2@gmail.com>
To: ALSA Development Mailing List <alsa-devel@alsa-project.org>
Subject: Re: [RFC] disabling ALSA period interrupts
Date: Thu, 13 May 2010 08:37:12 +0800 [thread overview]
Message-ID: <AANLkTinHc24MCBc0vBQB3WARiIfcYMRQ_WCKabKUtEIc@mail.gmail.com> (raw)
In-Reply-To: <AANLkTimBQOoQGFoPZ8T7nRrDKhsylLNiqkeQ-HinIeyV@mail.gmail.com>
2010/5/12 pl bossart <bossart.nospam@gmail.com>
> > Some care would need to be taken with regards to detecting xruns.
> > I think the alsa code currently uses the interrupt callback to detect
> this.
> > I have seen a Windows 7 machine happily loop the audio buffer
> > uncontrollably, so I assume it has problems detecting xruns as well.
>
> When the PulseAudio timer fires, the use of snd_pcm_avail() will force
> a call to .pointer and will detect underflows. PulseAudio modilfies
> its watermark when underflows occur so that more time is allocated to
> refilling the ring buffer.
> There are probably some cases I didn't plan for, but on paper I don't
> really see a show-stopper here.
>
> > Some sound card hardware only updates the hw pointer at around dma
> > interrupt event time, so again using the interrupt is used to improve
> > the accuracy of the hw pointer with interpolation used between
> > interrupts.
>
> If the hardware doesn't provide an accurate hw pointer, then the
> timer-based scheduling should not be used I agree.
>
How accurate do timer-based scheduling need ?
e.g. accuracy up to +/- 5% of period size
or the watermark is too low for those sound card
can PA provide option to change the initial watermark ?
>
> > Some sound card hardware has very small hardware buffers, so PA will
> > have to be waking up as often as the dma interrupts in order to keep
> > the audio hardware buffers full enough.
> > In how many cased would PA have to wake up less often than the DMA
> interrupt?
>
> This patch is mainly for music playback where you have more than 2s
> buffered in the ring buffer.
Do you mean that those application require low latency will fail with
underrun ?
seem the usuage of PA is quite limited
Can PA provide an option to increase the number of wake up for those desktop
user which power consumption is not important ? ( default- fragments )
it seem (disable timer option ) of new PA version is not as same as the
Traditional mode of old PA version anymore
> PulseAudio will wake-up after 1.9s or so,
> as the ring buffer becomes empty, and when it does the wake-up may be
> grouped with other system events with the timer slack. Having one or
> more interrupts in the middle or the ring buffer will reduce the
> efficiency of sleep modes that are being introduced with Moorestown
> and future Atom-based SOCs.
> So again this patch isn't for everyone. All standard disclaimers
> apply, if you have a pre-existing conditon tell your doctor etc. If
> there's a 4K ring buffer, this is not useful.
au88x0 has 4 set of hardware registers each with 4 K buffers ( i.e. total 16
K bytes)
PA work quite nicely with 2 periods per buffer on PA 1.0.13 but some user
reported cracking noise when new PA 1.0.14 or later version use 8 periods
per buffer
> If your hardware is
> broken, stay the course with the current solution. If PulseAudio is
> disabled in your distro, this is of no interest to you. In all these
> cases, this patch doesn't change anything, the behavior is the same.
> But if you want to optimize for power and latency isn't a concern,
> then these interrupts can be disabled and need to.
>
>
next prev parent reply other threads:[~2010-05-13 0:37 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-29 22:38 [RFC] disabling ALSA period interrupts pl bossart
2010-04-29 23:18 ` Raymond Yau
[not found] ` <k2j6160a5131004291644rd8645dc7oecee28ee290b683f@mail.gmail.com>
2010-04-30 0:59 ` Raymond Yau
2010-04-30 1:09 ` Raymond Yau
2010-04-30 13:46 ` pl bossart
2010-04-30 22:51 ` Raymond Yau
2010-04-30 3:47 ` Raymond Yau
2010-04-30 11:24 ` Clemens Ladisch
2010-04-30 13:44 ` pl bossart
2010-05-06 1:24 ` Raymond Yau
2010-05-14 8:12 ` Takashi Iwai
2010-05-14 13:36 ` pl bossart
2010-05-14 21:03 ` pl bossart
2010-05-17 9:12 ` Clemens Ladisch
2010-05-17 9:14 ` [PATCH 1/3] add API to allow disabling " Clemens Ladisch
2010-05-17 9:23 ` Jassi Brar
2010-05-17 11:16 ` Clemens Ladisch
2010-05-17 11:27 ` Jassi Brar
2010-05-17 14:42 ` Jaroslav Kysela
2010-05-17 16:05 ` pl bossart
2010-05-17 16:22 ` Jaroslav Kysela
2010-05-17 16:37 ` pl bossart
2010-05-17 16:54 ` Jaroslav Kysela
2010-05-18 9:11 ` Jassi Brar
2010-05-17 13:59 ` pl bossart
2010-05-17 9:14 ` [PATCH 2/3] ALSA: hda-intel: add support for disabling period irq Clemens Ladisch
2010-05-17 14:05 ` pl bossart
2010-05-17 9:15 ` [PATCH 3/3] ALSA: oxygen: " Clemens Ladisch
2010-05-17 14:17 ` [RFC] disabling ALSA period interrupts pl bossart
2010-05-20 14:50 ` Clemens Ladisch
2010-04-30 16:44 ` Liam Girdwood
2010-04-30 17:39 ` pl bossart
2010-05-04 3:18 ` Raymond Yau
2010-05-07 23:25 ` [alsa-devel] " Lennart Poettering
2010-05-08 3:12 ` pl bossart
2010-05-12 4:00 ` pl bossart
2010-05-12 13:00 ` Jaroslav Kysela
2010-05-12 17:10 ` [alsa-devel] " pl bossart
2010-05-12 18:15 ` Jaroslav Kysela
2010-05-13 3:56 ` pl bossart
2010-05-12 7:22 ` James Courtier-Dutton
2010-05-12 12:42 ` pl bossart
2010-05-13 0:37 ` Raymond Yau [this message]
2010-05-14 0:43 ` Raymond Yau
2010-05-14 1:51 ` pl bossart
2010-05-14 2:45 ` Raymond Yau
2010-05-14 3:09 ` Raymond Yau
2010-05-14 4:03 ` Raymond Yau
2010-05-12 13:08 ` Jassi Brar
2010-05-12 13:50 ` [alsa-devel] " pl bossart
2010-05-12 14:15 ` Jassi Brar
2010-05-12 14:16 ` Mark Brown
2010-05-13 0:04 ` Raymond Yau
2010-05-14 4:07 ` Jassi Brar
2010-05-14 4:39 ` pl bossart
2010-05-14 5:27 ` Jassi Brar
2010-05-12 14:41 ` Raymond Yau
2010-05-13 7:27 ` Raymond Yau
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=AANLkTinHc24MCBc0vBQB3WARiIfcYMRQ_WCKabKUtEIc@mail.gmail.com \
--to=superquad.vortex2@gmail.com \
--cc=alsa-devel@alsa-project.org \
/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).