From: Carlo Florendo <subscribermail@gmail.com>
To: alsa-devel@alsa-project.org
Cc: linux-audio-dev@lists.linuxaudio.org
Subject: How to get correct midi timings from ALSA using the library only
Date: Tue, 24 Jul 2007 17:01:19 +0800 [thread overview]
Message-ID: <46A5BFDF.4040906@gmail.com> (raw)
Hi,
(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.
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).
Here's the pseudo-code of the relevant MIDI player routine:
for (i = 0; i < number_of_events; i++)
{
usleep(event[i].delta_time_in_microseconds);
output_and_drain_event(event[i]);
}
This routine gives a non-bearable latency on 2.4 kernels but not so much on
2.6 kernels.
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? Or, is there a drain or output routine that supports
callbacks? If so, I will be grateful if you could point them out. I seem
not to find any output callback routine under the docs.
Thank you very much.
Best Regards,
Carlo
--
Carlo Florendo
Softare Engineer/Network Co-Administrator
Astra Philippines Inc.
UP-Ayala Technopark, Diliman 1101, Quezon City
Philippines
http://www.astra.ph
--
The Astra Group of Companies
5-3-11 Sekido, Tama City
Tokyo 206-0011, Japan
http://www.astra.co.jp
next reply other threads:[~2007-07-24 9:00 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-24 9:01 Carlo Florendo [this message]
[not found] ` <46A5BFDF.4040906-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2007-07-24 10:06 ` [LAD] How to get correct midi timings from ALSA using the library only Florian Schmidt
[not found] ` <200707241206.09991.mista.tapas-hi6Y0CQ0nG0@public.gmane.org>
2007-07-25 2:18 ` Carlo Florendo
[not found] ` <46A6B2DC.3030906-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2007-07-25 9:25 ` Florian Schmidt
2007-07-26 4:51 ` Carlo Florendo
2007-07-24 10:24 ` Clemens Ladisch
2007-07-25 0:54 ` Carlo Florendo
2007-07-25 8:24 ` [LAD] " Clemens Ladisch
2007-07-25 8:51 ` Carlo Florendo
2007-07-25 9:16 ` Carlo Florendo
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=46A5BFDF.4040906@gmail.com \
--to=subscribermail@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=linux-audio-dev@lists.linuxaudio.org \
/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