All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH alsa-lib 1/2] pcm: Add snd_pcm_audio_tstamp_type_t constants
@ 2020-12-17 10:29 Takashi Iwai
  2020-12-17 10:29 ` [PATCH alsa-lib 2/2] test/audio_time: Make use of SND_PCM_AUDIO_TSTAMP_TYPE constants Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Takashi Iwai @ 2020-12-17 10:29 UTC (permalink / raw)
  To: alsa-devel; +Cc: Alex Moon, David Henningsson

From: David Henningsson <diwic@ubuntu.com>

These are mostly a copy-paste from the kernel headers. But since functions
snd_pcm_audio_tstamp_config make use of these they should be added to the
public API as well.

Reported-by: Alex Moon <alex.r.moon@gmail.com>
Signed-off-by: David Henningsson <diwic@ubuntu.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 include/pcm.h | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/include/pcm.h b/include/pcm.h
index 5b0782315585..cf1eea8bbc9b 100644
--- a/include/pcm.h
+++ b/include/pcm.h
@@ -350,6 +350,20 @@ typedef enum _snd_pcm_tstamp_type {
 	SND_PCM_TSTAMP_TYPE_LAST = SND_PCM_TSTAMP_TYPE_MONOTONIC_RAW,
 } snd_pcm_tstamp_type_t;
 
+typedef enum _snd_pcm_audio_tstamp_type {
+	/**
+	 * first definition for backwards compatibility only,
+	 * maps to wallclock/link time for HDAudio playback and DEFAULT/DMA time for everything else
+	 */
+	SND_PCM_AUDIO_TSTAMP_TYPE_COMPAT = 0,
+	SND_PCM_AUDIO_TSTAMP_TYPE_DEFAULT = 1,           /**< DMA time, reported as per hw_ptr */
+	SND_PCM_AUDIO_TSTAMP_TYPE_LINK = 2,	           /**< link time reported by sample or wallclock counter, reset on startup */
+	SND_PCM_AUDIO_TSTAMP_TYPE_LINK_ABSOLUTE = 3,	   /**< link time reported by sample or wallclock counter, not reset on startup */
+	SND_PCM_AUDIO_TSTAMP_TYPE_LINK_ESTIMATED = 4,    /**< link time estimated indirectly */
+	SND_PCM_AUDIO_TSTAMP_TYPE_LINK_SYNCHRONIZED = 5, /**< link time synchronized with system time */
+	SND_PCM_AUDIO_TSTAMP_TYPE_LAST = SNDRV_PCM_AUDIO_TSTAMP_TYPE_LINK_SYNCHRONIZED
+} snd_pcm_audio_tstamp_type_t;
+
 typedef struct _snd_pcm_audio_tstamp_config {
 	/* 5 of max 16 bits used */
 	unsigned int type_requested:4;
-- 
2.26.2


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

end of thread, other threads:[~2020-12-17 10:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-17 10:29 [PATCH alsa-lib 1/2] pcm: Add snd_pcm_audio_tstamp_type_t constants Takashi Iwai
2020-12-17 10:29 ` [PATCH alsa-lib 2/2] test/audio_time: Make use of SND_PCM_AUDIO_TSTAMP_TYPE constants 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.