All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lee Revell <rlrevell@joe-job.com>
To: alsa-devel@lists.sourceforge.net
Subject: Re: emu10k1 latency / capture period
Date: Mon, 28 Jun 2004 16:44:05 -0400	[thread overview]
Message-ID: <1088455444.16916.96.camel@mindpipe> (raw)
In-Reply-To: <s5h7jtzn4hv.wl@alsa2.suse.de>

On Tue, 2004-06-22 at 08:47, Takashi Iwai wrote:
> At Tue, 22 Jun 2004 13:29:36 +0200 (CEST),
> Jaroslav wrote:
> > 
> > On Tue, 22 Jun 2004, Takashi Iwai wrote:
> > 
> > > At Mon, 21 Jun 2004 16:20:38 -0400,
> > > Lee Revell wrote:
> > > > 
> > > > The capture will be driven by the playback interrupts (I think
> > > > EFX_BUFFER(HALF)FULL).  This would look very similar to the 
> > > > interrupt handler example #2 in your ALSA driver guide, which 
> > > > uses timer interrupts to drive the capture/playback, except 
> > > > that for playback, in addition to calling snd_pcm_period_elapsed()
> > > > on the playback substream, we also maintain a pointer to the 
> > > > corresponding *capture* substream, and call snd_pcm_period_elapsed() 
> > > > on it, manually tracking the frames processed in the same way the timer
> > > > interrupt example does.
> > > 
> > > Even if we ignore the capture interrupts and use an additional
> > > interrupt source (e.g. an extra playback stream), the size of capture
> > > buffer still must follow the restriction.  That is, the minimal
> > > capture buffer size is still 384 x 2 bytes, although the period size
> > > can be set independently to smaller than 384 bytes. 
> > 
> > You can do lowlatency even with huge ring buffer, if you have a good
> > interrupt / scheduling timer, but it requires changes in application.
> 
> Yes.  At least, JACK should work well.
> 

OK, I think I have the solution.  You have to use the FX8010 PCM stream
type, snd_fx8010_pcm_t.  This PCM is implemented using the DSP, ETRAM is
used for the ringbuffers, and GPRs for the various pointers; you set the
high bit of GPR_IRQ to generate a DSP interrupt.  For each PCM you
register an interrupt handler in the trigger callback using
snd_emu10k1_fx8010_register_irq_handler(), then, when a DSP interrupt
occurs, you walk the list of registered handlers, and execute the proper
callbacks.

This technique is used by the existing ALSA driver for AC3 passthrough,
with the output going to the SPDIF port.  The kX driver must use this
method for ASIO, it just creates 16 PCMs and routes their output to the
first 16 FXBus channels.

For the time being this will only be possible to implement on EMU10K1,
because the ALSA driver does not yet support TRAM on the Audigy.

This should allow *really* low latency, down to the limits of the PCI
bus, because your timer has a resolution of one sample period. 

Lee







-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com

  parent reply	other threads:[~2004-06-28 20:44 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-16 20:14 emu10k1 latency / capture period Lee Revell
2004-06-16 20:52 ` James Courtier-Dutton
2004-06-16 21:02   ` Lee Revell
2004-06-20  4:06 ` Lee Revell
2004-06-21 15:35   ` Takashi Iwai
2004-06-21 15:54     ` Takashi Iwai
2004-06-21 20:20       ` Lee Revell
2004-06-22 11:13         ` Takashi Iwai
2004-06-22 11:29           ` Jaroslav Kysela
2004-06-22 12:47             ` Takashi Iwai
2004-06-22 21:15               ` Lee Revell
2004-06-28 20:44               ` Lee Revell [this message]
2004-06-22 20:26             ` Lee Revell
2004-06-22 18:48           ` Lee Revell
2004-06-21 20:25     ` Lee Revell
2004-07-08  0:40     ` Lee Revell
  -- strict thread matches above, loose matches on Subject: below --
2004-06-17  9:06 Peter Zubaj
2004-06-17 18:37 ` Lee Revell
2004-06-17 23:26   ` Paul Davis
2004-06-18  9:33     ` Takashi Iwai
2004-06-18 19:39       ` Lee Revell
2004-06-18 23:26       ` Lee Revell
2004-06-21  8:03 Peter Zubaj
2004-06-21 15:26 ` Takashi Iwai
2004-06-21 20:27   ` Lee Revell

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=1088455444.16916.96.camel@mindpipe \
    --to=rlrevell@joe-job.com \
    --cc=alsa-devel@lists.sourceforge.net \
    /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.