aboutsummaryrefslogtreecommitdiffstats
path: root/include/sound
diff options
context:
space:
mode:
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>2012-10-22 17:42:15 -0400
committerTakashi Iwai <tiwai@suse.de>2012-10-23 10:13:48 -0400
commit4eeaaeaea1cec60a25979678182720dc91308550 (patch)
treeef6895d3ff86454cc6348e2efde2313eceb24471 /include/sound
parent0e8014d772a7639f48d234b23dc4ce97335cce7f (diff)
ALSA: core: add hooks for audio timestamps
ALSA did not provide any direct means to infer the audio time for A/V sync and system/audio time correlations (eg. PulseAudio). Applications had to track the number of samples read/written and add/subtract the number of samples queued in the ring buffer. This accounting led to small errors, typically several samples, due to the two-step process. Computing the audio time in the kernel is more direct, as all the information is available in the same routines. Also add new .audio_wallclock routine to enable fine-grain synchronization between monotonic system time and audio hardware time. Using the wallclock, if supported in hardware, allows for a much better sub-microsecond precision and a common drift tracking for all devices sharing the same wall clock (master clock). Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'include/sound')
-rw-r--r--include/sound/pcm.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index 28fd9f95f9ba..45c1981c9ca2 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -71,6 +71,8 @@ struct snd_pcm_ops {
71 int (*prepare)(struct snd_pcm_substream *substream); 71 int (*prepare)(struct snd_pcm_substream *substream);
72 int (*trigger)(struct snd_pcm_substream *substream, int cmd); 72 int (*trigger)(struct snd_pcm_substream *substream, int cmd);
73 snd_pcm_uframes_t (*pointer)(struct snd_pcm_substream *substream); 73 snd_pcm_uframes_t (*pointer)(struct snd_pcm_substream *substream);
74 int (*wall_clock)(struct snd_pcm_substream *substream,
75 struct timespec *audio_ts);
74 int (*copy)(struct snd_pcm_substream *substream, int channel, 76 int (*copy)(struct snd_pcm_substream *substream, int channel,
75 snd_pcm_uframes_t pos, 77 snd_pcm_uframes_t pos,
76 void __user *buf, snd_pcm_uframes_t count); 78 void __user *buf, snd_pcm_uframes_t count);