diff options
author | Damien.Horsley <Damien.Horsley@imgtec.com> | 2015-04-30 17:16:57 +0100 |
---|---|---|
committer | Govindraj Raja <Govindraj.Raja@imgtec.com> | 2015-06-22 16:01:47 +0100 |
commit | 8497a15ca129d4f31ce127340f8225832d9139c1 (patch) | |
tree | dd3bcd9908692854d2484aad4d95d5dce9145fd0 /include/uapi | |
parent | a07eaf30de267dd4876c665d914edbba822decab (diff) | |
download | v4.1-8497a15ca129d4f31ce127340f8225832d9139c1.tar.gz |
ALSA: Add ALSA StartAt
- Implement START_AT ioctl
- Implement start_at for system (posix) clocks using hi-res timers
- Implement start_at for audio clocks by forwarding to new fields in
* snd_pcm_ops
* snd_soc_ops
* snd_soc_dai_ops
* snd_soc_platform_driver
SNDRV_PCM_AUDIO_TSTAMP_* is taken from Pierre Louis Boussart's "Audio
Timestamping Evolutions" patchset, which has been accepted upstream.
Change-Id: Ibc888e2675e9b155c91fc43d4fb5e4615a923e2f
Signed-off-by: Tim Cussins <tim.cussins@linn.co.uk>
Signed-off-by: Damien.Horsley <Damien.Horsley@imgtec.com>
Diffstat (limited to 'include/uapi')
-rw-r--r-- | include/uapi/sound/asound.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/include/uapi/sound/asound.h b/include/uapi/sound/asound.h index a45be6bdcf5..feb2da3c9e9 100644 --- a/include/uapi/sound/asound.h +++ b/include/uapi/sound/asound.h @@ -291,6 +291,7 @@ typedef int __bitwise snd_pcm_state_t; #define SNDRV_PCM_STATE_PAUSED ((__force snd_pcm_state_t) 6) /* stream is paused */ #define SNDRV_PCM_STATE_SUSPENDED ((__force snd_pcm_state_t) 7) /* hardware is suspended */ #define SNDRV_PCM_STATE_DISCONNECTED ((__force snd_pcm_state_t) 8) /* hardware is disconnected */ +#define SNDRV_PCM_STATE_STARTING ((__force snd_pcm_state_t) 9) /* stream start has been delegated to the kernel */ #define SNDRV_PCM_STATE_LAST SNDRV_PCM_STATE_DISCONNECTED enum { @@ -501,6 +502,26 @@ enum { SNDRV_PCM_TSTAMP_TYPE_LAST = SNDRV_PCM_TSTAMP_TYPE_MONOTONIC_RAW, }; +enum { + SNDRV_PCM_CLOCK_CLASS_SYSTEM = 0, + SNDRV_PCM_CLOCK_CLASS_AUDIO, + SNDRV_PCM_CLOCK_CLASS_LAST = SNDRV_PCM_CLOCK_CLASS_AUDIO, +}; + +struct snd_pcm_startat_state { + int pending; /* 0 or 1 */ + int clock_class; /* SNDRV_PCM_CLOCK_CLASS_* */ + int clock_type; /* SNDRV_PCM_TSTAMP_* or + * SNDRV_PCM_AUDIO_TSTAMP_TYPE_* */ + struct timespec start_time; +}; + +struct snd_startat { + int clock_class; + int clock_type; + struct timespec start_time; +}; + /* channel positions */ enum { SNDRV_CHMAP_UNKNOWN = 0, @@ -580,6 +601,8 @@ 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_startat) + /***************************************************************************** * * |