From: Takashi Iwai <tiwai@suse.de>
To: Lennart Poettering <mznyfn@0pointer.de>
Cc: alsa-devel@alsa-project.org
Subject: Re: Rationale behind snd_pcm_htimestamp()
Date: Wed, 25 Feb 2009 16:13:02 +0100 [thread overview]
Message-ID: <s5heixmo8ht.wl%tiwai@suse.de> (raw)
In-Reply-To: <20090218215157.GA13939@tango.0pointer.de>
At Wed, 18 Feb 2009 22:51:57 +0100,
Lennart Poettering wrote:
>
> On Mon, 16.02.09 17:08, Takashi Iwai (tiwai@suse.de) wrote:
>
> > > An alternative way seemed to be to go via the snd_pcm_status
> > > structure. However querying that seems not to sync the hw index
> > > data. Hmm... so let's call snd_pcm_hwsync() right before querying the
> > > struct -- as it turns out however, that function is now deprecated. So
> > > which function should I call? The doxygen comments of _hwsync() kind
> > > of suggest in a way to call snd_pcm_avail_update(), whose doxygen
> > > comments however declare that it does in fact *not* sync the hw state
> > > either, but suggest to use snd_pcm_avail() for that.
> > >
> > > Ok, so I am now tempted to first call snd_pcm_avail() and then
> > > snd_pcm_status() and have all three values atomically. But unfortunately
> > > that's not the case. Again the avail value of the two calls differs sometimes.
> > >
> > > How can I query the three values atomically? Can i do that at all?
> >
> > Hmm, there is no way to get them in atomic way anyway, I guess.
> > Even in *_avail_delay(), basically each of them is called
> > sequentially in alsa-lib code.
> >
> > But, I wonder whether calling snd_pcm_delay() then
> > snd_pcm_htimestamp() doesn't work? snd_pcm_avail_delay() is nothing
> > but a sequential call of snd_pcm_delay() and avail_update(). And,
> > htimestamp is avail_update() and timestamp check.
> >
> > Well, *_htimestamp() has a loop to sync with avail, so the similar
> > logic could be used to sync all of them...
>
> Hmm, so I understood you correctly then the API would need changing to
> get the timestamp, the delay and the avail value that belong together?
Yes, if you stick with snd_pcm_htimetamp(), snd_pcm_avil() and co.
But basically snd_pcm_status() does sync and fetch all status data.
Shouldn't calling this suffice for your purpose?
Takashi
next prev parent reply other threads:[~2009-02-25 15:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-16 2:35 Rationale behind snd_pcm_htimestamp() Lennart Poettering
2009-02-16 16:08 ` Takashi Iwai
2009-02-18 21:51 ` Lennart Poettering
2009-02-25 15:13 ` Takashi Iwai [this message]
2009-02-25 21:42 ` Lennart Poettering
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=s5heixmo8ht.wl%tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=mznyfn@0pointer.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 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.