xref: /titanic_50/usr/src/uts/common/sys/audio/audio_oss.h (revision 0a0e9771ca0211c15f3ac4466b661c145feeb9e4)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright (C) 4Front Technologies 1996-2008.
23  *
24  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
25  * Use is subject to license terms.
26  */
27 
28 
29 #ifndef	_SYS_AUDIO_OSS_H
30 #define	_SYS_AUDIO_OSS_H
31 
32 #include <sys/types.h>
33 #include <sys/time.h>
34 
35 /*
36  * These are the ioctl calls for all Solaris /dev/dsp and /dev/mixer audio
37  * devices.
38  *
39  * Note that the contents of this file include definitions which exist
40  * primarily for compatibility.  Many of the defines here are not
41  * actually implemented, but exist solely to facilitate compilation of
42  * programs from other operating systems.  Other definitions here may
43  * not be fully supported or may otherwise be obsolete. There are many
44  * things in this file which should not be used on SunOS.
45  *
46  * Please read the documentation to determine which portions of the
47  * API are fully supported and recommended for use in new
48  * applications.
49  */
50 
51 #ifdef __cplusplus
52 extern "C" {
53 #endif
54 
55 /*
56  * Buffer status queries.
57  * SNDCTL_DSP_GETOSPACE and SNDCTL_DSP_GETISPACE
58  */
59 typedef struct audio_buf_info {
60 	int fragments;		/* # of available fragments */
61 	int fragstotal;		/* Total # of fragments allocated */
62 	int fragsize;		/* Size of a fragment in bytes */
63 	int bytes;		/* Available space in bytes */
64 	/* Note! 'bytes' could be more than fragments*fragsize */
65 } audio_buf_info;
66 
67 /*
68  * Sync groups for audio devices.
69  * SNDCTL_DSP_SYNCGROUP and SNDCTL_DSP_SYNCSTART
70  */
71 typedef struct oss_syncgroup {
72 	int id;
73 	int mode;
74 	int filler[16];
75 } oss_syncgroup;
76 
77 /*
78  * SNDCTL_DSP_GETERROR
79  */
80 typedef struct audio_errinfo {
81 	int play_underruns;
82 	int rec_overruns;
83 	unsigned int play_ptradjust;
84 	unsigned int rec_ptradjust;
85 	int play_errorcount;
86 	int rec_errorcount;
87 	int play_lasterror;
88 	int rec_lasterror;
89 	int play_errorparm;
90 	int rec_errorparm;
91 	int filler[16];
92 } audio_errinfo;
93 
94 /*
95  * SNDCTL_DSP_GETIPTR and SNDCTL_DSP_GETOPTR
96  */
97 typedef struct count_info {
98 	unsigned int bytes;	/* Total # of bytes processed */
99 	int blocks;		/* # of fragment transitions since last time */
100 	int ptr;		/* Current DMA pointer value */
101 } count_info;
102 
103 /*
104  * SNDCTL_DSP_CURENT_IPTR and SNDCTL_DSP_CURRENT_OPTR
105  */
106 typedef struct {
107 	long long samples;	/* Total # of samples */
108 	int fifo_samples;	/* Samples in device FIFO */
109 	int filler[32];		/* For future use */
110 } oss_count_t;
111 
112 /*
113  * SNDCTL_DSP_GET_RECSRC_NAMES and SNDCTL_DSP_GET_PLAYTGT_NAMES
114  */
115 #define	OSS_ENUM_MAXVALUE	255
116 typedef struct oss_mixer_enuminfo {
117 	int dev;
118 	int ctrl;
119 	int nvalues;
120 	int version;
121 	short strindex[OSS_ENUM_MAXVALUE];
122 	char strings[3000];
123 } oss_mixer_enuminfo;
124 
125 /*
126  * Digital interface (S/PDIF) control interface
127  * SNDCTL_DSP_READCTL and SNDCTL_DSP_WRITECTL
128  */
129 typedef struct oss_digital_control {
130 	unsigned int caps;
131 #define	DIG_CBITIN_NONE		0x00000000
132 #define	DIG_CBITIN_LIMITED	0x00000001
133 #define	DIG_CBITIN_DATA		0x00000002
134 #define	DIG_CBITIN_BYTE0	0x00000004
135 #define	DIG_CBITIN_FULL		0x00000008
136 #define	DIG_CBITIN_MASK		0x0000000f
137 #define	DIG_CBITOUT_NONE	0x00000000
138 #define	DIG_CBITOUT_LIMITED	0x00000010
139 #define	DIG_CBITOUT_BYTE0	0x00000020
140 #define	DIG_CBITOUT_FULL	0x00000040
141 #define	DIG_CBITOUT_DATA	0x00000080
142 #define	DIG_CBITOUT_MASK	0x000000f0
143 #define	DIG_UBITIN		0x00000100
144 #define	DIG_UBITOUT		0x00000200
145 #define	DIG_VBITOUT		0x00000400
146 #define	DIG_OUTRATE		0x00000800
147 #define	DIG_INRATE		0x00001000
148 #define	DIG_INBITS		0x00002000
149 #define	DIG_OUTBITS		0x00004000
150 #define	DIG_EXACT		0x00010000
151 #define	DIG_PRO			0x00020000
152 #define	DIG_CONSUMER		0x00040000
153 #define	DIG_PASSTHROUGH		0x00080000
154 #define	DIG_OUTSEL		0x00100000
155 
156 	unsigned int valid;
157 #define	VAL_CBITIN		0x00000001
158 #define	VAL_UBITIN		0x00000002
159 #define	VAL_CBITOUT		0x00000004
160 #define	VAL_UBITOUT		0x00000008
161 #define	VAL_ISTATUS		0x00000010
162 #define	VAL_IRATE		0x00000020
163 #define	VAL_ORATE		0x00000040
164 #define	VAL_INBITS		0x00000080
165 #define	VAL_OUTBITS		0x00000100
166 #define	VAL_REQUEST		0x00000200
167 #define	VAL_OUTSEL		0x00000400
168 
169 #define	VAL_OUTMASK (VAL_CBITOUT|VAL_UBITOUT|VAL_ORATE|VAL_OUTBITS|VAL_OUTSEL)
170 
171 	unsigned int request;
172 	unsigned int param;
173 #define	SPD_RQ_PASSTHROUGH	1
174 
175 	unsigned char cbitin[24];
176 	unsigned char ubitin[24];
177 	unsigned char cbitout[24];
178 	unsigned char ubitout[24];
179 
180 	unsigned int outsel;
181 #define	OUTSEL_DIGITAL		1
182 #define	OUTSEL_ANALOG		2
183 #define	OUTSEL_BOTH		(OUTSEL_DIGITAL|OUTSEL_ANALOG)
184 
185 	int in_data;		/* Audio/data if autodetectable by receiver */
186 #define	IND_UNKNOWN		0
187 #define	IND_AUDIO		1
188 #define	IND_DATA		2
189 
190 	int in_locked;		/* Receiver locked */
191 #define	LOCK_NOT_INDICATED	0
192 #define	LOCK_UNLOCKED		1
193 #define	LOCK_LOCKED		2
194 
195 	int in_quality;		/* Input signal quality */
196 #define	IN_QUAL_NOT_INDICATED	0
197 #define	IN_QUAL_POOR		1
198 #define	IN_QUAL_GOOD		2
199 
200 	int in_vbit;
201 	int out_vbit;		/* V bits */
202 #define	VBIT_NOT_INDICATED	0
203 #define	VBIT_OFF		1
204 #define	VBIT_ON			2
205 
206 	unsigned int in_errors;	/* Various input error conditions */
207 #define	INERR_CRC		0x0001
208 #define	INERR_QCODE_CRC		0x0002
209 #define	INERR_PARITY		0x0004
210 #define	INERR_BIPHASE		0x0008
211 
212 	int srate_in;
213 	int srate_out;
214 	int bits_in;
215 	int bits_out;
216 
217 	int filler[32];
218 } oss_digital_control;
219 
220 /*
221  * The "new" mixer API.
222  *
223  * This improved mixer API makes it possible to access every possible feature
224  * of every possible device. However you should read the mixer programming
225  * section of the OSS API Developer's Manual. There is no chance that you
226  * could use this interface correctly just by examining this header.
227  */
228 #define	OSS_VERSION		0x040003
229 #define	SOUND_VERSION		OSS_VERSION
230 
231 typedef struct oss_sysinfo {
232 	char product[32];	/* E.g. SunOS Audio */
233 	char version[32];	/* E.g. 4.0a */
234 	int versionnum;		/* See OSS_GETVERSION */
235 	char options[128];	/* NOT SUPPORTED */
236 
237 	int numaudios;		/* # of audio/dsp devices */
238 	int openedaudio[8];	/* Mask of audio devices are busy */
239 
240 	int numsynths;		/* NOT SUPPORTED, always 0 */
241 	int nummidis;		/* NOT SUPPORTED, always 0 */
242 	int numtimers;		/* NOT SUPPORTED, always 0 */
243 	int nummixers;		/* # of mixer devices */
244 
245 	int openedmidi[8];	/* Mask of midi devices are busy */
246 	int numcards;		/* Number of sound cards in the system */
247 	int numaudioengines;	/* Number of audio engines in the system */
248 	char license[16];	/* E.g. "GPL" or "CDDL" */
249 	char revision_info[256];	/* For internal use */
250 	int filler[172];	/* For future expansion */
251 } oss_sysinfo;
252 
253 typedef struct oss_mixext {
254 	int dev;		/* Mixer device number */
255 	int ctrl;		/* Extension number */
256 	int type;		/* Entry type */
257 #define	MIXT_DEVROOT		0	/* Device root entry */
258 #define	MIXT_GROUP		1	/* Controller group */
259 #define	MIXT_ONOFF		2	/* OFF (0) or ON (1) */
260 #define	MIXT_ENUM		3	/* Enumerated (0 to maxvalue) */
261 #define	MIXT_MONOSLIDER		4	/* Mono slider (0 to 255) */
262 #define	MIXT_STEREOSLIDER	5	/* Stereo slider (dual 0 to 255) */
263 #define	MIXT_MESSAGE		6	/* (Readable) textual message */
264 #define	MIXT_MONOVU		7	/* VU meter value (mono) */
265 #define	MIXT_STEREOVU		8	/* VU meter value (stereo) */
266 #define	MIXT_MONOPEAK		9	/* VU meter peak value (mono) */
267 #define	MIXT_STEREOPEAK		10	/* VU meter peak value (stereo) */
268 #define	MIXT_RADIOGROUP		11	/* Radio button group */
269 #define	MIXT_MARKER		12	/* Separator between entries */
270 #define	MIXT_VALUE		13	/* Decimal value entry */
271 #define	MIXT_HEXVALUE		14	/* Hexadecimal value entry */
272 #define	MIXT_MONODB		15	/* OBSOLETE */
273 #define	MIXT_STEREODB		16	/* OBSOLETE */
274 #define	MIXT_SLIDER		17	/* Slider (mono, 31 bit int range) */
275 #define	MIXT_3D			18
276 #define	MIXT_MONOSLIDER16	19	/* Mono slider (0-32767) */
277 #define	MIXT_STEREOSLIDER16	20	/* Stereo slider (dual 0-32767) */
278 #define	MIXT_MUTE		21	/* Mute=1, unmute=0 */
279 
280 	/* Possible value range (minvalue to maxvalue) */
281 	/* Note that maxvalue may also be smaller than minvalue */
282 	int maxvalue;
283 	int minvalue;
284 
285 	int flags;
286 #define	MIXF_READABLE	0x00000001	/* Has readable value */
287 #define	MIXF_WRITEABLE	0x00000002	/* Has writeable value */
288 #define	MIXF_POLL	0x00000004	/* May change itself */
289 #define	MIXF_HZ		0x00000008	/* Hertz scale */
290 #define	MIXF_STRING	0x00000010	/* Use dynamic extensions for value */
291 #define	MIXF_DYNAMIC	0x00000010	/* Supports dynamic extensions */
292 #define	MIXF_OKFAIL	0x00000020	/* Interpret value as 1=OK, 0=FAIL */
293 #define	MIXF_FLAT	0x00000040	/* NOT SUPPORTED */
294 #define	MIXF_LEGACY	0x00000080	/* NOT SUPPORTED */
295 #define	MIXF_CENTIBEL	0x00000100	/* Centibel (0.1 dB) step size */
296 #define	MIXF_DECIBEL	0x00000200	/* Step size of 1 dB */
297 #define	MIXF_MAINVOL	0x00000400	/* Main volume control */
298 #define	MIXF_PCMVOL	0x00000800	/* PCM output volume control */
299 #define	MIXF_RECVOL	0x00001000	/* PCM recording volume control */
300 #define	MIXF_MONVOL	0x00002000	/* Input->output monitor volume */
301 #define	MIXF_WIDE	0x00004000	/* NOT SUPPORTED */
302 #define	MIXF_DESCR	0x00008000	/* NOT SUPPORTED */
303 #define	MIXF_DISABLE	0x00010000	/* Control has been disabled */
304 
305 	char id[16];			/* Mnemonic ID (internal use) */
306 	int parent;			/* Entry# of parent (-1 if root) */
307 
308 	int dummy;			/* NOT SUPPORTED */
309 
310 	int timestamp;
311 
312 	char data[64];			/* Misc data (entry type dependent) */
313 	unsigned char enum_present[32];	/* Mask of allowed enum values */
314 	int control_no;			/* NOT SUPPORTED, always -1 */
315 
316 	unsigned int desc;		/* Scope flags, etc */
317 #define	MIXEXT_SCOPE_MASK		0x0000003f
318 #define	MIXEXT_SCOPE_OTHER		0x00000000
319 #define	MIXEXT_SCOPE_INPUT		0x00000001
320 #define	MIXEXT_SCOPE_OUTPUT		0x00000002
321 #define	MIXEXT_SCOPE_MONITOR		0x00000003
322 #define	MIXEXT_SCOPE_RECSWITCH		0x00000004
323 
324 	char extname[32];
325 	int update_counter;
326 #ifdef	_KERNEL
327 	int filler[6];
328 	int enumbit;
329 #else
330 	int filler[7];
331 #endif
332 } oss_mixext;
333 
334 typedef struct oss_mixext_root {
335 	char id[16];
336 	char name[48];
337 } oss_mixext_root;
338 
339 typedef struct oss_mixer_value {
340 	int dev;
341 	int ctrl;
342 	int value;
343 	int flags;		/* Reserved for future use. Initialize to 0 */
344 	int timestamp;		/* Must be set to oss_mixext.timestamp */
345 	int filler[8];		/* Reserved for future use. Initialize to 0 */
346 } oss_mixer_value;
347 
348 #define	OSS_LONGNAME_SIZE	64
349 #define	OSS_LABEL_SIZE		16
350 #define	OSS_DEVNODE_SIZE	32
351 typedef	char	oss_longname_t[OSS_LONGNAME_SIZE];
352 typedef	char	oss_label_t[OSS_LABEL_SIZE];
353 typedef	char	oss_devnode_t[OSS_DEVNODE_SIZE];
354 
355 
356 typedef struct oss_audioinfo {
357 	int dev;		/* Audio device number */
358 	char name[64];
359 	int busy;		/* 0, OPEN_READ, OPEN_WRITE, OPEN_READWRITE */
360 	int pid;		/* Process ID, not used in SunOS */
361 	int caps;		/* PCM_CAP_INPUT, PCM_CAP_OUTPUT */
362 	int iformats;		/* Supported input formats */
363 	int oformats;		/* Supported output formats */
364 	int magic;		/* Internal use only */
365 	char cmd[64];		/* Command using the device (if known) */
366 	int card_number;
367 	int port_number;
368 	int mixer_dev;
369 	int legacy_device;	/* Obsolete field. Replaced by devnode */
370 	int enabled;		/* 1=enabled, 0=device not ready */
371 	int flags;		/* internal use only - no practical meaning */
372 	int min_rate;		/* Minimum sample rate */
373 	int max_rate;		/* Maximum sample rate */
374 	int min_channels;	/* Minimum number of channels */
375 	int max_channels;	/* Maximum number of channels */
376 	int binding;		/* DSP_BIND_FRONT, etc. 0 means undefined */
377 	int rate_source;
378 	char handle[32];
379 #define	OSS_MAX_SAMPLE_RATES	20	/* Cannot be changed  */
380 	unsigned int nrates;	/* Array of supported sample rates */
381 	unsigned int rates[OSS_MAX_SAMPLE_RATES];
382 	oss_longname_t song_name;	/* Song name (if given) */
383 	oss_label_t label;	/* Device label (if given) */
384 	int latency;		/* In usecs, -1=unknown */
385 	oss_devnode_t devnode;	/* Device special file name (absolute path) */
386 	int next_play_engine;
387 	int next_rec_engine;
388 	int filler[184];
389 } oss_audioinfo;
390 
391 typedef struct oss_mixerinfo {
392 	int dev;
393 	char id[16];
394 	char name[32];
395 	int modify_counter;
396 	int card_number;
397 	int port_number;
398 	char handle[32];
399 	int magic;		/* Reserved */
400 	int enabled;		/* Reserved */
401 	int caps;
402 #define	MIXER_CAP_VIRTUAL	0x00000001
403 #define	MIXER_CAP_LAYOUT_B	0x00000002	/* For internal use only */
404 #define	MIXER_CAP_NARROW	0x00000004	/* Conserve horiz space */
405 	int flags;		/* Reserved */
406 	int nrext;
407 	/*
408 	 * The priority field can be used to select the default
409 	 * (motherboard) mixer device. The mixer with the highest
410 	 * priority is the most preferred one. -2 or less means that
411 	 * this device cannot be used as the default mixer.
412 	 */
413 	int priority;
414 	oss_devnode_t devnode;  /* Device special file name (absolute path) */
415 	int legacy_device;
416 	int filler[245];	/* Reserved */
417 } oss_mixerinfo;
418 
419 typedef struct oss_card_info {
420 	int card;
421 	char shortname[16];
422 	char longname[128];
423 	int flags;
424 	char hw_info[400];
425 	int intr_count;
426 	int ack_count;
427 	int filler[154];
428 } oss_card_info;
429 
430 typedef struct mixer_info {	/* OBSOLETE */
431 	char id[16];
432 	char name[32];
433 	int modify_counter;
434 	int card_number;
435 	int port_number;
436 	char handle[32];
437 } mixer_info;
438 
439 #define	MAX_PEAK_CHANNELS	128
440 typedef unsigned short oss_peaks_t[MAX_PEAK_CHANNELS];
441 
442 /* For use with SNDCTL_DSP_GET_CHNORDER */
443 #define	CHID_UNDEF		0
444 #define	CHID_L			1
445 #define	CHID_R			2
446 #define	CHID_C			3
447 #define	CHID_LFE		4
448 #define	CHID_LS			5
449 #define	CHID_RS			6
450 #define	CHID_LR			7
451 #define	CHID_RR			8
452 #define	CHNORDER_UNDEF		0x0000000000000000ULL
453 #define	CHNORDER_NORMAL		0x0000000087654321ULL
454 
455 
456 #define	OSSIOCPARM_MASK	0x1fff		/* parameters must be < 8192 bytes */
457 #define	OSSIOC_VOID	0x00000000	/* no parameters */
458 #define	OSSIOC_OUT	0x20000000	/* copy out parameters */
459 #define	OSSIOC_IN	0x40000000	/* copy in parameters */
460 #define	OSSIOC_INOUT	(OSSIOC_IN|OSSIOC_OUT)
461 #define	OSSIOC_SZ(t)	((sizeof (t) & OSSIOCPARM_MASK) << 16)
462 #define	OSSIOC_GETSZ(x)	(((x) >> 16) & OSSIOCPARM_MASK)
463 
464 #define	__OSSIO(x, y)		((int)(OSSIOC_VOID|(x<<8)|y))
465 #define	__OSSIOR(x, y, t)	((int)(OSSIOC_OUT|OSSIOC_SZ(t)|(x<<8)|y))
466 #define	__OSSIOW(x, y, t)	((int)(OSSIOC_IN|OSSIOC_SZ(t)|(x<<8)|y))
467 #define	__OSSIOWR(x, y, t)	((int)(OSSIOC_INOUT|OSSIOC_SZ(t)|(x<<8)|y))
468 
469 #define	SNDCTL_SYSINFO		__OSSIOR('X', 1, oss_sysinfo)
470 #define	OSS_SYSINFO		SNDCTL_SYSINFO  /* Old name */
471 
472 #define	SNDCTL_MIX_NRMIX	__OSSIOR('X', 2, int)
473 #define	SNDCTL_MIX_NREXT	__OSSIOWR('X', 3, int)
474 #define	SNDCTL_MIX_EXTINFO	__OSSIOWR('X', 4, oss_mixext)
475 #define	SNDCTL_MIX_READ		__OSSIOWR('X', 5, oss_mixer_value)
476 #define	SNDCTL_MIX_WRITE	__OSSIOWR('X', 6, oss_mixer_value)
477 
478 #define	SNDCTL_AUDIOINFO	__OSSIOWR('X', 7, oss_audioinfo)
479 #define	SNDCTL_MIX_ENUMINFO	__OSSIOWR('X', 8, oss_mixer_enuminfo)
480 #define	SNDCTL_MIDIINFO		__OSSIO('X', 9)
481 #define	SNDCTL_MIXERINFO	__OSSIOWR('X', 10, oss_mixerinfo)
482 #define	SNDCTL_CARDINFO		__OSSIOWR('X', 11, oss_card_info)
483 #define	SNDCTL_ENGINEINFO	__OSSIOWR('X', 12, oss_audioinfo)
484 #define	SNDCTL_AUDIOINFO_EX	__OSSIOWR('X', 13, oss_audioinfo)
485 #define	SNDCTL_MIX_DESCRIPTION	__OSSIOWR('X', 14, oss_mixer_enuminfo)
486 
487 /* ioctl codes 'X', 200-255 are reserved for internal use */
488 
489 /*
490  * Few more "globally" available ioctl calls.
491  */
492 #define	SNDCTL_SETSONG		__OSSIOW('Y', 2, oss_longname_t)
493 #define	SNDCTL_GETSONG		__OSSIOR('Y', 2, oss_longname_t)
494 #define	SNDCTL_SETNAME		__OSSIOW('Y', 3, oss_longname_t)
495 #define	SNDCTL_SETLABEL		__OSSIOW('Y', 4, oss_label_t)
496 #define	SNDCTL_GETLABEL		__OSSIOR('Y', 4, oss_label_t)
497 
498 /*
499  * IOCTL commands for /dev/dsp
500  */
501 #define	SNDCTL_DSP_HALT		__OSSIO('P', 0)
502 #define	SNDCTL_DSP_RESET	SNDCTL_DSP_HALT /* Old name */
503 #define	SNDCTL_DSP_SYNC		__OSSIO('P', 1)
504 #define	SNDCTL_DSP_SPEED	__OSSIOWR('P', 2, int)
505 
506 #define	SNDCTL_DSP_STEREO	__OSSIOWR('P', 3, int)	/* OBSOLETE */
507 
508 #define	SNDCTL_DSP_GETBLKSIZE	__OSSIOWR('P', 4, int)
509 #define	SNDCTL_DSP_SAMPLESIZE	SNDCTL_DSP_SETFMT
510 #define	SNDCTL_DSP_CHANNELS	__OSSIOWR('P', 6, int)
511 #define	SNDCTL_DSP_POST		__OSSIO('P', 8)
512 #define	SNDCTL_DSP_SUBDIVIDE	__OSSIOWR('P', 9, int)
513 #define	SNDCTL_DSP_SETFRAGMENT	__OSSIOWR('P', 10, int)
514 
515 #define	SNDCTL_DSP_GETFMTS	__OSSIOR('P', 11, int)	/* Returns a mask */
516 #define	SNDCTL_DSP_SETFMT	__OSSIOWR('P', 5, int)	/* Selects ONE fmt */
517 
518 #define	SNDCTL_DSP_GETOSPACE	__OSSIOR('P', 12, audio_buf_info)
519 #define	SNDCTL_DSP_GETISPACE	__OSSIOR('P', 13, audio_buf_info)
520 #define	SNDCTL_DSP_NONBLOCK	__OSSIO('P', 14)	/* Obsolete */
521 #define	SNDCTL_DSP_GETCAPS	__OSSIOR('P', 15, int)
522 
523 #define	SNDCTL_DSP_GETTRIGGER	__OSSIOR('P', 16, int)
524 #define	SNDCTL_DSP_SETTRIGGER	__OSSIOW('P', 16, int)
525 
526 #define	SNDCTL_DSP_GETIPTR	__OSSIOR('P', 17, count_info)
527 #define	SNDCTL_DSP_GETOPTR	__OSSIOR('P', 18, count_info)
528 
529 #define	SNDCTL_DSP_SETSYNCRO	__OSSIO('P', 21)
530 #define	SNDCTL_DSP_SETDUPLEX	__OSSIO('P', 22)
531 
532 #define	SNDCTL_DSP_PROFILE	__OSSIOW('P', 23, int)   /* OBSOLETE */
533 #define	APF_NORMAL	0	/* Normal applications */
534 #define	APF_NETWORK	1	/* Underruns caused by "external" delay */
535 #define	APF_CPUINTENS	2	/* Underruns caused by "overheating" the CPU */
536 
537 
538 #define	SNDCTL_DSP_GETODELAY	__OSSIOR('P', 23, int)
539 
540 #define	SNDCTL_DSP_GETPLAYVOL	__OSSIOR('P', 24, int)
541 #define	SNDCTL_DSP_SETPLAYVOL	__OSSIOWR('P', 24, int)
542 #define	SNDCTL_DSP_GETERROR	__OSSIOR('P', 25, audio_errinfo)
543 
544 #define	SNDCTL_DSP_READCTL	__OSSIOWR('P', 26, oss_digital_control)
545 #define	SNDCTL_DSP_WRITECTL	__OSSIOWR('P', 27, oss_digital_control)
546 
547 #define	SNDCTL_DSP_SYNCGROUP	__OSSIOWR('P', 28, oss_syncgroup)
548 #define	SNDCTL_DSP_SYNCSTART	__OSSIOW('P', 29, int)
549 
550 #define	SNDCTL_DSP_COOKEDMODE	__OSSIOW('P', 30, int)
551 
552 #define	SNDCTL_DSP_SILENCE	__OSSIO('P', 31)
553 #define	SNDCTL_DSP_SKIP		__OSSIO('P', 32)
554 
555 #define	SNDCTL_DSP_HALT_INPUT	__OSSIO('P', 33)
556 #define	SNDCTL_DSP_RESET_INPUT	SNDCTL_DSP_HALT_INPUT   /* Old name */
557 #define	SNDCTL_DSP_HALT_OUTPUT	__OSSIO('P', 34)
558 #define	SNDCTL_DSP_RESET_OUTPUT	SNDCTL_DSP_HALT_OUTPUT  /* Old name */
559 
560 #define	SNDCTL_DSP_LOW_WATER	__OSSIOW('P', 34, int)
561 
562 #define	SNDCTL_DSP_CURRENT_IPTR	__OSSIOR('P', 35, oss_count_t)
563 #define	SNDCTL_DSP_CURRENT_OPTR	__OSSIOR('P', 36, oss_count_t)
564 
565 #define	SNDCTL_DSP_GET_RECSRC_NAMES	__OSSIOR('P', 37, oss_mixer_enuminfo)
566 #define	SNDCTL_DSP_GET_RECSRC	__OSSIOR('P', 38, int)
567 #define	SNDCTL_DSP_SET_RECSRC	__OSSIOWR('P', 38, int)
568 
569 #define	SNDCTL_DSP_GET_PLAYTGT_NAMES	__OSSIOR('P', 39, oss_mixer_enuminfo)
570 #define	SNDCTL_DSP_GET_PLAYTGT	__OSSIOR('P', 40, int)
571 #define	SNDCTL_DSP_SET_PLAYTGT	__OSSIOWR('P', 40, int)
572 #define	SNDCTL_DSP_GETRECVOL	__OSSIOR('P', 41, int)
573 #define	SNDCTL_DSP_SETRECVOL	__OSSIOWR('P', 41, int)
574 
575 #define	SNDCTL_DSP_GET_CHNORDER	__OSSIOR('P', 42, unsigned long long)
576 #define	SNDCTL_DSP_SET_CHNORDER	__OSSIOWR('P', 42, unsigned long long)
577 
578 #define	SNDCTL_DSP_GETIPEAKS	__OSSIOR('P', 43, oss_peaks_t)
579 #define	SNDCTL_DSP_GETOPEAKS	__OSSIOR('P', 44, oss_peaks_t)
580 
581 #define	SNDCTL_DSP_POLICY	__OSSIOW('P', 45, int)    /* See the manual */
582 
583 #define	SNDCTL_DSP_GETCHANNELMASK	__OSSIOWR('P', 64, int)
584 #define	SNDCTL_DSP_BIND_CHANNEL	__OSSIOWR('P', 65, int)
585 
586 /*
587  * These definitions are here for the benefit of compiling application
588  * code.  Most of these are NOT implemented in the Solaris code,
589  * however.  This is the older 3.x OSS API, and only the master input and
590  * output levels are actually supported.
591  */
592 #define	SOUND_MIXER_NRDEVICES	28
593 #define	SOUND_MIXER_VOLUME	0
594 #define	SOUND_MIXER_BASS	1
595 #define	SOUND_MIXER_TREBLE	2
596 #define	SOUND_MIXER_SYNTH	3
597 #define	SOUND_MIXER_PCM		4
598 #define	SOUND_MIXER_SPEAKER	5
599 #define	SOUND_MIXER_LINE	6
600 #define	SOUND_MIXER_MIC		7
601 #define	SOUND_MIXER_CD		8
602 #define	SOUND_MIXER_IMIX	9	/*  Recording monitor  */
603 #define	SOUND_MIXER_ALTPCM	10
604 #define	SOUND_MIXER_RECLEV	11	/* Recording level */
605 #define	SOUND_MIXER_IGAIN	12	/* Input gain */
606 #define	SOUND_MIXER_OGAIN	13	/* Output gain */
607 #define	SOUND_MIXER_LINE1	14	/* Input source 1  (aux1) */
608 #define	SOUND_MIXER_LINE2	15	/* Input source 2  (aux2) */
609 #define	SOUND_MIXER_LINE3	16	/* Input source 3  (line) */
610 #define	SOUND_MIXER_DIGITAL1	17	/* Digital I/O 1 */
611 #define	SOUND_MIXER_DIGITAL2	18	/* Digital I/O 2 */
612 #define	SOUND_MIXER_DIGITAL3	19	/* Digital I/O 3 */
613 #define	SOUND_MIXER_PHONE	20	/* Phone */
614 #define	SOUND_MIXER_MONO	21	/* Mono Output */
615 #define	SOUND_MIXER_VIDEO	22	/* Video/TV (audio) in */
616 #define	SOUND_MIXER_RADIO	23	/* Radio in */
617 #define	SOUND_MIXER_DEPTH	24	/* Surround depth */
618 #define	SOUND_MIXER_REARVOL	25	/* Rear/Surround speaker vol */
619 #define	SOUND_MIXER_CENTERVOL	26	/* Center/LFE speaker vol */
620 #define	SOUND_MIXER_SIDEVOL	27	/* Side-Surround (8speaker) vol */
621 #define	SOUND_MIXER_SURRVOL	SOUND_MIXER_SIDEVOL
622 #define	SOUND_ONOFF_MIN		28
623 #define	SOUND_ONOFF_MAX		30
624 #define	SOUND_MIXER_NONE	31
625 
626 #define	SOUND_MIXER_RECSRC	0xff	/* Recording sources */
627 #define	SOUND_MIXER_DEVMASK	0xfe	/* Supported devices */
628 #define	SOUND_MIXER_RECMASK	0xfd	/* Recording sources */
629 #define	SOUND_MIXER_CAPS	0xfc	/* Mixer capabilities (do not use) */
630 #define	SOUND_MIXER_STEREODEVS	0xfb	/* Mixer channels supporting stereo */
631 #define	SOUND_MIXER_OUTSRC	0xfa
632 #define	SOUND_MIXER_OUTMASK	0xf9
633 
634 #define	SOUND_MIXER_ENHANCE	SOUND_MIXER_NONE
635 #define	SOUND_MIXER_MUTE	SOUND_MIXER_NONE
636 #define	SOUND_MIXER_LOUD	SOUND_MIXER_NONE
637 
638 #define	SOUND_MASK_VOLUME	(1 << SOUND_MIXER_VOLUME)
639 #define	SOUND_MASK_BASS		(1 << SOUND_MIXER_BASS)
640 #define	SOUND_MASK_TREBLE	(1 << SOUND_MIXER_TREBLE)
641 #define	SOUND_MASK_SYNTH	(1 << SOUND_MIXER_SYNTH)
642 #define	SOUND_MASK_PCM		(1 << SOUND_MIXER_PCM)
643 #define	SOUND_MASK_SPEAKER	(1 << SOUND_MIXER_SPEAKER)
644 #define	SOUND_MASK_LINE		(1 << SOUND_MIXER_LINE)
645 #define	SOUND_MASK_MIC		(1 << SOUND_MIXER_MIC)
646 #define	SOUND_MASK_CD		(1 << SOUND_MIXER_CD)
647 #define	SOUND_MASK_IMIX		(1 << SOUND_MIXER_IMIX)
648 #define	SOUND_MASK_ALTPCM	(1 << SOUND_MIXER_ALTPCM)
649 #define	SOUND_MASK_RECLEV	(1 << SOUND_MIXER_RECLEV)
650 #define	SOUND_MASK_IGAIN	(1 << SOUND_MIXER_IGAIN)
651 #define	SOUND_MASK_OGAIN	(1 << SOUND_MIXER_OGAIN)
652 #define	SOUND_MASK_LINE1	(1 << SOUND_MIXER_LINE1)
653 #define	SOUND_MASK_LINE2	(1 << SOUND_MIXER_LINE2)
654 #define	SOUND_MASK_LINE3	(1 << SOUND_MIXER_LINE3)
655 #define	SOUND_MASK_DIGITAL1	(1 << SOUND_MIXER_DIGITAL1)
656 #define	SOUND_MASK_DIGITAL2	(1 << SOUND_MIXER_DIGITAL2)
657 #define	SOUND_MASK_DIGITAL3	(1 << SOUND_MIXER_DIGITAL3)
658 #define	SOUND_MASK_MONO		(1 << SOUND_MIXER_MONO)
659 #define	SOUND_MASK_PHONE	(1 << SOUND_MIXER_PHONE)
660 #define	SOUND_MASK_RADIO	(1 << SOUND_MIXER_RADIO)
661 #define	SOUND_MASK_VIDEO	(1 << SOUND_MIXER_VIDEO)
662 #define	SOUND_MASK_DEPTH	(1 << SOUND_MIXER_DEPTH)
663 #define	SOUND_MASK_REARVOL	(1 << SOUND_MIXER_REARVOL)
664 #define	SOUND_MASK_CENTERVOL	(1 << SOUND_MIXER_CENTERVOL)
665 #define	SOUND_MASK_SIDEVOL	(1 << SOUND_MIXER_SIDEVOL)
666 #define	SOUND_MASK_SURRVOL	SOUND_MASK_SIDEVOL
667 #define	SOUND_MASK_MUTE		(1 << SOUND_MIXER_MUTE)
668 #define	SOUND_MASK_ENHANCE	(1 << SOUND_MIXER_ENHANCE)
669 #define	SOUND_MASK_LOUD		(1 << SOUND_MIXER_LOUD)
670 
671 /*
672  * Again, DO NOT USE the following two macros.  They are here for SOURCE
673  * COMPATIBILITY ONLY.
674  */
675 #define	SOUND_DEVICE_LABELS	{					   \
676 	"Vol  ", "Bass ", "Treble", "Synth", "Pcm  ", "Speaker ", "Line ", \
677 	"Mic  ", "CD   ", "Mix  ", "Pcm2 ", "Rec  ", "IGain", "OGain",     \
678 	"Aux1", "Aux2", "Aux3", "Digital1", "Digital2", "Digital3",	   \
679 	"Phone", "Mono", "Video", "Radio", "Depth",		           \
680 	"Rear", "Center", "Side" }
681 
682 #define	SOUND_DEVICE_NAMES { 						\
683 	"vol", "bass", "treble", "synth", "pcm", "speaker", "line",	\
684 	"mic", "cd", "mix", "pcm2", "rec", "igain", "ogain",		\
685 	"aux1", "aux2", "aux3", "dig1", "dig2", "dig3",			\
686 	"phone", "mono", "video", "radio", "depth",			\
687 	"rear", "center", "side" }
688 
689 #define	MIXER_READ(dev)			__OSSIOR('M', dev, int)
690 #define	MIXER_WRITE(dev)		__OSSIOWR('M', dev, int)
691 #define	SOUND_MIXER_INFO		__OSSIOR('M', 101, mixer_info)
692 #define	OSS_GETVERSION			__OSSIOR('M', 118, int)
693 
694 /*
695  * These macros are useful for some applications.  They are implemented
696  * as soft values for the application, and do not affect real hardware.
697  */
698 #define	SOUND_MIXER_READ_VOLUME		MIXER_READ(SOUND_MIXER_VOLUME)
699 #define	SOUND_MIXER_READ_OGAIN		MIXER_READ(SOUND_MIXER_OGAIN)
700 #define	SOUND_MIXER_READ_PCM		MIXER_READ(SOUND_MIXER_PCM)
701 #define	SOUND_MIXER_READ_IGAIN		MIXER_READ(SOUND_MIXER_IGAIN)
702 #define	SOUND_MIXER_READ_RECLEV		MIXER_READ(SOUND_MIXER_RECLEV)
703 #define	SOUND_MIXER_READ_RECSRC		MIXER_READ(SOUND_MIXER_RECSRC)
704 #define	SOUND_MIXER_READ_DEVMASK	MIXER_READ(SOUND_MIXER_DEVMASK)
705 #define	SOUND_MIXER_READ_RECMASK	MIXER_READ(SOUND_MIXER_RECMASK)
706 #define	SOUND_MIXER_READ_CAPS		MIXER_READ(SOUND_MIXER_CAPS)
707 #define	SOUND_MIXER_READ_STEREODEVS	MIXER_READ(SOUND_MIXER_STEREODEVS)
708 #define	SOUND_MIXER_READ_RECGAIN	__OSSIOR('M', 119, int)
709 #define	SOUND_MIXER_READ_MONGAIN	__OSSIOR('M', 120, int)
710 
711 #define	SOUND_MIXER_WRITE_VOLUME	MIXER_WRITE(SOUND_MIXER_VOLUME)
712 #define	SOUND_MIXER_WRITE_OGAIN		MIXER_WRITE(SOUND_MIXER_OGAIN)
713 #define	SOUND_MIXER_WRITE_PCM		MIXER_WRITE(SOUND_MIXER_PCM)
714 #define	SOUND_MIXER_WRITE_IGAIN		MIXER_WRITE(SOUND_MIXER_IGAIN)
715 #define	SOUND_MIXER_WRITE_RECLEV	MIXER_WRITE(SOUND_MIXER_RECLEV)
716 #define	SOUND_MIXER_WRITE_RECSRC	MIXER_WRITE(SOUND_MIXER_RECSRC)
717 #define	SOUND_MIXER_WRITE_RECGAIN	__OSSIOWR('M', 119, int)
718 #define	SOUND_MIXER_WRITE_MONGAIN	__OSSIOWR('M', 120, int)
719 
720 /*
721  * These macros are here for source compatibility.  They intentionally don't
722  * map to any real hardware.  NOT SUPPORTED!
723  */
724 #define	SOUND_MIXER_READ_BASS		MIXER_READ(SOUND_MIXER_BASS)
725 #define	SOUND_MIXER_READ_TREBLE		MIXER_READ(SOUND_MIXER_TREBLE)
726 #define	SOUND_MIXER_READ_SYNTH		MIXER_READ(SOUND_MIXER_SYNTH)
727 #define	SOUND_MIXER_READ_SPEAKER	MIXER_READ(SOUND_MIXER_SPEAKER)
728 #define	SOUND_MIXER_READ_LINE		MIXER_READ(SOUND_MIXER_LINE)
729 #define	SOUND_MIXER_READ_MIC		MIXER_READ(SOUND_MIXER_MIC)
730 #define	SOUND_MIXER_READ_CD		MIXER_READ(SOUND_MIXER_CD)
731 #define	SOUND_MIXER_READ_IMIX		MIXER_READ(SOUND_MIXER_IMIX)
732 #define	SOUND_MIXER_READ_ALTPCM		MIXER_READ(SOUND_MIXER_ALTPCM)
733 #define	SOUND_MIXER_READ_LINE1		MIXER_READ(SOUND_MIXER_LINE1)
734 #define	SOUND_MIXER_READ_LINE2		MIXER_READ(SOUND_MIXER_LINE2)
735 #define	SOUND_MIXER_READ_LINE3		MIXER_READ(SOUND_MIXER_LINE3)
736 
737 #define	SOUND_MIXER_WRITE_BASS		MIXER_WRITE(SOUND_MIXER_BASS)
738 #define	SOUND_MIXER_WRITE_TREBLE	MIXER_WRITE(SOUND_MIXER_TREBLE)
739 #define	SOUND_MIXER_WRITE_SYNTH		MIXER_WRITE(SOUND_MIXER_SYNTH)
740 #define	SOUND_MIXER_WRITE_SPEAKER	MIXER_WRITE(SOUND_MIXER_SPEAKER)
741 #define	SOUND_MIXER_WRITE_LINE		MIXER_WRITE(SOUND_MIXER_LINE)
742 #define	SOUND_MIXER_WRITE_MIC		MIXER_WRITE(SOUND_MIXER_MIC)
743 #define	SOUND_MIXER_WRITE_CD		MIXER_WRITE(SOUND_MIXER_CD)
744 #define	SOUND_MIXER_WRITE_IMIX		MIXER_WRITE(SOUND_MIXER_IMIX)
745 #define	SOUND_MIXER_WRITE_ALTPCM	MIXER_WRITE(SOUND_MIXER_ALTPCM)
746 #define	SOUND_MIXER_WRITE_LINE1		MIXER_WRITE(SOUND_MIXER_LINE1)
747 #define	SOUND_MIXER_WRITE_LINE2		MIXER_WRITE(SOUND_MIXER_LINE2)
748 #define	SOUND_MIXER_WRITE_LINE3		MIXER_WRITE(SOUND_MIXER_LINE3)
749 
750 /*
751  * Audio encoding types (Note! U8=8 and S16_LE=16 for compatibility)
752  */
753 #define	AFMT_QUERY	0x00000000	/* Return current fmt */
754 #define	AFMT_MU_LAW	0x00000001
755 #define	AFMT_A_LAW	0x00000002
756 #define	AFMT_IMA_ADPCM	0x00000004
757 #define	AFMT_U8		0x00000008
758 #define	AFMT_S16_LE	0x00000010
759 #define	AFMT_S16_BE	0x00000020
760 #define	AFMT_S8		0x00000040
761 #define	AFMT_U16_LE	0x00000080
762 #define	AFMT_U16_BE	0x00000100
763 #define	AFMT_MPEG	0x00000200	/* NOT SUPPORTED: MPEG (2) audio */
764 #define	AFMT_AC3	0x00000400	/* NOT SUPPORTED: AC3 compressed */
765 #define	AFMT_VORBIS	0x00000800	/* NOT SUPPORTED: Ogg Vorbis */
766 #define	AFMT_S32_LE	0x00001000
767 #define	AFMT_S32_BE	0x00002000
768 #define	AFMT_FLOAT	0x00004000	/* NOT SUPPORTED: IEEE double float */
769 #define	AFMT_S24_LE	0x00008000	/* LSB aligned in 32 bit word */
770 #define	AFMT_S24_BE	0x00010000	/* LSB aligned in 32 bit word */
771 #define	AFMT_SPDIF_RAW	0x00020000	/* NOT SUPPORTED: Raw S/PDIF frames */
772 #define	AFMT_S24_PACKED	0x00040000	/* 24 bit packed little endian */
773 /*
774  * Some big endian/little endian handling macros (native endian and
775  * opposite endian formats).
776  */
777 #if defined(_BIG_ENDIAN)
778 #define	AFMT_S16_NE	AFMT_S16_BE
779 #define	AFMT_U16_NE	AFMT_U16_BE
780 #define	AFMT_S32_NE	AFMT_S32_BE
781 #define	AFMT_S24_NE	AFMT_S24_BE
782 #define	AFMT_S16_OE	AFMT_S16_LE
783 #define	AFMT_S32_OE	AFMT_S32_LE
784 #define	AFMT_S24_OE	AFMT_S24_LE
785 #else
786 #define	AFMT_S16_NE	AFMT_S16_LE
787 #define	AFMT_U16_NE	AFMT_U16_LE
788 #define	AFMT_S32_NE	AFMT_S32_LE
789 #define	AFMT_S24_NE	AFMT_S24_LE
790 #define	AFMT_S16_OE	AFMT_S16_BE
791 #define	AFMT_S32_OE	AFMT_S32_BE
792 #define	AFMT_S24_OE	AFMT_S24_BE
793 #endif
794 
795 /*
796  * SNDCTL_DSP_GETCAPS bits
797  */
798 #define	PCM_CAP_REVISION	0x000000ff	/* Revision level (0 to 255) */
799 #define	PCM_CAP_DUPLEX		0x00000100	/* Full duplex rec/play */
800 #define	PCM_CAP_REALTIME	0x00000200	/* NOT SUPPORTED */
801 #define	PCM_CAP_BATCH		0x00000400	/* NOT SUPPORTED */
802 #define	PCM_CAP_COPROC		0x00000800	/* NOT SUPPORTED */
803 #define	PCM_CAP_TRIGGER		0x00001000	/* Supports SETTRIGGER */
804 #define	PCM_CAP_MMAP		0x00002000	/* Supports mmap() */
805 #define	PCM_CAP_MULTI		0x00004000	/* Supports multiple open */
806 #define	PCM_CAP_BIND		0x00008000	/* Supports channel binding */
807 #define	PCM_CAP_INPUT		0x00010000	/* Supports recording */
808 #define	PCM_CAP_OUTPUT		0x00020000	/* Supports playback */
809 #define	PCM_CAP_VIRTUAL		0x00040000	/* Virtual device */
810 #define	PCM_CAP_ANALOGOUT	0x00100000	/* NOT SUPPORTED */
811 #define	PCM_CAP_ANALOGIN	0x00200000	/* NOT SUPPORTED */
812 #define	PCM_CAP_DIGITALOUT	0x00400000	/* NOT SUPPORTED */
813 #define	PCM_CAP_DIGITALIN	0x00800000	/* NOT SUPPORTED */
814 #define	PCM_CAP_ADMASK		0x00f00000	/* NOT SUPPORTED */
815 #define	PCM_CAP_SHADOW		0x01000000	/* "Shadow" device */
816 #define	PCM_CAP_CH_MASK		0x06000000	/* See DSP_CH_MASK below */
817 #define	PCM_CAP_HIDDEN		0x08000000	/* NOT SUPPORTED */
818 #define	PCM_CAP_FREERATE	0x10000000
819 #define	PCM_CAP_MODEM		0x20000000	/* NOT SUPPORTED */
820 #define	PCM_CAP_DEFAULT		0x40000000	/* "Default" device */
821 
822 /*
823  * Preferred channel usage. These bits can be used to give
824  * recommendations to the application. Used by few drivers.  For
825  * example if ((caps & DSP_CH_MASK) == DSP_CH_MONO) means that the
826  * device works best in mono mode. However it doesn't necessarily mean
827  * that the device cannot be used in stereo. These bits should only be
828  * used by special applications such as multi track hard disk
829  * recorders to find out the initial setup. However the user should be
830  * able to override this selection.
831  *
832  * To find out which modes are actually supported the application
833  * should try to select them using SNDCTL_DSP_CHANNELS.
834  */
835 #define	DSP_CH_MASK		0x06000000	/* Mask */
836 #define	DSP_CH_ANY		0x00000000	/* No preferred mode */
837 #define	DSP_CH_MONO		0x02000000
838 #define	DSP_CH_STEREO		0x04000000
839 #define	DSP_CH_MULTI		0x06000000	/* More than two channels */
840 
841 
842 /*
843  * The PCM_CAP_* capability names used to be known as DSP_CAP_*, so
844  * it's necessary to define the older names too.
845  */
846 #define	DSP_CAP_ADMASK		PCM_CAP_ADMASK
847 #define	DSP_CAP_ANALOGIN	PCM_CAP_ANALOGIN
848 #define	DSP_CAP_ANALOGOUT	PCM_CAP_ANALOGOUT
849 #define	DSP_CAP_BATCH		PCM_CAP_BATCH
850 #define	DSP_CAP_BIND		PCM_CAP_BIND
851 #define	DSP_CAP_COPROC		PCM_CAP_COPROC
852 #define	DSP_CAP_DEFAULT		PCM_CAP_DEFAULT
853 #define	DSP_CAP_DIGITALIN	PCM_CAP_DIGITALIN
854 #define	DSP_CAP_DIGITALOUT	PCM_CAP_DIGITALOUT
855 #define	DSP_CAP_DUPLEX		PCM_CAP_DUPLEX
856 #define	DSP_CAP_FREERATE	PCM_CAP_FREERATE
857 #define	DSP_CAP_HIDDEN		PCM_CAP_HIDDEN
858 #define	DSP_CAP_INPUT		PCM_CAP_INPUT
859 #define	DSP_CAP_MMAP		PCM_CAP_MMAP
860 #define	DSP_CAP_MODEM		PCM_CAP_MODEM
861 #define	DSP_CAP_MULTI		PCM_CAP_MULTI
862 #define	DSP_CAP_OUTPUT		PCM_CAP_OUTPUT
863 #define	DSP_CAP_REALTIME	PCM_CAP_REALTIME
864 #define	DSP_CAP_REVISION	PCM_CAP_REVISION
865 #define	DSP_CAP_SHADOW		PCM_CAP_SHADOW
866 #define	DSP_CAP_TRIGGER		PCM_CAP_TRIGGER
867 #define	DSP_CAP_VIRTUAL		PCM_CAP_VIRTUAL
868 
869 /*
870  * SNDCTL_DSP_GETTRIGGER and SNDCTL_DSP_SETTRIGGER
871  */
872 #define	PCM_ENABLE_INPUT	0x00000001
873 #define	PCM_ENABLE_OUTPUT	0x00000002
874 
875 /*
876  * SNDCTL_DSP_BIND_CHANNEL
877  */
878 #define	DSP_BIND_QUERY		0x00000000
879 #define	DSP_BIND_FRONT		0x00000001
880 #define	DSP_BIND_SURR		0x00000002
881 #define	DSP_BIND_CENTER_LFE	0x00000004
882 #define	DSP_BIND_HANDSET	0x00000008
883 #define	DSP_BIND_MIC		0x00000010
884 #define	DSP_BIND_MODEM1		0x00000020
885 #define	DSP_BIND_MODEM2		0x00000040
886 #define	DSP_BIND_I2S		0x00000080
887 #define	DSP_BIND_SPDIF		0x00000100
888 #define	DSP_BIND_REAR		0x00000200
889 
890 /*
891  * SOUND_MIXER_READ_CAPS
892  */
893 #define	SOUND_CAP_EXCL_INPUT	0x00000001
894 #define	SOUND_CAP_NOLEGACY	0x00000004
895 #define	SOUND_CAP_NORECSRC	0x00000008
896 
897 /*
898  * The following ioctl is for internal use only -- it is used to
899  * coordinate /dev/sndstat numbering with file names in /dev/sound.
900  * Applications must not use it.  (This is duplicated in sys/audioio.h
901  * as well.)
902  */
903 #define	SNDCTL_SUN_SEND_NUMBER	__OSSIOW('X', 200, int)
904 
905 #ifdef __cplusplus
906 }
907 #endif
908 
909 #endif /* _SYS_AUDIO_OSS_H */
910