Re: [linux-audio-dev] timing

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

Subject: Re: [linux-audio-dev] timing
From: Juan Linietsky (coding_AT_reduz.com.ar)
Date: Thu Jun 20 2002 - 17:37:46 EEST


On Thu, 20 Jun 2002 11:43:46 +0100
dunk fordyce <mailinglist_AT_dunkfordyce.co.uk> wrote:

> whats the best way to handle timing in a music app?
>

I use /dev/rtc in shaketracker, It works very well, but the problem
with it is that
it cant be shared between apps (Athought i'm working on a patch that
would enable it to be shared).
Still, unless your app is root, you cant have a latency over 64hz, so
for an userspace app,
it's actually worse than the system timer (10ms)

I also did some experiments of other approaches, SIGALRM works very
well (better than polling
from what I tried, which skips a lot more). So far, I've also had some
success for reducing
latency by starting 20 threads constanty polling and updating the
timer.

> im thinking that by a sequencer lib it would be possible to use
> that. is that a good idea or is it better to roll your own system.
>

The alsa sequencer interface proovides you with such timers, but they
use /dev/rtc
as a back-end, so if you want to make your program more portable and
also support
OSS, serial devices or just another kind of devices, I think it's
pointless using those.

> i have been looking at tracker code but havent got any solid ideas.
>

Normal trackers (unless you mean shaketracker/tektracker) use
the audio interrupt through blocking calls. It is a vaid approach
to use those as timers, and it's the most common way one under
windows.
Still, I dont think it's a very clean.

Juan Linietsky


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

This archive was generated by hypermail 2b28 : Thu Jun 20 2002 - 17:59:34 EEST