Re: [Alsa-devel] Re: [linux-audio-dev] minimum tick time

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [Alsa-devel] Re: [linux-audio-dev] minimum tick time
From: Abramo Bagnara (abramo_AT_alsa-project.org)
Date: Tue Nov 06 2001 - 20:34:05 EET


Takashi Iwai wrote:
>
> At Tue, 06 Nov 2001 19:10:20 +0100,
> Abramo wrote:
> >
> > Takashi Iwai wrote:
> > >
> > > Hi Maarten,
> > >
> > > At Tue, 6 Nov 2001 17:12:01 +0100,
> > > Maarten de Boer wrote:
> > > >
> > > > Hello,
> > > >
> > > > I am trying to get low latency with alsa.
> > > > I have kernel 2.4.13 with the preemptive patch and the
> > > > alsa-driver/utils/patches/rtc-2.4.9.dif patch applied.
> > > > In the kernel configuration, I turned on RTC and
> > > > Preemptive.
> > > >
> > > > I run the alsa-lib/test/latency.c test in poll mode,
> > > > but the problem is the tick time, which is at 100 Hz:
> > > >
> > > > snd_pcm_hw_params_get_tick_time(params, NULL) = 10000
> > > >
> > > > What am I doing wrong?
> > >
> > > The timer invoked by pcm is only system timer, so resolution is fixed
> > > as HZ. IMO, it would be nice to make it available to use other timer
> > > sources, but this will lead to major rewrite..
> >
> > This would not imply a "major" rewrite: the API and the kernel code has
> > been thought for that.
> > You need simply to have different snd_pcm_tick_set functions (see
> > pcm_lib.c).
>
> Yes, of course, I meant "not so quick and little" hack in kernel
> code :) Hmm, perhaps i'm wrong, we can change the code without too
> much rewrite.. Let me see..
>
> Anyway, if we use ALSA timer on pcm, we'll need an additional API call
> (or module parameter) for timer selection such as given in sequencer
> API.

I'm strongly against a module parameter for that.
We'd need an API call for tick source selection and a new ioctl, but I
don't like very much the sequencer API way, I'd prefer something like:

timer_fd = open(timer);
pcm_fd = open(pcm);
ioctl(pcm_fd, TICK_SOURCE, timer_fd);

Of course all that is hidden under alsa-lib API.

-- 
Abramo Bagnara                       mailto:abramo_AT_alsa-project.org

Opera Unica Phone: +39.546.656023 Via Emilia Interna, 140 48014 Castel Bolognese (RA) - Italy

ALSA project http://www.alsa-project.org It sounds good!


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Tue Nov 06 2001 - 20:30:11 EET