All of lore.kernel.org
 help / color / mirror / Atom feed
* How to interperet snd_pcm_htimestamp available frames?
@ 2020-11-22 16:03 Eric Buddington
  2020-12-02 14:52 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Buddington @ 2020-11-22 16:03 UTC (permalink / raw)
  To: alsa-devel

I am recording from multiple (cheap USB) mics, and trying to
synchronize them. I am assuming that there will be a common minimum
latency (reflecting an uncontested USB bus), with occasional spikes up
- but not down.

In my loop, I am calling snd_pcm_mmap_begin(), snd_pcm_htimestamp(),
and snd__mmap_commit() in that order.

My question is about the 'avail' value returned from htimestamp. It is
documented as "Number of available frames when timestamp was grabbed".
Does this mean frames since the last frame consumed with
_mmap_commit()?

Is there a possibility of there being no timestamp, or one where
'avail' refers to some older state?

Thanks for any insight.

-Eric

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: How to interperet snd_pcm_htimestamp available frames?
  2020-11-22 16:03 How to interperet snd_pcm_htimestamp available frames? Eric Buddington
@ 2020-12-02 14:52 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2020-12-02 14:52 UTC (permalink / raw)
  To: eric; +Cc: alsa-devel, Pierre-Louis Bossart

On Sun, 22 Nov 2020 17:03:35 +0100,
Eric Buddington wrote:
> 
> I am recording from multiple (cheap USB) mics, and trying to
> synchronize them. I am assuming that there will be a common minimum
> latency (reflecting an uncontested USB bus), with occasional spikes up
> - but not down.
> 
> In my loop, I am calling snd_pcm_mmap_begin(), snd_pcm_htimestamp(),
> and snd__mmap_commit() in that order.
> 
> My question is about the 'avail' value returned from htimestamp. It is
> documented as "Number of available frames when timestamp was grabbed".
> Does this mean frames since the last frame consumed with
> _mmap_commit()?

It's the value that is equivalent with the one in snd_pcm_status and
co: the available frames in the ring buffer.

> Is there a possibility of there being no timestamp, or one where
> 'avail' refers to some older state?

It was a quite long time ago that I tested it, but I don't think there
has been any significant changes in this regard.
I guess Pierre can have better insight.


Takashi

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-12-02 14:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-22 16:03 How to interperet snd_pcm_htimestamp available frames? Eric Buddington
2020-12-02 14:52 ` Takashi Iwai

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.