From: Juan Linietsky <coding@reduz.com.ar>
To: alsa-devel@alsa-project.org
Subject: Re: Forcing an absolute timestamp for every midi event.
Date: Mon, 19 Aug 2002 05:07:34 -0300 [thread overview]
Message-ID: <20020819050734.0e3e0a7c.coding@reduz.com.ar> (raw)
In-Reply-To: <002a01c2474b$842b6170$0400a8c0@martijn>
On Mon, 19 Aug 2002 07:41:30 +0100
"Martijn Sipkema" <msipkema@sipkema-digital.com> wrote:
> [...]
> > > - Callback based.
> >
> > Callbacks on midi are retarded, and VERY annoying. It's simply
> > throwing more work to the programmer which the lib can and should
> > do. Seriosly, think about it, what is better?
>
> Actually I was talking about the audio API in this case.
oh, nevermind then! :)
I thought all that fuzz was for midi. sorry!
>
> > > - All frames with a particular MSC occur at the same time. (I
> > > don't think
> > > OpenML requires this, EASI does have this with its 'position')
> > > - The audio callback provides an MSC value for every buffer
> > > corresponding
> > > to the first frame in the buffer.
> >
> > fine, what happens if your app xruns the audio buffer for X time?
> > all the count gets screwed?
> > you will shutdown the app like jack? will you ask devices for
> > sync? will you drop events?
>
> The application can detect xruns by looking at the MSCs.
Well, i guess i didnt make myself clear enough.
Technically, when you use some count/clock/tick based method
for doing things, there is a certain hardware that generates such
things.
How are you sure that you will be able to generate those reliably
within
the OS? The only way is generating them in realtime, and prequeuing
would be impossible. It happens the same when the OS generates
midi clocks, if the load affects wathever is timing internally,
all your queue gets screwed. This has its uses i guess anyway.
>
> > > - The audio callback provides an UST value for every input
> > > buffer
> > > corresponding to the end of that buffer/start of the next
> > > buffer.
> >
> > This is actually a great idea, Very good for audio/video
> > syncronization,
> > or for JACK. Which may have to process serial chained clients in
> > the graph,
> > Even if not 100% necesary for midi, it could also make good use
> > of it. Doesnt alsa already support
> > something like that? Still tho, it would need to have to handle
> > xruns.
>
> This is absolutely necessary for MIDI, or else scheduling MIDI to
> UST doesn't make much sense.
Of course it is, otherwise discussing it would be out of the question
;)
What i mean is the audio callback prooviding the UST time. I mean it's
not necesary
since you can compute the delay in time from ust and the audio buffer
size, but
I am _definitively_ in favor of this. Alsa should proovide this, and
JACK _must_ do it,
so clients can syncronize properly.
> MIDI clock sync (slave) should be handled by the application and by
> its very nature will not allow scheduling events ahead of time.
not clock sync, i mean the midi api. Thats why i think it's pointless.
ant hear it. So I think this is beyond pointless.
>
> I disagree. I'd rather have a small extra latency than jitter.
>
We're taling about something WAY beyond human-hearable latency.
Say you send the event, it will probably reach in nanoseconds if
things
go right, or useconds if things go not so right. The event would
need to delay like, 5 milliseconds for you to notice any jitter.
And this will _never_ happen. Absolutely *never*.
Well, all in all we're both talking about the same. ALSA and JACK
should proovide
access to some timer similar to UST. Now the real problem is the
implementation.
How to do this? Not all architectures proovide a secondary clock for
such things,
and on X86 I cant think of something other than the pentium cycle
counter.
Juan Linietsky
-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone? Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
next prev parent reply other threads:[~2002-08-19 8:07 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-18 8:57 Forcing an absolute timestamp for every midi event Juan Linietsky
2002-08-18 10:08 ` Patrick Shirkey
2002-08-18 12:48 ` Frank van de Pol
2002-08-18 22:17 ` Juan Linietsky
2002-08-19 15:47 ` Takashi Iwai
2002-08-18 20:12 ` Martijn Sipkema
2002-08-18 21:18 ` [linux-audio-dev] " Frank van de Pol
2002-08-19 6:43 ` Martijn Sipkema
2002-08-19 7:52 ` Jaroslav Kysela
2002-08-18 22:58 ` Juan Linietsky
2002-08-19 6:41 ` Martijn Sipkema
2002-08-19 8:07 ` Juan Linietsky [this message]
2002-08-19 12:39 ` Martijn Sipkema
2002-08-19 13:01 ` aside - alsa-docs Patrick Shirkey
2002-08-20 21:11 ` Forcing an absolute timestamp for every midi event Frank van de Pol
2002-08-21 1:10 ` Martijn Sipkema
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=20020819050734.0e3e0a7c.coding@reduz.com.ar \
--to=coding@reduz.com.ar \
--cc=alsa-devel@alsa-project.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.