Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Lee Revell <rlrevell@joe-job.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: Alsa-devel@lists.sourceforge.net
Subject: Re: emu10k1 latency / capture period
Date: Mon, 21 Jun 2004 16:20:38 -0400	[thread overview]
Message-ID: <1087849237.8161.38.camel@debian> (raw)
In-Reply-To: <s5h1xk8nbxu.wl@alsa2.suse.de>

On Mon, 2004-06-21 at 11:54, Takashi Iwai wrote:
> > > On Wed, 2004-06-16 at 16:14, Lee Revell wrote:
> > > > Hey,
> > > > 
> > > > I am having a problem with the emu10k1 driver where I am unable to set
> > > > the capture period lower than 512.  The result is that the lowest
> > > > achievable input to output latency is in the neighborhood of 40ms.
> > > > 
> > > 
> > > I think I may have solved this problem.  Here is a patch against
> > > alsa-driver-1.0.5a.
> > > 
> > > --- alsa-driver-1.0.5a/alsa-kernel/pci/emu10k1/emupcm.c.orig   
> > > 2004-06-19 23:21:09.000000000 -0400
> > > +++ alsa-driver-1.0.5a/alsa-kernel/pci/emu10k1/emupcm.c 2004-06-19
> > > 23:21:12.000000000 -0400
> > > @@ -932,7 +932,7 @@
> > >         spin_unlock_irqrestore(&emu->reg_lock, flags);
> > >         emu->capture_efx_interrupt = snd_emu10k1_pcm_efx_interrupt;
> > >         emu->pcm_capture_efx_substream = substream;
> > > -       snd_pcm_hw_constraint_list(runtime, 0,
> > > SNDRV_PCM_HW_PARAM_PERIOD_SIZE, &hw_constraints_capture_period_sizes);
> > > +       // snd_pcm_hw_constraint_list(runtime, 0,
> > > SNDRV_PCM_HW_PARAM_PERIOD_SIZE, &hw_constraints_capture_period_sizes);
> > >         return 0;
> > >  }
> > > 
> > > I do not think that the FX8010 capture device is constrained by the 
> > > period size limitations on the standard emu10k1 capture device.
> > 
> > Right, this constraint is invalid.
> 
> Well, after checking the code again, I'm not convinced any more...
> Are you sure that it works without this constraint on half-duplex
> capture?

You are correct, it does not work.  I should have fully tested this 
before posting.

I think I have figured out how the FXBus driver needs to work.

The FXBus device (lets say hw:0,3) has 16 (for SBLive) or 32 
(for Audigy) capture and playback channels, one for each hardware 
FXBus channel.

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.

We would ignore interrupts from the the standard capture device
ADC_BUFFER(HALF)FULL.  In order to capture the FXBus channels 
you would have to use ld10k1 to connect inputs and outputs to 
FXBus channels.

I think that one result of this design is that if an FXBus channel 
is opened for capture, and none are open for playback, then  
snd_pcm_period_elapsed() will never get called.  One way to solve 
this would be to open a fake playback substream in the open callback for
the capture.

Also, I think that this design requires all processes opening the FXBus 
device to use the same period size.  I am not sure about this.  
The kX ASIO driver works this way, but that may be a requirement of
ASIO.

Do you see any problems with this design?

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

  reply	other threads:[~2004-06-21 20:20 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 [this message]
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
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=1087849237.8161.38.camel@debian \
    --to=rlrevell@joe-job.com \
    --cc=Alsa-devel@lists.sourceforge.net \
    --cc=tiwai@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox