[LAD] Re: [alsa-devel] How to get correct midi timings from ALSA using the library only

From: Clemens Ladisch <cladisch@email-addr-hidden>
Date: Tue Jul 24 2007 - 13:24:15 EEST

Carlo Florendo wrote:
> (1) I've written a command line MIDI sequencer for lightweight systems and
> am successful in making it work using the ALSA queue API. However, one
> drawback of the API is its lack of callback functions. I wish to be able
> to track events as they are drained by the queue.
>
> (2) I know and have successfully worked on a work around whereby the
> application itself subscribes to the output port so as to see events as
> they are played.

You could also send special user-defined events just to yourself, but
the principle is the same.

> However, I wish to be able to make the sequencer or player work without the
> use of the ALSA queue nor the workaround in (2).

Why?

> How could I get the app to <u|nano>sleep() in the most accurate way in
> userspace without using the ALSA queue nor the extra subscription to an
> output port?

On newer kernels, you could try POSIX interval timers.

> Or, is there a drain or output routine that supports callbacks?

Why can't you simply call the callback when some event has been
received?

Regards,
Clemens
_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/mailman/listinfo.cgi/linux-audio-dev
Received on Tue Jul 24 16:15:03 2007

This archive was generated by hypermail 2.1.8 : Tue Jul 24 2007 - 16:15:03 EEST