Re: [linux-audio-dev] Sequencer Sync Woes

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

Subject: Re: [linux-audio-dev] Sequencer Sync Woes
From: Paul Davis (pbd_AT_Op.Net)
Date: Tue Feb 06 2001 - 19:37:39 EET


> I guess I just want to make sure that I don't have to install any
>kernel patches to run my sequencer.

then you're going to have accept the fact that even stock 2.4.[01]
will sometimes stall for 100-200ms. there's no way around that other
than one set of low latency patches. similar behaviour for 2.2 and earlier.

>> you could also use the cycle timer - using the RTC is (currently)
>> intel only anyway, so adding calls to rdtscl() shouldn't hurt. its
>> about 12 usecs instead of 60-200usecs for gettimeofday.
>
> Scary. I'd love to throw it in, but I can't find any documentation on
>how to make calculations based on rdtscl. Is there an easy way to
>calculate cycles/msec? Do I need to?

           #include <asm/msr.h>

           unsigned long then, now;

           rdtscl (then);
           ...
           rdtscl (now);

           elapsed_usecs = (int) ((float) (now - then) / (cpu_hz/1000000.0));

on the other hand, gettimeofday will do this for you, and has a number
of important corrections made within it, so i'd stick to that unless
those few extra cycles really matter.

discovering cpu_hz is non-trivial. its best to read /proc/cpuinfo.

> I turn on using_dma when I'm recording TV shows (otherwise the drive
>can't keep up), but otherwise that's off. It was off when I was doing
>my tests. What else need I tune?

See the LAD web site. I don't use IDE, so I can't comment.

> Should I just ditch my code and use the ALSA sequencer instead of
>/dev/midi? I'm just scared that it won't have drivers for my cards:
>(es1371, es1370, i8x0 onboard, mpu-ipc-t (mpu401), sb16pnp, dude's
>laptop joystick port...)

the ALSA sequencer can use the RTC as a timer source as well, but you
need a patch to the RTC driver for that. without the RTC, the
sequencer's timing resolution is as bad as the kernel timer (10ms).

i am not certain, but i think ALSA has drivers for all the devices you
mention above. that said, i don't personally recommend the use of any
kernel sequencer, even the ALSA one.

--p


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

This archive was generated by hypermail 2b28 : Tue Feb 06 2001 - 19:54:55 EET