All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Jack O'Quin <joq@io.com>
Cc: "Asbjørn Sæbø" <asbjs@stud.ntnu.no>, alsa-devel@lists.sourceforge.net
Subject: Re: Lowest latency: JACK, or ALSA directly?
Date: Wed, 17 Nov 2004 19:28:46 +0100	[thread overview]
Message-ID: <s5h6544s529.wl@alsa2.suse.de> (raw)
In-Reply-To: <87oehwv0tc.fsf@sulphur.joq.us>

At 17 Nov 2004 11:32:15 -0600,
Jack O'Quin wrote:
> 
> 
> > > Takashi Iwai <tiwai@suse.de> writes:
> > > > I'm asking this because some boards (e.g. RME32/96) have the fixed
> > > > buffer size, and can't take the configuration as two periods per
> > > > buffer.  IIRC, JACK fills all the buffer at the first sequence, and
> > > > this results in the higher latency than necessary.
> > > > 
> > > > Correct me if I'm wrong.
> 
> > At 12 Nov 2004 11:19:25 -0600,
> > Jack O'Quin wrote:
> > > I believe you are correct about this.  You probably understand it
> > > better than I do.  :-)
> > > 
> > > Is this something we could fix in JACK's ALSA driver backend?
> 
> Takashi Iwai <tiwai@suse.de> writes:
> > We can set different values to avail_min for playback and capture
> > directions.  For getting the minimal latency, set
> > (nperiods - 1) * period_size for playback and period_size for
> > capture.
> > 
> > The patch attached adds a new option -f to specify the filling
> > periods.  As default (= 0), it's identical with nperiods, so the old
> > behavior is kept.
> 
> Thanks for the patch!
> 
> Not sure I completely understand how to document this.  Is -f
> effectively setting the output latency, with -n as the default?
 
Well, it's so just because I didn't want to break the compatible
behavior.

With this model, basically the number of periods in the buffer doesn't
mean the latency at all but is required just for the stream
configuration.  The required condition is only nperiods >= 2.
So, this option isn't even necessary if we query the nearest buffer
size to "f-val * period_size".  Maybe this would be a better
implementation from the perspective of usability.

The playback latency is defined with -f option (the capture latency is
always minimal).  The minival value is 2.  Larger value means more
robustness.  For example, on some boards with the unreliable interrupt
handling (like ymfpci), one should set bigger than 2.
As mentioned, its default is as same as -n value, corresponding to the
_maximal_ latency.  It's just for compatibility.
It's fine to set this default to 2 if you think it's better.


> Is there some way users could just set the desired latency directly,
> or even request the minimum number of periods?  Is the minimum always
> 2?  What happens if the user specifies -f1?

2 periods (i.e. double buffer) are effectively the minimal latency.
The -f option doesn't acccept less than 2 or bigger than -n.


Takashi


-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE
FREE OODBMS DOWNLOAD - A multidimensional database that combines
robust object and relational technologies, making it a perfect match
for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8

  reply	other threads:[~2004-11-17 18:28 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-11 14:41 Lowest latency: JACK, or ALSA directly? Asbjørn Sæbø
2004-11-11 15:11 ` Jack O'Quin
2004-11-12  9:04   ` Asbjørn Sæbø
2004-11-12 16:42     ` Jack O'Quin
2004-11-12 17:01       ` Takashi Iwai
2004-11-12 17:19         ` Jack O'Quin
2004-11-17 14:55           ` Takashi Iwai
2004-11-17 17:32             ` Jack O'Quin
2004-11-17 18:28               ` Takashi Iwai [this message]
2004-11-17 19:41                 ` Takashi Iwai
2004-11-18  2:07                   ` Jack O'Quin
2004-11-18 12:38                     ` Takashi Iwai
2004-11-11 15:34 ` Paul Davis
2004-11-12  9:11   ` Asbjørn Sæbø
2004-11-12 14:47   ` Gilles Degottex
2004-11-12 15:28     ` Giuliano Pochini

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=s5h6544s529.wl@alsa2.suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@lists.sourceforge.net \
    --cc=asbjs@stud.ntnu.no \
    --cc=joq@io.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.