From: Lennart Poettering <mznyfn@0pointer.de>
To: ALSA Development Mailing List <alsa-devel@alsa-project.org>
Subject: Is there a way to figure out if the clocks of two snd_pcm_t's deviate? (snd_pcm_info_get_sync?)
Date: Fri, 4 Sep 2009 01:03:51 +0200 [thread overview]
Message-ID: <20090903230351.GA7493@tango.0pointer.de> (raw)
Heya!
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).
i.e. for real duplex devices that use the same crystal for input and
output this should tell me "Yes" for the playback snd_pcm_t tested
against the recording snd_pcm_t; and for all other, unrelated audio
devices it should return "No".
I found snd_pcm_info_get_sync() in the docs, but its documentation is
a bit terse, so I am wondering if this might be what I want. Is it?
Does this (untested) code snippet do what I hope it does?
<snip>
snd_pcm_info(a, info_a);
snd_pcm_info(b, info_b);
in_sync = memcmp(&snd_pcm_info_get_sync(info_a), &snd_pcm_info_get_sync(info_b)) == 0;
</snip>
Thanks,
Lennart
--
Lennart Poettering Red Hat, Inc.
lennart [at] poettering [dot] net
http://0pointer.net/lennart/ GnuPG 0x1A015CC4
next reply other threads:[~2009-09-03 23:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-03 23:03 Lennart Poettering [this message]
2009-09-04 6:44 ` Is there a way to figure out if the clocks of two snd_pcm_t's deviate? (snd_pcm_info_get_sync?) 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
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=20090903230351.GA7493@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.