alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Gregan <kinetik@flim.org>
To: David Henningsson <david.henningsson@canonical.com>
Cc: alsa-devel@alsa-project.org, pulseaudio-discuss@lists.freedesktop.org
Subject: Re: [pulseaudio-discuss] Immediate underrun with PulseAudio ALSA plugin when PA and ALSA buffer sizes differ
Date: Mon, 30 Jul 2012 17:49:57 +1200	[thread overview]
Message-ID: <20120730054957.GA2610@flim.org> (raw)
In-Reply-To: <5007CBA9.5050808@canonical.com>

At 2012-07-19T10:56:09+0200, David Henningsson wrote:
> What I meant was that I can successfully run your latency test with
> 10 ms here - when I go down to 5 I start to get xruns. In that
> context, getting problems around 50 - 100 ms of latency is quite a
> lot.

Oh, right.  Of the three bug reports I have, two reports are from users with
HDA, the third was using snd_ca01016 and tsched=0 with a fixed 200ms
latency.  On my system (Lenovo W510, 1.73GHz Core i7, HDA/CX20585), PA will
creep up to 46-56ms over multiple days of use (across multiple laptop
suspend/resume cycles), but will run with 16ms fine after restarting PA.

> Meanwhile, you could make a workaround like this in ~/.asoundrc:
> 
> pcm.pulse_no_underrun {
>   type pulse
>   handle_underrun 0
> }
> 
> and then open the device "pulse_no_underrun". With that workaround I
> can run with 1 ms without problem in your latency test. (We can't
> ignore underruns for everyone though, as that would break
> applications depending on these being delivered as well. Been there,
> done that.)

Thanks, this seems to work around the problem the way I'd hoped.  It's not
ideal, because you end up spinning on an instantly ready fd until the PCM's
buffer has filled, but it's better than anything I had managed to cook up in
the meantime.  I've added code to set this at runtime[0] via the local
config interface, inspired by WINE's winealsa.drv, which explicitly enables
rather than disables handle_underrun.

[0] https://github.com/kinetiknz/cubeb/commit/1aa0058d0729eb85505df104cd1ac072432c6d24

Thanks,
-mjg

  reply	other threads:[~2012-07-30  5:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-16 21:38 Immediate underrun with PulseAudio ALSA plugin when PA and ALSA buffer sizes differ Matthew Gregan
2012-07-17  5:29 ` Arun Raghavan
2012-07-17  6:22   ` David Henningsson
2012-07-18 22:14   ` Matthew Gregan
2012-07-19  8:56     ` David Henningsson
2012-07-30  5:49       ` Matthew Gregan [this message]
2012-07-22  0:34     ` Raymond Yau
2012-07-17  7:36 ` 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=20120730054957.GA2610@flim.org \
    --to=kinetik@flim.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=david.henningsson@canonical.com \
    --cc=pulseaudio-discuss@lists.freedesktop.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).