comparison alsa_pcm_api.h @ 0:c55ea9478c80

Hello Gensokyo!
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Tue, 21 May 2013 10:29:21 +0200
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:c55ea9478c80
1 /*
2 * ALSA kernel API and common-type definitions
3 *
4 * Copyright (c) 2011 by Takashi Iwai <tiwai@suse.de>
5 *
6 * This library is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as
8 * published by the Free Software Foundation; either version 2.1 of
9 * the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General Public License for more details.
15 */
16
17 #ifndef __ALSA_ASOUND_H
18 #define __ALSA_ASOUND_H
19
20 #include <sys/time.h>
21 #include <sys/types.h>
22 #include <sys/ioctl.h>
23 #include <endian.h>
24 #if __BYTE_ORDER == __LITTLE_ENDIAN
25 #define SND_LITTLE_ENDIAN
26 #elif __BYTE_ORDER == __BIG_ENDIAN
27 #define SND_BIG_ENDIAN
28 #else
29 #error "Unsupported endian..."
30 #endif
31
32 /* protocol version */
33 #define SNDRV_PROTOCOL_VERSION(major, minor, subminor) \
34 (((major) << 16) | ((minor) << 8) | (subminor))
35
36 /* PCM interface */
37 #define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 9)
38
39 typedef unsigned long snd_pcm_uframes_t;
40 typedef long snd_pcm_sframes_t;
41
42 typedef enum _snd_pcm_stream {
43 SND_PCM_STREAM_PLAYBACK = 0,
44 SND_PCM_STREAM_CAPTURE,
45 SND_PCM_STREAM_LAST = SND_PCM_STREAM_CAPTURE,
46 } snd_pcm_stream_t;
47
48 typedef enum _snd_pcm_access {
49 SND_PCM_ACCESS_MMAP_INTERLEAVED = 0,
50 SND_PCM_ACCESS_MMAP_NONINTERLEAVED,
51 SND_PCM_ACCESS_MMAP_COMPLEX,
52 SND_PCM_ACCESS_RW_INTERLEAVED,
53 SND_PCM_ACCESS_RW_NONINTERLEAVED,
54 SND_PCM_ACCESS_LAST = SND_PCM_ACCESS_RW_NONINTERLEAVED,
55 } snd_pcm_access_t;
56
57 typedef enum _sndrv_pcm_format {
58 SND_PCM_FORMAT_UNKNOWN = -1,
59 SND_PCM_FORMAT_S8 = 0, /* signed */
60 SND_PCM_FORMAT_U8, /* unsigned */
61 SND_PCM_FORMAT_S16_LE, /* signed little-endian */
62 SND_PCM_FORMAT_S16_BE, /* signed big-endian */
63 SND_PCM_FORMAT_U16_LE,
64 SND_PCM_FORMAT_U16_BE,
65 SND_PCM_FORMAT_S24_LE, /* low three bytes */
66 SND_PCM_FORMAT_S24_BE,
67 SND_PCM_FORMAT_U24_LE,
68 SND_PCM_FORMAT_U24_BE,
69 SND_PCM_FORMAT_S32_LE,
70 SND_PCM_FORMAT_S32_BE,
71 SND_PCM_FORMAT_U32_LE,
72 SND_PCM_FORMAT_U32_BE,
73 SND_PCM_FORMAT_FLOAT_LE, /* 4-byte float */
74 SND_PCM_FORMAT_FLOAT_BE,
75 SND_PCM_FORMAT_FLOAT64_LE, /* 8-byte float */
76 SND_PCM_FORMAT_FLOAT64_BE,
77 SND_PCM_FORMAT_IEC958_SUBFRAME_LE, /* IEC-958 subframe */
78 SND_PCM_FORMAT_IEC958_SUBFRAME_BE,
79 SND_PCM_FORMAT_MU_LAW,
80 SND_PCM_FORMAT_A_LAW,
81 SND_PCM_FORMAT_IMA_ADPCM,
82 SND_PCM_FORMAT_MPEG,
83 SND_PCM_FORMAT_GSM,
84 SND_PCM_FORMAT_SPECIAL = 31,
85 SND_PCM_FORMAT_S24_3LE = 32, /* in three bytes */
86 SND_PCM_FORMAT_S24_3BE,
87 SND_PCM_FORMAT_U24_3LE,
88 SND_PCM_FORMAT_U24_3BE,
89 SND_PCM_FORMAT_S20_3LE,
90 SND_PCM_FORMAT_S20_3BE,
91 SND_PCM_FORMAT_U20_3LE,
92 SND_PCM_FORMAT_U20_3BE,
93 SND_PCM_FORMAT_S18_3LE,
94 SND_PCM_FORMAT_S18_3BE,
95 SND_PCM_FORMAT_U18_3LE,
96 SND_PCM_FORMAT_U18_3BE,
97 SND_PCM_FORMAT_LAST = SND_PCM_FORMAT_U18_3BE,
98
99 #ifdef SND_LITTLE_ENDIAN
100 SND_PCM_FORMAT_S16 = SND_PCM_FORMAT_S16_LE,
101 SND_PCM_FORMAT_U16 = SND_PCM_FORMAT_U16_LE,
102 SND_PCM_FORMAT_S24 = SND_PCM_FORMAT_S24_LE,
103 SND_PCM_FORMAT_U24 = SND_PCM_FORMAT_U24_LE,
104 SND_PCM_FORMAT_S32 = SND_PCM_FORMAT_S32_LE,
105 SND_PCM_FORMAT_U32 = SND_PCM_FORMAT_U32_LE,
106 SND_PCM_FORMAT_FLOAT = SND_PCM_FORMAT_FLOAT_LE,
107 SND_PCM_FORMAT_FLOAT64 = SND_PCM_FORMAT_FLOAT64_LE,
108 SND_PCM_FORMAT_IEC958_SUBFRAME = SND_PCM_FORMAT_IEC958_SUBFRAME_LE,
109 #endif
110 #ifdef SND_BIG_ENDIAN
111 SND_PCM_FORMAT_S16 = SND_PCM_FORMAT_S16_BE,
112 SND_PCM_FORMAT_U16 = SND_PCM_FORMAT_U16_BE,
113 SND_PCM_FORMAT_S24 = SND_PCM_FORMAT_S24_BE,
114 SND_PCM_FORMAT_U24 = SND_PCM_FORMAT_U24_BE,
115 SND_PCM_FORMAT_S32 = SND_PCM_FORMAT_S32_BE,
116 SND_PCM_FORMAT_U32 = SND_PCM_FORMAT_U32_BE,
117 SND_PCM_FORMAT_FLOAT = SND_PCM_FORMAT_FLOAT_BE,
118 SND_PCM_FORMAT_FLOAT64 = SND_PCM_FORMAT_FLOAT64_BE,
119 SND_PCM_FORMAT_IEC958_SUBFRAME = SND_PCM_FORMAT_IEC958_SUBFRAME_BE,
120 #endif
121 } snd_pcm_format_t;
122
123 typedef enum _snd_pcm_subformat {
124 SND_PCM_SUBFORMAT_STD = 0,
125 SND_PCM_SUBFORMAT_LAST = SND_PCM_SUBFORMAT_STD,
126 } snd_pcm_subformat_t;
127
128 #define SNDRV_PCM_INFO_MMAP 0x00000001
129 #define SNDRV_PCM_INFO_MMAP_VALID 0x00000002
130 #define SNDRV_PCM_INFO_DOUBLE 0x00000004
131 #define SNDRV_PCM_INFO_BATCH 0x00000010
132 #define SNDRV_PCM_INFO_INTERLEAVED 0x00000100
133 #define SNDRV_PCM_INFO_NONINTERLEAVED 0x00000200
134 #define SNDRV_PCM_INFO_COMPLEX 0x00000400
135 #define SNDRV_PCM_INFO_BLOCK_TRANSFER 0x00010000
136 #define SNDRV_PCM_INFO_OVERRANGE 0x00020000
137 #define SNDRV_PCM_INFO_RESUME 0x00040000
138 #define SNDRV_PCM_INFO_PAUSE 0x00080000
139 #define SNDRV_PCM_INFO_HALF_DUPLEX 0x00100000
140 #define SNDRV_PCM_INFO_JOINT_DUPLEX 0x00200000
141 #define SNDRV_PCM_INFO_SYNC_START 0x00400000
142 #define SNDRV_PCM_INFO_NO_PERIOD_WAKEUP 0x00800000
143
144 typedef enum _snd_pcm_state {
145 SND_PCM_STATE_OPEN = 0,
146 SND_PCM_STATE_SETUP,
147 SND_PCM_STATE_PREPARED,
148 SND_PCM_STATE_RUNNING,
149 SND_PCM_STATE_XRUN,
150 SND_PCM_STATE_DRAINING,
151 SND_PCM_STATE_PAUSED,
152 SND_PCM_STATE_SUSPENDED,
153 SND_PCM_STATE_DISCONNECTED,
154 SND_PCM_STATE_LAST = SND_PCM_STATE_DISCONNECTED
155 } snd_pcm_state_t;
156
157 enum {
158 SNDRV_PCM_MMAP_OFFSET_DATA = 0x00000000,
159 SNDRV_PCM_MMAP_OFFSET_STATUS = 0x80000000,
160 SNDRV_PCM_MMAP_OFFSET_CONTROL = 0x81000000,
161 };
162
163 typedef union _snd_pcm_sync_id {
164 unsigned char id[16];
165 unsigned short id16[8];
166 unsigned int id32[4];
167 } snd_pcm_sync_id_t;
168
169 typedef struct snd_pcm_info {
170 unsigned int device;
171 unsigned int subdevice;
172 int stream;
173 int card;
174 unsigned char id[64];
175 unsigned char name[80];
176 unsigned char subname[32];
177 int dev_class;
178 int dev_subclass;
179 unsigned int subdevices_count;
180 unsigned int subdevices_avail;
181 snd_pcm_sync_id_t sync;
182 unsigned char reserved[64];
183 } snd_pcm_info_t;
184
185 enum sndrv_pcm_hw_param {
186 SNDRV_PCM_HW_PARAM_ACCESS = 0,
187 SNDRV_PCM_HW_PARAM_FIRST_MASK = SNDRV_PCM_HW_PARAM_ACCESS,
188 SNDRV_PCM_HW_PARAM_FORMAT,
189 SNDRV_PCM_HW_PARAM_SUBFORMAT,
190 SNDRV_PCM_HW_PARAM_LAST_MASK = SNDRV_PCM_HW_PARAM_SUBFORMAT,
191
192 SNDRV_PCM_HW_PARAM_SAMPLE_BITS = 8,
193 SNDRV_PCM_HW_PARAM_FIRST_INTERVAL = SNDRV_PCM_HW_PARAM_SAMPLE_BITS,
194 SNDRV_PCM_HW_PARAM_FRAME_BITS,
195 SNDRV_PCM_HW_PARAM_CHANNELS,
196 SNDRV_PCM_HW_PARAM_RATE,
197 SNDRV_PCM_HW_PARAM_PERIOD_TIME,
198 SNDRV_PCM_HW_PARAM_PERIOD_SIZE,
199 SNDRV_PCM_HW_PARAM_PERIOD_BYTES,
200 SNDRV_PCM_HW_PARAM_PERIODS,
201 SNDRV_PCM_HW_PARAM_BUFFER_TIME,
202 SNDRV_PCM_HW_PARAM_BUFFER_SIZE,
203 SNDRV_PCM_HW_PARAM_BUFFER_BYTES,
204 SNDRV_PCM_HW_PARAM_TICK_TIME,
205 SNDRV_PCM_HW_PARAM_LAST_INTERVAL = SNDRV_PCM_HW_PARAM_TICK_TIME
206 };
207
208 #define SNDRV_PCM_HW_PARAMS_NORESAMPLE (1<<0)
209 #define SNDRV_PCM_HW_PARAMS_EXPORT_BUFFER (1<<1)
210 #define SNDRV_PCM_HW_PARAMS_NO_PERIOD_WAKEUP (1<<2)
211
212 typedef struct snd_interval {
213 unsigned int min, max;
214 unsigned int openmin:1,
215 openmax:1,
216 integer:1,
217 empty:1;
218 } snd_interval_t;
219
220 #define SND_MASK_MAX 256
221
222 typedef struct snd_mask {
223 u_int32_t bits[SND_MASK_MAX / 32];
224 } snd_mask_t;
225
226 typedef struct snd_pcm_hw_params {
227 unsigned int flags;
228 snd_mask_t masks[SNDRV_PCM_HW_PARAM_LAST_MASK -
229 SNDRV_PCM_HW_PARAM_FIRST_MASK + 1];
230 snd_mask_t mres[5];
231 snd_interval_t intervals[SNDRV_PCM_HW_PARAM_LAST_INTERVAL -
232 SNDRV_PCM_HW_PARAM_FIRST_INTERVAL + 1];
233 snd_interval_t ires[9];
234 unsigned int rmask;
235 unsigned int cmask;
236 unsigned int info;
237 unsigned int msbits;
238 unsigned int rate_num;
239 unsigned int rate_den;
240 snd_pcm_uframes_t fifo_size;
241 unsigned char reserved[64];
242 } snd_pcm_hw_params_t;
243
244 typedef enum _snd_pcm_tstamp {
245 SND_PCM_TSTAMP_NONE = 0,
246 SND_PCM_TSTAMP_ENABLE,
247 SND_PCM_TSTAMP_MMAP = SND_PCM_TSTAMP_ENABLE,
248 SND_PCM_TSTAMP_LAST = SND_PCM_TSTAMP_MMAP
249 } snd_pcm_tstamp_t;
250
251 typedef struct snd_pcm_sw_params {
252 int tstamp_mode;
253 unsigned int period_step;
254 unsigned int sleep_min;
255 snd_pcm_uframes_t avail_min;
256 snd_pcm_uframes_t xfer_align;
257 snd_pcm_uframes_t start_threshold;
258 snd_pcm_uframes_t stop_threshold;
259 snd_pcm_uframes_t silence_threshold;
260 snd_pcm_uframes_t silence_size;
261 snd_pcm_uframes_t boundary;
262 unsigned char reserved[60];
263 unsigned int period_event;
264 } snd_pcm_sw_params_t;
265
266 /* XXX this is different from snd_pcm_channel_info_t !! */
267 struct sndrv_pcm_channel_info {
268 unsigned int channel;
269 long offset;
270 unsigned int first;
271 unsigned int step;
272 };
273
274 typedef struct snd_pcm_status {
275 int state;
276 struct timespec trigger_tstamp;
277 struct timespec tstamp;
278 snd_pcm_uframes_t appl_ptr;
279 snd_pcm_uframes_t hw_ptr;
280 snd_pcm_sframes_t delay;
281 snd_pcm_uframes_t avail;
282 snd_pcm_uframes_t avail_max;
283 snd_pcm_uframes_t overrange;
284 int suspended_state;
285 unsigned char reserved[60];
286 } snd_pcm_status_t;
287
288 struct snd_pcm_mmap_status {
289 int state;
290 int pad1;
291 snd_pcm_uframes_t hw_ptr;
292 struct timespec tstamp;
293 int suspended_state;
294 };
295
296 struct snd_pcm_mmap_control {
297 snd_pcm_uframes_t appl_ptr;
298 snd_pcm_uframes_t avail_min;
299 };
300
301 #define SNDRV_PCM_SYNC_PTR_HWSYNC (1<<0)
302 #define SNDRV_PCM_SYNC_PTR_APPL (1<<1)
303 #define SNDRV_PCM_SYNC_PTR_AVAIL_MIN (1<<2)
304
305 struct snd_pcm_sync_ptr {
306 unsigned int flags;
307 union {
308 struct snd_pcm_mmap_status status;
309 unsigned char reserved[64];
310 } s;
311 union {
312 struct snd_pcm_mmap_control control;
313 unsigned char reserved[64];
314 } c;
315 };
316
317 struct snd_xferi {
318 snd_pcm_sframes_t result;
319 void *buf;
320 snd_pcm_uframes_t frames;
321 };
322
323 struct snd_xfern {
324 snd_pcm_sframes_t result;
325 void **bufs;
326 snd_pcm_uframes_t frames;
327 };
328
329
330 enum {
331 SNDRV_PCM_TSTAMP_TYPE_GETTIMEOFDAY = 0,
332 SNDRV_PCM_TSTAMP_TYPE_MONOTONIC,
333 SNDRV_PCM_TSTAMP_TYPE_LAST = SNDRV_PCM_TSTAMP_TYPE_MONOTONIC,
334 };
335
336 enum {
337 SNDRV_PCM_IOCTL_PVERSION = _IOR('A', 0x00, int),
338 SNDRV_PCM_IOCTL_INFO = _IOR('A', 0x01, snd_pcm_info_t),
339 SNDRV_PCM_IOCTL_TSTAMP = _IOW('A', 0x02, int),
340 SNDRV_PCM_IOCTL_TTSTAMP = _IOW('A', 0x03, int),
341 SNDRV_PCM_IOCTL_HW_REFINE = _IOWR('A', 0x10, snd_pcm_hw_params_t),
342 SNDRV_PCM_IOCTL_HW_PARAMS = _IOWR('A', 0x11, snd_pcm_hw_params_t),
343 SNDRV_PCM_IOCTL_HW_FREE = _IO('A', 0x12),
344 SNDRV_PCM_IOCTL_SW_PARAMS = _IOWR('A', 0x13, snd_pcm_sw_params_t),
345 SNDRV_PCM_IOCTL_STATUS = _IOR('A', 0x20, snd_pcm_status_t),
346 SNDRV_PCM_IOCTL_DELAY = _IOR('A', 0x21, snd_pcm_sframes_t),
347 SNDRV_PCM_IOCTL_HWSYNC = _IO('A', 0x22),
348 SNDRV_PCM_IOCTL_SYNC_PTR = _IOWR('A', 0x23, struct snd_pcm_sync_ptr),
349 SNDRV_PCM_IOCTL_CHANNEL_INFO = _IOR('A', 0x32, struct sndrv_pcm_channel_info),
350 SNDRV_PCM_IOCTL_PREPARE = _IO('A', 0x40),
351 SNDRV_PCM_IOCTL_RESET = _IO('A', 0x41),
352 SNDRV_PCM_IOCTL_START = _IO('A', 0x42),
353 SNDRV_PCM_IOCTL_DROP = _IO('A', 0x43),
354 SNDRV_PCM_IOCTL_DRAIN = _IO('A', 0x44),
355 SNDRV_PCM_IOCTL_PAUSE = _IOW('A', 0x45, int),
356 SNDRV_PCM_IOCTL_REWIND = _IOW('A', 0x46, snd_pcm_uframes_t),
357 SNDRV_PCM_IOCTL_RESUME = _IO('A', 0x47),
358 SNDRV_PCM_IOCTL_XRUN = _IO('A', 0x48),
359 SNDRV_PCM_IOCTL_FORWARD = _IOW('A', 0x49, snd_pcm_uframes_t),
360 SNDRV_PCM_IOCTL_WRITEI_FRAMES = _IOW('A', 0x50, struct snd_xferi),
361 SNDRV_PCM_IOCTL_READI_FRAMES = _IOR('A', 0x51, struct snd_xferi),
362 SNDRV_PCM_IOCTL_WRITEN_FRAMES = _IOW('A', 0x52, struct snd_xfern),
363 SNDRV_PCM_IOCTL_READN_FRAMES = _IOR('A', 0x53, struct snd_xfern),
364 SNDRV_PCM_IOCTL_LINK = _IOW('A', 0x60, int),
365 SNDRV_PCM_IOCTL_UNLINK = _IO('A', 0x61),
366 };
367
368 /* Trick to make alsa-lib/acinclude.m4 happy */
369 #define SNDRV_PCM_IOCTL_REWIND SNDRV_PCM_IOCTL_REWIND
370
371 /* Timer interface */
372 #define SNDRV_TIMER_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 5)
373
374 typedef enum _snd_timer_class {
375 SND_TIMER_CLASS_NONE = -1,
376 SND_TIMER_CLASS_SLAVE = 0,
377 SND_TIMER_CLASS_GLOBAL,
378 SND_TIMER_CLASS_CARD,
379 SND_TIMER_CLASS_PCM,
380 SND_TIMER_CLASS_LAST = SND_TIMER_CLASS_PCM
381 } snd_timer_class_t;
382
383 typedef enum _snd_timer_slave_class {
384 SND_TIMER_SCLASS_NONE = 0,
385 SND_TIMER_SCLASS_APPLICATION,
386 SND_TIMER_SCLASS_SEQUENCER,
387 SND_TIMER_SCLASS_OSS_SEQUENCER,
388 SND_TIMER_SCLASS_LAST = SND_TIMER_SCLASS_OSS_SEQUENCER
389 } snd_timer_slave_class_t;
390
391 /* global timers (device member) */
392 #define SND_TIMER_GLOBAL_SYSTEM 0
393 #define SND_TIMER_GLOBAL_RTC 1
394 #define SND_TIMER_GLOBAL_HPET 2
395 #define SND_TIMER_GLOBAL_HRTIMER 3
396
397 /* info flags */
398 #define SNDRV_TIMER_FLG_SLAVE (1<<0) /* cannot be controlled */
399
400 typedef struct snd_timer_id {
401 int dev_class;
402 int dev_sclass;
403 int card;
404 int device;
405 int subdevice;
406 } snd_timer_id_t;
407
408 typedef struct snd_timer_ginfo {
409 snd_timer_id_t tid;
410 unsigned int flags;
411 int card;
412 unsigned char id[64];
413 unsigned char name[80];
414 unsigned long reserved0;
415 unsigned long resolution;
416 unsigned long resolution_min;
417 unsigned long resolution_max;
418 unsigned int clients;
419 unsigned char reserved[32];
420 } snd_timer_ginfo_t;
421
422 typedef struct snd_timer_gparams {
423 snd_timer_id_t tid;
424 unsigned long period_num;
425 unsigned long period_den;
426 unsigned char reserved[32];
427 } snd_timer_gparams_t;
428
429 typedef struct snd_timer_gstatus {
430 snd_timer_id_t tid;
431 unsigned long resolution;
432 unsigned long resolution_num;
433 unsigned long resolution_den;
434 unsigned char reserved[32];
435 } snd_timer_gstatus_t;
436
437 typedef struct snd_timer_select {
438 snd_timer_id_t id;
439 unsigned char reserved[32];
440 } snd_timer_select_t;
441
442 typedef struct snd_timer_info {
443 unsigned int flags;
444 int card;
445 unsigned char id[64];
446 unsigned char name[80];
447 unsigned long reserved0;
448 unsigned long resolution;
449 unsigned char reserved[64];
450 } snd_timer_info_t;
451
452 #define SNDRV_TIMER_PSFLG_AUTO (1<<0)
453 #define SNDRV_TIMER_PSFLG_EXCLUSIVE (1<<1)
454 #define SNDRV_TIMER_PSFLG_EARLY_EVENT (1<<2)
455
456 typedef struct snd_timer_params {
457 unsigned int flags;
458 unsigned int ticks;
459 unsigned int queue_size;
460 unsigned int reserved0;
461 unsigned int filter;
462 unsigned char reserved[60];
463 } snd_timer_params_t;
464
465 typedef struct snd_timer_status {
466 struct timespec tstamp;
467 unsigned int resolution;
468 unsigned int lost;
469 unsigned int overrun;
470 unsigned int queue;
471 unsigned char reserved[64];
472 } snd_timer_status_t;
473
474 enum {
475 SNDRV_TIMER_IOCTL_PVERSION = _IOR('T', 0x00, int),
476 SNDRV_TIMER_IOCTL_NEXT_DEVICE = _IOWR('T', 0x01, snd_timer_id_t),
477 SNDRV_TIMER_IOCTL_TREAD = _IOW('T', 0x02, int),
478 SNDRV_TIMER_IOCTL_GINFO = _IOWR('T', 0x03, snd_timer_ginfo_t),
479 SNDRV_TIMER_IOCTL_GPARAMS = _IOW('T', 0x04, snd_timer_gparams_t),
480 SNDRV_TIMER_IOCTL_GSTATUS = _IOWR('T', 0x05, snd_timer_gstatus_t),
481 SNDRV_TIMER_IOCTL_SELECT = _IOW('T', 0x10, snd_timer_select_t),
482 SNDRV_TIMER_IOCTL_INFO = _IOR('T', 0x11, snd_timer_info_t),
483 SNDRV_TIMER_IOCTL_PARAMS = _IOW('T', 0x12, snd_timer_params_t),
484 SNDRV_TIMER_IOCTL_STATUS = _IOR('T', 0x14, snd_timer_status_t),
485 /* The following four ioctls are changed since 1.0.9 due to confliction */
486 SNDRV_TIMER_IOCTL_START = _IO('T', 0xa0),
487 SNDRV_TIMER_IOCTL_STOP = _IO('T', 0xa1),
488 SNDRV_TIMER_IOCTL_CONTINUE = _IO('T', 0xa2),
489 SNDRV_TIMER_IOCTL_PAUSE = _IO('T', 0xa3),
490 };
491
492 typedef struct _snd_timer_read {
493 unsigned int resolution;
494 unsigned int ticks;
495 } snd_timer_read_t;
496
497 typedef enum _snd_timer_event {
498 SND_TIMER_EVENT_RESOLUTION = 0,
499 SND_TIMER_EVENT_TICK,
500 SND_TIMER_EVENT_START,
501 SND_TIMER_EVENT_STOP,
502 SND_TIMER_EVENT_CONTINUE,
503 SND_TIMER_EVENT_PAUSE,
504 SND_TIMER_EVENT_EARLY,
505 SND_TIMER_EVENT_SUSPEND,
506 SND_TIMER_EVENT_RESUME,
507 SND_TIMER_EVENT_MSTART = SND_TIMER_EVENT_START + 10,
508 SND_TIMER_EVENT_MSTOP = SND_TIMER_EVENT_STOP + 10,
509 SND_TIMER_EVENT_MCONTINUE = SND_TIMER_EVENT_CONTINUE + 10,
510 SND_TIMER_EVENT_MPAUSE = SND_TIMER_EVENT_PAUSE + 10,
511 SND_TIMER_EVENT_MSUSPEND = SND_TIMER_EVENT_SUSPEND + 10,
512 SND_TIMER_EVENT_MRESUME = SND_TIMER_EVENT_RESUME + 10
513 } snd_timer_event_t;
514
515 typedef struct timeval snd_timestamp_t;
516 typedef struct timespec snd_htimestamp_t;
517
518 typedef struct _snd_timer_tread {
519 snd_timer_event_t event;
520 snd_htimestamp_t tstamp;
521 unsigned int val;
522 } snd_timer_tread_t;
523
524 typedef snd_mask_t snd_pcm_access_mask_t;
525 typedef snd_mask_t snd_pcm_format_mask_t;
526 typedef snd_mask_t snd_pcm_subformat_mask_t;
527 #define SND_PCM_NONBLOCK 0x00000001
528
529 #endif /* __ALSA_ASOUND_H */