| @@ -25,6 +25,9 @@ · 24 unmodified lines |
| 25 | 25 | |
| 26 | 26 | #include <linux/types.h> |
| 27 | 27 | |
| 28 | +#ifndef __KERNEL__ |
| 29 | +#include <stdlib.h> |
| 30 | +#endif |
| 28 | 31 | |
| 29 | 32 | /* |
| 30 | 33 | * protocol version |
| @@ -140,7 +143,7 @@ struct snd_hwdep_dsp_image { · 109 unmodified lines |
| 140 | 143 | * * |
| 141 | 144 | *****************************************************************************/ |
| 142 | 145 | |
| 143 | | −#define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 12) |
| 146 | +#define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 13) |
| 144 | 147 | |
| 145 | 148 | typedef unsigned long snd_pcm_uframes_t; |
| 146 | 149 | typedef signed long snd_pcm_sframes_t; |
| @@ -267,10 +270,17 @@ typedef int __bitwise snd_pcm_subformat_t; · 120 unmodified lines |
| 267 | 270 | #define SNDRV_PCM_INFO_JOINT_DUPLEX 0x00200000 /* playback and capture stream are somewhat correlated */ |
| 268 | 271 | #define SNDRV_PCM_INFO_SYNC_START 0x00400000 /* pcm support some kind of sync go */ |
| 269 | 272 | #define SNDRV_PCM_INFO_NO_PERIOD_WAKEUP 0x00800000 /* period wakeup can be disabled */ |
| 270 | | −#define SNDRV_PCM_INFO_HAS_WALL_CLOCK 0x01000000 /* has audio wall clock for audio/system time sync */ |
| 273 | +#define SNDRV_PCM_INFO_HAS_WALL_CLOCK 0x01000000 /* (Deprecated)has audio wall clock for audio/system time sync */ |
| 274 | +#define SNDRV_PCM_INFO_HAS_LINK_ATIME 0x01000000 /* report hardware link audio time, reset on startup */ |
| 275 | +#define SNDRV_PCM_INFO_HAS_LINK_ABSOLUTE_ATIME 0x02000000 /* report absolute hardware link audio time, not reset on startup */ |
| 276 | +#define SNDRV_PCM_INFO_HAS_LINK_ESTIMATED_ATIME 0x04000000 /* report estimated link audio time */ |
| 277 | +#define SNDRV_PCM_INFO_HAS_LINK_SYNCHRONIZED_ATIME 0x08000000 /* report synchronized audio/system time */ |
| 278 | + |
| 271 | 279 | #define SNDRV_PCM_INFO_DRAIN_TRIGGER 0x40000000 /* internal kernel flag - trigger in drain */ |
| 272 | 280 | #define SNDRV_PCM_INFO_FIFO_IN_FRAMES 0x80000000 /* internal kernel flag - FIFO size is in frames */ |
| 273 | 281 | |
| 282 | + |
| 283 | + |
| 274 | 284 | typedef int __bitwise snd_pcm_state_t; |
| 275 | 285 | #define SNDRV_PCM_STATE_OPEN ((__force snd_pcm_state_t) 0) /* stream is open */ |
| 276 | 286 | #define SNDRV_PCM_STATE_SETUP ((__force snd_pcm_state_t) 1) /* stream has a setup */ |
| @@ -408,6 +418,22 @@ struct snd_pcm_channel_info { · 131 unmodified lines |
| 408 | 418 | unsigned int step; /* samples distance in bits */ |
| 409 | 419 | }; |
| 410 | 420 | |
| 421 | +enum { |
| 422 | + /* |
| 423 | + * first definition for backwards compatibility only, |
| 424 | + * maps to wallclock/link time for HDAudio playback and DEFAULT/DMA time for everything else |
| 425 | + */ |
| 426 | + SNDRV_PCM_AUDIO_TSTAMP_TYPE_COMPAT = 0, |
| 427 | + |
| 428 | + /* timestamp definitions */ |
| 429 | + SNDRV_PCM_AUDIO_TSTAMP_TYPE_DEFAULT = 1, /* DMA time, reported as per hw_ptr */ |
| 430 | + SNDRV_PCM_AUDIO_TSTAMP_TYPE_LINK = 2, /* link time reported by sample or wallclock counter, reset on startup */ |
| 431 | + SNDRV_PCM_AUDIO_TSTAMP_TYPE_LINK_ABSOLUTE = 3, /* link time reported by sample or wallclock counter, not reset on startup */ |
| 432 | + SNDRV_PCM_AUDIO_TSTAMP_TYPE_LINK_ESTIMATED = 4, /* link time estimated indirectly */ |
| 433 | + SNDRV_PCM_AUDIO_TSTAMP_TYPE_LINK_SYNCHRONIZED = 5, /* link time synchronized with system time */ |
| 434 | + SNDRV_PCM_AUDIO_TSTAMP_TYPE_LAST = SNDRV_PCM_AUDIO_TSTAMP_TYPE_LINK_SYNCHRONIZED |
| 435 | +}; |
| 436 | + |
| 411 | 437 | struct snd_pcm_status { |
| 412 | 438 | snd_pcm_state_t state; /* stream state */ |
| 413 | 439 | struct timespec trigger_tstamp; /* time when stream was started/stopped/paused */ |
| @@ -419,9 +445,11 @@ struct snd_pcm_status { · 5 unmodified lines |
| 419 | 445 | snd_pcm_uframes_t avail_max; /* max frames available on hw since last status */ |
| 420 | 446 | snd_pcm_uframes_t overrange; /* count of ADC (capture) overrange detections from last status */ |
| 421 | 447 | snd_pcm_state_t suspended_state; /* suspended stream state */ |
| 422 | | − __u32 reserved_alignment; /* must be filled with zero */ |
| 423 | | − struct timespec audio_tstamp; /* from sample counter or wall clock */ |
| 424 | | − unsigned char reserved[56-sizeof(struct timespec)]; /* must be filled with zero */ |
| 448 | + __u32 audio_tstamp_data; /* needed for 64-bit alignment, used for configs/report to/from userspace */ |
| 449 | + struct timespec audio_tstamp; /* sample counter, wall clock, PHC or on-demand sync'ed */ |
| 450 | + struct timespec driver_tstamp; /* useful in case reference system tstamp is reported with delay */ |
| 451 | + __u32 audio_tstamp_accuracy; /* in ns units, only valid if indicated in audio_tstamp_data */ |
| 452 | + unsigned char reserved[52-2*sizeof(struct timespec)]; /* must be filled with zero */ |
| 425 | 453 | }; |
| 426 | 454 | |
| 427 | 455 | struct snd_pcm_mmap_status { |
| @@ -534,6 +562,7 @@ enum { · 106 unmodified lines |
| 534 | 562 | #define SNDRV_PCM_IOCTL_DELAY _IOR('A', 0x21, snd_pcm_sframes_t) |
| 535 | 563 | #define SNDRV_PCM_IOCTL_HWSYNC _IO('A', 0x22) |
| 536 | 564 | #define SNDRV_PCM_IOCTL_SYNC_PTR _IOWR('A', 0x23, struct snd_pcm_sync_ptr) |
| 565 | +#define SNDRV_PCM_IOCTL_STATUS_EXT _IOWR('A', 0x24, struct snd_pcm_status) |
| 537 | 566 | #define SNDRV_PCM_IOCTL_CHANNEL_INFO _IOR('A', 0x32, struct snd_pcm_channel_info) |
| 538 | 567 | #define SNDRV_PCM_IOCTL_PREPARE _IO('A', 0x40) |
| 539 | 568 | #define SNDRV_PCM_IOCTL_RESET _IO('A', 0x41) |