All of lore.kernel.org
 help / color / mirror / Atom feed
From: Clemens Ladisch <clemens@ladisch.de>
To: alsa-devel@alsa-project.org
Subject: Re: Misusing snd_pcm_avail_update()
Date: Thu, 29 Jan 2009 09:28:12 +0100	[thread overview]
Message-ID: <4981689C.7000609@ladisch.de> (raw)
In-Reply-To: <20090128183000.GG11770@tango.0pointer.de>

Lennart Poettering wrote:
> On Fri, 23.01.09 18:56, Clemens Ladisch (clemens@ladisch.de) wrote:
> > Instead of writing a callback in the USB driver to compute the time
> > until the next underrun, I'd rather rip out that fast start code.

(Done.)

> > So, no kernel computation is needed.  :-)
> 
> While I think it would be good not have this kind of double-buffering
> I wonder if this is really future-proof. i.e. can this done with every
> driver that uses 'fast starts'? 

Yes, because the USB driver was the only one that did this.

There are other drivers that use double-buffering (and the USB driver
still does), but there the playback speed does not change, i.e., the
stream is not more underrun-prone when starting.

> > * For many devices (legacy ISA, etc.), we just don't know the correct
> >   value.
> 
> But it should be possible to pick a safe boundary, shouldn't it?

In theory, the _safe_ boundary is one period.  In practice, ISA devices
cannot afford to prefetch much data due to the low bus bandwidth, so
one (frame) should be OK.  (And we _know_ devices that do whole-period
double-buffering because the code is right there in the driver.)


Best regards,
Clemens

  reply	other threads:[~2009-01-29  8:28 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-20  2:57 Misusing snd_pcm_avail_update() Lennart Poettering
2009-01-20  8:29 ` Clemens Ladisch
2009-01-20  8:32   ` Clemens Ladisch
2009-01-20 14:26   ` Lennart Poettering
2009-01-20 18:48     ` Clemens Ladisch
2009-01-20 20:29       ` Lennart Poettering
2009-01-21  0:39         ` Takashi Iwai
2009-01-22 22:20           ` Lennart Poettering
2009-01-23 17:13             ` Takashi Iwai
2009-01-23 17:56               ` Clemens Ladisch
2009-01-24  9:52                 ` Takashi Iwai
2009-01-28 18:30                 ` Lennart Poettering
2009-01-29  8:28                   ` Clemens Ladisch [this message]
2009-01-28 18:26               ` Lennart Poettering
2009-01-23 18:49           ` James Courtier-Dutton

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=4981689C.7000609@ladisch.de \
    --to=clemens@ladisch.de \
    --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 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.