From: Lennart Poettering <mznyfn@0pointer.de>
To: alsa-devel@alsa-project.org
Subject: Re: Is there a way to figure out if the clocks of two snd_pcm_t's deviate? (snd_pcm_info_get_sync?)
Date: Wed, 9 Sep 2009 01:18:53 +0200 [thread overview]
Message-ID: <20090908231853.GC32605@tango.0pointer.de> (raw)
In-Reply-To: <6160a5130909040552k34548733o3d2fc71e1a7362c8@mail.gmail.com>
On Fri, 04.09.09 07:52, pl bossart (bossart.nospam@gmail.com) wrote:
>
> > I am looking for a way to find out whether the clocks of two
> > snd_pcm_t's are perfectly in sync and don't deviate (or only deviate
> > by a constant phase).
>
> short answer:no
> You would need hardware that would count the bit clock transitions and
> provide the delta. Few devices provide this in the consumer space, and
> when they do they actually perform an asynchronous sample-rate
> conversion on the fly (cf. Freescale DSP563xx). Analog Devices also
> provides dedicated sample-rate converters that perform this comparison
> and resampling; they are typically used when multiple masters are
> present.
> All this nice hardware wouldn't work anyway for USB where audio is
> transmitted in packets every ms; it's hard to guess what the real
> audio speed is.
But that should already be good enough for my purposes. I mostly care
that over a longer period of time the deviation between input and
output (or two outputs) is bounded. That means, if there is a fixed
time deviation between recording and playback and I know only that it
is fixed but don't know exactly what it is I am already a happier man.
> That's the reason why I introduced the resampling enable/disable in
> the PA module-loopback code, only the user/system designer will know
> if you have one master or more, and whether you should enable
> variable-rate interpolation.
but why shouldn't this information be queriable from the drivers?
Drivers do know a lot about the hardware they drive, so they should
now about clocks, too.
Lennart
--
Lennart Poettering Red Hat, Inc.
lennart [at] poettering [dot] net
http://0pointer.net/lennart/ GnuPG 0x1A015CC4
next prev parent reply other threads:[~2009-09-08 23:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-03 23:03 Is there a way to figure out if the clocks of two snd_pcm_t's deviate? (snd_pcm_info_get_sync?) Lennart Poettering
2009-09-04 6:44 ` Jaroslav Kysela
2009-09-04 11:44 ` Mark Brown
2009-09-08 23:13 ` Lennart Poettering
2009-09-04 12:52 ` pl bossart
2009-09-08 23:18 ` Lennart Poettering [this message]
2009-09-09 16:03 ` pl bossart
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=20090908231853.GC32605@tango.0pointer.de \
--to=mznyfn@0pointer.de \
--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.