From: Paul Davis <pbd@Op.Net>
To: Jaroslav Kysela <perex@suse.cz>
Cc: Ulrich Zadow <ulrich.zadow@ARTCOM.DE>,
"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [Alsa-devel] Timer?
Date: Wed, 06 Mar 2002 12:20:57 -0500 [thread overview]
Message-ID: <200203061724.MAA26665@renoir.op.net> (raw)
In-Reply-To: Your message of "Wed, 06 Mar 2002 17:57:54 +0100." <Pine.LNX.4.33.0203061741300.2187-100000@pnote.perex-int.cz>
>You're right. But it would be really nice to have a continuous timer
>source in some resolution (microseconds?) available for all platforms
>to satisfy synchronization requirements.
its often called "UST" (Unadjusted System Time). Its part of the POSIX
CLOCK_MONOTONIC specification. this is supported (apparently) as part
of glibc. i don't know what kind of kernel support is offered; it
almost certainly isn't of the resolution that UST has under IRIX or
BeOS (where it appears to be based on a cycle counter).
>It's not probably required exactly for this example where timing from one
>audio target is sufficient, but I can imagine several applications
>synchronized together.
jaroslav, as you know, this has been the subject of much discussion on
alsa-devel; the presence of a UST source doesn't permit
multi-application synchronization in and of itself. you have to have
a scheme that uses either:
a) synchronous client execution (the JACK/CoreAudio model)
b) timestamped buffers with client-side drift correction (the dmSDK/OpenML
model)
UST is useful for (b), but its not necessary for (a). the kernel
provides no specific support for (a) or (b).
As far as I know, Linux has not a continous timer.
>I am ready to work on this issue. It is very simple to create an interface
>with one ioctl returning struct timeval with the absolute timer value
>measured from system boot on i386 using rdtsc instruction.
>
>Perhaps, I'm trying to reinvent wheel, so please, let me know, if someone
>solved this issue.
i think this is reinventing the wheel. however, AFAIK, at this time,
its not *reimplementing* the wheel, since Linux doesn't appear to
offer this facility at this time. Having CLOCK_MONOTONIC properly
supported by the cycle counter would be good.
But notice: this also does not provide proper synchronization, since
it actually *adds* a clock source. Without it, you've the clock
attached to each hardware i/o device (audio, video, MIDI). With it,
those clocks continue to exist, but you add the UST one. Its
incredibly unlikely that the UST source will run in sync with any of
the others, and so now you have to do client-side drift correction for
*every* stream type.
If instead, you just pick one of the existing stream clocks
(e.g. audio) and sync to that, you reduce the number of instances of
drift correction that have to be done.
as a result, i'm ambivalent about its use for synchronization. it
would be nice, however, to use a UST source for other things.
--p
prev parent reply other threads:[~2002-03-06 17:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200203061631.LAA17147@renoir.op.net>
2002-03-06 16:57 ` Jaroslav Kysela
2002-03-06 17:20 ` Paul Davis [this message]
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=200203061724.MAA26665@renoir.op.net \
--to=pbd@op.net \
--cc=alsa-devel@alsa-project.org \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@suse.cz \
--cc=ulrich.zadow@ARTCOM.DE \
/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
all inboxes | Powered by JetHome®