enum {
SNDRV_PCM_TSTAMP_NONE = 0,
- SNDRV_PCM_TSTAMP_MMAP,
- SNDRV_PCM_TSTAMP_LAST = SNDRV_PCM_TSTAMP_MMAP,
+ SNDRV_PCM_TSTAMP_ENABLE,
+ SNDRV_PCM_TSTAMP_LAST = SNDRV_PCM_TSTAMP_ENABLE,
};
struct snd_pcm_sw_params {
static char *snd_pcm_tstamp_mode_names[] = {
TSTAMP(NONE),
- TSTAMP(MMAP),
+ TSTAMP(ENABLE),
};
static const char *snd_pcm_stream_name(int stream)
{
snd_pcm_uframes_t pos;
+ if (runtime->tstamp_mode == SNDRV_PCM_TSTAMP_ENABLE)
+ snd_pcm_gettime(runtime, (struct timespec *)&runtime->status->tstamp);
pos = substream->ops->pointer(substream);
if (pos == SNDRV_PCM_POS_XRUN)
return pos; /* XRUN */
snd_pcm_uframes_t new_hw_ptr, hw_ptr_interrupt;
snd_pcm_sframes_t delta;
- if (runtime->tstamp_mode == SNDRV_PCM_TSTAMP_MMAP)
- snd_pcm_gettime(runtime, (struct timespec *)&runtime->status->tstamp);
pos = snd_pcm_update_hw_ptr_pos(substream, runtime);
if (pos == SNDRV_PCM_POS_XRUN) {
xrun(substream);
if (status->state == SNDRV_PCM_STATE_OPEN)
goto _end;
status->trigger_tstamp = runtime->trigger_tstamp;
- if (snd_pcm_running(substream))
+ if (snd_pcm_running(substream)) {
snd_pcm_update_hw_ptr(substream);
+ if (runtime->tstamp_mode == SNDRV_PCM_TSTAMP_ENABLE) {
+ status->tstamp = runtime->status->tstamp;
+ goto _tstamp_end;
+ }
+ }
snd_pcm_gettime(runtime, &status->tstamp);
+ _tstamp_end:
status->appl_ptr = runtime->control->appl_ptr;
status->hw_ptr = runtime->status->hw_ptr;
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {