1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23#ifndef _UAPI__SOUND_ASOUND_H
24#define _UAPI__SOUND_ASOUND_H
25
26#include <linux/types.h>
27
28
29
30
31
32
33#define SNDRV_PROTOCOL_VERSION(major, minor, subminor) (((major)<<16)|((minor)<<8)|(subminor))
34#define SNDRV_PROTOCOL_MAJOR(version) (((version)>>16)&0xffff)
35#define SNDRV_PROTOCOL_MINOR(version) (((version)>>8)&0xff)
36#define SNDRV_PROTOCOL_MICRO(version) ((version)&0xff)
37#define SNDRV_PROTOCOL_INCOMPATIBLE(kversion, uversion) \
38 (SNDRV_PROTOCOL_MAJOR(kversion) != SNDRV_PROTOCOL_MAJOR(uversion) || \
39 (SNDRV_PROTOCOL_MAJOR(kversion) == SNDRV_PROTOCOL_MAJOR(uversion) && \
40 SNDRV_PROTOCOL_MINOR(kversion) != SNDRV_PROTOCOL_MINOR(uversion)))
41
42
43
44
45
46
47
48struct snd_aes_iec958 {
49 unsigned char status[24];
50 unsigned char subcode[147];
51 unsigned char pad;
52 unsigned char dig_subframe[4];
53};
54
55
56
57
58
59
60
61struct snd_cea_861_aud_if {
62 unsigned char db1_ct_cc;
63 unsigned char db2_sf_ss;
64 unsigned char db3;
65 unsigned char db4_ca;
66 unsigned char db5_dminh_lsv;
67};
68
69
70
71
72
73
74
75#define SNDRV_HWDEP_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 1)
76
77enum {
78 SNDRV_HWDEP_IFACE_OPL2 = 0,
79 SNDRV_HWDEP_IFACE_OPL3,
80 SNDRV_HWDEP_IFACE_OPL4,
81 SNDRV_HWDEP_IFACE_SB16CSP,
82 SNDRV_HWDEP_IFACE_EMU10K1,
83 SNDRV_HWDEP_IFACE_YSS225,
84 SNDRV_HWDEP_IFACE_ICS2115,
85 SNDRV_HWDEP_IFACE_SSCAPE,
86 SNDRV_HWDEP_IFACE_VX,
87 SNDRV_HWDEP_IFACE_MIXART,
88 SNDRV_HWDEP_IFACE_USX2Y,
89 SNDRV_HWDEP_IFACE_EMUX_WAVETABLE,
90 SNDRV_HWDEP_IFACE_BLUETOOTH,
91 SNDRV_HWDEP_IFACE_USX2Y_PCM,
92 SNDRV_HWDEP_IFACE_PCXHR,
93 SNDRV_HWDEP_IFACE_SB_RC,
94 SNDRV_HWDEP_IFACE_HDA,
95 SNDRV_HWDEP_IFACE_USB_STREAM,
96 SNDRV_HWDEP_IFACE_FW_DICE,
97
98
99 SNDRV_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_FW_DICE
100};
101
102struct snd_hwdep_info {
103 unsigned int device;
104 int card;
105 unsigned char id[64];
106 unsigned char name[80];
107 int iface;
108 unsigned char reserved[64];
109};
110
111
112struct snd_hwdep_dsp_status {
113 unsigned int version;
114 unsigned char id[32];
115 unsigned int num_dsps;
116 unsigned int dsp_loaded;
117 unsigned int chip_ready;
118 unsigned char reserved[16];
119};
120
121struct snd_hwdep_dsp_image {
122 unsigned int index;
123 unsigned char name[64];
124 unsigned char __user *image;
125 size_t length;
126 unsigned long driver_data;
127};
128
129#define SNDRV_HWDEP_IOCTL_PVERSION _IOR ('H', 0x00, int)
130#define SNDRV_HWDEP_IOCTL_INFO _IOR ('H', 0x01, struct snd_hwdep_info)
131#define SNDRV_HWDEP_IOCTL_DSP_STATUS _IOR('H', 0x02, struct snd_hwdep_dsp_status)
132#define SNDRV_HWDEP_IOCTL_DSP_LOAD _IOW('H', 0x03, struct snd_hwdep_dsp_image)
133
134
135
136
137
138
139
140#define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 11)
141
142typedef unsigned long snd_pcm_uframes_t;
143typedef signed long snd_pcm_sframes_t;
144
145enum {
146 SNDRV_PCM_CLASS_GENERIC = 0,
147 SNDRV_PCM_CLASS_MULTI,
148 SNDRV_PCM_CLASS_MODEM,
149 SNDRV_PCM_CLASS_DIGITIZER,
150
151 SNDRV_PCM_CLASS_LAST = SNDRV_PCM_CLASS_DIGITIZER,
152};
153
154enum {
155 SNDRV_PCM_SUBCLASS_GENERIC_MIX = 0,
156 SNDRV_PCM_SUBCLASS_MULTI_MIX,
157
158 SNDRV_PCM_SUBCLASS_LAST = SNDRV_PCM_SUBCLASS_MULTI_MIX,
159};
160
161enum {
162 SNDRV_PCM_STREAM_PLAYBACK = 0,
163 SNDRV_PCM_STREAM_CAPTURE,
164 SNDRV_PCM_STREAM_LAST = SNDRV_PCM_STREAM_CAPTURE,
165};
166
167typedef int __bitwise snd_pcm_access_t;
168#define SNDRV_PCM_ACCESS_MMAP_INTERLEAVED ((__force snd_pcm_access_t) 0)
169#define SNDRV_PCM_ACCESS_MMAP_NONINTERLEAVED ((__force snd_pcm_access_t) 1)
170#define SNDRV_PCM_ACCESS_MMAP_COMPLEX ((__force snd_pcm_access_t) 2)
171#define SNDRV_PCM_ACCESS_RW_INTERLEAVED ((__force snd_pcm_access_t) 3)
172#define SNDRV_PCM_ACCESS_RW_NONINTERLEAVED ((__force snd_pcm_access_t) 4)
173#define SNDRV_PCM_ACCESS_LAST SNDRV_PCM_ACCESS_RW_NONINTERLEAVED
174
175typedef int __bitwise snd_pcm_format_t;
176#define SNDRV_PCM_FORMAT_S8 ((__force snd_pcm_format_t) 0)
177#define SNDRV_PCM_FORMAT_U8 ((__force snd_pcm_format_t) 1)
178#define SNDRV_PCM_FORMAT_S16_LE ((__force snd_pcm_format_t) 2)
179#define SNDRV_PCM_FORMAT_S16_BE ((__force snd_pcm_format_t) 3)
180#define SNDRV_PCM_FORMAT_U16_LE ((__force snd_pcm_format_t) 4)
181#define SNDRV_PCM_FORMAT_U16_BE ((__force snd_pcm_format_t) 5)
182#define SNDRV_PCM_FORMAT_S24_LE ((__force snd_pcm_format_t) 6)
183#define SNDRV_PCM_FORMAT_S24_BE ((__force snd_pcm_format_t) 7)
184#define SNDRV_PCM_FORMAT_U24_LE ((__force snd_pcm_format_t) 8)
185#define SNDRV_PCM_FORMAT_U24_BE ((__force snd_pcm_format_t) 9)
186#define SNDRV_PCM_FORMAT_S32_LE ((__force snd_pcm_format_t) 10)
187#define SNDRV_PCM_FORMAT_S32_BE ((__force snd_pcm_format_t) 11)
188#define SNDRV_PCM_FORMAT_U32_LE ((__force snd_pcm_format_t) 12)
189#define SNDRV_PCM_FORMAT_U32_BE ((__force snd_pcm_format_t) 13)
190#define SNDRV_PCM_FORMAT_FLOAT_LE ((__force snd_pcm_format_t) 14)
191#define SNDRV_PCM_FORMAT_FLOAT_BE ((__force snd_pcm_format_t) 15)
192#define SNDRV_PCM_FORMAT_FLOAT64_LE ((__force snd_pcm_format_t) 16)
193#define SNDRV_PCM_FORMAT_FLOAT64_BE ((__force snd_pcm_format_t) 17)
194#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE ((__force snd_pcm_format_t) 18)
195#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE ((__force snd_pcm_format_t) 19)
196#define SNDRV_PCM_FORMAT_MU_LAW ((__force snd_pcm_format_t) 20)
197#define SNDRV_PCM_FORMAT_A_LAW ((__force snd_pcm_format_t) 21)
198#define SNDRV_PCM_FORMAT_IMA_ADPCM ((__force snd_pcm_format_t) 22)
199#define SNDRV_PCM_FORMAT_MPEG ((__force snd_pcm_format_t) 23)
200#define SNDRV_PCM_FORMAT_GSM ((__force snd_pcm_format_t) 24)
201#define SNDRV_PCM_FORMAT_SPECIAL ((__force snd_pcm_format_t) 31)
202#define SNDRV_PCM_FORMAT_S24_3LE ((__force snd_pcm_format_t) 32)
203#define SNDRV_PCM_FORMAT_S24_3BE ((__force snd_pcm_format_t) 33)
204#define SNDRV_PCM_FORMAT_U24_3LE ((__force snd_pcm_format_t) 34)
205#define SNDRV_PCM_FORMAT_U24_3BE ((__force snd_pcm_format_t) 35)
206#define SNDRV_PCM_FORMAT_S20_3LE ((__force snd_pcm_format_t) 36)
207#define SNDRV_PCM_FORMAT_S20_3BE ((__force snd_pcm_format_t) 37)
208#define SNDRV_PCM_FORMAT_U20_3LE ((__force snd_pcm_format_t) 38)
209#define SNDRV_PCM_FORMAT_U20_3BE ((__force snd_pcm_format_t) 39)
210#define SNDRV_PCM_FORMAT_S18_3LE ((__force snd_pcm_format_t) 40)
211#define SNDRV_PCM_FORMAT_S18_3BE ((__force snd_pcm_format_t) 41)
212#define SNDRV_PCM_FORMAT_U18_3LE ((__force snd_pcm_format_t) 42)
213#define SNDRV_PCM_FORMAT_U18_3BE ((__force snd_pcm_format_t) 43)
214#define SNDRV_PCM_FORMAT_G723_24 ((__force snd_pcm_format_t) 44)
215#define SNDRV_PCM_FORMAT_G723_24_1B ((__force snd_pcm_format_t) 45)
216#define SNDRV_PCM_FORMAT_G723_40 ((__force snd_pcm_format_t) 46)
217#define SNDRV_PCM_FORMAT_G723_40_1B ((__force snd_pcm_format_t) 47)
218#define SNDRV_PCM_FORMAT_DSD_U8 ((__force snd_pcm_format_t) 48)
219#define SNDRV_PCM_FORMAT_DSD_U16_LE ((__force snd_pcm_format_t) 49)
220#define SNDRV_PCM_FORMAT_LAST SNDRV_PCM_FORMAT_DSD_U16_LE
221
222#ifdef SNDRV_LITTLE_ENDIAN
223#define SNDRV_PCM_FORMAT_S16 SNDRV_PCM_FORMAT_S16_LE
224#define SNDRV_PCM_FORMAT_U16 SNDRV_PCM_FORMAT_U16_LE
225#define SNDRV_PCM_FORMAT_S24 SNDRV_PCM_FORMAT_S24_LE
226#define SNDRV_PCM_FORMAT_U24 SNDRV_PCM_FORMAT_U24_LE
227#define SNDRV_PCM_FORMAT_S32 SNDRV_PCM_FORMAT_S32_LE
228#define SNDRV_PCM_FORMAT_U32 SNDRV_PCM_FORMAT_U32_LE
229#define SNDRV_PCM_FORMAT_FLOAT SNDRV_PCM_FORMAT_FLOAT_LE
230#define SNDRV_PCM_FORMAT_FLOAT64 SNDRV_PCM_FORMAT_FLOAT64_LE
231#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE
232#endif
233#ifdef SNDRV_BIG_ENDIAN
234#define SNDRV_PCM_FORMAT_S16 SNDRV_PCM_FORMAT_S16_BE
235#define SNDRV_PCM_FORMAT_U16 SNDRV_PCM_FORMAT_U16_BE
236#define SNDRV_PCM_FORMAT_S24 SNDRV_PCM_FORMAT_S24_BE
237#define SNDRV_PCM_FORMAT_U24 SNDRV_PCM_FORMAT_U24_BE
238#define SNDRV_PCM_FORMAT_S32 SNDRV_PCM_FORMAT_S32_BE
239#define SNDRV_PCM_FORMAT_U32 SNDRV_PCM_FORMAT_U32_BE
240#define SNDRV_PCM_FORMAT_FLOAT SNDRV_PCM_FORMAT_FLOAT_BE
241#define SNDRV_PCM_FORMAT_FLOAT64 SNDRV_PCM_FORMAT_FLOAT64_BE
242#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE
243#endif
244
245typedef int __bitwise snd_pcm_subformat_t;
246#define SNDRV_PCM_SUBFORMAT_STD ((__force snd_pcm_subformat_t) 0)
247#define SNDRV_PCM_SUBFORMAT_LAST SNDRV_PCM_SUBFORMAT_STD
248
249#define SNDRV_PCM_INFO_MMAP 0x00000001
250#define SNDRV_PCM_INFO_MMAP_VALID 0x00000002
251#define SNDRV_PCM_INFO_DOUBLE 0x00000004
252#define SNDRV_PCM_INFO_BATCH 0x00000010
253#define SNDRV_PCM_INFO_INTERLEAVED 0x00000100
254#define SNDRV_PCM_INFO_NONINTERLEAVED 0x00000200
255#define SNDRV_PCM_INFO_COMPLEX 0x00000400
256#define SNDRV_PCM_INFO_BLOCK_TRANSFER 0x00010000
257#define SNDRV_PCM_INFO_OVERRANGE 0x00020000
258#define SNDRV_PCM_INFO_RESUME 0x00040000
259#define SNDRV_PCM_INFO_PAUSE 0x00080000
260#define SNDRV_PCM_INFO_HALF_DUPLEX 0x00100000
261#define SNDRV_PCM_INFO_JOINT_DUPLEX 0x00200000
262#define SNDRV_PCM_INFO_SYNC_START 0x00400000
263#define SNDRV_PCM_INFO_NO_PERIOD_WAKEUP 0x00800000
264#define SNDRV_PCM_INFO_HAS_WALL_CLOCK 0x01000000
265#define SNDRV_PCM_INFO_FIFO_IN_FRAMES 0x80000000
266
267typedef int __bitwise snd_pcm_state_t;
268#define SNDRV_PCM_STATE_OPEN ((__force snd_pcm_state_t) 0)
269#define SNDRV_PCM_STATE_SETUP ((__force snd_pcm_state_t) 1)
270#define SNDRV_PCM_STATE_PREPARED ((__force snd_pcm_state_t) 2)
271#define SNDRV_PCM_STATE_RUNNING ((__force snd_pcm_state_t) 3)
272#define SNDRV_PCM_STATE_XRUN ((__force snd_pcm_state_t) 4)
273#define SNDRV_PCM_STATE_DRAINING ((__force snd_pcm_state_t) 5)
274#define SNDRV_PCM_STATE_PAUSED ((__force snd_pcm_state_t) 6)
275#define SNDRV_PCM_STATE_SUSPENDED ((__force snd_pcm_state_t) 7)
276#define SNDRV_PCM_STATE_DISCONNECTED ((__force snd_pcm_state_t) 8)
277#define SNDRV_PCM_STATE_LAST SNDRV_PCM_STATE_DISCONNECTED
278
279enum {
280 SNDRV_PCM_MMAP_OFFSET_DATA = 0x00000000,
281 SNDRV_PCM_MMAP_OFFSET_STATUS = 0x80000000,
282 SNDRV_PCM_MMAP_OFFSET_CONTROL = 0x81000000,
283};
284
285union snd_pcm_sync_id {
286 unsigned char id[16];
287 unsigned short id16[8];
288 unsigned int id32[4];
289};
290
291struct snd_pcm_info {
292 unsigned int device;
293 unsigned int subdevice;
294 int stream;
295 int card;
296 unsigned char id[64];
297 unsigned char name[80];
298 unsigned char subname[32];
299 int dev_class;
300 int dev_subclass;
301 unsigned int subdevices_count;
302 unsigned int subdevices_avail;
303 union snd_pcm_sync_id sync;
304 unsigned char reserved[64];
305};
306
307typedef int snd_pcm_hw_param_t;
308#define SNDRV_PCM_HW_PARAM_ACCESS 0
309#define SNDRV_PCM_HW_PARAM_FORMAT 1
310#define SNDRV_PCM_HW_PARAM_SUBFORMAT 2
311#define SNDRV_PCM_HW_PARAM_FIRST_MASK SNDRV_PCM_HW_PARAM_ACCESS
312#define SNDRV_PCM_HW_PARAM_LAST_MASK SNDRV_PCM_HW_PARAM_SUBFORMAT
313
314#define SNDRV_PCM_HW_PARAM_SAMPLE_BITS 8
315#define SNDRV_PCM_HW_PARAM_FRAME_BITS 9
316#define SNDRV_PCM_HW_PARAM_CHANNELS 10
317#define SNDRV_PCM_HW_PARAM_RATE 11
318#define SNDRV_PCM_HW_PARAM_PERIOD_TIME 12
319
320
321#define SNDRV_PCM_HW_PARAM_PERIOD_SIZE 13
322
323
324#define SNDRV_PCM_HW_PARAM_PERIOD_BYTES 14
325
326
327#define SNDRV_PCM_HW_PARAM_PERIODS 15
328
329
330#define SNDRV_PCM_HW_PARAM_BUFFER_TIME 16
331
332
333#define SNDRV_PCM_HW_PARAM_BUFFER_SIZE 17
334#define SNDRV_PCM_HW_PARAM_BUFFER_BYTES 18
335#define SNDRV_PCM_HW_PARAM_TICK_TIME 19
336#define SNDRV_PCM_HW_PARAM_FIRST_INTERVAL SNDRV_PCM_HW_PARAM_SAMPLE_BITS
337#define SNDRV_PCM_HW_PARAM_LAST_INTERVAL SNDRV_PCM_HW_PARAM_TICK_TIME
338
339#define SNDRV_PCM_HW_PARAMS_NORESAMPLE (1<<0)
340#define SNDRV_PCM_HW_PARAMS_EXPORT_BUFFER (1<<1)
341#define SNDRV_PCM_HW_PARAMS_NO_PERIOD_WAKEUP (1<<2)
342
343struct snd_interval {
344 unsigned int min, max;
345 unsigned int openmin:1,
346 openmax:1,
347 integer:1,
348 empty:1;
349};
350
351#define SNDRV_MASK_MAX 256
352
353struct snd_mask {
354 __u32 bits[(SNDRV_MASK_MAX+31)/32];
355};
356
357struct snd_pcm_hw_params {
358 unsigned int flags;
359 struct snd_mask masks[SNDRV_PCM_HW_PARAM_LAST_MASK -
360 SNDRV_PCM_HW_PARAM_FIRST_MASK + 1];
361 struct snd_mask mres[5];
362 struct snd_interval intervals[SNDRV_PCM_HW_PARAM_LAST_INTERVAL -
363 SNDRV_PCM_HW_PARAM_FIRST_INTERVAL + 1];
364 struct snd_interval ires[9];
365 unsigned int rmask;
366 unsigned int cmask;
367 unsigned int info;
368 unsigned int msbits;
369 unsigned int rate_num;
370 unsigned int rate_den;
371 snd_pcm_uframes_t fifo_size;
372 unsigned char reserved[64];
373};
374
375enum {
376 SNDRV_PCM_TSTAMP_NONE = 0,
377 SNDRV_PCM_TSTAMP_ENABLE,
378 SNDRV_PCM_TSTAMP_LAST = SNDRV_PCM_TSTAMP_ENABLE,
379};
380
381struct snd_pcm_sw_params {
382 int tstamp_mode;
383 unsigned int period_step;
384 unsigned int sleep_min;
385 snd_pcm_uframes_t avail_min;
386 snd_pcm_uframes_t xfer_align;
387 snd_pcm_uframes_t start_threshold;
388 snd_pcm_uframes_t stop_threshold;
389 snd_pcm_uframes_t silence_threshold;
390 snd_pcm_uframes_t silence_size;
391 snd_pcm_uframes_t boundary;
392 unsigned char reserved[64];
393};
394
395struct snd_pcm_channel_info {
396 unsigned int channel;
397 __kernel_off_t offset;
398 unsigned int first;
399 unsigned int step;
400};
401
402struct snd_pcm_status {
403 snd_pcm_state_t state;
404 struct timespec trigger_tstamp;
405 struct timespec tstamp;
406 snd_pcm_uframes_t appl_ptr;
407 snd_pcm_uframes_t hw_ptr;
408 snd_pcm_sframes_t delay;
409 snd_pcm_uframes_t avail;
410 snd_pcm_uframes_t avail_max;
411 snd_pcm_uframes_t overrange;
412 snd_pcm_state_t suspended_state;
413 __u32 reserved_alignment;
414 struct timespec audio_tstamp;
415 unsigned char reserved[56-sizeof(struct timespec)];
416};
417
418struct snd_pcm_mmap_status {
419 snd_pcm_state_t state;
420 int pad1;
421 snd_pcm_uframes_t hw_ptr;
422 struct timespec tstamp;
423 snd_pcm_state_t suspended_state;
424 struct timespec audio_tstamp;
425};
426
427struct snd_pcm_mmap_control {
428 snd_pcm_uframes_t appl_ptr;
429 snd_pcm_uframes_t avail_min;
430};
431
432#define SNDRV_PCM_SYNC_PTR_HWSYNC (1<<0)
433#define SNDRV_PCM_SYNC_PTR_APPL (1<<1)
434#define SNDRV_PCM_SYNC_PTR_AVAIL_MIN (1<<2)
435
436struct snd_pcm_sync_ptr {
437 unsigned int flags;
438 union {
439 struct snd_pcm_mmap_status status;
440 unsigned char reserved[64];
441 } s;
442 union {
443 struct snd_pcm_mmap_control control;
444 unsigned char reserved[64];
445 } c;
446};
447
448struct snd_xferi {
449 snd_pcm_sframes_t result;
450 void __user *buf;
451 snd_pcm_uframes_t frames;
452};
453
454struct snd_xfern {
455 snd_pcm_sframes_t result;
456 void __user * __user *bufs;
457 snd_pcm_uframes_t frames;
458};
459
460enum {
461 SNDRV_PCM_TSTAMP_TYPE_GETTIMEOFDAY = 0,
462 SNDRV_PCM_TSTAMP_TYPE_MONOTONIC,
463 SNDRV_PCM_TSTAMP_TYPE_LAST = SNDRV_PCM_TSTAMP_TYPE_MONOTONIC,
464};
465
466
467enum {
468 SNDRV_CHMAP_UNKNOWN = 0,
469 SNDRV_CHMAP_NA,
470 SNDRV_CHMAP_MONO,
471
472 SNDRV_CHMAP_FL,
473 SNDRV_CHMAP_FR,
474 SNDRV_CHMAP_RL,
475 SNDRV_CHMAP_RR,
476 SNDRV_CHMAP_FC,
477 SNDRV_CHMAP_LFE,
478 SNDRV_CHMAP_SL,
479 SNDRV_CHMAP_SR,
480 SNDRV_CHMAP_RC,
481
482 SNDRV_CHMAP_FLC,
483 SNDRV_CHMAP_FRC,
484 SNDRV_CHMAP_RLC,
485 SNDRV_CHMAP_RRC,
486 SNDRV_CHMAP_FLW,
487 SNDRV_CHMAP_FRW,
488 SNDRV_CHMAP_FLH,
489 SNDRV_CHMAP_FCH,
490 SNDRV_CHMAP_FRH,
491 SNDRV_CHMAP_TC,
492 SNDRV_CHMAP_TFL,
493 SNDRV_CHMAP_TFR,
494 SNDRV_CHMAP_TFC,
495 SNDRV_CHMAP_TRL,
496 SNDRV_CHMAP_TRR,
497 SNDRV_CHMAP_TRC,
498
499 SNDRV_CHMAP_TFLC,
500 SNDRV_CHMAP_TFRC,
501 SNDRV_CHMAP_TSL,
502 SNDRV_CHMAP_TSR,
503 SNDRV_CHMAP_LLFE,
504 SNDRV_CHMAP_RLFE,
505 SNDRV_CHMAP_BC,
506 SNDRV_CHMAP_BLC,
507 SNDRV_CHMAP_BRC,
508 SNDRV_CHMAP_LAST = SNDRV_CHMAP_BRC,
509};
510
511#define SNDRV_CHMAP_POSITION_MASK 0xffff
512#define SNDRV_CHMAP_PHASE_INVERSE (0x01 << 16)
513#define SNDRV_CHMAP_DRIVER_SPEC (0x02 << 16)
514
515#define SNDRV_PCM_IOCTL_PVERSION _IOR('A', 0x00, int)
516#define SNDRV_PCM_IOCTL_INFO _IOR('A', 0x01, struct snd_pcm_info)
517#define SNDRV_PCM_IOCTL_TSTAMP _IOW('A', 0x02, int)
518#define SNDRV_PCM_IOCTL_TTSTAMP _IOW('A', 0x03, int)
519#define SNDRV_PCM_IOCTL_HW_REFINE _IOWR('A', 0x10, struct snd_pcm_hw_params)
520#define SNDRV_PCM_IOCTL_HW_PARAMS _IOWR('A', 0x11, struct snd_pcm_hw_params)
521#define SNDRV_PCM_IOCTL_HW_FREE _IO('A', 0x12)
522#define SNDRV_PCM_IOCTL_SW_PARAMS _IOWR('A', 0x13, struct snd_pcm_sw_params)
523#define SNDRV_PCM_IOCTL_STATUS _IOR('A', 0x20, struct snd_pcm_status)
524#define SNDRV_PCM_IOCTL_DELAY _IOR('A', 0x21, snd_pcm_sframes_t)
525#define SNDRV_PCM_IOCTL_HWSYNC _IO('A', 0x22)
526#define SNDRV_PCM_IOCTL_SYNC_PTR _IOWR('A', 0x23, struct snd_pcm_sync_ptr)
527#define SNDRV_PCM_IOCTL_CHANNEL_INFO _IOR('A', 0x32, struct snd_pcm_channel_info)
528#define SNDRV_PCM_IOCTL_PREPARE _IO('A', 0x40)
529#define SNDRV_PCM_IOCTL_RESET _IO('A', 0x41)
530#define SNDRV_PCM_IOCTL_START _IO('A', 0x42)
531#define SNDRV_PCM_IOCTL_DROP _IO('A', 0x43)
532#define SNDRV_PCM_IOCTL_DRAIN _IO('A', 0x44)
533#define SNDRV_PCM_IOCTL_PAUSE _IOW('A', 0x45, int)
534#define SNDRV_PCM_IOCTL_REWIND _IOW('A', 0x46, snd_pcm_uframes_t)
535#define SNDRV_PCM_IOCTL_RESUME _IO('A', 0x47)
536#define SNDRV_PCM_IOCTL_XRUN _IO('A', 0x48)
537#define SNDRV_PCM_IOCTL_FORWARD _IOW('A', 0x49, snd_pcm_uframes_t)
538#define SNDRV_PCM_IOCTL_WRITEI_FRAMES _IOW('A', 0x50, struct snd_xferi)
539#define SNDRV_PCM_IOCTL_READI_FRAMES _IOR('A', 0x51, struct snd_xferi)
540#define SNDRV_PCM_IOCTL_WRITEN_FRAMES _IOW('A', 0x52, struct snd_xfern)
541#define SNDRV_PCM_IOCTL_READN_FRAMES _IOR('A', 0x53, struct snd_xfern)
542#define SNDRV_PCM_IOCTL_LINK _IOW('A', 0x60, int)
543#define SNDRV_PCM_IOCTL_UNLINK _IO('A', 0x61)
544
545
546
547
548
549
550
551
552
553
554
555#define SNDRV_RAWMIDI_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 0)
556
557enum {
558 SNDRV_RAWMIDI_STREAM_OUTPUT = 0,
559 SNDRV_RAWMIDI_STREAM_INPUT,
560 SNDRV_RAWMIDI_STREAM_LAST = SNDRV_RAWMIDI_STREAM_INPUT,
561};
562
563#define SNDRV_RAWMIDI_INFO_OUTPUT 0x00000001
564#define SNDRV_RAWMIDI_INFO_INPUT 0x00000002
565#define SNDRV_RAWMIDI_INFO_DUPLEX 0x00000004
566
567struct snd_rawmidi_info {
568 unsigned int device;
569 unsigned int subdevice;
570 int stream;
571 int card;
572 unsigned int flags;
573 unsigned char id[64];
574 unsigned char name[80];
575 unsigned char subname[32];
576 unsigned int subdevices_count;
577 unsigned int subdevices_avail;
578 unsigned char reserved[64];
579};
580
581struct snd_rawmidi_params {
582 int stream;
583 size_t buffer_size;
584 size_t avail_min;
585 unsigned int no_active_sensing: 1;
586 unsigned char reserved[16];
587};
588
589struct snd_rawmidi_status {
590 int stream;
591 struct timespec tstamp;
592 size_t avail;
593 size_t xruns;
594 unsigned char reserved[16];
595};
596
597#define SNDRV_RAWMIDI_IOCTL_PVERSION _IOR('W', 0x00, int)
598#define SNDRV_RAWMIDI_IOCTL_INFO _IOR('W', 0x01, struct snd_rawmidi_info)
599#define SNDRV_RAWMIDI_IOCTL_PARAMS _IOWR('W', 0x10, struct snd_rawmidi_params)
600#define SNDRV_RAWMIDI_IOCTL_STATUS _IOWR('W', 0x20, struct snd_rawmidi_status)
601#define SNDRV_RAWMIDI_IOCTL_DROP _IOW('W', 0x30, int)
602#define SNDRV_RAWMIDI_IOCTL_DRAIN _IOW('W', 0x31, int)
603
604
605
606
607
608#define SNDRV_TIMER_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 6)
609
610enum {
611 SNDRV_TIMER_CLASS_NONE = -1,
612 SNDRV_TIMER_CLASS_SLAVE = 0,
613 SNDRV_TIMER_CLASS_GLOBAL,
614 SNDRV_TIMER_CLASS_CARD,
615 SNDRV_TIMER_CLASS_PCM,
616 SNDRV_TIMER_CLASS_LAST = SNDRV_TIMER_CLASS_PCM,
617};
618
619
620enum {
621 SNDRV_TIMER_SCLASS_NONE = 0,
622 SNDRV_TIMER_SCLASS_APPLICATION,
623 SNDRV_TIMER_SCLASS_SEQUENCER,
624 SNDRV_TIMER_SCLASS_OSS_SEQUENCER,
625 SNDRV_TIMER_SCLASS_LAST = SNDRV_TIMER_SCLASS_OSS_SEQUENCER,
626};
627
628
629#define SNDRV_TIMER_GLOBAL_SYSTEM 0
630#define SNDRV_TIMER_GLOBAL_RTC 1
631#define SNDRV_TIMER_GLOBAL_HPET 2
632#define SNDRV_TIMER_GLOBAL_HRTIMER 3
633
634
635#define SNDRV_TIMER_FLG_SLAVE (1<<0)
636
637struct snd_timer_id {
638 int dev_class;
639 int dev_sclass;
640 int card;
641 int device;
642 int subdevice;
643};
644
645struct snd_timer_ginfo {
646 struct snd_timer_id tid;
647 unsigned int flags;
648 int card;
649 unsigned char id[64];
650 unsigned char name[80];
651 unsigned long reserved0;
652 unsigned long resolution;
653 unsigned long resolution_min;
654 unsigned long resolution_max;
655 unsigned int clients;
656 unsigned char reserved[32];
657};
658
659struct snd_timer_gparams {
660 struct snd_timer_id tid;
661 unsigned long period_num;
662 unsigned long period_den;
663 unsigned char reserved[32];
664};
665
666struct snd_timer_gstatus {
667 struct snd_timer_id tid;
668 unsigned long resolution;
669 unsigned long resolution_num;
670 unsigned long resolution_den;
671 unsigned char reserved[32];
672};
673
674struct snd_timer_select {
675 struct snd_timer_id id;
676 unsigned char reserved[32];
677};
678
679struct snd_timer_info {
680 unsigned int flags;
681 int card;
682 unsigned char id[64];
683 unsigned char name[80];
684 unsigned long reserved0;
685 unsigned long resolution;
686 unsigned char reserved[64];
687};
688
689#define SNDRV_TIMER_PSFLG_AUTO (1<<0)
690#define SNDRV_TIMER_PSFLG_EXCLUSIVE (1<<1)
691#define SNDRV_TIMER_PSFLG_EARLY_EVENT (1<<2)
692
693struct snd_timer_params {
694 unsigned int flags;
695 unsigned int ticks;
696 unsigned int queue_size;
697 unsigned int reserved0;
698 unsigned int filter;
699 unsigned char reserved[60];
700};
701
702struct snd_timer_status {
703 struct timespec tstamp;
704 unsigned int resolution;
705 unsigned int lost;
706 unsigned int overrun;
707 unsigned int queue;
708 unsigned char reserved[64];
709};
710
711#define SNDRV_TIMER_IOCTL_PVERSION _IOR('T', 0x00, int)
712#define SNDRV_TIMER_IOCTL_NEXT_DEVICE _IOWR('T', 0x01, struct snd_timer_id)
713#define SNDRV_TIMER_IOCTL_TREAD _IOW('T', 0x02, int)
714#define SNDRV_TIMER_IOCTL_GINFO _IOWR('T', 0x03, struct snd_timer_ginfo)
715#define SNDRV_TIMER_IOCTL_GPARAMS _IOW('T', 0x04, struct snd_timer_gparams)
716#define SNDRV_TIMER_IOCTL_GSTATUS _IOWR('T', 0x05, struct snd_timer_gstatus)
717#define SNDRV_TIMER_IOCTL_SELECT _IOW('T', 0x10, struct snd_timer_select)
718#define SNDRV_TIMER_IOCTL_INFO _IOR('T', 0x11, struct snd_timer_info)
719#define SNDRV_TIMER_IOCTL_PARAMS _IOW('T', 0x12, struct snd_timer_params)
720#define SNDRV_TIMER_IOCTL_STATUS _IOR('T', 0x14, struct snd_timer_status)
721
722#define SNDRV_TIMER_IOCTL_START _IO('T', 0xa0)
723#define SNDRV_TIMER_IOCTL_STOP _IO('T', 0xa1)
724#define SNDRV_TIMER_IOCTL_CONTINUE _IO('T', 0xa2)
725#define SNDRV_TIMER_IOCTL_PAUSE _IO('T', 0xa3)
726
727struct snd_timer_read {
728 unsigned int resolution;
729 unsigned int ticks;
730};
731
732enum {
733 SNDRV_TIMER_EVENT_RESOLUTION = 0,
734 SNDRV_TIMER_EVENT_TICK,
735 SNDRV_TIMER_EVENT_START,
736 SNDRV_TIMER_EVENT_STOP,
737 SNDRV_TIMER_EVENT_CONTINUE,
738 SNDRV_TIMER_EVENT_PAUSE,
739 SNDRV_TIMER_EVENT_EARLY,
740 SNDRV_TIMER_EVENT_SUSPEND,
741 SNDRV_TIMER_EVENT_RESUME,
742
743 SNDRV_TIMER_EVENT_MSTART = SNDRV_TIMER_EVENT_START + 10,
744 SNDRV_TIMER_EVENT_MSTOP = SNDRV_TIMER_EVENT_STOP + 10,
745 SNDRV_TIMER_EVENT_MCONTINUE = SNDRV_TIMER_EVENT_CONTINUE + 10,
746 SNDRV_TIMER_EVENT_MPAUSE = SNDRV_TIMER_EVENT_PAUSE + 10,
747 SNDRV_TIMER_EVENT_MSUSPEND = SNDRV_TIMER_EVENT_SUSPEND + 10,
748 SNDRV_TIMER_EVENT_MRESUME = SNDRV_TIMER_EVENT_RESUME + 10,
749};
750
751struct snd_timer_tread {
752 int event;
753 struct timespec tstamp;
754 unsigned int val;
755};
756
757
758
759
760
761
762
763#define SNDRV_CTL_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 7)
764
765struct snd_ctl_card_info {
766 int card;
767 int pad;
768 unsigned char id[16];
769 unsigned char driver[16];
770 unsigned char name[32];
771 unsigned char longname[80];
772 unsigned char reserved_[16];
773 unsigned char mixername[80];
774 unsigned char components[128];
775};
776
777typedef int __bitwise snd_ctl_elem_type_t;
778#define SNDRV_CTL_ELEM_TYPE_NONE ((__force snd_ctl_elem_type_t) 0)
779#define SNDRV_CTL_ELEM_TYPE_BOOLEAN ((__force snd_ctl_elem_type_t) 1)
780#define SNDRV_CTL_ELEM_TYPE_INTEGER ((__force snd_ctl_elem_type_t) 2)
781#define SNDRV_CTL_ELEM_TYPE_ENUMERATED ((__force snd_ctl_elem_type_t) 3)
782#define SNDRV_CTL_ELEM_TYPE_BYTES ((__force snd_ctl_elem_type_t) 4)
783#define SNDRV_CTL_ELEM_TYPE_IEC958 ((__force snd_ctl_elem_type_t) 5)
784#define SNDRV_CTL_ELEM_TYPE_INTEGER64 ((__force snd_ctl_elem_type_t) 6)
785#define SNDRV_CTL_ELEM_TYPE_LAST SNDRV_CTL_ELEM_TYPE_INTEGER64
786
787typedef int __bitwise snd_ctl_elem_iface_t;
788#define SNDRV_CTL_ELEM_IFACE_CARD ((__force snd_ctl_elem_iface_t) 0)
789#define SNDRV_CTL_ELEM_IFACE_HWDEP ((__force snd_ctl_elem_iface_t) 1)
790#define SNDRV_CTL_ELEM_IFACE_MIXER ((__force snd_ctl_elem_iface_t) 2)
791#define SNDRV_CTL_ELEM_IFACE_PCM ((__force snd_ctl_elem_iface_t) 3)
792#define SNDRV_CTL_ELEM_IFACE_RAWMIDI ((__force snd_ctl_elem_iface_t) 4)
793#define SNDRV_CTL_ELEM_IFACE_TIMER ((__force snd_ctl_elem_iface_t) 5)
794#define SNDRV_CTL_ELEM_IFACE_SEQUENCER ((__force snd_ctl_elem_iface_t) 6)
795#define SNDRV_CTL_ELEM_IFACE_LAST SNDRV_CTL_ELEM_IFACE_SEQUENCER
796
797#define SNDRV_CTL_ELEM_ACCESS_READ (1<<0)
798#define SNDRV_CTL_ELEM_ACCESS_WRITE (1<<1)
799#define SNDRV_CTL_ELEM_ACCESS_READWRITE (SNDRV_CTL_ELEM_ACCESS_READ|SNDRV_CTL_ELEM_ACCESS_WRITE)
800#define SNDRV_CTL_ELEM_ACCESS_VOLATILE (1<<2)
801#define SNDRV_CTL_ELEM_ACCESS_TIMESTAMP (1<<3)
802#define SNDRV_CTL_ELEM_ACCESS_TLV_READ (1<<4)
803#define SNDRV_CTL_ELEM_ACCESS_TLV_WRITE (1<<5)
804#define SNDRV_CTL_ELEM_ACCESS_TLV_READWRITE (SNDRV_CTL_ELEM_ACCESS_TLV_READ|SNDRV_CTL_ELEM_ACCESS_TLV_WRITE)
805#define SNDRV_CTL_ELEM_ACCESS_TLV_COMMAND (1<<6)
806#define SNDRV_CTL_ELEM_ACCESS_INACTIVE (1<<8)
807#define SNDRV_CTL_ELEM_ACCESS_LOCK (1<<9)
808#define SNDRV_CTL_ELEM_ACCESS_OWNER (1<<10)
809#define SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK (1<<28)
810#define SNDRV_CTL_ELEM_ACCESS_USER (1<<29)
811
812
813
814#define SNDRV_CTL_POWER_D0 0x0000
815#define SNDRV_CTL_POWER_D1 0x0100
816#define SNDRV_CTL_POWER_D2 0x0200
817#define SNDRV_CTL_POWER_D3 0x0300
818#define SNDRV_CTL_POWER_D3hot (SNDRV_CTL_POWER_D3|0x0000)
819#define SNDRV_CTL_POWER_D3cold (SNDRV_CTL_POWER_D3|0x0001)
820
821#define SNDRV_CTL_ELEM_ID_NAME_MAXLEN 44
822
823struct snd_ctl_elem_id {
824 unsigned int numid;
825 snd_ctl_elem_iface_t iface;
826 unsigned int device;
827 unsigned int subdevice;
828 unsigned char name[44];
829 unsigned int index;
830};
831
832struct snd_ctl_elem_list {
833 unsigned int offset;
834 unsigned int space;
835 unsigned int used;
836 unsigned int count;
837 struct snd_ctl_elem_id __user *pids;
838 unsigned char reserved[50];
839};
840
841struct snd_ctl_elem_info {
842 struct snd_ctl_elem_id id;
843 snd_ctl_elem_type_t type;
844 unsigned int access;
845 unsigned int count;
846 __kernel_pid_t owner;
847 union {
848 struct {
849 long min;
850 long max;
851 long step;
852 } integer;
853 struct {
854 long long min;
855 long long max;
856 long long step;
857 } integer64;
858 struct {
859 unsigned int items;
860 unsigned int item;
861 char name[64];
862 __u64 names_ptr;
863 unsigned int names_length;
864 } enumerated;
865 unsigned char reserved[128];
866 } value;
867 union {
868 unsigned short d[4];
869 unsigned short *d_ptr;
870 } dimen;
871 unsigned char reserved[64-4*sizeof(unsigned short)];
872};
873
874struct snd_ctl_elem_value {
875 struct snd_ctl_elem_id id;
876 unsigned int indirect: 1;
877 union {
878 union {
879 long value[128];
880 long *value_ptr;
881 } integer;
882 union {
883 long long value[64];
884 long long *value_ptr;
885 } integer64;
886 union {
887 unsigned int item[128];
888 unsigned int *item_ptr;
889 } enumerated;
890 union {
891 unsigned char data[512];
892 unsigned char *data_ptr;
893 } bytes;
894 struct snd_aes_iec958 iec958;
895 } value;
896 struct timespec tstamp;
897 unsigned char reserved[128-sizeof(struct timespec)];
898};
899
900struct snd_ctl_tlv {
901 unsigned int numid;
902 unsigned int length;
903 unsigned int tlv[0];
904};
905
906#define SNDRV_CTL_IOCTL_PVERSION _IOR('U', 0x00, int)
907#define SNDRV_CTL_IOCTL_CARD_INFO _IOR('U', 0x01, struct snd_ctl_card_info)
908#define SNDRV_CTL_IOCTL_ELEM_LIST _IOWR('U', 0x10, struct snd_ctl_elem_list)
909#define SNDRV_CTL_IOCTL_ELEM_INFO _IOWR('U', 0x11, struct snd_ctl_elem_info)
910#define SNDRV_CTL_IOCTL_ELEM_READ _IOWR('U', 0x12, struct snd_ctl_elem_value)
911#define SNDRV_CTL_IOCTL_ELEM_WRITE _IOWR('U', 0x13, struct snd_ctl_elem_value)
912#define SNDRV_CTL_IOCTL_ELEM_LOCK _IOW('U', 0x14, struct snd_ctl_elem_id)
913#define SNDRV_CTL_IOCTL_ELEM_UNLOCK _IOW('U', 0x15, struct snd_ctl_elem_id)
914#define SNDRV_CTL_IOCTL_SUBSCRIBE_EVENTS _IOWR('U', 0x16, int)
915#define SNDRV_CTL_IOCTL_ELEM_ADD _IOWR('U', 0x17, struct snd_ctl_elem_info)
916#define SNDRV_CTL_IOCTL_ELEM_REPLACE _IOWR('U', 0x18, struct snd_ctl_elem_info)
917#define SNDRV_CTL_IOCTL_ELEM_REMOVE _IOWR('U', 0x19, struct snd_ctl_elem_id)
918#define SNDRV_CTL_IOCTL_TLV_READ _IOWR('U', 0x1a, struct snd_ctl_tlv)
919#define SNDRV_CTL_IOCTL_TLV_WRITE _IOWR('U', 0x1b, struct snd_ctl_tlv)
920#define SNDRV_CTL_IOCTL_TLV_COMMAND _IOWR('U', 0x1c, struct snd_ctl_tlv)
921#define SNDRV_CTL_IOCTL_HWDEP_NEXT_DEVICE _IOWR('U', 0x20, int)
922#define SNDRV_CTL_IOCTL_HWDEP_INFO _IOR('U', 0x21, struct snd_hwdep_info)
923#define SNDRV_CTL_IOCTL_PCM_NEXT_DEVICE _IOR('U', 0x30, int)
924#define SNDRV_CTL_IOCTL_PCM_INFO _IOWR('U', 0x31, struct snd_pcm_info)
925#define SNDRV_CTL_IOCTL_PCM_PREFER_SUBDEVICE _IOW('U', 0x32, int)
926#define SNDRV_CTL_IOCTL_RAWMIDI_NEXT_DEVICE _IOWR('U', 0x40, int)
927#define SNDRV_CTL_IOCTL_RAWMIDI_INFO _IOWR('U', 0x41, struct snd_rawmidi_info)
928#define SNDRV_CTL_IOCTL_RAWMIDI_PREFER_SUBDEVICE _IOW('U', 0x42, int)
929#define SNDRV_CTL_IOCTL_POWER _IOWR('U', 0xd0, int)
930#define SNDRV_CTL_IOCTL_POWER_STATE _IOR('U', 0xd1, int)
931
932
933
934
935
936enum sndrv_ctl_event_type {
937 SNDRV_CTL_EVENT_ELEM = 0,
938 SNDRV_CTL_EVENT_LAST = SNDRV_CTL_EVENT_ELEM,
939};
940
941#define SNDRV_CTL_EVENT_MASK_VALUE (1<<0)
942#define SNDRV_CTL_EVENT_MASK_INFO (1<<1)
943#define SNDRV_CTL_EVENT_MASK_ADD (1<<2)
944#define SNDRV_CTL_EVENT_MASK_TLV (1<<3)
945#define SNDRV_CTL_EVENT_MASK_REMOVE (~0U)
946
947struct snd_ctl_event {
948 int type;
949 union {
950 struct {
951 unsigned int mask;
952 struct snd_ctl_elem_id id;
953 } elem;
954 unsigned char data8[60];
955 } data;
956};
957
958
959
960
961
962#define SNDRV_CTL_NAME_NONE ""
963#define SNDRV_CTL_NAME_PLAYBACK "Playback "
964#define SNDRV_CTL_NAME_CAPTURE "Capture "
965
966#define SNDRV_CTL_NAME_IEC958_NONE ""
967#define SNDRV_CTL_NAME_IEC958_SWITCH "Switch"
968#define SNDRV_CTL_NAME_IEC958_VOLUME "Volume"
969#define SNDRV_CTL_NAME_IEC958_DEFAULT "Default"
970#define SNDRV_CTL_NAME_IEC958_MASK "Mask"
971#define SNDRV_CTL_NAME_IEC958_CON_MASK "Con Mask"
972#define SNDRV_CTL_NAME_IEC958_PRO_MASK "Pro Mask"
973#define SNDRV_CTL_NAME_IEC958_PCM_STREAM "PCM Stream"
974#define SNDRV_CTL_NAME_IEC958(expl,direction,what) "IEC958 " expl SNDRV_CTL_NAME_##direction SNDRV_CTL_NAME_IEC958_##what
975
976#endif
977