All of lore.kernel.org
 help / color / mirror / Atom feed
* how to obtain hardware playback position after underrun?
@ 2012-04-25 16:42 Maarten de Boer
  2012-04-27 12:39 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Maarten de Boer @ 2012-04-25 16:42 UTC (permalink / raw)
  To: ALSA development

Hello,

I am trying to figure out how to obtain the hardware playback position
after an underrun occured. When I have no underruns, I can simply keep
track of the time by counting the samples processed. (I am using
snd_pcm_mmap_commit). But in the unlucky event an underrun occurs, I
would like to know what the playback position would have been without
any underrun. Is this possible? I have been looking at the API docs,
and at the source code, but to no avail.

Thanks,

Maarten

 

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

* Re: how to obtain hardware playback position after underrun?
  2012-04-25 16:42 how to obtain hardware playback position after underrun? Maarten de Boer
@ 2012-04-27 12:39 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2012-04-27 12:39 UTC (permalink / raw)
  To: Maarten de Boer; +Cc: ALSA development

At Wed, 25 Apr 2012 18:42:16 +0200,
Maarten de Boer wrote:
> 
> Hello,
> 
> I am trying to figure out how to obtain the hardware playback position
> after an underrun occured. When I have no underruns, I can simply keep
> track of the time by counting the samples processed. (I am using
> snd_pcm_mmap_commit). But in the unlucky event an underrun occurs, I
> would like to know what the playback position would have been without
> any underrun. Is this possible? I have been looking at the API docs,
> and at the source code, but to no avail.

In general, the driver doesn't give such information directly.  When
an underrun happens, it depends on the hardware what happens at the
next.  It might stop immediately, reset, or whatever.

The driver can take a timestamp at the time the underrun is detected,
at most.  You can guess from this value.

Note that this doesn't guarantee the exact time, though.  The
detection is usually done at the period boundary unless the hardware
generates the underrun event or the position callback casually detects 
the underrun.


Takashi

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

end of thread, other threads:[~2012-04-27 12:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-25 16:42 how to obtain hardware playback position after underrun? Maarten de Boer
2012-04-27 12:39 ` 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.