19484Sgarrett.damore@Sun.COM /* 29484Sgarrett.damore@Sun.COM * CDDL HEADER START 39484Sgarrett.damore@Sun.COM * 49484Sgarrett.damore@Sun.COM * The contents of this file are subject to the terms of the 59484Sgarrett.damore@Sun.COM * Common Development and Distribution License (the "License"). 69484Sgarrett.damore@Sun.COM * You may not use this file except in compliance with the License. 79484Sgarrett.damore@Sun.COM * 89484Sgarrett.damore@Sun.COM * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 99484Sgarrett.damore@Sun.COM * or http://www.opensolaris.org/os/licensing. 109484Sgarrett.damore@Sun.COM * See the License for the specific language governing permissions 119484Sgarrett.damore@Sun.COM * and limitations under the License. 129484Sgarrett.damore@Sun.COM * 139484Sgarrett.damore@Sun.COM * When distributing Covered Code, include this CDDL HEADER in each 149484Sgarrett.damore@Sun.COM * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 159484Sgarrett.damore@Sun.COM * If applicable, add the following below this CDDL HEADER, with the 169484Sgarrett.damore@Sun.COM * fields enclosed by brackets "[]" replaced with your own identifying 179484Sgarrett.damore@Sun.COM * information: Portions Copyright [yyyy] [name of copyright owner] 189484Sgarrett.damore@Sun.COM * 199484Sgarrett.damore@Sun.COM * CDDL HEADER END 209484Sgarrett.damore@Sun.COM */ 219484Sgarrett.damore@Sun.COM /* 229484Sgarrett.damore@Sun.COM * Copyright (C) 4Front Technologies 1996-2008. 239484Sgarrett.damore@Sun.COM * 249484Sgarrett.damore@Sun.COM * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 259484Sgarrett.damore@Sun.COM * Use is subject to license terms. 269484Sgarrett.damore@Sun.COM */ 279484Sgarrett.damore@Sun.COM 289484Sgarrett.damore@Sun.COM 299484Sgarrett.damore@Sun.COM #ifndef _SYS_AUDIO_OSS_H 309484Sgarrett.damore@Sun.COM #define _SYS_AUDIO_OSS_H 319484Sgarrett.damore@Sun.COM 329484Sgarrett.damore@Sun.COM #include <sys/types.h> 339484Sgarrett.damore@Sun.COM #include <sys/time.h> 349484Sgarrett.damore@Sun.COM 359484Sgarrett.damore@Sun.COM /* 369484Sgarrett.damore@Sun.COM * These are the ioctl calls for all Solaris /dev/dsp and /dev/mixer audio 379484Sgarrett.damore@Sun.COM * devices. 389484Sgarrett.damore@Sun.COM * 399484Sgarrett.damore@Sun.COM * Note that the contents of this file include definitions which exist 409484Sgarrett.damore@Sun.COM * primarily for compatibility. Many of the defines here are not 419484Sgarrett.damore@Sun.COM * actually implemented, but exist solely to facilitate compilation of 429484Sgarrett.damore@Sun.COM * programs from other operating systems. Other definitions here may 439484Sgarrett.damore@Sun.COM * not be fully supported or may otherwise be obsolete. There are many 449484Sgarrett.damore@Sun.COM * things in this file which should not be used on SunOS. 459484Sgarrett.damore@Sun.COM * 469484Sgarrett.damore@Sun.COM * Please read the documentation to determine which portions of the 479484Sgarrett.damore@Sun.COM * API are fully supported and recommended for use in new 489484Sgarrett.damore@Sun.COM * applications. 499484Sgarrett.damore@Sun.COM */ 509484Sgarrett.damore@Sun.COM 519484Sgarrett.damore@Sun.COM #ifdef __cplusplus 529484Sgarrett.damore@Sun.COM extern "C" { 539484Sgarrett.damore@Sun.COM #endif 549484Sgarrett.damore@Sun.COM 559484Sgarrett.damore@Sun.COM /* 569484Sgarrett.damore@Sun.COM * Buffer status queries. 579484Sgarrett.damore@Sun.COM * SNDCTL_DSP_GETOSPACE and SNDCTL_DSP_GETISPACE 589484Sgarrett.damore@Sun.COM */ 599484Sgarrett.damore@Sun.COM typedef struct audio_buf_info { 609484Sgarrett.damore@Sun.COM int fragments; /* # of available fragments */ 619484Sgarrett.damore@Sun.COM int fragstotal; /* Total # of fragments allocated */ 629484Sgarrett.damore@Sun.COM int fragsize; /* Size of a fragment in bytes */ 639484Sgarrett.damore@Sun.COM int bytes; /* Available space in bytes */ 649484Sgarrett.damore@Sun.COM /* Note! 'bytes' could be more than fragments*fragsize */ 659484Sgarrett.damore@Sun.COM } audio_buf_info; 669484Sgarrett.damore@Sun.COM 679484Sgarrett.damore@Sun.COM /* 689484Sgarrett.damore@Sun.COM * Sync groups for audio devices. 699484Sgarrett.damore@Sun.COM * SNDCTL_DSP_SYNCGROUP and SNDCTL_DSP_SYNCSTART 709484Sgarrett.damore@Sun.COM */ 719484Sgarrett.damore@Sun.COM typedef struct oss_syncgroup { 729484Sgarrett.damore@Sun.COM int id; 739484Sgarrett.damore@Sun.COM int mode; 749484Sgarrett.damore@Sun.COM int filler[16]; 759484Sgarrett.damore@Sun.COM } oss_syncgroup; 769484Sgarrett.damore@Sun.COM 779484Sgarrett.damore@Sun.COM /* 789484Sgarrett.damore@Sun.COM * SNDCTL_DSP_GETERROR 799484Sgarrett.damore@Sun.COM */ 809484Sgarrett.damore@Sun.COM typedef struct audio_errinfo { 819484Sgarrett.damore@Sun.COM int play_underruns; 829484Sgarrett.damore@Sun.COM int rec_overruns; 839484Sgarrett.damore@Sun.COM unsigned int play_ptradjust; 849484Sgarrett.damore@Sun.COM unsigned int rec_ptradjust; 859484Sgarrett.damore@Sun.COM int play_errorcount; 869484Sgarrett.damore@Sun.COM int rec_errorcount; 879484Sgarrett.damore@Sun.COM int play_lasterror; 889484Sgarrett.damore@Sun.COM int rec_lasterror; 899484Sgarrett.damore@Sun.COM int play_errorparm; 909484Sgarrett.damore@Sun.COM int rec_errorparm; 919484Sgarrett.damore@Sun.COM int filler[16]; 929484Sgarrett.damore@Sun.COM } audio_errinfo; 939484Sgarrett.damore@Sun.COM 949484Sgarrett.damore@Sun.COM /* 959484Sgarrett.damore@Sun.COM * SNDCTL_DSP_GETIPTR and SNDCTL_DSP_GETOPTR 969484Sgarrett.damore@Sun.COM */ 979484Sgarrett.damore@Sun.COM typedef struct count_info { 989484Sgarrett.damore@Sun.COM unsigned int bytes; /* Total # of bytes processed */ 999484Sgarrett.damore@Sun.COM int blocks; /* # of fragment transitions since last time */ 1009484Sgarrett.damore@Sun.COM int ptr; /* Current DMA pointer value */ 1019484Sgarrett.damore@Sun.COM } count_info; 1029484Sgarrett.damore@Sun.COM 1039484Sgarrett.damore@Sun.COM /* 1049484Sgarrett.damore@Sun.COM * SNDCTL_DSP_CURENT_IPTR and SNDCTL_DSP_CURRENT_OPTR 1059484Sgarrett.damore@Sun.COM */ 1069484Sgarrett.damore@Sun.COM typedef struct { 1079484Sgarrett.damore@Sun.COM long long samples; /* Total # of samples */ 1089484Sgarrett.damore@Sun.COM int fifo_samples; /* Samples in device FIFO */ 1099484Sgarrett.damore@Sun.COM int filler[32]; /* For future use */ 1109484Sgarrett.damore@Sun.COM } oss_count_t; 1119484Sgarrett.damore@Sun.COM 1129484Sgarrett.damore@Sun.COM /* 1139484Sgarrett.damore@Sun.COM * SNDCTL_DSP_GET_RECSRC_NAMES and SNDCTL_DSP_GET_PLAYTGT_NAMES 1149484Sgarrett.damore@Sun.COM */ 1159484Sgarrett.damore@Sun.COM #define OSS_ENUM_MAXVALUE 255 1169484Sgarrett.damore@Sun.COM typedef struct oss_mixer_enuminfo { 1179484Sgarrett.damore@Sun.COM int dev; 1189484Sgarrett.damore@Sun.COM int ctrl; 1199484Sgarrett.damore@Sun.COM int nvalues; 1209484Sgarrett.damore@Sun.COM int version; 1219484Sgarrett.damore@Sun.COM short strindex[OSS_ENUM_MAXVALUE]; 1229484Sgarrett.damore@Sun.COM char strings[3000]; 1239484Sgarrett.damore@Sun.COM } oss_mixer_enuminfo; 1249484Sgarrett.damore@Sun.COM 1259484Sgarrett.damore@Sun.COM /* 1269484Sgarrett.damore@Sun.COM * Digital interface (S/PDIF) control interface 1279484Sgarrett.damore@Sun.COM * SNDCTL_DSP_READCTL and SNDCTL_DSP_WRITECTL 1289484Sgarrett.damore@Sun.COM */ 1299484Sgarrett.damore@Sun.COM typedef struct oss_digital_control { 1309484Sgarrett.damore@Sun.COM unsigned int caps; 1319484Sgarrett.damore@Sun.COM #define DIG_CBITIN_NONE 0x00000000 1329484Sgarrett.damore@Sun.COM #define DIG_CBITIN_LIMITED 0x00000001 1339484Sgarrett.damore@Sun.COM #define DIG_CBITIN_DATA 0x00000002 1349484Sgarrett.damore@Sun.COM #define DIG_CBITIN_BYTE0 0x00000004 1359484Sgarrett.damore@Sun.COM #define DIG_CBITIN_FULL 0x00000008 1369484Sgarrett.damore@Sun.COM #define DIG_CBITIN_MASK 0x0000000f 1379484Sgarrett.damore@Sun.COM #define DIG_CBITOUT_NONE 0x00000000 1389484Sgarrett.damore@Sun.COM #define DIG_CBITOUT_LIMITED 0x00000010 1399484Sgarrett.damore@Sun.COM #define DIG_CBITOUT_BYTE0 0x00000020 1409484Sgarrett.damore@Sun.COM #define DIG_CBITOUT_FULL 0x00000040 1419484Sgarrett.damore@Sun.COM #define DIG_CBITOUT_DATA 0x00000080 1429484Sgarrett.damore@Sun.COM #define DIG_CBITOUT_MASK 0x000000f0 1439484Sgarrett.damore@Sun.COM #define DIG_UBITIN 0x00000100 1449484Sgarrett.damore@Sun.COM #define DIG_UBITOUT 0x00000200 1459484Sgarrett.damore@Sun.COM #define DIG_VBITOUT 0x00000400 1469484Sgarrett.damore@Sun.COM #define DIG_OUTRATE 0x00000800 1479484Sgarrett.damore@Sun.COM #define DIG_INRATE 0x00001000 1489484Sgarrett.damore@Sun.COM #define DIG_INBITS 0x00002000 1499484Sgarrett.damore@Sun.COM #define DIG_OUTBITS 0x00004000 1509484Sgarrett.damore@Sun.COM #define DIG_EXACT 0x00010000 1519484Sgarrett.damore@Sun.COM #define DIG_PRO 0x00020000 1529484Sgarrett.damore@Sun.COM #define DIG_CONSUMER 0x00040000 1539484Sgarrett.damore@Sun.COM #define DIG_PASSTHROUGH 0x00080000 1549484Sgarrett.damore@Sun.COM #define DIG_OUTSEL 0x00100000 1559484Sgarrett.damore@Sun.COM 1569484Sgarrett.damore@Sun.COM unsigned int valid; 1579484Sgarrett.damore@Sun.COM #define VAL_CBITIN 0x00000001 1589484Sgarrett.damore@Sun.COM #define VAL_UBITIN 0x00000002 1599484Sgarrett.damore@Sun.COM #define VAL_CBITOUT 0x00000004 1609484Sgarrett.damore@Sun.COM #define VAL_UBITOUT 0x00000008 1619484Sgarrett.damore@Sun.COM #define VAL_ISTATUS 0x00000010 1629484Sgarrett.damore@Sun.COM #define VAL_IRATE 0x00000020 1639484Sgarrett.damore@Sun.COM #define VAL_ORATE 0x00000040 1649484Sgarrett.damore@Sun.COM #define VAL_INBITS 0x00000080 1659484Sgarrett.damore@Sun.COM #define VAL_OUTBITS 0x00000100 1669484Sgarrett.damore@Sun.COM #define VAL_REQUEST 0x00000200 1679484Sgarrett.damore@Sun.COM #define VAL_OUTSEL 0x00000400 1689484Sgarrett.damore@Sun.COM 1699484Sgarrett.damore@Sun.COM #define VAL_OUTMASK (VAL_CBITOUT|VAL_UBITOUT|VAL_ORATE|VAL_OUTBITS|VAL_OUTSEL) 1709484Sgarrett.damore@Sun.COM 1719484Sgarrett.damore@Sun.COM unsigned int request; 1729484Sgarrett.damore@Sun.COM unsigned int param; 1739484Sgarrett.damore@Sun.COM #define SPD_RQ_PASSTHROUGH 1 1749484Sgarrett.damore@Sun.COM 1759484Sgarrett.damore@Sun.COM unsigned char cbitin[24]; 1769484Sgarrett.damore@Sun.COM unsigned char ubitin[24]; 1779484Sgarrett.damore@Sun.COM unsigned char cbitout[24]; 1789484Sgarrett.damore@Sun.COM unsigned char ubitout[24]; 1799484Sgarrett.damore@Sun.COM 1809484Sgarrett.damore@Sun.COM unsigned int outsel; 1819484Sgarrett.damore@Sun.COM #define OUTSEL_DIGITAL 1 1829484Sgarrett.damore@Sun.COM #define OUTSEL_ANALOG 2 1839484Sgarrett.damore@Sun.COM #define OUTSEL_BOTH (OUTSEL_DIGITAL|OUTSEL_ANALOG) 1849484Sgarrett.damore@Sun.COM 1859484Sgarrett.damore@Sun.COM int in_data; /* Audio/data if autodetectable by receiver */ 1869484Sgarrett.damore@Sun.COM #define IND_UNKNOWN 0 1879484Sgarrett.damore@Sun.COM #define IND_AUDIO 1 1889484Sgarrett.damore@Sun.COM #define IND_DATA 2 1899484Sgarrett.damore@Sun.COM 1909484Sgarrett.damore@Sun.COM int in_locked; /* Receiver locked */ 1919484Sgarrett.damore@Sun.COM #define LOCK_NOT_INDICATED 0 1929484Sgarrett.damore@Sun.COM #define LOCK_UNLOCKED 1 1939484Sgarrett.damore@Sun.COM #define LOCK_LOCKED 2 1949484Sgarrett.damore@Sun.COM 1959484Sgarrett.damore@Sun.COM int in_quality; /* Input signal quality */ 1969484Sgarrett.damore@Sun.COM #define IN_QUAL_NOT_INDICATED 0 1979484Sgarrett.damore@Sun.COM #define IN_QUAL_POOR 1 1989484Sgarrett.damore@Sun.COM #define IN_QUAL_GOOD 2 1999484Sgarrett.damore@Sun.COM 2009484Sgarrett.damore@Sun.COM int in_vbit; 2019484Sgarrett.damore@Sun.COM int out_vbit; /* V bits */ 2029484Sgarrett.damore@Sun.COM #define VBIT_NOT_INDICATED 0 2039484Sgarrett.damore@Sun.COM #define VBIT_OFF 1 2049484Sgarrett.damore@Sun.COM #define VBIT_ON 2 2059484Sgarrett.damore@Sun.COM 2069484Sgarrett.damore@Sun.COM unsigned int in_errors; /* Various input error conditions */ 2079484Sgarrett.damore@Sun.COM #define INERR_CRC 0x0001 2089484Sgarrett.damore@Sun.COM #define INERR_QCODE_CRC 0x0002 2099484Sgarrett.damore@Sun.COM #define INERR_PARITY 0x0004 2109484Sgarrett.damore@Sun.COM #define INERR_BIPHASE 0x0008 2119484Sgarrett.damore@Sun.COM 2129484Sgarrett.damore@Sun.COM int srate_in; 2139484Sgarrett.damore@Sun.COM int srate_out; 2149484Sgarrett.damore@Sun.COM int bits_in; 2159484Sgarrett.damore@Sun.COM int bits_out; 2169484Sgarrett.damore@Sun.COM 2179484Sgarrett.damore@Sun.COM int filler[32]; 2189484Sgarrett.damore@Sun.COM } oss_digital_control; 2199484Sgarrett.damore@Sun.COM 2209484Sgarrett.damore@Sun.COM /* 2219484Sgarrett.damore@Sun.COM * The "new" mixer API. 2229484Sgarrett.damore@Sun.COM * 2239484Sgarrett.damore@Sun.COM * This improved mixer API makes it possible to access every possible feature 2249484Sgarrett.damore@Sun.COM * of every possible device. However you should read the mixer programming 2259484Sgarrett.damore@Sun.COM * section of the OSS API Developer's Manual. There is no chance that you 2269484Sgarrett.damore@Sun.COM * could use this interface correctly just by examining this header. 2279484Sgarrett.damore@Sun.COM */ 2289484Sgarrett.damore@Sun.COM #define OSS_VERSION 0x040003 2299484Sgarrett.damore@Sun.COM #define SOUND_VERSION OSS_VERSION 2309484Sgarrett.damore@Sun.COM 2319484Sgarrett.damore@Sun.COM typedef struct oss_sysinfo { 2329484Sgarrett.damore@Sun.COM char product[32]; /* E.g. SunOS Audio */ 2339484Sgarrett.damore@Sun.COM char version[32]; /* E.g. 4.0a */ 2349484Sgarrett.damore@Sun.COM int versionnum; /* See OSS_GETVERSION */ 2359484Sgarrett.damore@Sun.COM char options[128]; /* NOT SUPPORTED */ 2369484Sgarrett.damore@Sun.COM 2379484Sgarrett.damore@Sun.COM int numaudios; /* # of audio/dsp devices */ 2389484Sgarrett.damore@Sun.COM int openedaudio[8]; /* Mask of audio devices are busy */ 2399484Sgarrett.damore@Sun.COM 2409484Sgarrett.damore@Sun.COM int numsynths; /* NOT SUPPORTED, always 0 */ 2419484Sgarrett.damore@Sun.COM int nummidis; /* NOT SUPPORTED, always 0 */ 2429484Sgarrett.damore@Sun.COM int numtimers; /* NOT SUPPORTED, always 0 */ 2439484Sgarrett.damore@Sun.COM int nummixers; /* # of mixer devices */ 2449484Sgarrett.damore@Sun.COM 2459484Sgarrett.damore@Sun.COM int openedmidi[8]; /* Mask of midi devices are busy */ 2469484Sgarrett.damore@Sun.COM int numcards; /* Number of sound cards in the system */ 2479484Sgarrett.damore@Sun.COM int numaudioengines; /* Number of audio engines in the system */ 2489484Sgarrett.damore@Sun.COM char license[16]; /* E.g. "GPL" or "CDDL" */ 2499484Sgarrett.damore@Sun.COM char revision_info[256]; /* For internal use */ 2509484Sgarrett.damore@Sun.COM int filler[172]; /* For future expansion */ 2519484Sgarrett.damore@Sun.COM } oss_sysinfo; 2529484Sgarrett.damore@Sun.COM 2539484Sgarrett.damore@Sun.COM typedef struct oss_mixext { 2549484Sgarrett.damore@Sun.COM int dev; /* Mixer device number */ 2559484Sgarrett.damore@Sun.COM int ctrl; /* Extension number */ 2569484Sgarrett.damore@Sun.COM int type; /* Entry type */ 2579484Sgarrett.damore@Sun.COM #define MIXT_DEVROOT 0 /* Device root entry */ 2589484Sgarrett.damore@Sun.COM #define MIXT_GROUP 1 /* Controller group */ 2599484Sgarrett.damore@Sun.COM #define MIXT_ONOFF 2 /* OFF (0) or ON (1) */ 2609484Sgarrett.damore@Sun.COM #define MIXT_ENUM 3 /* Enumerated (0 to maxvalue) */ 2619484Sgarrett.damore@Sun.COM #define MIXT_MONOSLIDER 4 /* Mono slider (0 to 255) */ 2629484Sgarrett.damore@Sun.COM #define MIXT_STEREOSLIDER 5 /* Stereo slider (dual 0 to 255) */ 2639484Sgarrett.damore@Sun.COM #define MIXT_MESSAGE 6 /* (Readable) textual message */ 2649484Sgarrett.damore@Sun.COM #define MIXT_MONOVU 7 /* VU meter value (mono) */ 2659484Sgarrett.damore@Sun.COM #define MIXT_STEREOVU 8 /* VU meter value (stereo) */ 2669484Sgarrett.damore@Sun.COM #define MIXT_MONOPEAK 9 /* VU meter peak value (mono) */ 2679484Sgarrett.damore@Sun.COM #define MIXT_STEREOPEAK 10 /* VU meter peak value (stereo) */ 2689484Sgarrett.damore@Sun.COM #define MIXT_RADIOGROUP 11 /* Radio button group */ 2699484Sgarrett.damore@Sun.COM #define MIXT_MARKER 12 /* Separator between entries */ 2709484Sgarrett.damore@Sun.COM #define MIXT_VALUE 13 /* Decimal value entry */ 2719484Sgarrett.damore@Sun.COM #define MIXT_HEXVALUE 14 /* Hexadecimal value entry */ 2729484Sgarrett.damore@Sun.COM #define MIXT_MONODB 15 /* OBSOLETE */ 2739484Sgarrett.damore@Sun.COM #define MIXT_STEREODB 16 /* OBSOLETE */ 2749484Sgarrett.damore@Sun.COM #define MIXT_SLIDER 17 /* Slider (mono, 31 bit int range) */ 2759484Sgarrett.damore@Sun.COM #define MIXT_3D 18 2769484Sgarrett.damore@Sun.COM #define MIXT_MONOSLIDER16 19 /* Mono slider (0-32767) */ 2779484Sgarrett.damore@Sun.COM #define MIXT_STEREOSLIDER16 20 /* Stereo slider (dual 0-32767) */ 2789484Sgarrett.damore@Sun.COM #define MIXT_MUTE 21 /* Mute=1, unmute=0 */ 2799484Sgarrett.damore@Sun.COM 2809484Sgarrett.damore@Sun.COM /* Possible value range (minvalue to maxvalue) */ 2819484Sgarrett.damore@Sun.COM /* Note that maxvalue may also be smaller than minvalue */ 2829484Sgarrett.damore@Sun.COM int maxvalue; 2839484Sgarrett.damore@Sun.COM int minvalue; 2849484Sgarrett.damore@Sun.COM 2859484Sgarrett.damore@Sun.COM int flags; 2869484Sgarrett.damore@Sun.COM #define MIXF_READABLE 0x00000001 /* Has readable value */ 2879484Sgarrett.damore@Sun.COM #define MIXF_WRITEABLE 0x00000002 /* Has writeable value */ 2889484Sgarrett.damore@Sun.COM #define MIXF_POLL 0x00000004 /* May change itself */ 2899484Sgarrett.damore@Sun.COM #define MIXF_HZ 0x00000008 /* Hertz scale */ 2909484Sgarrett.damore@Sun.COM #define MIXF_STRING 0x00000010 /* Use dynamic extensions for value */ 2919484Sgarrett.damore@Sun.COM #define MIXF_DYNAMIC 0x00000010 /* Supports dynamic extensions */ 2929484Sgarrett.damore@Sun.COM #define MIXF_OKFAIL 0x00000020 /* Interpret value as 1=OK, 0=FAIL */ 2939484Sgarrett.damore@Sun.COM #define MIXF_FLAT 0x00000040 /* NOT SUPPORTED */ 2949484Sgarrett.damore@Sun.COM #define MIXF_LEGACY 0x00000080 /* NOT SUPPORTED */ 2959484Sgarrett.damore@Sun.COM #define MIXF_CENTIBEL 0x00000100 /* Centibel (0.1 dB) step size */ 2969484Sgarrett.damore@Sun.COM #define MIXF_DECIBEL 0x00000200 /* Step size of 1 dB */ 2979484Sgarrett.damore@Sun.COM #define MIXF_MAINVOL 0x00000400 /* Main volume control */ 2989484Sgarrett.damore@Sun.COM #define MIXF_PCMVOL 0x00000800 /* PCM output volume control */ 2999484Sgarrett.damore@Sun.COM #define MIXF_RECVOL 0x00001000 /* PCM recording volume control */ 3009484Sgarrett.damore@Sun.COM #define MIXF_MONVOL 0x00002000 /* Input->output monitor volume */ 3019484Sgarrett.damore@Sun.COM #define MIXF_WIDE 0x00004000 /* NOT SUPPORTED */ 3029484Sgarrett.damore@Sun.COM #define MIXF_DESCR 0x00008000 /* NOT SUPPORTED */ 3039484Sgarrett.damore@Sun.COM #define MIXF_DISABLE 0x00010000 /* Control has been disabled */ 3049484Sgarrett.damore@Sun.COM 3059484Sgarrett.damore@Sun.COM char id[16]; /* Mnemonic ID (internal use) */ 3069484Sgarrett.damore@Sun.COM int parent; /* Entry# of parent (-1 if root) */ 3079484Sgarrett.damore@Sun.COM 3089484Sgarrett.damore@Sun.COM int dummy; /* NOT SUPPORTED */ 3099484Sgarrett.damore@Sun.COM 3109484Sgarrett.damore@Sun.COM int timestamp; 3119484Sgarrett.damore@Sun.COM 3129484Sgarrett.damore@Sun.COM char data[64]; /* Misc data (entry type dependent) */ 3139484Sgarrett.damore@Sun.COM unsigned char enum_present[32]; /* Mask of allowed enum values */ 3149484Sgarrett.damore@Sun.COM int control_no; /* NOT SUPPORTED, always -1 */ 3159484Sgarrett.damore@Sun.COM 3169484Sgarrett.damore@Sun.COM unsigned int desc; /* Scope flags, etc */ 3179484Sgarrett.damore@Sun.COM #define MIXEXT_SCOPE_MASK 0x0000003f 3189484Sgarrett.damore@Sun.COM #define MIXEXT_SCOPE_OTHER 0x00000000 3199484Sgarrett.damore@Sun.COM #define MIXEXT_SCOPE_INPUT 0x00000001 3209484Sgarrett.damore@Sun.COM #define MIXEXT_SCOPE_OUTPUT 0x00000002 3219484Sgarrett.damore@Sun.COM #define MIXEXT_SCOPE_MONITOR 0x00000003 3229484Sgarrett.damore@Sun.COM #define MIXEXT_SCOPE_RECSWITCH 0x00000004 3239484Sgarrett.damore@Sun.COM 3249484Sgarrett.damore@Sun.COM char extname[32]; 3259484Sgarrett.damore@Sun.COM int update_counter; 3269484Sgarrett.damore@Sun.COM #ifdef _KERNEL 3279484Sgarrett.damore@Sun.COM int filler[6]; 3289484Sgarrett.damore@Sun.COM int enumbit; 3299484Sgarrett.damore@Sun.COM #else 3309484Sgarrett.damore@Sun.COM int filler[7]; 3319484Sgarrett.damore@Sun.COM #endif 3329484Sgarrett.damore@Sun.COM } oss_mixext; 3339484Sgarrett.damore@Sun.COM 3349484Sgarrett.damore@Sun.COM typedef struct oss_mixext_root { 3359484Sgarrett.damore@Sun.COM char id[16]; 3369484Sgarrett.damore@Sun.COM char name[48]; 3379484Sgarrett.damore@Sun.COM } oss_mixext_root; 3389484Sgarrett.damore@Sun.COM 3399484Sgarrett.damore@Sun.COM typedef struct oss_mixer_value { 3409484Sgarrett.damore@Sun.COM int dev; 3419484Sgarrett.damore@Sun.COM int ctrl; 3429484Sgarrett.damore@Sun.COM int value; 3439484Sgarrett.damore@Sun.COM int flags; /* Reserved for future use. Initialize to 0 */ 3449484Sgarrett.damore@Sun.COM int timestamp; /* Must be set to oss_mixext.timestamp */ 3459484Sgarrett.damore@Sun.COM int filler[8]; /* Reserved for future use. Initialize to 0 */ 3469484Sgarrett.damore@Sun.COM } oss_mixer_value; 3479484Sgarrett.damore@Sun.COM 3489484Sgarrett.damore@Sun.COM #define OSS_LONGNAME_SIZE 64 3499484Sgarrett.damore@Sun.COM #define OSS_LABEL_SIZE 16 3509484Sgarrett.damore@Sun.COM #define OSS_DEVNODE_SIZE 32 3519484Sgarrett.damore@Sun.COM typedef char oss_longname_t[OSS_LONGNAME_SIZE]; 3529484Sgarrett.damore@Sun.COM typedef char oss_label_t[OSS_LABEL_SIZE]; 3539484Sgarrett.damore@Sun.COM typedef char oss_devnode_t[OSS_DEVNODE_SIZE]; 3549484Sgarrett.damore@Sun.COM 3559484Sgarrett.damore@Sun.COM 3569484Sgarrett.damore@Sun.COM typedef struct oss_audioinfo { 3579484Sgarrett.damore@Sun.COM int dev; /* Audio device number */ 3589484Sgarrett.damore@Sun.COM char name[64]; 3599484Sgarrett.damore@Sun.COM int busy; /* 0, OPEN_READ, OPEN_WRITE, OPEN_READWRITE */ 3609484Sgarrett.damore@Sun.COM int pid; /* Process ID, not used in SunOS */ 3619484Sgarrett.damore@Sun.COM int caps; /* PCM_CAP_INPUT, PCM_CAP_OUTPUT */ 3629484Sgarrett.damore@Sun.COM int iformats; /* Supported input formats */ 3639484Sgarrett.damore@Sun.COM int oformats; /* Supported output formats */ 3649484Sgarrett.damore@Sun.COM int magic; /* Internal use only */ 3659484Sgarrett.damore@Sun.COM char cmd[64]; /* Command using the device (if known) */ 3669484Sgarrett.damore@Sun.COM int card_number; 3679484Sgarrett.damore@Sun.COM int port_number; 3689484Sgarrett.damore@Sun.COM int mixer_dev; 3699484Sgarrett.damore@Sun.COM int legacy_device; /* Obsolete field. Replaced by devnode */ 3709484Sgarrett.damore@Sun.COM int enabled; /* 1=enabled, 0=device not ready */ 3719484Sgarrett.damore@Sun.COM int flags; /* internal use only - no practical meaning */ 3729484Sgarrett.damore@Sun.COM int min_rate; /* Minimum sample rate */ 3739484Sgarrett.damore@Sun.COM int max_rate; /* Maximum sample rate */ 3749484Sgarrett.damore@Sun.COM int min_channels; /* Minimum number of channels */ 3759484Sgarrett.damore@Sun.COM int max_channels; /* Maximum number of channels */ 3769484Sgarrett.damore@Sun.COM int binding; /* DSP_BIND_FRONT, etc. 0 means undefined */ 3779484Sgarrett.damore@Sun.COM int rate_source; 3789484Sgarrett.damore@Sun.COM char handle[32]; 3799484Sgarrett.damore@Sun.COM #define OSS_MAX_SAMPLE_RATES 20 /* Cannot be changed */ 3809484Sgarrett.damore@Sun.COM unsigned int nrates; /* Array of supported sample rates */ 3819484Sgarrett.damore@Sun.COM unsigned int rates[OSS_MAX_SAMPLE_RATES]; 3829484Sgarrett.damore@Sun.COM oss_longname_t song_name; /* Song name (if given) */ 3839484Sgarrett.damore@Sun.COM oss_label_t label; /* Device label (if given) */ 3849484Sgarrett.damore@Sun.COM int latency; /* In usecs, -1=unknown */ 3859484Sgarrett.damore@Sun.COM oss_devnode_t devnode; /* Device special file name (absolute path) */ 3869484Sgarrett.damore@Sun.COM int next_play_engine; 3879484Sgarrett.damore@Sun.COM int next_rec_engine; 3889484Sgarrett.damore@Sun.COM int filler[184]; 3899484Sgarrett.damore@Sun.COM } oss_audioinfo; 3909484Sgarrett.damore@Sun.COM 3919484Sgarrett.damore@Sun.COM typedef struct oss_mixerinfo { 3929484Sgarrett.damore@Sun.COM int dev; 3939484Sgarrett.damore@Sun.COM char id[16]; 3949484Sgarrett.damore@Sun.COM char name[32]; 3959484Sgarrett.damore@Sun.COM int modify_counter; 3969484Sgarrett.damore@Sun.COM int card_number; 3979484Sgarrett.damore@Sun.COM int port_number; 3989484Sgarrett.damore@Sun.COM char handle[32]; 3999484Sgarrett.damore@Sun.COM int magic; /* Reserved */ 4009484Sgarrett.damore@Sun.COM int enabled; /* Reserved */ 4019484Sgarrett.damore@Sun.COM int caps; 4029484Sgarrett.damore@Sun.COM #define MIXER_CAP_VIRTUAL 0x00000001 4039484Sgarrett.damore@Sun.COM #define MIXER_CAP_LAYOUT_B 0x00000002 /* For internal use only */ 4049484Sgarrett.damore@Sun.COM #define MIXER_CAP_NARROW 0x00000004 /* Conserve horiz space */ 4059484Sgarrett.damore@Sun.COM int flags; /* Reserved */ 4069484Sgarrett.damore@Sun.COM int nrext; 4079484Sgarrett.damore@Sun.COM /* 4089484Sgarrett.damore@Sun.COM * The priority field can be used to select the default 4099484Sgarrett.damore@Sun.COM * (motherboard) mixer device. The mixer with the highest 4109484Sgarrett.damore@Sun.COM * priority is the most preferred one. -2 or less means that 4119484Sgarrett.damore@Sun.COM * this device cannot be used as the default mixer. 4129484Sgarrett.damore@Sun.COM */ 4139484Sgarrett.damore@Sun.COM int priority; 4149484Sgarrett.damore@Sun.COM oss_devnode_t devnode; /* Device special file name (absolute path) */ 4159484Sgarrett.damore@Sun.COM int legacy_device; 4169484Sgarrett.damore@Sun.COM int filler[245]; /* Reserved */ 4179484Sgarrett.damore@Sun.COM } oss_mixerinfo; 4189484Sgarrett.damore@Sun.COM 4199484Sgarrett.damore@Sun.COM typedef struct oss_card_info { 4209484Sgarrett.damore@Sun.COM int card; 4219484Sgarrett.damore@Sun.COM char shortname[16]; 4229484Sgarrett.damore@Sun.COM char longname[128]; 4239484Sgarrett.damore@Sun.COM int flags; 4249484Sgarrett.damore@Sun.COM char hw_info[400]; 4259484Sgarrett.damore@Sun.COM int intr_count; 4269484Sgarrett.damore@Sun.COM int ack_count; 4279484Sgarrett.damore@Sun.COM int filler[154]; 4289484Sgarrett.damore@Sun.COM } oss_card_info; 4299484Sgarrett.damore@Sun.COM 4309484Sgarrett.damore@Sun.COM typedef struct mixer_info { /* OBSOLETE */ 4319484Sgarrett.damore@Sun.COM char id[16]; 4329484Sgarrett.damore@Sun.COM char name[32]; 4339484Sgarrett.damore@Sun.COM int modify_counter; 4349484Sgarrett.damore@Sun.COM int card_number; 4359484Sgarrett.damore@Sun.COM int port_number; 4369484Sgarrett.damore@Sun.COM char handle[32]; 4379484Sgarrett.damore@Sun.COM } mixer_info; 4389484Sgarrett.damore@Sun.COM 4399484Sgarrett.damore@Sun.COM #define MAX_PEAK_CHANNELS 128 4409484Sgarrett.damore@Sun.COM typedef unsigned short oss_peaks_t[MAX_PEAK_CHANNELS]; 4419484Sgarrett.damore@Sun.COM 4429484Sgarrett.damore@Sun.COM /* For use with SNDCTL_DSP_GET_CHNORDER */ 4439484Sgarrett.damore@Sun.COM #define CHID_UNDEF 0 4449484Sgarrett.damore@Sun.COM #define CHID_L 1 4459484Sgarrett.damore@Sun.COM #define CHID_R 2 4469484Sgarrett.damore@Sun.COM #define CHID_C 3 4479484Sgarrett.damore@Sun.COM #define CHID_LFE 4 4489484Sgarrett.damore@Sun.COM #define CHID_LS 5 4499484Sgarrett.damore@Sun.COM #define CHID_RS 6 4509484Sgarrett.damore@Sun.COM #define CHID_LR 7 4519484Sgarrett.damore@Sun.COM #define CHID_RR 8 4529484Sgarrett.damore@Sun.COM #define CHNORDER_UNDEF 0x0000000000000000ULL 4539484Sgarrett.damore@Sun.COM #define CHNORDER_NORMAL 0x0000000087654321ULL 4549484Sgarrett.damore@Sun.COM 4559484Sgarrett.damore@Sun.COM 4569484Sgarrett.damore@Sun.COM #define OSSIOCPARM_MASK 0x1fff /* parameters must be < 8192 bytes */ 4579484Sgarrett.damore@Sun.COM #define OSSIOC_VOID 0x00000000 /* no parameters */ 4589484Sgarrett.damore@Sun.COM #define OSSIOC_OUT 0x20000000 /* copy out parameters */ 4599484Sgarrett.damore@Sun.COM #define OSSIOC_IN 0x40000000 /* copy in parameters */ 4609484Sgarrett.damore@Sun.COM #define OSSIOC_INOUT (OSSIOC_IN|OSSIOC_OUT) 4619484Sgarrett.damore@Sun.COM #define OSSIOC_SZ(t) ((sizeof (t) & OSSIOCPARM_MASK) << 16) 4629484Sgarrett.damore@Sun.COM #define OSSIOC_GETSZ(x) (((x) >> 16) & OSSIOCPARM_MASK) 4639484Sgarrett.damore@Sun.COM 4649484Sgarrett.damore@Sun.COM #define __OSSIO(x, y) ((int)(OSSIOC_VOID|(x<<8)|y)) 4659484Sgarrett.damore@Sun.COM #define __OSSIOR(x, y, t) ((int)(OSSIOC_OUT|OSSIOC_SZ(t)|(x<<8)|y)) 4669484Sgarrett.damore@Sun.COM #define __OSSIOW(x, y, t) ((int)(OSSIOC_IN|OSSIOC_SZ(t)|(x<<8)|y)) 4679484Sgarrett.damore@Sun.COM #define __OSSIOWR(x, y, t) ((int)(OSSIOC_INOUT|OSSIOC_SZ(t)|(x<<8)|y)) 4689484Sgarrett.damore@Sun.COM 4699484Sgarrett.damore@Sun.COM #define SNDCTL_SYSINFO __OSSIOR('X', 1, oss_sysinfo) 4709484Sgarrett.damore@Sun.COM #define OSS_SYSINFO SNDCTL_SYSINFO /* Old name */ 4719484Sgarrett.damore@Sun.COM 4729484Sgarrett.damore@Sun.COM #define SNDCTL_MIX_NRMIX __OSSIOR('X', 2, int) 4739484Sgarrett.damore@Sun.COM #define SNDCTL_MIX_NREXT __OSSIOWR('X', 3, int) 4749484Sgarrett.damore@Sun.COM #define SNDCTL_MIX_EXTINFO __OSSIOWR('X', 4, oss_mixext) 4759484Sgarrett.damore@Sun.COM #define SNDCTL_MIX_READ __OSSIOWR('X', 5, oss_mixer_value) 4769484Sgarrett.damore@Sun.COM #define SNDCTL_MIX_WRITE __OSSIOWR('X', 6, oss_mixer_value) 4779484Sgarrett.damore@Sun.COM 4789484Sgarrett.damore@Sun.COM #define SNDCTL_AUDIOINFO __OSSIOWR('X', 7, oss_audioinfo) 4799484Sgarrett.damore@Sun.COM #define SNDCTL_MIX_ENUMINFO __OSSIOWR('X', 8, oss_mixer_enuminfo) 4809484Sgarrett.damore@Sun.COM #define SNDCTL_MIDIINFO __OSSIO('X', 9) 4819484Sgarrett.damore@Sun.COM #define SNDCTL_MIXERINFO __OSSIOWR('X', 10, oss_mixerinfo) 4829484Sgarrett.damore@Sun.COM #define SNDCTL_CARDINFO __OSSIOWR('X', 11, oss_card_info) 4839484Sgarrett.damore@Sun.COM #define SNDCTL_ENGINEINFO __OSSIOWR('X', 12, oss_audioinfo) 4849484Sgarrett.damore@Sun.COM #define SNDCTL_AUDIOINFO_EX __OSSIOWR('X', 13, oss_audioinfo) 4859484Sgarrett.damore@Sun.COM #define SNDCTL_MIX_DESCRIPTION __OSSIOWR('X', 14, oss_mixer_enuminfo) 4869484Sgarrett.damore@Sun.COM 4879484Sgarrett.damore@Sun.COM /* ioctl codes 'X', 200-255 are reserved for internal use */ 4889484Sgarrett.damore@Sun.COM 4899484Sgarrett.damore@Sun.COM /* 4909484Sgarrett.damore@Sun.COM * Few more "globally" available ioctl calls. 4919484Sgarrett.damore@Sun.COM */ 4929484Sgarrett.damore@Sun.COM #define SNDCTL_SETSONG __OSSIOW('Y', 2, oss_longname_t) 4939484Sgarrett.damore@Sun.COM #define SNDCTL_GETSONG __OSSIOR('Y', 2, oss_longname_t) 4949484Sgarrett.damore@Sun.COM #define SNDCTL_SETNAME __OSSIOW('Y', 3, oss_longname_t) 4959484Sgarrett.damore@Sun.COM #define SNDCTL_SETLABEL __OSSIOW('Y', 4, oss_label_t) 4969484Sgarrett.damore@Sun.COM #define SNDCTL_GETLABEL __OSSIOR('Y', 4, oss_label_t) 4979484Sgarrett.damore@Sun.COM 4989484Sgarrett.damore@Sun.COM /* 4999484Sgarrett.damore@Sun.COM * IOCTL commands for /dev/dsp 5009484Sgarrett.damore@Sun.COM */ 5019484Sgarrett.damore@Sun.COM #define SNDCTL_DSP_HALT __OSSIO('P', 0) 5029484Sgarrett.damore@Sun.COM #define SNDCTL_DSP_RESET SNDCTL_DSP_HALT /* Old name */ 5039484Sgarrett.damore@Sun.COM #define SNDCTL_DSP_SYNC __OSSIO('P', 1) 5049484Sgarrett.damore@Sun.COM #define SNDCTL_DSP_SPEED __OSSIOWR('P', 2, int) 5059484Sgarrett.damore@Sun.COM 5069484Sgarrett.damore@Sun.COM #define SNDCTL_DSP_STEREO __OSSIOWR('P', 3, int) /* OBSOLETE */ 5079484Sgarrett.damore@Sun.COM 5089484Sgarrett.damore@Sun.COM #define SNDCTL_DSP_GETBLKSIZE __OSSIOWR('P', 4, int) 5099484Sgarrett.damore@Sun.COM #define SNDCTL_DSP_SAMPLESIZE SNDCTL_DSP_SETFMT 5109484Sgarrett.damore@Sun.COM #define SNDCTL_DSP_CHANNELS __OSSIOWR('P', 6, int) 5119484Sgarrett.damore@Sun.COM #define SNDCTL_DSP_POST __OSSIO('P', 8) 5129484Sgarrett.damore@Sun.COM #define SNDCTL_DSP_SUBDIVIDE __OSSIOWR('P', 9, int) 5139484Sgarrett.damore@Sun.COM #define SNDCTL_DSP_SETFRAGMENT __OSSIOWR('P', 10, int) 5149484Sgarrett.damore@Sun.COM 5159484Sgarrett.damore@Sun.COM #define SNDCTL_DSP_GETFMTS __OSSIOR('P', 11, int) /* Returns a mask */ 5169484Sgarrett.damore@Sun.COM #define SNDCTL_DSP_SETFMT __OSSIOWR('P', 5, int) /* Selects ONE fmt */ 5179484Sgarrett.damore@Sun.COM 5189484Sgarrett.damore@Sun.COM #define SNDCTL_DSP_GETOSPACE __OSSIOR('P', 12, audio_buf_info) 5199484Sgarrett.damore@Sun.COM #define SNDCTL_DSP_GETISPACE __OSSIOR('P', 13, audio_buf_info) 520*10477SGarrett.Damore@Sun.COM #define SNDCTL_DSP_NONBLOCK __OSSIO('P', 14) /* Obsolete */ 5219484Sgarrett.damore@Sun.COM #define SNDCTL_DSP_GETCAPS __OSSIOR('P', 15, int) 5229484Sgarrett.damore@Sun.COM 5239484Sgarrett.damore@Sun.COM #define SNDCTL_DSP_GETTRIGGER __OSSIOR('P', 16, int) 5249484Sgarrett.damore@Sun.COM #define SNDCTL_DSP_SETTRIGGER __OSSIOW('P', 16, int) 5259484Sgarrett.damore@Sun.COM 5269484Sgarrett.damore@Sun.COM #define SNDCTL_DSP_GETIPTR __OSSIOR('P', 17, count_info) 5279484Sgarrett.damore@Sun.COM #define SNDCTL_DSP_GETOPTR __OSSIOR('P', 18, count_info) 5289484Sgarrett.damore@Sun.COM 5299484Sgarrett.damore@Sun.COM #define SNDCTL_DSP_SETSYNCRO __OSSIO('P', 21) 5309484Sgarrett.damore@Sun.COM #define SNDCTL_DSP_SETDUPLEX __OSSIO('P', 22) 5319484Sgarrett.damore@Sun.COM 5329484Sgarrett.damore@Sun.COM #define SNDCTL_DSP_PROFILE __OSSIOW('P', 23, int) /* OBSOLETE */ 5339484Sgarrett.damore@Sun.COM #define APF_NORMAL 0 /* Normal applications */ 5349484Sgarrett.damore@Sun.COM #define APF_NETWORK 1 /* Underruns caused by "external" delay */ 5359484Sgarrett.damore@Sun.COM #define APF_CPUINTENS 2 /* Underruns caused by "overheating" the CPU */ 5369484Sgarrett.damore@Sun.COM 5379484Sgarrett.damore@Sun.COM 5389484Sgarrett.damore@Sun.COM #define SNDCTL_DSP_GETODELAY __OSSIOR('P', 23, int) 5399484Sgarrett.damore@Sun.COM 5409484Sgarrett.damore@Sun.COM #define SNDCTL_DSP_GETPLAYVOL __OSSIOR('P', 24, int) 5419484Sgarrett.damore@Sun.COM #define SNDCTL_DSP_SETPLAYVOL __OSSIOWR('P', 24, int) 5429484Sgarrett.damore@Sun.COM #define SNDCTL_DSP_GETERROR __OSSIOR('P', 25, audio_errinfo) 5439484Sgarrett.damore@Sun.COM 5449484Sgarrett.damore@Sun.COM #define SNDCTL_DSP_READCTL __OSSIOWR('P', 26, oss_digital_control) 5459484Sgarrett.damore@Sun.COM #define SNDCTL_DSP_WRITECTL __OSSIOWR('P', 27, oss_digital_control) 5469484Sgarrett.damore@Sun.COM 5479484Sgarrett.damore@Sun.COM #define SNDCTL_DSP_SYNCGROUP __OSSIOWR('P', 28, oss_syncgroup) 5489484Sgarrett.damore@Sun.COM #define SNDCTL_DSP_SYNCSTART __OSSIOW('P', 29, int) 5499484Sgarrett.damore@Sun.COM 5509484Sgarrett.damore@Sun.COM #define SNDCTL_DSP_COOKEDMODE __OSSIOW('P', 30, int) 5519484Sgarrett.damore@Sun.COM 5529484Sgarrett.damore@Sun.COM #define SNDCTL_DSP_SILENCE __OSSIO('P', 31) 5539484Sgarrett.damore@Sun.COM #define SNDCTL_DSP_SKIP __OSSIO('P', 32) 5549484Sgarrett.damore@Sun.COM 5559484Sgarrett.damore@Sun.COM #define SNDCTL_DSP_HALT_INPUT __OSSIO('P', 33) 5569484Sgarrett.damore@Sun.COM #define SNDCTL_DSP_RESET_INPUT SNDCTL_DSP_HALT_INPUT /* Old name */ 5579484Sgarrett.damore@Sun.COM #define SNDCTL_DSP_HALT_OUTPUT __OSSIO('P', 34) 5589484Sgarrett.damore@Sun.COM #define SNDCTL_DSP_RESET_OUTPUT SNDCTL_DSP_HALT_OUTPUT /* Old name */ 5599484Sgarrett.damore@Sun.COM 5609484Sgarrett.damore@Sun.COM #define SNDCTL_DSP_LOW_WATER __OSSIOW('P', 34, int) 5619484Sgarrett.damore@Sun.COM 5629484Sgarrett.damore@Sun.COM #define SNDCTL_DSP_CURRENT_IPTR __OSSIOR('P', 35, oss_count_t) 5639484Sgarrett.damore@Sun.COM #define SNDCTL_DSP_CURRENT_OPTR __OSSIOR('P', 36, oss_count_t) 5649484Sgarrett.damore@Sun.COM 5659484Sgarrett.damore@Sun.COM #define SNDCTL_DSP_GET_RECSRC_NAMES __OSSIOR('P', 37, oss_mixer_enuminfo) 5669484Sgarrett.damore@Sun.COM #define SNDCTL_DSP_GET_RECSRC __OSSIOR('P', 38, int) 5679484Sgarrett.damore@Sun.COM #define SNDCTL_DSP_SET_RECSRC __OSSIOWR('P', 38, int) 5689484Sgarrett.damore@Sun.COM 5699484Sgarrett.damore@Sun.COM #define SNDCTL_DSP_GET_PLAYTGT_NAMES __OSSIOR('P', 39, oss_mixer_enuminfo) 5709484Sgarrett.damore@Sun.COM #define SNDCTL_DSP_GET_PLAYTGT __OSSIOR('P', 40, int) 5719484Sgarrett.damore@Sun.COM #define SNDCTL_DSP_SET_PLAYTGT __OSSIOWR('P', 40, int) 5729484Sgarrett.damore@Sun.COM #define SNDCTL_DSP_GETRECVOL __OSSIOR('P', 41, int) 5739484Sgarrett.damore@Sun.COM #define SNDCTL_DSP_SETRECVOL __OSSIOWR('P', 41, int) 5749484Sgarrett.damore@Sun.COM 5759484Sgarrett.damore@Sun.COM #define SNDCTL_DSP_GET_CHNORDER __OSSIOR('P', 42, unsigned long long) 5769484Sgarrett.damore@Sun.COM #define SNDCTL_DSP_SET_CHNORDER __OSSIOWR('P', 42, unsigned long long) 5779484Sgarrett.damore@Sun.COM 5789484Sgarrett.damore@Sun.COM #define SNDCTL_DSP_GETIPEAKS __OSSIOR('P', 43, oss_peaks_t) 5799484Sgarrett.damore@Sun.COM #define SNDCTL_DSP_GETOPEAKS __OSSIOR('P', 44, oss_peaks_t) 5809484Sgarrett.damore@Sun.COM 5819484Sgarrett.damore@Sun.COM #define SNDCTL_DSP_POLICY __OSSIOW('P', 45, int) /* See the manual */ 5829484Sgarrett.damore@Sun.COM 5839484Sgarrett.damore@Sun.COM #define SNDCTL_DSP_GETCHANNELMASK __OSSIOWR('P', 64, int) 5849484Sgarrett.damore@Sun.COM #define SNDCTL_DSP_BIND_CHANNEL __OSSIOWR('P', 65, int) 5859484Sgarrett.damore@Sun.COM 5869484Sgarrett.damore@Sun.COM /* 5879484Sgarrett.damore@Sun.COM * These definitions are here for the benefit of compiling application 5889484Sgarrett.damore@Sun.COM * code. Most of these are NOT implemented in the Solaris code, 5899484Sgarrett.damore@Sun.COM * however. This is the older 3.x OSS API, and only the master input and 5909484Sgarrett.damore@Sun.COM * output levels are actually supported. 5919484Sgarrett.damore@Sun.COM */ 5929484Sgarrett.damore@Sun.COM #define SOUND_MIXER_NRDEVICES 28 5939484Sgarrett.damore@Sun.COM #define SOUND_MIXER_VOLUME 0 5949484Sgarrett.damore@Sun.COM #define SOUND_MIXER_BASS 1 5959484Sgarrett.damore@Sun.COM #define SOUND_MIXER_TREBLE 2 5969484Sgarrett.damore@Sun.COM #define SOUND_MIXER_SYNTH 3 5979484Sgarrett.damore@Sun.COM #define SOUND_MIXER_PCM 4 5989484Sgarrett.damore@Sun.COM #define SOUND_MIXER_SPEAKER 5 5999484Sgarrett.damore@Sun.COM #define SOUND_MIXER_LINE 6 6009484Sgarrett.damore@Sun.COM #define SOUND_MIXER_MIC 7 6019484Sgarrett.damore@Sun.COM #define SOUND_MIXER_CD 8 6029484Sgarrett.damore@Sun.COM #define SOUND_MIXER_IMIX 9 /* Recording monitor */ 6039484Sgarrett.damore@Sun.COM #define SOUND_MIXER_ALTPCM 10 6049484Sgarrett.damore@Sun.COM #define SOUND_MIXER_RECLEV 11 /* Recording level */ 6059484Sgarrett.damore@Sun.COM #define SOUND_MIXER_IGAIN 12 /* Input gain */ 6069484Sgarrett.damore@Sun.COM #define SOUND_MIXER_OGAIN 13 /* Output gain */ 6079484Sgarrett.damore@Sun.COM #define SOUND_MIXER_LINE1 14 /* Input source 1 (aux1) */ 6089484Sgarrett.damore@Sun.COM #define SOUND_MIXER_LINE2 15 /* Input source 2 (aux2) */ 6099484Sgarrett.damore@Sun.COM #define SOUND_MIXER_LINE3 16 /* Input source 3 (line) */ 6109484Sgarrett.damore@Sun.COM #define SOUND_MIXER_DIGITAL1 17 /* Digital I/O 1 */ 6119484Sgarrett.damore@Sun.COM #define SOUND_MIXER_DIGITAL2 18 /* Digital I/O 2 */ 6129484Sgarrett.damore@Sun.COM #define SOUND_MIXER_DIGITAL3 19 /* Digital I/O 3 */ 6139484Sgarrett.damore@Sun.COM #define SOUND_MIXER_PHONE 20 /* Phone */ 6149484Sgarrett.damore@Sun.COM #define SOUND_MIXER_MONO 21 /* Mono Output */ 6159484Sgarrett.damore@Sun.COM #define SOUND_MIXER_VIDEO 22 /* Video/TV (audio) in */ 6169484Sgarrett.damore@Sun.COM #define SOUND_MIXER_RADIO 23 /* Radio in */ 6179484Sgarrett.damore@Sun.COM #define SOUND_MIXER_DEPTH 24 /* Surround depth */ 6189484Sgarrett.damore@Sun.COM #define SOUND_MIXER_REARVOL 25 /* Rear/Surround speaker vol */ 6199484Sgarrett.damore@Sun.COM #define SOUND_MIXER_CENTERVOL 26 /* Center/LFE speaker vol */ 6209484Sgarrett.damore@Sun.COM #define SOUND_MIXER_SIDEVOL 27 /* Side-Surround (8speaker) vol */ 6219484Sgarrett.damore@Sun.COM #define SOUND_MIXER_SURRVOL SOUND_MIXER_SIDEVOL 6229484Sgarrett.damore@Sun.COM #define SOUND_ONOFF_MIN 28 6239484Sgarrett.damore@Sun.COM #define SOUND_ONOFF_MAX 30 6249484Sgarrett.damore@Sun.COM #define SOUND_MIXER_NONE 31 6259484Sgarrett.damore@Sun.COM 6269484Sgarrett.damore@Sun.COM #define SOUND_MIXER_RECSRC 0xff /* Recording sources */ 6279484Sgarrett.damore@Sun.COM #define SOUND_MIXER_DEVMASK 0xfe /* Supported devices */ 6289484Sgarrett.damore@Sun.COM #define SOUND_MIXER_RECMASK 0xfd /* Recording sources */ 6299484Sgarrett.damore@Sun.COM #define SOUND_MIXER_CAPS 0xfc /* Mixer capabilities (do not use) */ 6309484Sgarrett.damore@Sun.COM #define SOUND_MIXER_STEREODEVS 0xfb /* Mixer channels supporting stereo */ 6319484Sgarrett.damore@Sun.COM #define SOUND_MIXER_OUTSRC 0xfa 6329484Sgarrett.damore@Sun.COM #define SOUND_MIXER_OUTMASK 0xf9 6339484Sgarrett.damore@Sun.COM 6349484Sgarrett.damore@Sun.COM #define SOUND_MIXER_ENHANCE SOUND_MIXER_NONE 6359484Sgarrett.damore@Sun.COM #define SOUND_MIXER_MUTE SOUND_MIXER_NONE 6369484Sgarrett.damore@Sun.COM #define SOUND_MIXER_LOUD SOUND_MIXER_NONE 6379484Sgarrett.damore@Sun.COM 6389484Sgarrett.damore@Sun.COM #define SOUND_MASK_VOLUME (1 << SOUND_MIXER_VOLUME) 6399484Sgarrett.damore@Sun.COM #define SOUND_MASK_BASS (1 << SOUND_MIXER_BASS) 6409484Sgarrett.damore@Sun.COM #define SOUND_MASK_TREBLE (1 << SOUND_MIXER_TREBLE) 6419484Sgarrett.damore@Sun.COM #define SOUND_MASK_SYNTH (1 << SOUND_MIXER_SYNTH) 6429484Sgarrett.damore@Sun.COM #define SOUND_MASK_PCM (1 << SOUND_MIXER_PCM) 6439484Sgarrett.damore@Sun.COM #define SOUND_MASK_SPEAKER (1 << SOUND_MIXER_SPEAKER) 6449484Sgarrett.damore@Sun.COM #define SOUND_MASK_LINE (1 << SOUND_MIXER_LINE) 6459484Sgarrett.damore@Sun.COM #define SOUND_MASK_MIC (1 << SOUND_MIXER_MIC) 6469484Sgarrett.damore@Sun.COM #define SOUND_MASK_CD (1 << SOUND_MIXER_CD) 6479484Sgarrett.damore@Sun.COM #define SOUND_MASK_IMIX (1 << SOUND_MIXER_IMIX) 6489484Sgarrett.damore@Sun.COM #define SOUND_MASK_ALTPCM (1 << SOUND_MIXER_ALTPCM) 6499484Sgarrett.damore@Sun.COM #define SOUND_MASK_RECLEV (1 << SOUND_MIXER_RECLEV) 6509484Sgarrett.damore@Sun.COM #define SOUND_MASK_IGAIN (1 << SOUND_MIXER_IGAIN) 6519484Sgarrett.damore@Sun.COM #define SOUND_MASK_OGAIN (1 << SOUND_MIXER_OGAIN) 6529484Sgarrett.damore@Sun.COM #define SOUND_MASK_LINE1 (1 << SOUND_MIXER_LINE1) 6539484Sgarrett.damore@Sun.COM #define SOUND_MASK_LINE2 (1 << SOUND_MIXER_LINE2) 6549484Sgarrett.damore@Sun.COM #define SOUND_MASK_LINE3 (1 << SOUND_MIXER_LINE3) 6559484Sgarrett.damore@Sun.COM #define SOUND_MASK_DIGITAL1 (1 << SOUND_MIXER_DIGITAL1) 6569484Sgarrett.damore@Sun.COM #define SOUND_MASK_DIGITAL2 (1 << SOUND_MIXER_DIGITAL2) 6579484Sgarrett.damore@Sun.COM #define SOUND_MASK_DIGITAL3 (1 << SOUND_MIXER_DIGITAL3) 6589484Sgarrett.damore@Sun.COM #define SOUND_MASK_MONO (1 << SOUND_MIXER_MONO) 6599484Sgarrett.damore@Sun.COM #define SOUND_MASK_PHONE (1 << SOUND_MIXER_PHONE) 6609484Sgarrett.damore@Sun.COM #define SOUND_MASK_RADIO (1 << SOUND_MIXER_RADIO) 6619484Sgarrett.damore@Sun.COM #define SOUND_MASK_VIDEO (1 << SOUND_MIXER_VIDEO) 6629484Sgarrett.damore@Sun.COM #define SOUND_MASK_DEPTH (1 << SOUND_MIXER_DEPTH) 6639484Sgarrett.damore@Sun.COM #define SOUND_MASK_REARVOL (1 << SOUND_MIXER_REARVOL) 6649484Sgarrett.damore@Sun.COM #define SOUND_MASK_CENTERVOL (1 << SOUND_MIXER_CENTERVOL) 6659484Sgarrett.damore@Sun.COM #define SOUND_MASK_SIDEVOL (1 << SOUND_MIXER_SIDEVOL) 6669484Sgarrett.damore@Sun.COM #define SOUND_MASK_SURRVOL SOUND_MASK_SIDEVOL 6679484Sgarrett.damore@Sun.COM #define SOUND_MASK_MUTE (1 << SOUND_MIXER_MUTE) 6689484Sgarrett.damore@Sun.COM #define SOUND_MASK_ENHANCE (1 << SOUND_MIXER_ENHANCE) 6699484Sgarrett.damore@Sun.COM #define SOUND_MASK_LOUD (1 << SOUND_MIXER_LOUD) 6709484Sgarrett.damore@Sun.COM 6719484Sgarrett.damore@Sun.COM /* 6729484Sgarrett.damore@Sun.COM * Again, DO NOT USE the following two macros. They are here for SOURCE 6739484Sgarrett.damore@Sun.COM * COMPATIBILITY ONLY. 6749484Sgarrett.damore@Sun.COM */ 6759484Sgarrett.damore@Sun.COM #define SOUND_DEVICE_LABELS { \ 6769484Sgarrett.damore@Sun.COM "Vol ", "Bass ", "Treble", "Synth", "Pcm ", "Speaker ", "Line ", \ 6779484Sgarrett.damore@Sun.COM "Mic ", "CD ", "Mix ", "Pcm2 ", "Rec ", "IGain", "OGain", \ 6789484Sgarrett.damore@Sun.COM "Aux1", "Aux2", "Aux3", "Digital1", "Digital2", "Digital3", \ 6799484Sgarrett.damore@Sun.COM "Phone", "Mono", "Video", "Radio", "Depth", \ 6809484Sgarrett.damore@Sun.COM "Rear", "Center", "Side" } 6819484Sgarrett.damore@Sun.COM 6829484Sgarrett.damore@Sun.COM #define SOUND_DEVICE_NAMES { \ 6839484Sgarrett.damore@Sun.COM "vol", "bass", "treble", "synth", "pcm", "speaker", "line", \ 6849484Sgarrett.damore@Sun.COM "mic", "cd", "mix", "pcm2", "rec", "igain", "ogain", \ 6859484Sgarrett.damore@Sun.COM "aux1", "aux2", "aux3", "dig1", "dig2", "dig3", \ 6869484Sgarrett.damore@Sun.COM "phone", "mono", "video", "radio", "depth", \ 6879484Sgarrett.damore@Sun.COM "rear", "center", "side" } 6889484Sgarrett.damore@Sun.COM 6899484Sgarrett.damore@Sun.COM #define MIXER_READ(dev) __OSSIOR('M', dev, int) 6909484Sgarrett.damore@Sun.COM #define MIXER_WRITE(dev) __OSSIOWR('M', dev, int) 6919484Sgarrett.damore@Sun.COM #define SOUND_MIXER_INFO __OSSIOR('M', 101, mixer_info) 6929484Sgarrett.damore@Sun.COM #define OSS_GETVERSION __OSSIOR('M', 118, int) 6939484Sgarrett.damore@Sun.COM 6949484Sgarrett.damore@Sun.COM /* 6959484Sgarrett.damore@Sun.COM * These macros are useful for some applications. They are implemented 6969484Sgarrett.damore@Sun.COM * as soft values for the application, and do not affect real hardware. 6979484Sgarrett.damore@Sun.COM */ 6989484Sgarrett.damore@Sun.COM #define SOUND_MIXER_READ_VOLUME MIXER_READ(SOUND_MIXER_VOLUME) 6999484Sgarrett.damore@Sun.COM #define SOUND_MIXER_READ_OGAIN MIXER_READ(SOUND_MIXER_OGAIN) 7009484Sgarrett.damore@Sun.COM #define SOUND_MIXER_READ_PCM MIXER_READ(SOUND_MIXER_PCM) 7019484Sgarrett.damore@Sun.COM #define SOUND_MIXER_READ_IGAIN MIXER_READ(SOUND_MIXER_IGAIN) 7029484Sgarrett.damore@Sun.COM #define SOUND_MIXER_READ_RECLEV MIXER_READ(SOUND_MIXER_RECLEV) 7039484Sgarrett.damore@Sun.COM #define SOUND_MIXER_READ_RECSRC MIXER_READ(SOUND_MIXER_RECSRC) 7049484Sgarrett.damore@Sun.COM #define SOUND_MIXER_READ_DEVMASK MIXER_READ(SOUND_MIXER_DEVMASK) 7059484Sgarrett.damore@Sun.COM #define SOUND_MIXER_READ_RECMASK MIXER_READ(SOUND_MIXER_RECMASK) 7069484Sgarrett.damore@Sun.COM #define SOUND_MIXER_READ_CAPS MIXER_READ(SOUND_MIXER_CAPS) 7079484Sgarrett.damore@Sun.COM #define SOUND_MIXER_READ_STEREODEVS MIXER_READ(SOUND_MIXER_STEREODEVS) 7089484Sgarrett.damore@Sun.COM #define SOUND_MIXER_READ_RECGAIN __OSSIOR('M', 119, int) 7099484Sgarrett.damore@Sun.COM #define SOUND_MIXER_READ_MONGAIN __OSSIOR('M', 120, int) 7109484Sgarrett.damore@Sun.COM 7119484Sgarrett.damore@Sun.COM #define SOUND_MIXER_WRITE_VOLUME MIXER_WRITE(SOUND_MIXER_VOLUME) 7129484Sgarrett.damore@Sun.COM #define SOUND_MIXER_WRITE_OGAIN MIXER_WRITE(SOUND_MIXER_OGAIN) 7139484Sgarrett.damore@Sun.COM #define SOUND_MIXER_WRITE_PCM MIXER_WRITE(SOUND_MIXER_PCM) 7149484Sgarrett.damore@Sun.COM #define SOUND_MIXER_WRITE_IGAIN MIXER_WRITE(SOUND_MIXER_IGAIN) 7159484Sgarrett.damore@Sun.COM #define SOUND_MIXER_WRITE_RECLEV MIXER_WRITE(SOUND_MIXER_RECLEV) 7169484Sgarrett.damore@Sun.COM #define SOUND_MIXER_WRITE_RECSRC MIXER_WRITE(SOUND_MIXER_RECSRC) 7179484Sgarrett.damore@Sun.COM #define SOUND_MIXER_WRITE_RECGAIN __OSSIOWR('M', 119, int) 7189484Sgarrett.damore@Sun.COM #define SOUND_MIXER_WRITE_MONGAIN __OSSIOWR('M', 120, int) 7199484Sgarrett.damore@Sun.COM 7209484Sgarrett.damore@Sun.COM /* 7219484Sgarrett.damore@Sun.COM * These macros are here for source compatibility. They intentionally don't 7229484Sgarrett.damore@Sun.COM * map to any real hardware. NOT SUPPORTED! 7239484Sgarrett.damore@Sun.COM */ 7249484Sgarrett.damore@Sun.COM #define SOUND_MIXER_READ_BASS MIXER_READ(SOUND_MIXER_BASS) 7259484Sgarrett.damore@Sun.COM #define SOUND_MIXER_READ_TREBLE MIXER_READ(SOUND_MIXER_TREBLE) 7269484Sgarrett.damore@Sun.COM #define SOUND_MIXER_READ_SYNTH MIXER_READ(SOUND_MIXER_SYNTH) 7279484Sgarrett.damore@Sun.COM #define SOUND_MIXER_READ_SPEAKER MIXER_READ(SOUND_MIXER_SPEAKER) 7289484Sgarrett.damore@Sun.COM #define SOUND_MIXER_READ_LINE MIXER_READ(SOUND_MIXER_LINE) 7299484Sgarrett.damore@Sun.COM #define SOUND_MIXER_READ_MIC MIXER_READ(SOUND_MIXER_MIC) 7309484Sgarrett.damore@Sun.COM #define SOUND_MIXER_READ_CD MIXER_READ(SOUND_MIXER_CD) 7319484Sgarrett.damore@Sun.COM #define SOUND_MIXER_READ_IMIX MIXER_READ(SOUND_MIXER_IMIX) 7329484Sgarrett.damore@Sun.COM #define SOUND_MIXER_READ_ALTPCM MIXER_READ(SOUND_MIXER_ALTPCM) 7339484Sgarrett.damore@Sun.COM #define SOUND_MIXER_READ_LINE1 MIXER_READ(SOUND_MIXER_LINE1) 7349484Sgarrett.damore@Sun.COM #define SOUND_MIXER_READ_LINE2 MIXER_READ(SOUND_MIXER_LINE2) 7359484Sgarrett.damore@Sun.COM #define SOUND_MIXER_READ_LINE3 MIXER_READ(SOUND_MIXER_LINE3) 7369484Sgarrett.damore@Sun.COM 7379484Sgarrett.damore@Sun.COM #define SOUND_MIXER_WRITE_BASS MIXER_WRITE(SOUND_MIXER_BASS) 7389484Sgarrett.damore@Sun.COM #define SOUND_MIXER_WRITE_TREBLE MIXER_WRITE(SOUND_MIXER_TREBLE) 7399484Sgarrett.damore@Sun.COM #define SOUND_MIXER_WRITE_SYNTH MIXER_WRITE(SOUND_MIXER_SYNTH) 7409484Sgarrett.damore@Sun.COM #define SOUND_MIXER_WRITE_SPEAKER MIXER_WRITE(SOUND_MIXER_SPEAKER) 7419484Sgarrett.damore@Sun.COM #define SOUND_MIXER_WRITE_LINE MIXER_WRITE(SOUND_MIXER_LINE) 7429484Sgarrett.damore@Sun.COM #define SOUND_MIXER_WRITE_MIC MIXER_WRITE(SOUND_MIXER_MIC) 7439484Sgarrett.damore@Sun.COM #define SOUND_MIXER_WRITE_CD MIXER_WRITE(SOUND_MIXER_CD) 7449484Sgarrett.damore@Sun.COM #define SOUND_MIXER_WRITE_IMIX MIXER_WRITE(SOUND_MIXER_IMIX) 7459484Sgarrett.damore@Sun.COM #define SOUND_MIXER_WRITE_ALTPCM MIXER_WRITE(SOUND_MIXER_ALTPCM) 7469484Sgarrett.damore@Sun.COM #define SOUND_MIXER_WRITE_LINE1 MIXER_WRITE(SOUND_MIXER_LINE1) 7479484Sgarrett.damore@Sun.COM #define SOUND_MIXER_WRITE_LINE2 MIXER_WRITE(SOUND_MIXER_LINE2) 7489484Sgarrett.damore@Sun.COM #define SOUND_MIXER_WRITE_LINE3 MIXER_WRITE(SOUND_MIXER_LINE3) 7499484Sgarrett.damore@Sun.COM 7509484Sgarrett.damore@Sun.COM /* 7519484Sgarrett.damore@Sun.COM * Audio encoding types (Note! U8=8 and S16_LE=16 for compatibility) 7529484Sgarrett.damore@Sun.COM */ 7539484Sgarrett.damore@Sun.COM #define AFMT_QUERY 0x00000000 /* Return current fmt */ 7549484Sgarrett.damore@Sun.COM #define AFMT_MU_LAW 0x00000001 7559484Sgarrett.damore@Sun.COM #define AFMT_A_LAW 0x00000002 7569484Sgarrett.damore@Sun.COM #define AFMT_IMA_ADPCM 0x00000004 7579484Sgarrett.damore@Sun.COM #define AFMT_U8 0x00000008 7589484Sgarrett.damore@Sun.COM #define AFMT_S16_LE 0x00000010 7599484Sgarrett.damore@Sun.COM #define AFMT_S16_BE 0x00000020 7609484Sgarrett.damore@Sun.COM #define AFMT_S8 0x00000040 7619484Sgarrett.damore@Sun.COM #define AFMT_U16_LE 0x00000080 7629484Sgarrett.damore@Sun.COM #define AFMT_U16_BE 0x00000100 7639484Sgarrett.damore@Sun.COM #define AFMT_MPEG 0x00000200 /* NOT SUPPORTED: MPEG (2) audio */ 7649484Sgarrett.damore@Sun.COM #define AFMT_AC3 0x00000400 /* NOT SUPPORTED: AC3 compressed */ 7659484Sgarrett.damore@Sun.COM #define AFMT_VORBIS 0x00000800 /* NOT SUPPORTED: Ogg Vorbis */ 7669484Sgarrett.damore@Sun.COM #define AFMT_S32_LE 0x00001000 7679484Sgarrett.damore@Sun.COM #define AFMT_S32_BE 0x00002000 7689484Sgarrett.damore@Sun.COM #define AFMT_FLOAT 0x00004000 /* NOT SUPPORTED: IEEE double float */ 7699484Sgarrett.damore@Sun.COM #define AFMT_S24_LE 0x00008000 /* LSB aligned in 32 bit word */ 7709484Sgarrett.damore@Sun.COM #define AFMT_S24_BE 0x00010000 /* LSB aligned in 32 bit word */ 7719484Sgarrett.damore@Sun.COM #define AFMT_SPDIF_RAW 0x00020000 /* NOT SUPPORTED: Raw S/PDIF frames */ 7729484Sgarrett.damore@Sun.COM #define AFMT_S24_PACKED 0x00040000 /* 24 bit packed little endian */ 7739484Sgarrett.damore@Sun.COM /* 7749484Sgarrett.damore@Sun.COM * Some big endian/little endian handling macros (native endian and 7759484Sgarrett.damore@Sun.COM * opposite endian formats). 7769484Sgarrett.damore@Sun.COM */ 7779484Sgarrett.damore@Sun.COM #if defined(_BIG_ENDIAN) 7789484Sgarrett.damore@Sun.COM #define AFMT_S16_NE AFMT_S16_BE 7799484Sgarrett.damore@Sun.COM #define AFMT_U16_NE AFMT_U16_BE 7809484Sgarrett.damore@Sun.COM #define AFMT_S32_NE AFMT_S32_BE 7819484Sgarrett.damore@Sun.COM #define AFMT_S24_NE AFMT_S24_BE 7829484Sgarrett.damore@Sun.COM #define AFMT_S16_OE AFMT_S16_LE 7839484Sgarrett.damore@Sun.COM #define AFMT_S32_OE AFMT_S32_LE 7849484Sgarrett.damore@Sun.COM #define AFMT_S24_OE AFMT_S24_LE 7859484Sgarrett.damore@Sun.COM #else 7869484Sgarrett.damore@Sun.COM #define AFMT_S16_NE AFMT_S16_LE 7879484Sgarrett.damore@Sun.COM #define AFMT_U16_NE AFMT_U16_LE 7889484Sgarrett.damore@Sun.COM #define AFMT_S32_NE AFMT_S32_LE 7899484Sgarrett.damore@Sun.COM #define AFMT_S24_NE AFMT_S24_LE 7909484Sgarrett.damore@Sun.COM #define AFMT_S16_OE AFMT_S16_BE 7919484Sgarrett.damore@Sun.COM #define AFMT_S32_OE AFMT_S32_BE 7929484Sgarrett.damore@Sun.COM #define AFMT_S24_OE AFMT_S24_BE 7939484Sgarrett.damore@Sun.COM #endif 7949484Sgarrett.damore@Sun.COM 7959484Sgarrett.damore@Sun.COM /* 7969484Sgarrett.damore@Sun.COM * SNDCTL_DSP_GETCAPS bits 7979484Sgarrett.damore@Sun.COM */ 7989484Sgarrett.damore@Sun.COM #define PCM_CAP_REVISION 0x000000ff /* Revision level (0 to 255) */ 7999484Sgarrett.damore@Sun.COM #define PCM_CAP_DUPLEX 0x00000100 /* Full duplex rec/play */ 8009484Sgarrett.damore@Sun.COM #define PCM_CAP_REALTIME 0x00000200 /* NOT SUPPORTED */ 8019484Sgarrett.damore@Sun.COM #define PCM_CAP_BATCH 0x00000400 /* NOT SUPPORTED */ 8029484Sgarrett.damore@Sun.COM #define PCM_CAP_COPROC 0x00000800 /* NOT SUPPORTED */ 8039484Sgarrett.damore@Sun.COM #define PCM_CAP_TRIGGER 0x00001000 /* Supports SETTRIGGER */ 8049484Sgarrett.damore@Sun.COM #define PCM_CAP_MMAP 0x00002000 /* Supports mmap() */ 8059484Sgarrett.damore@Sun.COM #define PCM_CAP_MULTI 0x00004000 /* Supports multiple open */ 8069484Sgarrett.damore@Sun.COM #define PCM_CAP_BIND 0x00008000 /* Supports channel binding */ 8079484Sgarrett.damore@Sun.COM #define PCM_CAP_INPUT 0x00010000 /* Supports recording */ 8089484Sgarrett.damore@Sun.COM #define PCM_CAP_OUTPUT 0x00020000 /* Supports playback */ 8099484Sgarrett.damore@Sun.COM #define PCM_CAP_VIRTUAL 0x00040000 /* Virtual device */ 8109484Sgarrett.damore@Sun.COM #define PCM_CAP_ANALOGOUT 0x00100000 /* NOT SUPPORTED */ 8119484Sgarrett.damore@Sun.COM #define PCM_CAP_ANALOGIN 0x00200000 /* NOT SUPPORTED */ 8129484Sgarrett.damore@Sun.COM #define PCM_CAP_DIGITALOUT 0x00400000 /* NOT SUPPORTED */ 8139484Sgarrett.damore@Sun.COM #define PCM_CAP_DIGITALIN 0x00800000 /* NOT SUPPORTED */ 8149484Sgarrett.damore@Sun.COM #define PCM_CAP_ADMASK 0x00f00000 /* NOT SUPPORTED */ 8159484Sgarrett.damore@Sun.COM #define PCM_CAP_SHADOW 0x01000000 /* "Shadow" device */ 8169484Sgarrett.damore@Sun.COM #define PCM_CAP_CH_MASK 0x06000000 /* See DSP_CH_MASK below */ 8179484Sgarrett.damore@Sun.COM #define PCM_CAP_HIDDEN 0x08000000 /* NOT SUPPORTED */ 8189484Sgarrett.damore@Sun.COM #define PCM_CAP_FREERATE 0x10000000 8199484Sgarrett.damore@Sun.COM #define PCM_CAP_MODEM 0x20000000 /* NOT SUPPORTED */ 8209484Sgarrett.damore@Sun.COM #define PCM_CAP_DEFAULT 0x40000000 /* "Default" device */ 8219484Sgarrett.damore@Sun.COM 8229484Sgarrett.damore@Sun.COM /* 8239484Sgarrett.damore@Sun.COM * Preferred channel usage. These bits can be used to give 8249484Sgarrett.damore@Sun.COM * recommendations to the application. Used by few drivers. For 8259484Sgarrett.damore@Sun.COM * example if ((caps & DSP_CH_MASK) == DSP_CH_MONO) means that the 8269484Sgarrett.damore@Sun.COM * device works best in mono mode. However it doesn't necessarily mean 8279484Sgarrett.damore@Sun.COM * that the device cannot be used in stereo. These bits should only be 8289484Sgarrett.damore@Sun.COM * used by special applications such as multi track hard disk 8299484Sgarrett.damore@Sun.COM * recorders to find out the initial setup. However the user should be 8309484Sgarrett.damore@Sun.COM * able to override this selection. 8319484Sgarrett.damore@Sun.COM * 8329484Sgarrett.damore@Sun.COM * To find out which modes are actually supported the application 8339484Sgarrett.damore@Sun.COM * should try to select them using SNDCTL_DSP_CHANNELS. 8349484Sgarrett.damore@Sun.COM */ 8359484Sgarrett.damore@Sun.COM #define DSP_CH_MASK 0x06000000 /* Mask */ 8369484Sgarrett.damore@Sun.COM #define DSP_CH_ANY 0x00000000 /* No preferred mode */ 8379484Sgarrett.damore@Sun.COM #define DSP_CH_MONO 0x02000000 8389484Sgarrett.damore@Sun.COM #define DSP_CH_STEREO 0x04000000 8399484Sgarrett.damore@Sun.COM #define DSP_CH_MULTI 0x06000000 /* More than two channels */ 8409484Sgarrett.damore@Sun.COM 8419484Sgarrett.damore@Sun.COM 8429484Sgarrett.damore@Sun.COM /* 8439484Sgarrett.damore@Sun.COM * The PCM_CAP_* capability names used to be known as DSP_CAP_*, so 8449484Sgarrett.damore@Sun.COM * it's necessary to define the older names too. 8459484Sgarrett.damore@Sun.COM */ 8469484Sgarrett.damore@Sun.COM #define DSP_CAP_ADMASK PCM_CAP_ADMASK 8479484Sgarrett.damore@Sun.COM #define DSP_CAP_ANALOGIN PCM_CAP_ANALOGIN 8489484Sgarrett.damore@Sun.COM #define DSP_CAP_ANALOGOUT PCM_CAP_ANALOGOUT 8499484Sgarrett.damore@Sun.COM #define DSP_CAP_BATCH PCM_CAP_BATCH 8509484Sgarrett.damore@Sun.COM #define DSP_CAP_BIND PCM_CAP_BIND 8519484Sgarrett.damore@Sun.COM #define DSP_CAP_COPROC PCM_CAP_COPROC 8529484Sgarrett.damore@Sun.COM #define DSP_CAP_DEFAULT PCM_CAP_DEFAULT 8539484Sgarrett.damore@Sun.COM #define DSP_CAP_DIGITALIN PCM_CAP_DIGITALIN 8549484Sgarrett.damore@Sun.COM #define DSP_CAP_DIGITALOUT PCM_CAP_DIGITALOUT 8559484Sgarrett.damore@Sun.COM #define DSP_CAP_DUPLEX PCM_CAP_DUPLEX 8569484Sgarrett.damore@Sun.COM #define DSP_CAP_FREERATE PCM_CAP_FREERATE 8579484Sgarrett.damore@Sun.COM #define DSP_CAP_HIDDEN PCM_CAP_HIDDEN 8589484Sgarrett.damore@Sun.COM #define DSP_CAP_INPUT PCM_CAP_INPUT 8599484Sgarrett.damore@Sun.COM #define DSP_CAP_MMAP PCM_CAP_MMAP 8609484Sgarrett.damore@Sun.COM #define DSP_CAP_MODEM PCM_CAP_MODEM 8619484Sgarrett.damore@Sun.COM #define DSP_CAP_MULTI PCM_CAP_MULTI 8629484Sgarrett.damore@Sun.COM #define DSP_CAP_OUTPUT PCM_CAP_OUTPUT 8639484Sgarrett.damore@Sun.COM #define DSP_CAP_REALTIME PCM_CAP_REALTIME 8649484Sgarrett.damore@Sun.COM #define DSP_CAP_REVISION PCM_CAP_REVISION 8659484Sgarrett.damore@Sun.COM #define DSP_CAP_SHADOW PCM_CAP_SHADOW 8669484Sgarrett.damore@Sun.COM #define DSP_CAP_TRIGGER PCM_CAP_TRIGGER 8679484Sgarrett.damore@Sun.COM #define DSP_CAP_VIRTUAL PCM_CAP_VIRTUAL 8689484Sgarrett.damore@Sun.COM 8699484Sgarrett.damore@Sun.COM /* 8709484Sgarrett.damore@Sun.COM * SNDCTL_DSP_GETTRIGGER and SNDCTL_DSP_SETTRIGGER 8719484Sgarrett.damore@Sun.COM */ 8729484Sgarrett.damore@Sun.COM #define PCM_ENABLE_INPUT 0x00000001 8739484Sgarrett.damore@Sun.COM #define PCM_ENABLE_OUTPUT 0x00000002 8749484Sgarrett.damore@Sun.COM 8759484Sgarrett.damore@Sun.COM /* 8769484Sgarrett.damore@Sun.COM * SNDCTL_DSP_BIND_CHANNEL 8779484Sgarrett.damore@Sun.COM */ 8789484Sgarrett.damore@Sun.COM #define DSP_BIND_QUERY 0x00000000 8799484Sgarrett.damore@Sun.COM #define DSP_BIND_FRONT 0x00000001 8809484Sgarrett.damore@Sun.COM #define DSP_BIND_SURR 0x00000002 8819484Sgarrett.damore@Sun.COM #define DSP_BIND_CENTER_LFE 0x00000004 8829484Sgarrett.damore@Sun.COM #define DSP_BIND_HANDSET 0x00000008 8839484Sgarrett.damore@Sun.COM #define DSP_BIND_MIC 0x00000010 8849484Sgarrett.damore@Sun.COM #define DSP_BIND_MODEM1 0x00000020 8859484Sgarrett.damore@Sun.COM #define DSP_BIND_MODEM2 0x00000040 8869484Sgarrett.damore@Sun.COM #define DSP_BIND_I2S 0x00000080 8879484Sgarrett.damore@Sun.COM #define DSP_BIND_SPDIF 0x00000100 8889484Sgarrett.damore@Sun.COM #define DSP_BIND_REAR 0x00000200 8899484Sgarrett.damore@Sun.COM 8909484Sgarrett.damore@Sun.COM /* 8919484Sgarrett.damore@Sun.COM * SOUND_MIXER_READ_CAPS 8929484Sgarrett.damore@Sun.COM */ 8939484Sgarrett.damore@Sun.COM #define SOUND_CAP_EXCL_INPUT 0x00000001 8949484Sgarrett.damore@Sun.COM #define SOUND_CAP_NOLEGACY 0x00000004 8959484Sgarrett.damore@Sun.COM #define SOUND_CAP_NORECSRC 0x00000008 8969484Sgarrett.damore@Sun.COM 8979484Sgarrett.damore@Sun.COM /* 8989484Sgarrett.damore@Sun.COM * The following ioctl is for internal use only -- it is used to 8999484Sgarrett.damore@Sun.COM * coordinate /dev/sndstat numbering with file names in /dev/sound. 9009484Sgarrett.damore@Sun.COM * Applications must not use it. (This is duplicated in sys/audioio.h 9019484Sgarrett.damore@Sun.COM * as well.) 9029484Sgarrett.damore@Sun.COM */ 9039484Sgarrett.damore@Sun.COM #define SNDCTL_SUN_SEND_NUMBER __OSSIOW('X', 200, int) 9049484Sgarrett.damore@Sun.COM 9059484Sgarrett.damore@Sun.COM #ifdef __cplusplus 9069484Sgarrett.damore@Sun.COM } 9079484Sgarrett.damore@Sun.COM #endif 9089484Sgarrett.damore@Sun.COM 9099484Sgarrett.damore@Sun.COM #endif /* _SYS_AUDIO_OSS_H */ 910