| 1 | /* $NetBSD: soundcard.h,v 1.24 2014/09/09 10:45:18 nat Exp $ */ |
| 2 | |
| 3 | /*- |
| 4 | * Copyright (c) 1997 The NetBSD Foundation, Inc. |
| 5 | * All rights reserved. |
| 6 | * |
| 7 | * This code is derived from software contributed to The NetBSD Foundation |
| 8 | * by Lennart Augustsson. |
| 9 | * |
| 10 | * Redistribution and use in source and binary forms, with or without |
| 11 | * modification, are permitted provided that the following conditions |
| 12 | * are met: |
| 13 | * 1. Redistributions of source code must retain the above copyright |
| 14 | * notice, this list of conditions and the following disclaimer. |
| 15 | * 2. Redistributions in binary form must reproduce the above copyright |
| 16 | * notice, this list of conditions and the following disclaimer in the |
| 17 | * documentation and/or other materials provided with the distribution. |
| 18 | * |
| 19 | * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS |
| 20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED |
| 21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
| 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS |
| 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
| 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 29 | * POSSIBILITY OF SUCH DAMAGE. |
| 30 | */ |
| 31 | |
| 32 | /* |
| 33 | * WARNING! WARNING! |
| 34 | * This is an OSS (Linux) audio emulator. |
| 35 | * Use the Native NetBSD API for developing new code, and this |
| 36 | * only for compiling Linux programs. |
| 37 | */ |
| 38 | |
| 39 | #ifndef _SOUNDCARD_H_ |
| 40 | #define _SOUNDCARD_H_ |
| 41 | |
| 42 | #ifndef SOUND_VERSION |
| 43 | #define SOUND_VERSION 0x030001 |
| 44 | #endif |
| 45 | |
| 46 | #define SNDCTL_DSP_RESET _IO ('P', 0) |
| 47 | #define SNDCTL_DSP_SYNC _IO ('P', 1) |
| 48 | #define SNDCTL_DSP_SPEED _IOWR('P', 2, int) |
| 49 | #define SOUND_PCM_READ_RATE _IOR ('P', 2, int) |
| 50 | #define SNDCTL_DSP_STEREO _IOWR('P', 3, int) |
| 51 | #define SNDCTL_DSP_GETBLKSIZE _IOWR('P', 4, int) |
| 52 | #define SNDCTL_DSP_SETFMT _IOWR('P', 5, int) |
| 53 | #define AFMT_QUERY 0x00000000 |
| 54 | #define AFMT_MU_LAW 0x00000001 |
| 55 | #define AFMT_A_LAW 0x00000002 |
| 56 | #define AFMT_IMA_ADPCM 0x00000004 |
| 57 | #define AFMT_U8 0x00000008 |
| 58 | #define AFMT_S16_LE 0x00000010 |
| 59 | #define AFMT_S16_BE 0x00000020 |
| 60 | #define AFMT_S8 0x00000040 |
| 61 | #define AFMT_U16_LE 0x00000080 |
| 62 | #define AFMT_U16_BE 0x00000100 |
| 63 | #define AFMT_MPEG 0x00000200 |
| 64 | #define AFMT_AC3 0x00000400 |
| 65 | #define AFMT_S24_LE 0x00000800 |
| 66 | #define AFMT_S24_BE 0x00001000 |
| 67 | #define AFMT_S32_LE 0x00002000 |
| 68 | #define AFMT_S32_BE 0x00004000 |
| 69 | #define SNDCTL_DSP_SAMPLESIZE SNDCTL_DSP_SETFMT |
| 70 | #define SOUND_PCM_READ_BITS _IOR ('P', 5, int) |
| 71 | #define SNDCTL_DSP_CHANNELS _IOWR('P', 6, int) |
| 72 | #define SOUND_PCM_WRITE_CHANNELS SNDCTL_DSP_CHANNELS |
| 73 | #define SOUND_PCM_READ_CHANNELS _IOR ('P', 6, int) |
| 74 | #define SOUND_PCM_WRITE_FILTER _IOWR('P', 7, int) |
| 75 | #define SOUND_PCM_READ_FILTER _IOR ('P', 7, int) |
| 76 | #define SNDCTL_DSP_POST _IO ('P', 8) |
| 77 | #define SNDCTL_DSP_SUBDIVIDE _IOWR('P', 9, int) |
| 78 | #define SNDCTL_DSP_SETFRAGMENT _IOWR('P', 10, int) |
| 79 | #define SNDCTL_DSP_GETFMTS _IOR ('P', 11, int) |
| 80 | #define SNDCTL_DSP_GETOSPACE _IOR ('P',12, struct audio_buf_info) |
| 81 | #define SNDCTL_DSP_GETISPACE _IOR ('P',13, struct audio_buf_info) |
| 82 | #define SNDCTL_DSP_NONBLOCK _IO ('P',14) |
| 83 | #define SNDCTL_DSP_GETCAPS _IOR ('P',15, int) |
| 84 | # define DSP_CAP_REVISION 0x000000ff |
| 85 | # define DSP_CAP_DUPLEX 0x00000100 |
| 86 | # define DSP_CAP_REALTIME 0x00000200 |
| 87 | # define DSP_CAP_BATCH 0x00000400 |
| 88 | # define DSP_CAP_COPROC 0x00000800 |
| 89 | # define DSP_CAP_TRIGGER 0x00001000 |
| 90 | # define DSP_CAP_MMAP 0x00002000 |
| 91 | # define PCM_CAP_INPUT 0x00004000 |
| 92 | # define PCM_CAP_OUTPUT 0x00008000 |
| 93 | # define PCM_CAP_MODEM 0x00010000 |
| 94 | # define PCM_CAP_HIDDEN 0x00020000 |
| 95 | #define SNDCTL_DSP_GETTRIGGER _IOR ('P', 16, int) |
| 96 | #define SNDCTL_DSP_SETTRIGGER _IOW ('P', 16, int) |
| 97 | # define PCM_ENABLE_INPUT 0x00000001 |
| 98 | # define PCM_ENABLE_OUTPUT 0x00000002 |
| 99 | #define SNDCTL_DSP_GETIPTR _IOR ('P', 17, struct count_info) |
| 100 | #define SNDCTL_DSP_GETOPTR _IOR ('P', 18, struct count_info) |
| 101 | #define SNDCTL_DSP_MAPINBUF _IOR ('P', 19, struct buffmem_desc) |
| 102 | #define SNDCTL_DSP_MAPOUTBUF _IOR ('P', 20, struct buffmem_desc) |
| 103 | #define SNDCTL_DSP_SETSYNCRO _IO ('P', 21) |
| 104 | #define SNDCTL_DSP_SETDUPLEX _IO ('P', 22) |
| 105 | #define SNDCTL_DSP_PROFILE _IOW ('P', 23, int) |
| 106 | #define SNDCTL_DSP_GETODELAY _IOR ('P', 23, int) |
| 107 | #define APF_NORMAL 0 |
| 108 | #define APF_NETWORK 1 |
| 109 | #define APF_CPUINTENS 2 |
| 110 | |
| 111 | /* Need native 16 bit format which depends on byte order */ |
| 112 | #include <machine/endian_machdep.h> |
| 113 | #if _BYTE_ORDER == _LITTLE_ENDIAN |
| 114 | #define AFMT_S16_NE AFMT_S16_LE |
| 115 | #define AFMT_S16_OE AFMT_S16_BE |
| 116 | #define AFMT_S24_NE AFMT_S24_LE |
| 117 | #define AFMT_S24_OE AFMT_S24_BE |
| 118 | #define AFMT_S32_NE AFMT_S32_LE |
| 119 | #define AFMT_S32_OE AFMT_S32_BE |
| 120 | #else |
| 121 | #define AFMT_S16_NE AFMT_S16_BE |
| 122 | #define AFMT_S16_OE AFMT_S16_LE |
| 123 | #define AFMT_S24_NE AFMT_S24_BE |
| 124 | #define AFMT_S24_OE AFMT_S24_LE |
| 125 | #define AFMT_S32_NE AFMT_S32_BE |
| 126 | #define AFMT_S32_OE AFMT_S32_LE |
| 127 | #endif |
| 128 | |
| 129 | /* Aliases */ |
| 130 | #define SOUND_PCM_WRITE_BITS SNDCTL_DSP_SETFMT |
| 131 | #define SOUND_PCM_WRITE_RATE SNDCTL_DSP_SPEED |
| 132 | #define SOUND_PCM_POST SNDCTL_DSP_POST |
| 133 | #define SOUND_PCM_RESET SNDCTL_DSP_RESET |
| 134 | #define SOUND_PCM_SYNC SNDCTL_DSP_SYNC |
| 135 | #define SOUND_PCM_SUBDIVIDE SNDCTL_DSP_SUBDIVIDE |
| 136 | #define SOUND_PCM_SETFRAGMENT SNDCTL_DSP_SETFRAGMENT |
| 137 | #define SOUND_PCM_GETFMTS SNDCTL_DSP_GETFMTS |
| 138 | #define SOUND_PCM_SETFMT SNDCTL_DSP_SETFMT |
| 139 | #define SOUND_PCM_GETOSPACE SNDCTL_DSP_GETOSPACE |
| 140 | #define SOUND_PCM_GETISPACE SNDCTL_DSP_GETISPACE |
| 141 | #define SOUND_PCM_NONBLOCK SNDCTL_DSP_NONBLOCK |
| 142 | #define SOUND_PCM_GETCAPS SNDCTL_DSP_GETCAPS |
| 143 | #define SOUND_PCM_GETTRIGGER SNDCTL_DSP_GETTRIGGER |
| 144 | #define SOUND_PCM_SETTRIGGER SNDCTL_DSP_SETTRIGGER |
| 145 | #define SOUND_PCM_SETSYNCRO SNDCTL_DSP_SETSYNCRO |
| 146 | #define SOUND_PCM_GETIPTR SNDCTL_DSP_GETIPTR |
| 147 | #define SOUND_PCM_GETOPTR SNDCTL_DSP_GETOPTR |
| 148 | #define SOUND_PCM_MAPINBUF SNDCTL_DSP_MAPINBUF |
| 149 | #define SOUND_PCM_MAPOUTBUF SNDCTL_DSP_MAPOUTBUF |
| 150 | |
| 151 | /* Mixer defines */ |
| 152 | #define SOUND_MIXER_FIRST 0 |
| 153 | #define SOUND_MIXER_NRDEVICES 25 |
| 154 | |
| 155 | #define SOUND_MIXER_VOLUME 0 |
| 156 | #define SOUND_MIXER_BASS 1 |
| 157 | #define SOUND_MIXER_TREBLE 2 |
| 158 | #define SOUND_MIXER_SYNTH 3 |
| 159 | #define SOUND_MIXER_PCM 4 |
| 160 | #define SOUND_MIXER_SPEAKER 5 |
| 161 | #define SOUND_MIXER_LINE 6 |
| 162 | #define SOUND_MIXER_MIC 7 |
| 163 | #define SOUND_MIXER_CD 8 |
| 164 | #define SOUND_MIXER_IMIX 9 |
| 165 | #define SOUND_MIXER_ALTPCM 10 |
| 166 | #define SOUND_MIXER_RECLEV 11 |
| 167 | #define SOUND_MIXER_IGAIN 12 |
| 168 | #define SOUND_MIXER_OGAIN 13 |
| 169 | #define SOUND_MIXER_LINE1 14 |
| 170 | #define SOUND_MIXER_LINE2 15 |
| 171 | #define SOUND_MIXER_LINE3 16 |
| 172 | #define SOUND_MIXER_DIGITAL1 17 |
| 173 | #define SOUND_MIXER_DIGITAL2 18 |
| 174 | #define SOUND_MIXER_DIGITAL3 19 |
| 175 | #define SOUND_MIXER_PHONEIN 20 |
| 176 | #define SOUND_MIXER_PHONEOUT 21 |
| 177 | #define SOUND_MIXER_VIDEO 22 |
| 178 | #define SOUND_MIXER_RADIO 23 |
| 179 | #define SOUND_MIXER_MONITOR 24 |
| 180 | |
| 181 | #define SOUND_ONOFF_MIN 28 |
| 182 | #define SOUND_ONOFF_MAX 30 |
| 183 | |
| 184 | #define SOUND_MIXER_NONE 31 |
| 185 | |
| 186 | #define SOUND_DEVICE_LABELS {"Vol ", "Bass ", "Trebl", "Synth", "Pcm ", "Spkr ", "Line ", \ |
| 187 | "Mic ", "CD ", "Mix ", "Pcm2 ", "Rec ", "IGain", "OGain", \ |
| 188 | "Line1", "Line2", "Line3", "Digital1", "Digital2", "Digital3", \ |
| 189 | "PhoneIn", "PhoneOut", "Video", "Radio", "Monitor"} |
| 190 | |
| 191 | #define SOUND_DEVICE_NAMES {"vol", "bass", "treble", "synth", "pcm", "speaker", "line", \ |
| 192 | "mic", "cd", "mix", "pcm2", "rec", "igain", "ogain", \ |
| 193 | "line1", "line2", "line3", "dig1", "dig2", "dig3", \ |
| 194 | "phin", "phout", "video", "radio", "monitor"} |
| 195 | |
| 196 | #define SOUND_MIXER_RECSRC 0xff |
| 197 | #define SOUND_MIXER_DEVMASK 0xfe |
| 198 | #define SOUND_MIXER_RECMASK 0xfd |
| 199 | #define SOUND_MIXER_CAPS 0xfc |
| 200 | #define SOUND_CAP_EXCL_INPUT 1 |
| 201 | #define SOUND_MIXER_STEREODEVS 0xfb |
| 202 | |
| 203 | #define MIXER_READ(dev) _IOR('M', dev, int) |
| 204 | |
| 205 | #define SOUND_MIXER_READ_RECSRC MIXER_READ(SOUND_MIXER_RECSRC) |
| 206 | #define SOUND_MIXER_READ_DEVMASK MIXER_READ(SOUND_MIXER_DEVMASK) |
| 207 | #define SOUND_MIXER_READ_RECMASK MIXER_READ(SOUND_MIXER_RECMASK) |
| 208 | #define SOUND_MIXER_READ_STEREODEVS MIXER_READ(SOUND_MIXER_STEREODEVS) |
| 209 | #define SOUND_MIXER_READ_CAPS MIXER_READ(SOUND_MIXER_CAPS) |
| 210 | |
| 211 | #define SOUND_MIXER_READ_VOLUME MIXER_READ(SOUND_MIXER_VOLUME) |
| 212 | #define SOUND_MIXER_READ_BASS MIXER_READ(SOUND_MIXER_BASS) |
| 213 | #define SOUND_MIXER_READ_TREBLE MIXER_READ(SOUND_MIXER_TREBLE) |
| 214 | #define SOUND_MIXER_READ_SYNTH MIXER_READ(SOUND_MIXER_SYNTH) |
| 215 | #define SOUND_MIXER_READ_PCM MIXER_READ(SOUND_MIXER_PCM) |
| 216 | #define SOUND_MIXER_READ_SPEAKER MIXER_READ(SOUND_MIXER_SPEAKER) |
| 217 | #define SOUND_MIXER_READ_LINE MIXER_READ(SOUND_MIXER_LINE) |
| 218 | #define SOUND_MIXER_READ_MIC MIXER_READ(SOUND_MIXER_MIC) |
| 219 | #define SOUND_MIXER_READ_CD MIXER_READ(SOUND_MIXER_CD) |
| 220 | #define SOUND_MIXER_READ_IMIX MIXER_READ(SOUND_MIXER_IMIX) |
| 221 | #define SOUND_MIXER_READ_ALTPCM MIXER_READ(SOUND_MIXER_ALTPCM) |
| 222 | #define SOUND_MIXER_READ_RECLEV MIXER_READ(SOUND_MIXER_RECLEV) |
| 223 | #define SOUND_MIXER_READ_IGAIN MIXER_READ(SOUND_MIXER_IGAIN) |
| 224 | #define SOUND_MIXER_READ_OGAIN MIXER_READ(SOUND_MIXER_OGAIN) |
| 225 | #define SOUND_MIXER_READ_LINE1 MIXER_READ(SOUND_MIXER_LINE1) |
| 226 | #define SOUND_MIXER_READ_LINE2 MIXER_READ(SOUND_MIXER_LINE2) |
| 227 | #define SOUND_MIXER_READ_LINE3 MIXER_READ(SOUND_MIXER_LINE3) |
| 228 | |
| 229 | #define MIXER_WRITE(dev) _IOW ('M', dev, int) |
| 230 | #define MIXER_WRITE_R(dev) _IOWR('M', dev, int) |
| 231 | |
| 232 | #define SOUND_MIXER_WRITE_RECSRC MIXER_WRITE(SOUND_MIXER_RECSRC) |
| 233 | #define SOUND_MIXER_WRITE_R_RECSRC MIXER_WRITE_R(SOUND_MIXER_RECSRC) |
| 234 | |
| 235 | #define SOUND_MIXER_WRITE_VOLUME MIXER_WRITE(SOUND_MIXER_VOLUME) |
| 236 | #define SOUND_MIXER_WRITE_BASS MIXER_WRITE(SOUND_MIXER_BASS) |
| 237 | #define SOUND_MIXER_WRITE_TREBLE MIXER_WRITE(SOUND_MIXER_TREBLE) |
| 238 | #define SOUND_MIXER_WRITE_SYNTH MIXER_WRITE(SOUND_MIXER_SYNTH) |
| 239 | #define SOUND_MIXER_WRITE_PCM MIXER_WRITE(SOUND_MIXER_PCM) |
| 240 | #define SOUND_MIXER_WRITE_SPEAKER MIXER_WRITE(SOUND_MIXER_SPEAKER) |
| 241 | #define SOUND_MIXER_WRITE_LINE MIXER_WRITE(SOUND_MIXER_LINE) |
| 242 | #define SOUND_MIXER_WRITE_MIC MIXER_WRITE(SOUND_MIXER_MIC) |
| 243 | #define SOUND_MIXER_WRITE_CD MIXER_WRITE(SOUND_MIXER_CD) |
| 244 | #define SOUND_MIXER_WRITE_IMIX MIXER_WRITE(SOUND_MIXER_IMIX) |
| 245 | #define SOUND_MIXER_WRITE_ALTPCM MIXER_WRITE(SOUND_MIXER_ALTPCM) |
| 246 | #define SOUND_MIXER_WRITE_RECLEV MIXER_WRITE(SOUND_MIXER_RECLEV) |
| 247 | #define SOUND_MIXER_WRITE_IGAIN MIXER_WRITE(SOUND_MIXER_IGAIN) |
| 248 | #define SOUND_MIXER_WRITE_OGAIN MIXER_WRITE(SOUND_MIXER_OGAIN) |
| 249 | #define SOUND_MIXER_WRITE_LINE1 MIXER_WRITE(SOUND_MIXER_LINE1) |
| 250 | #define SOUND_MIXER_WRITE_LINE2 MIXER_WRITE(SOUND_MIXER_LINE2) |
| 251 | #define SOUND_MIXER_WRITE_LINE3 MIXER_WRITE(SOUND_MIXER_LINE3) |
| 252 | |
| 253 | #define SOUND_MASK_VOLUME (1 << SOUND_MIXER_VOLUME) |
| 254 | #define SOUND_MASK_BASS (1 << SOUND_MIXER_BASS) |
| 255 | #define SOUND_MASK_TREBLE (1 << SOUND_MIXER_TREBLE) |
| 256 | #define SOUND_MASK_SYNTH (1 << SOUND_MIXER_SYNTH) |
| 257 | #define SOUND_MASK_PCM (1 << SOUND_MIXER_PCM) |
| 258 | #define SOUND_MASK_SPEAKER (1 << SOUND_MIXER_SPEAKER) |
| 259 | #define SOUND_MASK_LINE (1 << SOUND_MIXER_LINE) |
| 260 | #define SOUND_MASK_MIC (1 << SOUND_MIXER_MIC) |
| 261 | #define SOUND_MASK_CD (1 << SOUND_MIXER_CD) |
| 262 | #define SOUND_MASK_IMIX (1 << SOUND_MIXER_IMIX) |
| 263 | #define SOUND_MASK_ALTPCM (1 << SOUND_MIXER_ALTPCM) |
| 264 | #define SOUND_MASK_RECLEV (1 << SOUND_MIXER_RECLEV) |
| 265 | #define SOUND_MASK_IGAIN (1 << SOUND_MIXER_IGAIN) |
| 266 | #define SOUND_MASK_OGAIN (1 << SOUND_MIXER_OGAIN) |
| 267 | #define SOUND_MASK_LINE1 (1 << SOUND_MIXER_LINE1) |
| 268 | #define SOUND_MASK_LINE2 (1 << SOUND_MIXER_LINE2) |
| 269 | #define SOUND_MASK_LINE3 (1 << SOUND_MIXER_LINE3) |
| 270 | #define SOUND_MASK_DIGITAL1 (1 << SOUND_MIXER_DIGITAL1) |
| 271 | #define SOUND_MASK_DIGITAL2 (1 << SOUND_MIXER_DIGITAL2) |
| 272 | #define SOUND_MASK_DIGITAL3 (1 << SOUND_MIXER_DIGITAL3) |
| 273 | #define SOUND_MASK_PHONEIN (1 << SOUND_MIXER_PHONEIN) |
| 274 | #define SOUND_MASK_PHONEOUT (1 << SOUND_MIXER_PHONEOUT) |
| 275 | #define SOUND_MASK_VIDEO (1 << SOUND_MIXER_VIDEO) |
| 276 | #define SOUND_MASK_RADIO (1 << SOUND_MIXER_RADIO) |
| 277 | #define SOUND_MASK_MONITOR (1 << SOUND_MIXER_MONITOR) |
| 278 | |
| 279 | typedef struct mixer_info { |
| 280 | char id[16]; |
| 281 | char name[32]; |
| 282 | int modify_counter; |
| 283 | int fillers[10]; |
| 284 | } mixer_info; |
| 285 | |
| 286 | typedef struct _old_mixer_info { |
| 287 | char id[16]; |
| 288 | char name[32]; |
| 289 | } _old_mixer_info; |
| 290 | |
| 291 | #define SOUND_MIXER_INFO _IOR('M', 101, mixer_info) |
| 292 | #define SOUND_OLD_MIXER_INFO _IOR('M', 101, _old_mixer_info) |
| 293 | |
| 294 | #define OSS_GETVERSION _IOR ('M', 118, int) |
| 295 | |
| 296 | typedef struct audio_buf_info { |
| 297 | int fragments; |
| 298 | int fragstotal; |
| 299 | int fragsize; |
| 300 | int bytes; |
| 301 | } audio_buf_info; |
| 302 | |
| 303 | typedef struct count_info { |
| 304 | int bytes; |
| 305 | int blocks; |
| 306 | int ptr; |
| 307 | } count_info; |
| 308 | |
| 309 | typedef struct buffmem_desc { |
| 310 | unsigned int *buffer; |
| 311 | int size; |
| 312 | } buffmem_desc; |
| 313 | |
| 314 | /* Some OSSv4 calls. */ |
| 315 | |
| 316 | #define OSS_DEVNODE_SIZE 32 |
| 317 | #define OSS_LABEL_SIZE 16 |
| 318 | #define OSS_LONGNAME_SIZE 64 |
| 319 | #define OSS_MAX_AUDIO_DEVS 64 |
| 320 | |
| 321 | #define SNDCTL_SYSINFO _IOR ('P',24, struct oss_sysinfo) |
| 322 | #define SNDCTL_AUDIOINFO _IOWR ('P',25, struct oss_audioinfo) |
| 323 | #define SNDCTL_ENGINEINFO _IOWR ('P',26, struct oss_audioinfo) |
| 324 | #define SNDCTL_DSP_GETPLAYVOL _IOR ('P',27, uint) |
| 325 | #define SNDCTL_DSP_SETPLAYVOL _IOW ('P',28, uint) |
| 326 | #define SNDCTL_DSP_GETRECVOL _IOR ('P',29, uint) |
| 327 | #define SNDCTL_DSP_SETRECVOL _IOW ('P',30, uint) |
| 328 | #define SNDCTL_DSP_SKIP _IO ('P',31) |
| 329 | #define SNDCTL_DSP_SILENCE _IO ('P',32) |
| 330 | |
| 331 | typedef struct oss_sysinfo { |
| 332 | char product[32]; |
| 333 | char version[32]; |
| 334 | int versionnum; |
| 335 | char options[128]; /* Future use */ |
| 336 | int numaudios; |
| 337 | int openedaudio[8]; /* Obsolete */ |
| 338 | int numsynths; /* Obsolete */ |
| 339 | int nummidis; |
| 340 | int numtimers; |
| 341 | int nummixers; |
| 342 | int openedmidi[8]; |
| 343 | int numcards; |
| 344 | int numaudioengines; |
| 345 | char license[16]; |
| 346 | char revision_info[256]; /* Internal Use */ |
| 347 | int filler[172]; /* For expansion */ |
| 348 | } oss_sysinfo; |
| 349 | |
| 350 | typedef struct oss_audioinfo { |
| 351 | int dev; /* Set by caller */ |
| 352 | char name[OSS_LONGNAME_SIZE]; |
| 353 | int busy; |
| 354 | int pid; |
| 355 | int caps; |
| 356 | int iformats; |
| 357 | int oformats; |
| 358 | int magic; /* Unused */ |
| 359 | char cmd[OSS_LONGNAME_SIZE]; |
| 360 | int card_number; |
| 361 | int port_number; |
| 362 | int mixer_dev; |
| 363 | int legacy_device; /* Obsolete */ |
| 364 | int enabled; |
| 365 | int flags; /* Reserved */ |
| 366 | int min_rate; |
| 367 | int max_rate; |
| 368 | int min_channels; |
| 369 | int max_channels; |
| 370 | int binding; /* Reserved */ |
| 371 | int rate_source; |
| 372 | char handle[32]; |
| 373 | #define OSS_MAX_SAMPLE_RATES 20 |
| 374 | int nrates; |
| 375 | int rates[OSS_MAX_SAMPLE_RATES]; |
| 376 | char song_name[OSS_LONGNAME_SIZE]; |
| 377 | char label[OSS_LABEL_SIZE]; |
| 378 | int latency; /* In usecs -1 = unknown */ |
| 379 | char devnode[OSS_DEVNODE_SIZE]; |
| 380 | int next_play_engine; |
| 381 | int next_rec_engine; |
| 382 | int filler[184]; /* For expansion */ |
| 383 | } oss_audioinfo; |
| 384 | |
| 385 | #define ioctl _oss_ioctl |
| 386 | /* |
| 387 | * If we already included <sys/ioctl.h>, then we define our own prototype, |
| 388 | * else we depend on <sys/ioctl.h> to do it for us. We do it this way, so |
| 389 | * that we don't define the prototype twice. |
| 390 | */ |
| 391 | #ifndef _SYS_IOCTL_H_ |
| 392 | #include <sys/ioctl.h> |
| 393 | #else |
| 394 | __BEGIN_DECLS |
| 395 | int _oss_ioctl(int, unsigned long, ...); |
| 396 | __END_DECLS |
| 397 | #endif |
| 398 | |
| 399 | #endif /* !_SOUNDCARD_H_ */ |
| 400 | |