From: Paul Davis <paul@linuxaudiosystems.com>
To: Johan Bilien <jobi@via.ecp.fr>
Cc: alsa-devel@lists.sourceforge.net
Subject: Re: start_threshold having no effect
Date: Mon, 20 Oct 2003 18:23:26 -0400 [thread overview]
Message-ID: <200310202223.h9KMNQlC022039@oud.linuxaudiosystems.com> (raw)
In-Reply-To: Your message of "Mon, 20 Oct 2003 19:30:30 +0200." <20031020173030.GC28408@via.ecp.fr>
>My second idea was to have a rather big hw buffer (500ms), and then set
>the start_threshold to a low value (32 frames for instance). But whatever
>my parameters were, I always got a playout delay of about the hw buffer
>size.
the output latency is always roughly the size of the hardware
buffer. there is no way to avoid this. the best you could ever do
would be one period, where there are two periods per buffer (i.e half
the buffer size). when i say "the best you could do", the truth is
that you probably can't do it. the very first sample you deliver to
the hardware will have a delay of 1 period, each subsequent sample has
a steadily increasing delay all the way up to the last sample, which
is delayed by the length of the entire hardware buffer (2
periods). this assumes that delivery is basically instaneous:
obviously, if you take time to deliver it, the delay drops, but the
total delay (from when you could have written to when the sound is
audible) is the same.
i don't know what you're doing, but you might to investigate JACK,
which does precisely what you're hoping for, supports the lowest
latencies of any supported hardware (with an appropriate kernel), but
also bundles it all up in an easy to use API. jackit.sf.net.
if nothing else, you can study JACK's ALSA code to see how it does
it. its not simple.
--p
-------------------------------------------------------
This SF.net email is sponsored by OSDN developer relations
Here's your chance to show off your extensive product knowledge
We want to know what you know. Tell us and you have a chance to win $100
http://www.zoomerang.com/survey.zgi?HRPT1X3RYQNC5V4MLNSV3E54
next prev parent reply other threads:[~2003-10-20 22:23 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-10-20 17:30 start_threshold having no effect Johan Bilien
2003-10-20 22:23 ` Paul Davis [this message]
2003-10-21 9:50 ` Johan Bilien
2003-10-21 11:32 ` Jaroslav Kysela
2003-10-21 12:26 ` Takashi Iwai
2003-10-21 12:28 ` Johan Bilien
2003-10-21 12:39 ` Paul Davis
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=200310202223.h9KMNQlC022039@oud.linuxaudiosystems.com \
--to=paul@linuxaudiosystems.com \
--cc=alsa-devel@lists.sourceforge.net \
--cc=jobi@via.ecp.fr \
/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