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