All of lore.kernel.org
 help / color / mirror / Atom feed
From: Clemens Ladisch <clemens@ladisch.de>
To: Manuel Jander <manuel.jander@gmail.com>
Cc: alsa-devel@alsa-project.org
Subject: Re: ALSA default buffer sizes
Date: Wed, 26 Aug 2009 14:12:19 +0200	[thread overview]
Message-ID: <4A9526A3.8030804@ladisch.de> (raw)
In-Reply-To: <21ed1c370908241138n1fef462eoc636fe21ff444b35@mail.gmail.com>

Manuel Jander wrote:
> Can anyone tell me why choosing the smallest period size by default is
> a good idea ?

Because there a sound cards where there is no more precise information
about the current position than the period interrupt, so using smaller
periods gives better position information.

Using larger periods is useful only if you really want to save power.

Most PCI drivers have a minimum period size of 32 bytes (related to the
PCI burst size) and do not limit the number of periods, so this
algorithm tends to work just fine.

> Maybe it would be good to know inside the driver that the user program
> does not actually care about the period time?

When the program actually does not care, then it does not matter what
value gets used, so the minimum period time is correct by definition.

> The problem is, as far as I understand right now, I would have to
> increase the minimum period time of the au88x0 driver,

Just increase the maximum number of periods.

Increasing period_bytes_min to 32 or so wouldn't hurt either.

> As a work around, maybe I could set the minimum period bytes to 0,
> and if I encounter that value at snd_pcm_xxx_hw_params(), override
> that value with something useable and reasonable ?

You cannot use values that the ALSA framework does not know about.

> > au88x0_pcm.c has period_bytes_min = 0x1 and periods_max = 32.
> >
> > Is that periods_max an actual hardware limit?
> 
> No. I considered that anything beyond 32 is just plain stupid :)

Those fields are intended to enforce hardware limits.

Besides, using the sound card period interrupt as a 48 kHz timer is a
perfectly valid application.  (Well, as a stress test. :-)


Best regards,
Clemens

      parent reply	other threads:[~2009-08-26 12:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-22 20:47 ALSA default buffer sizes (recent now being subscribed with correct address... hopefully) Manuel Jander
     [not found] ` <4A926196.5000705@ladisch.de>
2009-08-24 18:38   ` ALSA default buffer sizes Manuel Jander
2009-08-25  6:00     ` Takashi Iwai
2009-08-26 12:12     ` Clemens Ladisch [this message]

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=4A9526A3.8030804@ladisch.de \
    --to=clemens@ladisch.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=manuel.jander@gmail.com \
    /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.