Skip to contentSkip to conversation

ALSA: provide a simple mechanism to start playback at a given time

PATCH New Nick Stoughton 1 participant 1 message Oct 23, 2014 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: provide a simple mechanism to start playback at a given time

Given an absolute time based on the clock used by the substream setup a high resolution timer to cause playback to be triggered at that time.

---
 include/uapi/sound/asound.h |   6 ++
 sound/core/pcm_native.c     | 142 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 148 insertions(+)
include/uapi/sound/asound.h +6 -0
index 6ee5867..92d5856 100644
@@ -462,6 +462,11 @@ struct snd_xfern {
 	snd_pcm_uframes_t frames;
 };
 
+struct snd_clock_time {
+        clockid_t       clock;
+        struct timespec time;
+};
+
 enum {
 	SNDRV_PCM_TSTAMP_TYPE_GETTIMEOFDAY = 0,	/* gettimeofday equivalent */
 	SNDRV_PCM_TSTAMP_TYPE_MONOTONIC,	/* posix_clock_monotonic equivalent */
@@ -547,6 +552,7 @@ enum {
 #define SNDRV_PCM_IOCTL_READN_FRAMES	_IOR('A', 0x53, struct snd_xfern)
 #define SNDRV_PCM_IOCTL_LINK		_IOW('A', 0x60, int)
 #define SNDRV_PCM_IOCTL_UNLINK		_IO('A', 0x61)
+#define SNDRV_PCM_IOCTL_START_AT	_IOW('A', 0x62, struct snd_clock_time)
 
 /*****************************************************************************
  *                                                                           *
sound/core/pcm_native.c +142 -0

166 lines not on this page · raw message

Signature · 1 line
1.9.3