From: Takashi Iwai <tiwai@suse.de>
To: Karsten Wiese <annabellesgarden@yahoo.de>
Cc: Alsa-Devel <alsa-devel@alsa-project.org>
Subject: Re: usb-audio: variable periodsize / nframes per callback can shorten latency times
Date: Mon, 19 Aug 2002 17:38:31 +0200 [thread overview]
Message-ID: <s5h65y6uadk.wl@alsa2.suse.de> (raw)
In-Reply-To: <DAELIEGDPLDDCIJPAICBCEFFCDAA.annabellesgarden@yahoo.de>
At Mon, 19 Aug 2002 15:17:51 +0200,
Karsten Wiese wrote:
>
> Hi,
>
> usb iso transfers happen every 1ms (USB1.1) ( or at multiples of 125µs for
> USB2.0).
> this timing is fixed and leads to a variable amount of frames available at
> interrupt.
> looking at 44100Hz on USB 1.1, we receive/send 44 frames on 9 of 10
> USB-interrupts and 45 frames on 1 of 10
> USB-interrupts.
> on first sight 48000Hz seams to lead to a constant 48 frames per interrupt.
> this does not remain true if the USB-audio device is in sync to an
> externally connected device (digital in).
> the current usb-audio mimics constant period size in the USB-interrupt
> routines by calling snd_period_elapsed() only, if at least full period sizes
> are transfered on the usb.
well, this is a workaround.
as you pointed out, basically the period size must be aligned to the
time not to the frames.
however, the current implementation of alsa driver assumes that the
period size in frames. although you can specify the period time, the
period size will be aligned to the frames at the final stage.
> this good for constant period-size compatibility but leads to sub-optimal
> latency: i.e. for capture worst case, audio apps start working 1ms later
> than possible.
yep.
> How can we implement the latency-optimal behaviour with alsa-driver
> framework?
> Can we implement something like a snd_1ms_elapsed() routine (called from
> USB-interrupt), which in turn triggers a waiting app with the available
> period size (which would be 44 or 45 frames for 44100Hz)?
> I would like to see this in ALSA / JACK.
> What do you think?
hmm, it's not so easy, since this will break also the assumption of
constant period "frames" by applications. if we introduce the
time-based period size, it won't work as compatible as older one,
e.g. jack wouldn't run properly if the period size changes
dynamically.
hence, this should be handled in a special case.
Takashi
-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone? Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
next prev parent reply other threads:[~2002-08-19 15:38 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-19 13:17 usb-audio: variable periodsize / nframes per callback can shorten latency times Karsten Wiese
2002-08-19 15:38 ` Takashi Iwai [this message]
2002-08-20 10:30 ` Tim Goetze
2002-08-20 10:55 ` Takashi Iwai
2002-08-20 11:34 ` Tim Goetze
2002-08-20 17:15 ` Takashi Iwai
2002-08-20 20:27 ` Tim Goetze
2002-08-21 5:40 ` Correct me if I am wrong & few questions Shaju Abraham
2002-08-27 14:19 ` usb-audio: variable periodsize / nframes per callback can shorten latency times 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=s5h65y6uadk.wl@alsa2.suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=annabellesgarden@yahoo.de \
/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.