| @@ -1,591 +1,616 @@ | | | @@ -1,591 +1,616 @@ |
1 | /* $NetBSD: soundcard.h,v 1.31 2020/10/23 09:05:20 nia Exp $ */ | | 1 | /* $NetBSD: soundcard.h,v 1.32 2020/11/03 09:33:53 nia Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 1997, 2020 The NetBSD Foundation, Inc. | | 4 | * Copyright (c) 1997, 2020 The NetBSD Foundation, Inc. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from software contributed to The NetBSD Foundation | | 7 | * This code is derived from software contributed to The NetBSD Foundation |
8 | * by Lennart Augustsson and Nia Alarie. | | 8 | * by Lennart Augustsson and Nia Alarie. |
9 | * | | 9 | * |
10 | * Redistribution and use in source and binary forms, with or without | | 10 | * Redistribution and use in source and binary forms, with or without |
11 | * modification, are permitted provided that the following conditions | | 11 | * modification, are permitted provided that the following conditions |
12 | * are met: | | 12 | * are met: |
13 | * 1. Redistributions of source code must retain the above copyright | | 13 | * 1. Redistributions of source code must retain the above copyright |
14 | * notice, this list of conditions and the following disclaimer. | | 14 | * notice, this list of conditions and the following disclaimer. |
15 | * 2. Redistributions in binary form must reproduce the above copyright | | 15 | * 2. Redistributions in binary form must reproduce the above copyright |
16 | * notice, this list of conditions and the following disclaimer in the | | 16 | * notice, this list of conditions and the following disclaimer in the |
17 | * documentation and/or other materials provided with the distribution. | | 17 | * documentation and/or other materials provided with the distribution. |
18 | * | | 18 | * |
19 | * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | | 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 | | 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 | | 21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | | 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS |
23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | | 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | | 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | | 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 | | 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | | 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 | | 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
29 | * POSSIBILITY OF SUCH DAMAGE. | | 29 | * POSSIBILITY OF SUCH DAMAGE. |
30 | */ | | 30 | */ |
31 | | | 31 | |
32 | /* | | 32 | /* |
33 | * WARNING! WARNING! | | 33 | * WARNING! WARNING! |
34 | * This is an Open Sound System compatibility layer. | | 34 | * This is an Open Sound System compatibility layer. |
35 | * Use the Native NetBSD API in <sys/audioio.h> for developing new code, | | 35 | * Use the Native NetBSD API in <sys/audioio.h> for developing new code, |
36 | * and this only for compiling programs written for other operating systems. | | 36 | * and this only for compiling programs written for other operating systems. |
37 | */ | | 37 | */ |
38 | | | 38 | |
39 | #ifndef _SOUNDCARD_H_ | | 39 | #ifndef _SOUNDCARD_H_ |
40 | #define _SOUNDCARD_H_ | | 40 | #define _SOUNDCARD_H_ |
41 | | | 41 | |
42 | #ifndef SOUND_VERSION | | 42 | #ifndef SOUND_VERSION |
43 | #define SOUND_VERSION 0x030001 | | 43 | #define SOUND_VERSION 0x030001 |
44 | #endif | | 44 | #endif |
45 | | | 45 | |
46 | #define SNDCTL_DSP_RESET _IO ('P', 0) | | 46 | #define SNDCTL_DSP_RESET _IO ('P', 0) |
47 | #define SNDCTL_DSP_SYNC _IO ('P', 1) | | 47 | #define SNDCTL_DSP_SYNC _IO ('P', 1) |
48 | #define SNDCTL_DSP_SPEED _IOWR('P', 2, int) | | 48 | #define SNDCTL_DSP_SPEED _IOWR('P', 2, int) |
49 | #define SOUND_PCM_READ_RATE _IOR ('P', 2, int) | | 49 | #define SOUND_PCM_READ_RATE _IOR ('P', 2, int) |
50 | #define SNDCTL_DSP_STEREO _IOWR('P', 3, int) | | 50 | #define SNDCTL_DSP_STEREO _IOWR('P', 3, int) |
51 | #define SNDCTL_DSP_GETBLKSIZE _IOWR('P', 4, int) | | 51 | #define SNDCTL_DSP_GETBLKSIZE _IOWR('P', 4, int) |
52 | #define SNDCTL_DSP_SETFMT _IOWR('P', 5, int) | | 52 | #define SNDCTL_DSP_SETFMT _IOWR('P', 5, int) |
53 | #define AFMT_QUERY 0x00000000 | | 53 | #define AFMT_QUERY 0x00000000 |
54 | #define AFMT_MU_LAW 0x00000001 | | 54 | #define AFMT_MU_LAW 0x00000001 |
55 | #define AFMT_A_LAW 0x00000002 | | 55 | #define AFMT_A_LAW 0x00000002 |
56 | #define AFMT_IMA_ADPCM 0x00000004 | | 56 | #define AFMT_IMA_ADPCM 0x00000004 |
57 | #define AFMT_U8 0x00000008 | | 57 | #define AFMT_U8 0x00000008 |
58 | #define AFMT_S16_LE 0x00000010 | | 58 | #define AFMT_S16_LE 0x00000010 |
59 | #define AFMT_S16_BE 0x00000020 | | 59 | #define AFMT_S16_BE 0x00000020 |
60 | #define AFMT_S8 0x00000040 | | 60 | #define AFMT_S8 0x00000040 |
61 | #define AFMT_U16_LE 0x00000080 | | 61 | #define AFMT_U16_LE 0x00000080 |
62 | #define AFMT_U16_BE 0x00000100 | | 62 | #define AFMT_U16_BE 0x00000100 |
63 | #define AFMT_MPEG 0x00000200 | | 63 | #define AFMT_MPEG 0x00000200 |
64 | #define AFMT_AC3 0x00000400 | | 64 | #define AFMT_AC3 0x00000400 |
65 | #define AFMT_S24_LE 0x00000800 | | 65 | #define AFMT_S24_LE 0x00000800 |
66 | #define AFMT_S24_BE 0x00001000 | | 66 | #define AFMT_S24_BE 0x00001000 |
67 | #define AFMT_S32_LE 0x00002000 | | 67 | #define AFMT_S32_LE 0x00002000 |
68 | #define AFMT_S32_BE 0x00004000 | | 68 | #define AFMT_S32_BE 0x00004000 |
69 | #define SNDCTL_DSP_SAMPLESIZE SNDCTL_DSP_SETFMT | | 69 | #define SNDCTL_DSP_SAMPLESIZE SNDCTL_DSP_SETFMT |
70 | #define SOUND_PCM_READ_BITS _IOR ('P', 5, int) | | 70 | #define SOUND_PCM_READ_BITS _IOR ('P', 5, int) |
71 | #define SNDCTL_DSP_CHANNELS _IOWR('P', 6, int) | | 71 | #define SNDCTL_DSP_CHANNELS _IOWR('P', 6, int) |
72 | #define SOUND_PCM_WRITE_CHANNELS SNDCTL_DSP_CHANNELS | | 72 | #define SOUND_PCM_WRITE_CHANNELS SNDCTL_DSP_CHANNELS |
73 | #define SOUND_PCM_READ_CHANNELS _IOR ('P', 6, int) | | 73 | #define SOUND_PCM_READ_CHANNELS _IOR ('P', 6, int) |
74 | #define SOUND_PCM_WRITE_FILTER _IOWR('P', 7, int) | | 74 | #define SOUND_PCM_WRITE_FILTER _IOWR('P', 7, int) |
75 | #define SOUND_PCM_READ_FILTER _IOR ('P', 7, int) | | 75 | #define SOUND_PCM_READ_FILTER _IOR ('P', 7, int) |
76 | #define SNDCTL_DSP_POST _IO ('P', 8) | | 76 | #define SNDCTL_DSP_POST _IO ('P', 8) |
77 | #define SNDCTL_DSP_SUBDIVIDE _IOWR('P', 9, int) | | 77 | #define SNDCTL_DSP_SUBDIVIDE _IOWR('P', 9, int) |
78 | #define SNDCTL_DSP_SETFRAGMENT _IOWR('P', 10, int) | | 78 | #define SNDCTL_DSP_SETFRAGMENT _IOWR('P', 10, int) |
79 | #define SNDCTL_DSP_GETFMTS _IOR ('P', 11, int) | | 79 | #define SNDCTL_DSP_GETFMTS _IOR ('P', 11, int) |
80 | #define SNDCTL_DSP_GETOSPACE _IOR ('P',12, struct audio_buf_info) | | 80 | #define SNDCTL_DSP_GETOSPACE _IOR ('P',12, struct audio_buf_info) |
81 | #define SNDCTL_DSP_GETISPACE _IOR ('P',13, struct audio_buf_info) | | 81 | #define SNDCTL_DSP_GETISPACE _IOR ('P',13, struct audio_buf_info) |
82 | #define SNDCTL_DSP_NONBLOCK _IO ('P',14) | | 82 | #define SNDCTL_DSP_NONBLOCK _IO ('P',14) |
83 | #define SNDCTL_DSP_GETCAPS _IOR ('P',15, int) | | 83 | #define SNDCTL_DSP_GETCAPS _IOR ('P',15, int) |
84 | # define DSP_CAP_REVISION 0x000000ff | | 84 | /* PCM_CAP_* were known as DSP_CAP_ before OSS 4.0 */ |
85 | # define DSP_CAP_DUPLEX 0x00000100 | | 85 | # define DSP_CAP_REVISION PCM_CAP_REVISION |
86 | # define DSP_CAP_REALTIME 0x00000200 | | 86 | # define DSP_CAP_DUPLEX PCM_CAP_DUPLEX |
87 | # define DSP_CAP_BATCH 0x00000400 | | 87 | # define DSP_CAP_REALTIME PCM_CAP_REALTIME |
88 | # define DSP_CAP_COPROC 0x00000800 | | 88 | # define DSP_CAP_BATCH PCM_CAP_BATCH |
89 | # define DSP_CAP_TRIGGER 0x00001000 | | 89 | # define DSP_CAP_COPROC PCM_CAP_COPROC |
90 | # define DSP_CAP_MMAP 0x00002000 | | 90 | # define DSP_CAP_TRIGGER PCM_CAP_TRIGGER |
91 | # define PCM_CAP_INPUT 0x00004000 | | 91 | # define DSP_CAP_MMAP PCM_CAP_MMAP |
92 | # define PCM_CAP_OUTPUT 0x00008000 | | 92 | # define DSP_CAP_INPUT PCM_CAP_INPUT |
93 | # define PCM_CAP_MODEM 0x00010000 | | 93 | # define DSP_CAP_OUTPUT PCM_CAP_OUTPUT |
94 | # define PCM_CAP_HIDDEN 0x00020000 | | 94 | # define DSP_CAP_MODEM PCM_CAP_MODEM |
| | | 95 | # define DSP_CAP_HIDDEN PCM_CAP_HIDDEN |
| | | 96 | # define DSP_CAP_VIRTUAL PCM_CAP_VIRTUAL |
| | | 97 | # define DSP_CAP_ANALOGOUT PCM_CAP_ANALOGOUT |
| | | 98 | # define DSP_CAP_ANALOGIN PCM_CAP_ANALOGIN |
| | | 99 | # define DSP_CAP_DIGITALOUT PCM_CAP_DIGITALOUT |
| | | 100 | # define DSP_CAP_DIGITALIN PCM_CAP_DIGITALIN |
| | | 101 | # define DSP_CAP_ADMASK PCM_CAP_ADMASK |
| | | 102 | # define PCM_CAP_REVISION 0x000000ff /* Unused in NetBSD */ |
| | | 103 | # define PCM_CAP_DUPLEX 0x00000100 /* Full duplex */ |
| | | 104 | # define PCM_CAP_REALTIME 0x00000200 /* Unused in NetBSD */ |
| | | 105 | # define PCM_CAP_BATCH 0x00000400 /* Unused in NetBSD */ |
| | | 106 | # define PCM_CAP_COPROC 0x00000800 /* Unused in NetBSD */ |
| | | 107 | # define PCM_CAP_TRIGGER 0x00001000 /* Supports SETTRIGGER */ |
| | | 108 | # define PCM_CAP_MMAP 0x00002000 /* Supports mmap() */ |
| | | 109 | # define PCM_CAP_INPUT 0x00004000 /* Recording device */ |
| | | 110 | # define PCM_CAP_OUTPUT 0x00008000 /* Playback device */ |
| | | 111 | # define PCM_CAP_MODEM 0x00010000 /* Unused in NetBSD */ |
| | | 112 | # define PCM_CAP_HIDDEN 0x00020000 /* Unused in NetBSD */ |
| | | 113 | # define PCM_CAP_VIRTUAL 0x00040000 /* Unused in NetBSD */ |
| | | 114 | # define PCM_CAP_ANALOGOUT 0x00100000 /* Unused in NetBSD */ |
| | | 115 | # define PCM_CAP_ANALOGIN 0x00200000 /* Unused in NetBSD */ |
| | | 116 | # define PCM_CAP_DIGITALOUT 0x00400000 /* Unused in NetBSD */ |
| | | 117 | # define PCM_CAP_DIGITALIN 0x00800000 /* Unused in NetBSD */ |
| | | 118 | # define PCM_CAP_ADMASK 0x00f00000 /* Unused in NetBSD */ |
| | | 119 | # define PCM_CAP_SPECIAL 0x01000000 /* Unused in NetBSD */ |
95 | #define SNDCTL_DSP_GETTRIGGER _IOR ('P', 16, int) | | 120 | #define SNDCTL_DSP_GETTRIGGER _IOR ('P', 16, int) |
96 | #define SNDCTL_DSP_SETTRIGGER _IOW ('P', 16, int) | | 121 | #define SNDCTL_DSP_SETTRIGGER _IOW ('P', 16, int) |
97 | # define PCM_ENABLE_INPUT 0x00000001 | | 122 | # define PCM_ENABLE_INPUT 0x00000001 |
98 | # define PCM_ENABLE_OUTPUT 0x00000002 | | 123 | # define PCM_ENABLE_OUTPUT 0x00000002 |
99 | #define SNDCTL_DSP_GETIPTR _IOR ('P', 17, struct count_info) | | 124 | #define SNDCTL_DSP_GETIPTR _IOR ('P', 17, struct count_info) |
100 | #define SNDCTL_DSP_GETOPTR _IOR ('P', 18, struct count_info) | | 125 | #define SNDCTL_DSP_GETOPTR _IOR ('P', 18, struct count_info) |
101 | #define SNDCTL_DSP_MAPINBUF _IOR ('P', 19, struct buffmem_desc) | | 126 | #define SNDCTL_DSP_MAPINBUF _IOR ('P', 19, struct buffmem_desc) |
102 | #define SNDCTL_DSP_MAPOUTBUF _IOR ('P', 20, struct buffmem_desc) | | 127 | #define SNDCTL_DSP_MAPOUTBUF _IOR ('P', 20, struct buffmem_desc) |
103 | #define SNDCTL_DSP_SETSYNCRO _IO ('P', 21) | | 128 | #define SNDCTL_DSP_SETSYNCRO _IO ('P', 21) |
104 | #define SNDCTL_DSP_SETDUPLEX _IO ('P', 22) | | 129 | #define SNDCTL_DSP_SETDUPLEX _IO ('P', 22) |
105 | #define SNDCTL_DSP_PROFILE _IOW ('P', 23, int) | | 130 | #define SNDCTL_DSP_PROFILE _IOW ('P', 23, int) |
106 | #define SNDCTL_DSP_GETODELAY _IOR ('P', 23, int) | | 131 | #define SNDCTL_DSP_GETODELAY _IOR ('P', 23, int) |
107 | #define APF_NORMAL 0 | | 132 | #define APF_NORMAL 0 |
108 | #define APF_NETWORK 1 | | 133 | #define APF_NETWORK 1 |
109 | #define APF_CPUINTENS 2 | | 134 | #define APF_CPUINTENS 2 |
110 | | | 135 | |
111 | /* Need native 16 bit format which depends on byte order */ | | 136 | /* Need native 16 bit format which depends on byte order */ |
112 | #include <machine/endian_machdep.h> | | 137 | #include <machine/endian_machdep.h> |
113 | #if _BYTE_ORDER == _LITTLE_ENDIAN | | 138 | #if _BYTE_ORDER == _LITTLE_ENDIAN |
114 | #define AFMT_U16_NE AFMT_U16_LE | | 139 | #define AFMT_U16_NE AFMT_U16_LE |
115 | #define AFMT_U16_OE AFMT_U16_BE | | 140 | #define AFMT_U16_OE AFMT_U16_BE |
116 | #define AFMT_S16_NE AFMT_S16_LE | | 141 | #define AFMT_S16_NE AFMT_S16_LE |
117 | #define AFMT_S16_OE AFMT_S16_BE | | 142 | #define AFMT_S16_OE AFMT_S16_BE |
118 | #define AFMT_S24_NE AFMT_S24_LE | | 143 | #define AFMT_S24_NE AFMT_S24_LE |
119 | #define AFMT_S24_OE AFMT_S24_BE | | 144 | #define AFMT_S24_OE AFMT_S24_BE |
120 | #define AFMT_S32_NE AFMT_S32_LE | | 145 | #define AFMT_S32_NE AFMT_S32_LE |
121 | #define AFMT_S32_OE AFMT_S32_BE | | 146 | #define AFMT_S32_OE AFMT_S32_BE |
122 | #else | | 147 | #else |
123 | #define AFMT_U16_NE AFMT_U16_BE | | 148 | #define AFMT_U16_NE AFMT_U16_BE |
124 | #define AFMT_U16_OE AFMT_U16_LE | | 149 | #define AFMT_U16_OE AFMT_U16_LE |
125 | #define AFMT_S16_NE AFMT_S16_BE | | 150 | #define AFMT_S16_NE AFMT_S16_BE |
126 | #define AFMT_S16_OE AFMT_S16_LE | | 151 | #define AFMT_S16_OE AFMT_S16_LE |
127 | #define AFMT_S24_NE AFMT_S24_BE | | 152 | #define AFMT_S24_NE AFMT_S24_BE |
128 | #define AFMT_S24_OE AFMT_S24_LE | | 153 | #define AFMT_S24_OE AFMT_S24_LE |
129 | #define AFMT_S32_NE AFMT_S32_BE | | 154 | #define AFMT_S32_NE AFMT_S32_BE |
130 | #define AFMT_S32_OE AFMT_S32_LE | | 155 | #define AFMT_S32_OE AFMT_S32_LE |
131 | #endif | | 156 | #endif |
132 | | | 157 | |
133 | /* Aliases */ | | 158 | /* Aliases */ |
134 | #define SOUND_PCM_WRITE_BITS SNDCTL_DSP_SETFMT | | 159 | #define SOUND_PCM_WRITE_BITS SNDCTL_DSP_SETFMT |
135 | #define SOUND_PCM_WRITE_RATE SNDCTL_DSP_SPEED | | 160 | #define SOUND_PCM_WRITE_RATE SNDCTL_DSP_SPEED |
136 | #define SOUND_PCM_POST SNDCTL_DSP_POST | | 161 | #define SOUND_PCM_POST SNDCTL_DSP_POST |
137 | #define SOUND_PCM_RESET SNDCTL_DSP_RESET | | 162 | #define SOUND_PCM_RESET SNDCTL_DSP_RESET |
138 | #define SOUND_PCM_SYNC SNDCTL_DSP_SYNC | | 163 | #define SOUND_PCM_SYNC SNDCTL_DSP_SYNC |
139 | #define SOUND_PCM_SUBDIVIDE SNDCTL_DSP_SUBDIVIDE | | 164 | #define SOUND_PCM_SUBDIVIDE SNDCTL_DSP_SUBDIVIDE |
140 | #define SOUND_PCM_SETFRAGMENT SNDCTL_DSP_SETFRAGMENT | | 165 | #define SOUND_PCM_SETFRAGMENT SNDCTL_DSP_SETFRAGMENT |
141 | #define SOUND_PCM_GETFMTS SNDCTL_DSP_GETFMTS | | 166 | #define SOUND_PCM_GETFMTS SNDCTL_DSP_GETFMTS |
142 | #define SOUND_PCM_SETFMT SNDCTL_DSP_SETFMT | | 167 | #define SOUND_PCM_SETFMT SNDCTL_DSP_SETFMT |
143 | #define SOUND_PCM_GETOSPACE SNDCTL_DSP_GETOSPACE | | 168 | #define SOUND_PCM_GETOSPACE SNDCTL_DSP_GETOSPACE |
144 | #define SOUND_PCM_GETISPACE SNDCTL_DSP_GETISPACE | | 169 | #define SOUND_PCM_GETISPACE SNDCTL_DSP_GETISPACE |
145 | #define SOUND_PCM_NONBLOCK SNDCTL_DSP_NONBLOCK | | 170 | #define SOUND_PCM_NONBLOCK SNDCTL_DSP_NONBLOCK |
146 | #define SOUND_PCM_GETCAPS SNDCTL_DSP_GETCAPS | | 171 | #define SOUND_PCM_GETCAPS SNDCTL_DSP_GETCAPS |
147 | #define SOUND_PCM_GETTRIGGER SNDCTL_DSP_GETTRIGGER | | 172 | #define SOUND_PCM_GETTRIGGER SNDCTL_DSP_GETTRIGGER |
148 | #define SOUND_PCM_SETTRIGGER SNDCTL_DSP_SETTRIGGER | | 173 | #define SOUND_PCM_SETTRIGGER SNDCTL_DSP_SETTRIGGER |
149 | #define SOUND_PCM_SETSYNCRO SNDCTL_DSP_SETSYNCRO | | 174 | #define SOUND_PCM_SETSYNCRO SNDCTL_DSP_SETSYNCRO |
150 | #define SOUND_PCM_GETIPTR SNDCTL_DSP_GETIPTR | | 175 | #define SOUND_PCM_GETIPTR SNDCTL_DSP_GETIPTR |
151 | #define SOUND_PCM_GETOPTR SNDCTL_DSP_GETOPTR | | 176 | #define SOUND_PCM_GETOPTR SNDCTL_DSP_GETOPTR |
152 | #define SOUND_PCM_MAPINBUF SNDCTL_DSP_MAPINBUF | | 177 | #define SOUND_PCM_MAPINBUF SNDCTL_DSP_MAPINBUF |
153 | #define SOUND_PCM_MAPOUTBUF SNDCTL_DSP_MAPOUTBUF | | 178 | #define SOUND_PCM_MAPOUTBUF SNDCTL_DSP_MAPOUTBUF |
154 | | | 179 | |
155 | /* Mixer defines */ | | 180 | /* Mixer defines */ |
156 | #define SOUND_MIXER_FIRST 0 | | 181 | #define SOUND_MIXER_FIRST 0 |
157 | #define SOUND_MIXER_NRDEVICES 25 | | 182 | #define SOUND_MIXER_NRDEVICES 25 |
158 | | | 183 | |
159 | #define SOUND_MIXER_VOLUME 0 | | 184 | #define SOUND_MIXER_VOLUME 0 |
160 | #define SOUND_MIXER_BASS 1 | | 185 | #define SOUND_MIXER_BASS 1 |
161 | #define SOUND_MIXER_TREBLE 2 | | 186 | #define SOUND_MIXER_TREBLE 2 |
162 | #define SOUND_MIXER_SYNTH 3 | | 187 | #define SOUND_MIXER_SYNTH 3 |
163 | #define SOUND_MIXER_PCM 4 | | 188 | #define SOUND_MIXER_PCM 4 |
164 | #define SOUND_MIXER_SPEAKER 5 | | 189 | #define SOUND_MIXER_SPEAKER 5 |
165 | #define SOUND_MIXER_LINE 6 | | 190 | #define SOUND_MIXER_LINE 6 |
166 | #define SOUND_MIXER_MIC 7 | | 191 | #define SOUND_MIXER_MIC 7 |
167 | #define SOUND_MIXER_CD 8 | | 192 | #define SOUND_MIXER_CD 8 |
168 | #define SOUND_MIXER_IMIX 9 | | 193 | #define SOUND_MIXER_IMIX 9 |
169 | #define SOUND_MIXER_ALTPCM 10 | | 194 | #define SOUND_MIXER_ALTPCM 10 |
170 | #define SOUND_MIXER_RECLEV 11 | | 195 | #define SOUND_MIXER_RECLEV 11 |
171 | #define SOUND_MIXER_IGAIN 12 | | 196 | #define SOUND_MIXER_IGAIN 12 |
172 | #define SOUND_MIXER_OGAIN 13 | | 197 | #define SOUND_MIXER_OGAIN 13 |
173 | #define SOUND_MIXER_LINE1 14 | | 198 | #define SOUND_MIXER_LINE1 14 |
174 | #define SOUND_MIXER_LINE2 15 | | 199 | #define SOUND_MIXER_LINE2 15 |
175 | #define SOUND_MIXER_LINE3 16 | | 200 | #define SOUND_MIXER_LINE3 16 |
176 | #define SOUND_MIXER_DIGITAL1 17 | | 201 | #define SOUND_MIXER_DIGITAL1 17 |
177 | #define SOUND_MIXER_DIGITAL2 18 | | 202 | #define SOUND_MIXER_DIGITAL2 18 |
178 | #define SOUND_MIXER_DIGITAL3 19 | | 203 | #define SOUND_MIXER_DIGITAL3 19 |
179 | #define SOUND_MIXER_PHONEIN 20 | | 204 | #define SOUND_MIXER_PHONEIN 20 |
180 | #define SOUND_MIXER_PHONEOUT 21 | | 205 | #define SOUND_MIXER_PHONEOUT 21 |
181 | #define SOUND_MIXER_VIDEO 22 | | 206 | #define SOUND_MIXER_VIDEO 22 |
182 | #define SOUND_MIXER_RADIO 23 | | 207 | #define SOUND_MIXER_RADIO 23 |
183 | #define SOUND_MIXER_MONITOR 24 | | 208 | #define SOUND_MIXER_MONITOR 24 |
184 | | | 209 | |
185 | #define SOUND_ONOFF_MIN 28 | | 210 | #define SOUND_ONOFF_MIN 28 |
186 | #define SOUND_ONOFF_MAX 30 | | 211 | #define SOUND_ONOFF_MAX 30 |
187 | | | 212 | |
188 | #define SOUND_MIXER_NONE 31 | | 213 | #define SOUND_MIXER_NONE 31 |
189 | | | 214 | |
190 | #define SOUND_DEVICE_LABELS {"Vol ", "Bass ", "Trebl", "Synth", "Pcm ", "Spkr ", "Line ", \ | | 215 | #define SOUND_DEVICE_LABELS {"Vol ", "Bass ", "Trebl", "Synth", "Pcm ", "Spkr ", "Line ", \ |
191 | "Mic ", "CD ", "Mix ", "Pcm2 ", "Rec ", "IGain", "OGain", \ | | 216 | "Mic ", "CD ", "Mix ", "Pcm2 ", "Rec ", "IGain", "OGain", \ |
192 | "Line1", "Line2", "Line3", "Digital1", "Digital2", "Digital3", \ | | 217 | "Line1", "Line2", "Line3", "Digital1", "Digital2", "Digital3", \ |
193 | "PhoneIn", "PhoneOut", "Video", "Radio", "Monitor"} | | 218 | "PhoneIn", "PhoneOut", "Video", "Radio", "Monitor"} |
194 | | | 219 | |
195 | #define SOUND_DEVICE_NAMES {"vol", "bass", "treble", "synth", "pcm", "speaker", "line", \ | | 220 | #define SOUND_DEVICE_NAMES {"vol", "bass", "treble", "synth", "pcm", "speaker", "line", \ |
196 | "mic", "cd", "mix", "pcm2", "rec", "igain", "ogain", \ | | 221 | "mic", "cd", "mix", "pcm2", "rec", "igain", "ogain", \ |
197 | "line1", "line2", "line3", "dig1", "dig2", "dig3", \ | | 222 | "line1", "line2", "line3", "dig1", "dig2", "dig3", \ |
198 | "phin", "phout", "video", "radio", "monitor"} | | 223 | "phin", "phout", "video", "radio", "monitor"} |
199 | | | 224 | |
200 | #define SOUND_MIXER_RECSRC 0xff | | 225 | #define SOUND_MIXER_RECSRC 0xff |
201 | #define SOUND_MIXER_DEVMASK 0xfe | | 226 | #define SOUND_MIXER_DEVMASK 0xfe |
202 | #define SOUND_MIXER_RECMASK 0xfd | | 227 | #define SOUND_MIXER_RECMASK 0xfd |
203 | #define SOUND_MIXER_CAPS 0xfc | | 228 | #define SOUND_MIXER_CAPS 0xfc |
204 | #define SOUND_CAP_EXCL_INPUT 1 | | 229 | #define SOUND_CAP_EXCL_INPUT 1 |
205 | #define SOUND_MIXER_STEREODEVS 0xfb | | 230 | #define SOUND_MIXER_STEREODEVS 0xfb |
206 | | | 231 | |
207 | #define MIXER_READ(dev) _IOR('M', dev, int) | | 232 | #define MIXER_READ(dev) _IOR('M', dev, int) |
208 | | | 233 | |
209 | #define SOUND_MIXER_READ_RECSRC MIXER_READ(SOUND_MIXER_RECSRC) | | 234 | #define SOUND_MIXER_READ_RECSRC MIXER_READ(SOUND_MIXER_RECSRC) |
210 | #define SOUND_MIXER_READ_DEVMASK MIXER_READ(SOUND_MIXER_DEVMASK) | | 235 | #define SOUND_MIXER_READ_DEVMASK MIXER_READ(SOUND_MIXER_DEVMASK) |
211 | #define SOUND_MIXER_READ_RECMASK MIXER_READ(SOUND_MIXER_RECMASK) | | 236 | #define SOUND_MIXER_READ_RECMASK MIXER_READ(SOUND_MIXER_RECMASK) |
212 | #define SOUND_MIXER_READ_STEREODEVS MIXER_READ(SOUND_MIXER_STEREODEVS) | | 237 | #define SOUND_MIXER_READ_STEREODEVS MIXER_READ(SOUND_MIXER_STEREODEVS) |
213 | #define SOUND_MIXER_READ_CAPS MIXER_READ(SOUND_MIXER_CAPS) | | 238 | #define SOUND_MIXER_READ_CAPS MIXER_READ(SOUND_MIXER_CAPS) |
214 | | | 239 | |
215 | #define SOUND_MIXER_READ_VOLUME MIXER_READ(SOUND_MIXER_VOLUME) | | 240 | #define SOUND_MIXER_READ_VOLUME MIXER_READ(SOUND_MIXER_VOLUME) |
216 | #define SOUND_MIXER_READ_BASS MIXER_READ(SOUND_MIXER_BASS) | | 241 | #define SOUND_MIXER_READ_BASS MIXER_READ(SOUND_MIXER_BASS) |
217 | #define SOUND_MIXER_READ_TREBLE MIXER_READ(SOUND_MIXER_TREBLE) | | 242 | #define SOUND_MIXER_READ_TREBLE MIXER_READ(SOUND_MIXER_TREBLE) |
218 | #define SOUND_MIXER_READ_SYNTH MIXER_READ(SOUND_MIXER_SYNTH) | | 243 | #define SOUND_MIXER_READ_SYNTH MIXER_READ(SOUND_MIXER_SYNTH) |
219 | #define SOUND_MIXER_READ_PCM MIXER_READ(SOUND_MIXER_PCM) | | 244 | #define SOUND_MIXER_READ_PCM MIXER_READ(SOUND_MIXER_PCM) |
220 | #define SOUND_MIXER_READ_SPEAKER MIXER_READ(SOUND_MIXER_SPEAKER) | | 245 | #define SOUND_MIXER_READ_SPEAKER MIXER_READ(SOUND_MIXER_SPEAKER) |
221 | #define SOUND_MIXER_READ_LINE MIXER_READ(SOUND_MIXER_LINE) | | 246 | #define SOUND_MIXER_READ_LINE MIXER_READ(SOUND_MIXER_LINE) |
222 | #define SOUND_MIXER_READ_MIC MIXER_READ(SOUND_MIXER_MIC) | | 247 | #define SOUND_MIXER_READ_MIC MIXER_READ(SOUND_MIXER_MIC) |
223 | #define SOUND_MIXER_READ_CD MIXER_READ(SOUND_MIXER_CD) | | 248 | #define SOUND_MIXER_READ_CD MIXER_READ(SOUND_MIXER_CD) |
224 | #define SOUND_MIXER_READ_IMIX MIXER_READ(SOUND_MIXER_IMIX) | | 249 | #define SOUND_MIXER_READ_IMIX MIXER_READ(SOUND_MIXER_IMIX) |
225 | #define SOUND_MIXER_READ_ALTPCM MIXER_READ(SOUND_MIXER_ALTPCM) | | 250 | #define SOUND_MIXER_READ_ALTPCM MIXER_READ(SOUND_MIXER_ALTPCM) |
226 | #define SOUND_MIXER_READ_RECLEV MIXER_READ(SOUND_MIXER_RECLEV) | | 251 | #define SOUND_MIXER_READ_RECLEV MIXER_READ(SOUND_MIXER_RECLEV) |
227 | #define SOUND_MIXER_READ_IGAIN MIXER_READ(SOUND_MIXER_IGAIN) | | 252 | #define SOUND_MIXER_READ_IGAIN MIXER_READ(SOUND_MIXER_IGAIN) |
228 | #define SOUND_MIXER_READ_OGAIN MIXER_READ(SOUND_MIXER_OGAIN) | | 253 | #define SOUND_MIXER_READ_OGAIN MIXER_READ(SOUND_MIXER_OGAIN) |
229 | #define SOUND_MIXER_READ_LINE1 MIXER_READ(SOUND_MIXER_LINE1) | | 254 | #define SOUND_MIXER_READ_LINE1 MIXER_READ(SOUND_MIXER_LINE1) |
230 | #define SOUND_MIXER_READ_LINE2 MIXER_READ(SOUND_MIXER_LINE2) | | 255 | #define SOUND_MIXER_READ_LINE2 MIXER_READ(SOUND_MIXER_LINE2) |
231 | #define SOUND_MIXER_READ_LINE3 MIXER_READ(SOUND_MIXER_LINE3) | | 256 | #define SOUND_MIXER_READ_LINE3 MIXER_READ(SOUND_MIXER_LINE3) |
232 | | | 257 | |
233 | #define MIXER_WRITE(dev) _IOW ('M', dev, int) | | 258 | #define MIXER_WRITE(dev) _IOW ('M', dev, int) |
234 | #define MIXER_WRITE_R(dev) _IOWR('M', dev, int) | | 259 | #define MIXER_WRITE_R(dev) _IOWR('M', dev, int) |
235 | | | 260 | |
236 | #define SOUND_MIXER_WRITE_RECSRC MIXER_WRITE(SOUND_MIXER_RECSRC) | | 261 | #define SOUND_MIXER_WRITE_RECSRC MIXER_WRITE(SOUND_MIXER_RECSRC) |
237 | #define SOUND_MIXER_WRITE_R_RECSRC MIXER_WRITE_R(SOUND_MIXER_RECSRC) | | 262 | #define SOUND_MIXER_WRITE_R_RECSRC MIXER_WRITE_R(SOUND_MIXER_RECSRC) |
238 | | | 263 | |
239 | #define SOUND_MIXER_WRITE_VOLUME MIXER_WRITE(SOUND_MIXER_VOLUME) | | 264 | #define SOUND_MIXER_WRITE_VOLUME MIXER_WRITE(SOUND_MIXER_VOLUME) |
240 | #define SOUND_MIXER_WRITE_BASS MIXER_WRITE(SOUND_MIXER_BASS) | | 265 | #define SOUND_MIXER_WRITE_BASS MIXER_WRITE(SOUND_MIXER_BASS) |
241 | #define SOUND_MIXER_WRITE_TREBLE MIXER_WRITE(SOUND_MIXER_TREBLE) | | 266 | #define SOUND_MIXER_WRITE_TREBLE MIXER_WRITE(SOUND_MIXER_TREBLE) |
242 | #define SOUND_MIXER_WRITE_SYNTH MIXER_WRITE(SOUND_MIXER_SYNTH) | | 267 | #define SOUND_MIXER_WRITE_SYNTH MIXER_WRITE(SOUND_MIXER_SYNTH) |
243 | #define SOUND_MIXER_WRITE_PCM MIXER_WRITE(SOUND_MIXER_PCM) | | 268 | #define SOUND_MIXER_WRITE_PCM MIXER_WRITE(SOUND_MIXER_PCM) |
244 | #define SOUND_MIXER_WRITE_SPEAKER MIXER_WRITE(SOUND_MIXER_SPEAKER) | | 269 | #define SOUND_MIXER_WRITE_SPEAKER MIXER_WRITE(SOUND_MIXER_SPEAKER) |
245 | #define SOUND_MIXER_WRITE_LINE MIXER_WRITE(SOUND_MIXER_LINE) | | 270 | #define SOUND_MIXER_WRITE_LINE MIXER_WRITE(SOUND_MIXER_LINE) |
246 | #define SOUND_MIXER_WRITE_MIC MIXER_WRITE(SOUND_MIXER_MIC) | | 271 | #define SOUND_MIXER_WRITE_MIC MIXER_WRITE(SOUND_MIXER_MIC) |
247 | #define SOUND_MIXER_WRITE_CD MIXER_WRITE(SOUND_MIXER_CD) | | 272 | #define SOUND_MIXER_WRITE_CD MIXER_WRITE(SOUND_MIXER_CD) |
248 | #define SOUND_MIXER_WRITE_IMIX MIXER_WRITE(SOUND_MIXER_IMIX) | | 273 | #define SOUND_MIXER_WRITE_IMIX MIXER_WRITE(SOUND_MIXER_IMIX) |
249 | #define SOUND_MIXER_WRITE_ALTPCM MIXER_WRITE(SOUND_MIXER_ALTPCM) | | 274 | #define SOUND_MIXER_WRITE_ALTPCM MIXER_WRITE(SOUND_MIXER_ALTPCM) |
250 | #define SOUND_MIXER_WRITE_RECLEV MIXER_WRITE(SOUND_MIXER_RECLEV) | | 275 | #define SOUND_MIXER_WRITE_RECLEV MIXER_WRITE(SOUND_MIXER_RECLEV) |
251 | #define SOUND_MIXER_WRITE_IGAIN MIXER_WRITE(SOUND_MIXER_IGAIN) | | 276 | #define SOUND_MIXER_WRITE_IGAIN MIXER_WRITE(SOUND_MIXER_IGAIN) |
252 | #define SOUND_MIXER_WRITE_OGAIN MIXER_WRITE(SOUND_MIXER_OGAIN) | | 277 | #define SOUND_MIXER_WRITE_OGAIN MIXER_WRITE(SOUND_MIXER_OGAIN) |
253 | #define SOUND_MIXER_WRITE_LINE1 MIXER_WRITE(SOUND_MIXER_LINE1) | | 278 | #define SOUND_MIXER_WRITE_LINE1 MIXER_WRITE(SOUND_MIXER_LINE1) |
254 | #define SOUND_MIXER_WRITE_LINE2 MIXER_WRITE(SOUND_MIXER_LINE2) | | 279 | #define SOUND_MIXER_WRITE_LINE2 MIXER_WRITE(SOUND_MIXER_LINE2) |
255 | #define SOUND_MIXER_WRITE_LINE3 MIXER_WRITE(SOUND_MIXER_LINE3) | | 280 | #define SOUND_MIXER_WRITE_LINE3 MIXER_WRITE(SOUND_MIXER_LINE3) |
256 | | | 281 | |
257 | #define SOUND_MASK_VOLUME (1 << SOUND_MIXER_VOLUME) | | 282 | #define SOUND_MASK_VOLUME (1 << SOUND_MIXER_VOLUME) |
258 | #define SOUND_MASK_BASS (1 << SOUND_MIXER_BASS) | | 283 | #define SOUND_MASK_BASS (1 << SOUND_MIXER_BASS) |
259 | #define SOUND_MASK_TREBLE (1 << SOUND_MIXER_TREBLE) | | 284 | #define SOUND_MASK_TREBLE (1 << SOUND_MIXER_TREBLE) |
260 | #define SOUND_MASK_SYNTH (1 << SOUND_MIXER_SYNTH) | | 285 | #define SOUND_MASK_SYNTH (1 << SOUND_MIXER_SYNTH) |
261 | #define SOUND_MASK_PCM (1 << SOUND_MIXER_PCM) | | 286 | #define SOUND_MASK_PCM (1 << SOUND_MIXER_PCM) |
262 | #define SOUND_MASK_SPEAKER (1 << SOUND_MIXER_SPEAKER) | | 287 | #define SOUND_MASK_SPEAKER (1 << SOUND_MIXER_SPEAKER) |
263 | #define SOUND_MASK_LINE (1 << SOUND_MIXER_LINE) | | 288 | #define SOUND_MASK_LINE (1 << SOUND_MIXER_LINE) |
264 | #define SOUND_MASK_MIC (1 << SOUND_MIXER_MIC) | | 289 | #define SOUND_MASK_MIC (1 << SOUND_MIXER_MIC) |
265 | #define SOUND_MASK_CD (1 << SOUND_MIXER_CD) | | 290 | #define SOUND_MASK_CD (1 << SOUND_MIXER_CD) |
266 | #define SOUND_MASK_IMIX (1 << SOUND_MIXER_IMIX) | | 291 | #define SOUND_MASK_IMIX (1 << SOUND_MIXER_IMIX) |
267 | #define SOUND_MASK_ALTPCM (1 << SOUND_MIXER_ALTPCM) | | 292 | #define SOUND_MASK_ALTPCM (1 << SOUND_MIXER_ALTPCM) |
268 | #define SOUND_MASK_RECLEV (1 << SOUND_MIXER_RECLEV) | | 293 | #define SOUND_MASK_RECLEV (1 << SOUND_MIXER_RECLEV) |
269 | #define SOUND_MASK_IGAIN (1 << SOUND_MIXER_IGAIN) | | 294 | #define SOUND_MASK_IGAIN (1 << SOUND_MIXER_IGAIN) |
270 | #define SOUND_MASK_OGAIN (1 << SOUND_MIXER_OGAIN) | | 295 | #define SOUND_MASK_OGAIN (1 << SOUND_MIXER_OGAIN) |
271 | #define SOUND_MASK_LINE1 (1 << SOUND_MIXER_LINE1) | | 296 | #define SOUND_MASK_LINE1 (1 << SOUND_MIXER_LINE1) |
272 | #define SOUND_MASK_LINE2 (1 << SOUND_MIXER_LINE2) | | 297 | #define SOUND_MASK_LINE2 (1 << SOUND_MIXER_LINE2) |
273 | #define SOUND_MASK_LINE3 (1 << SOUND_MIXER_LINE3) | | 298 | #define SOUND_MASK_LINE3 (1 << SOUND_MIXER_LINE3) |
274 | #define SOUND_MASK_DIGITAL1 (1 << SOUND_MIXER_DIGITAL1) | | 299 | #define SOUND_MASK_DIGITAL1 (1 << SOUND_MIXER_DIGITAL1) |
275 | #define SOUND_MASK_DIGITAL2 (1 << SOUND_MIXER_DIGITAL2) | | 300 | #define SOUND_MASK_DIGITAL2 (1 << SOUND_MIXER_DIGITAL2) |
276 | #define SOUND_MASK_DIGITAL3 (1 << SOUND_MIXER_DIGITAL3) | | 301 | #define SOUND_MASK_DIGITAL3 (1 << SOUND_MIXER_DIGITAL3) |
277 | #define SOUND_MASK_PHONEIN (1 << SOUND_MIXER_PHONEIN) | | 302 | #define SOUND_MASK_PHONEIN (1 << SOUND_MIXER_PHONEIN) |
278 | #define SOUND_MASK_PHONEOUT (1 << SOUND_MIXER_PHONEOUT) | | 303 | #define SOUND_MASK_PHONEOUT (1 << SOUND_MIXER_PHONEOUT) |
279 | #define SOUND_MASK_VIDEO (1 << SOUND_MIXER_VIDEO) | | 304 | #define SOUND_MASK_VIDEO (1 << SOUND_MIXER_VIDEO) |
280 | #define SOUND_MASK_RADIO (1 << SOUND_MIXER_RADIO) | | 305 | #define SOUND_MASK_RADIO (1 << SOUND_MIXER_RADIO) |
281 | #define SOUND_MASK_MONITOR (1 << SOUND_MIXER_MONITOR) | | 306 | #define SOUND_MASK_MONITOR (1 << SOUND_MIXER_MONITOR) |
282 | | | 307 | |
283 | typedef struct mixer_info { | | 308 | typedef struct mixer_info { |
284 | char id[16]; | | 309 | char id[16]; |
285 | char name[32]; | | 310 | char name[32]; |
286 | int modify_counter; | | 311 | int modify_counter; |
287 | int fillers[10]; | | 312 | int fillers[10]; |
288 | } mixer_info; | | 313 | } mixer_info; |
289 | | | 314 | |
290 | typedef struct _old_mixer_info { | | 315 | typedef struct _old_mixer_info { |
291 | char id[16]; | | 316 | char id[16]; |
292 | char name[32]; | | 317 | char name[32]; |
293 | } _old_mixer_info; | | 318 | } _old_mixer_info; |
294 | | | 319 | |
295 | #define SOUND_MIXER_INFO _IOR('M', 101, mixer_info) | | 320 | #define SOUND_MIXER_INFO _IOR('M', 101, mixer_info) |
296 | #define SOUND_OLD_MIXER_INFO _IOR('M', 101, _old_mixer_info) | | 321 | #define SOUND_OLD_MIXER_INFO _IOR('M', 101, _old_mixer_info) |
297 | | | 322 | |
298 | #define OSS_GETVERSION _IOR ('M', 118, int) | | 323 | #define OSS_GETVERSION _IOR ('M', 118, int) |
299 | | | 324 | |
300 | typedef struct audio_buf_info { | | 325 | typedef struct audio_buf_info { |
301 | int fragments; | | 326 | int fragments; |
302 | int fragstotal; | | 327 | int fragstotal; |
303 | int fragsize; | | 328 | int fragsize; |
304 | int bytes; | | 329 | int bytes; |
305 | } audio_buf_info; | | 330 | } audio_buf_info; |
306 | | | 331 | |
307 | typedef struct count_info { | | 332 | typedef struct count_info { |
308 | int bytes; | | 333 | int bytes; |
309 | int blocks; | | 334 | int blocks; |
310 | int ptr; | | 335 | int ptr; |
311 | } count_info; | | 336 | } count_info; |
312 | | | 337 | |
313 | typedef struct buffmem_desc { | | 338 | typedef struct buffmem_desc { |
314 | unsigned int *buffer; | | 339 | unsigned int *buffer; |
315 | int size; | | 340 | int size; |
316 | } buffmem_desc; | | 341 | } buffmem_desc; |
317 | | | 342 | |
318 | /* Some OSSv4 calls. */ | | 343 | /* Some OSSv4 calls. */ |
319 | | | 344 | |
320 | #define OSS_DEVNODE_SIZE 32 | | 345 | #define OSS_DEVNODE_SIZE 32 |
321 | #define OSS_LABEL_SIZE 16 | | 346 | #define OSS_LABEL_SIZE 16 |
322 | #define OSS_LONGNAME_SIZE 64 | | 347 | #define OSS_LONGNAME_SIZE 64 |
323 | #define OSS_MAX_AUDIO_DEVS 64 | | 348 | #define OSS_MAX_AUDIO_DEVS 64 |
324 | | | 349 | |
325 | #define SNDCTL_DSP_GETPLAYVOL _IOR ('P',27, uint) | | 350 | #define SNDCTL_DSP_GETPLAYVOL _IOR ('P',27, uint) |
326 | #define SNDCTL_DSP_SETPLAYVOL _IOW ('P',28, uint) | | 351 | #define SNDCTL_DSP_SETPLAYVOL _IOW ('P',28, uint) |
327 | #define SNDCTL_DSP_GETRECVOL _IOR ('P',29, uint) | | 352 | #define SNDCTL_DSP_GETRECVOL _IOR ('P',29, uint) |
328 | #define SNDCTL_DSP_SETRECVOL _IOW ('P',30, uint) | | 353 | #define SNDCTL_DSP_SETRECVOL _IOW ('P',30, uint) |
329 | #define SNDCTL_DSP_SKIP _IO ('P',31) | | 354 | #define SNDCTL_DSP_SKIP _IO ('P',31) |
330 | #define SNDCTL_DSP_SILENCE _IO ('P',32) | | 355 | #define SNDCTL_DSP_SILENCE _IO ('P',32) |
331 | #define SNDCTL_DSP_COOKEDMODE _IOW ('P',33, int) | | 356 | #define SNDCTL_DSP_COOKEDMODE _IOW ('P',33, int) |
332 | #define SNDCTL_DSP_GETERROR _IOR ('P',34, struct audio_errinfo) | | 357 | #define SNDCTL_DSP_GETERROR _IOR ('P',34, struct audio_errinfo) |
333 | #define SNDCTL_DSP_CURRENT_IPTR _IOR ('P',35, oss_count_t) | | 358 | #define SNDCTL_DSP_CURRENT_IPTR _IOR ('P',35, oss_count_t) |
334 | #define SNDCTL_DSP_CURRENT_OPTR _IOR ('P',36, oss_count_t) | | 359 | #define SNDCTL_DSP_CURRENT_OPTR _IOR ('P',36, oss_count_t) |
335 | | | 360 | |
336 | typedef struct { | | 361 | typedef struct { |
337 | long long samples; | | 362 | long long samples; |
338 | int fifo_samples; | | 363 | int fifo_samples; |
339 | int filler[32]; /* "Future use" */ | | 364 | int filler[32]; /* "Future use" */ |
340 | } oss_count_t; | | 365 | } oss_count_t; |
341 | | | 366 | |
342 | typedef struct audio_errinfo { | | 367 | typedef struct audio_errinfo { |
343 | int play_underruns; | | 368 | int play_underruns; |
344 | int rec_overruns; | | 369 | int rec_overruns; |
345 | unsigned int play_ptradjust; /* Obsolete */ | | 370 | unsigned int play_ptradjust; /* Obsolete */ |
346 | unsigned int rec_ptradjust; /* Obsolete */ | | 371 | unsigned int rec_ptradjust; /* Obsolete */ |
347 | int play_errorcount; /* Unused */ | | 372 | int play_errorcount; /* Unused */ |
348 | int rec_errorcount; /* Unused */ | | 373 | int rec_errorcount; /* Unused */ |
349 | int play_lasterror; /* Unused */ | | 374 | int play_lasterror; /* Unused */ |
350 | int rec_lasterror; /* Unused */ | | 375 | int rec_lasterror; /* Unused */ |
351 | int play_errorparm; /* Unused */ | | 376 | int play_errorparm; /* Unused */ |
352 | int rec_errorparm; /* Unused */ | | 377 | int rec_errorparm; /* Unused */ |
353 | int filler[16]; /* Unused */ | | 378 | int filler[16]; /* Unused */ |
354 | } audio_errinfo; | | 379 | } audio_errinfo; |
355 | | | 380 | |
356 | typedef struct oss_sysinfo { | | 381 | typedef struct oss_sysinfo { |
357 | char product[32]; | | 382 | char product[32]; |
358 | char version[32]; | | 383 | char version[32]; |
359 | int versionnum; | | 384 | int versionnum; |
360 | char options[128]; /* Future use */ | | 385 | char options[128]; /* Future use */ |
361 | int numaudios; | | 386 | int numaudios; |
362 | int openedaudio[8]; /* Obsolete */ | | 387 | int openedaudio[8]; /* Obsolete */ |
363 | int numsynths; /* Obsolete */ | | 388 | int numsynths; /* Obsolete */ |
364 | int nummidis; | | 389 | int nummidis; |
365 | int numtimers; | | 390 | int numtimers; |
366 | int nummixers; | | 391 | int nummixers; |
367 | int openedmidi[8]; | | 392 | int openedmidi[8]; |
368 | int numcards; | | 393 | int numcards; |
369 | int numaudioengines; | | 394 | int numaudioengines; |
370 | char license[16]; | | 395 | char license[16]; |
371 | char revision_info[256]; /* Internal Use */ | | 396 | char revision_info[256]; /* Internal Use */ |
372 | int filler[172]; /* For expansion */ | | 397 | int filler[172]; /* For expansion */ |
373 | } oss_sysinfo; | | 398 | } oss_sysinfo; |
374 | | | 399 | |
375 | typedef struct oss_audioinfo { | | 400 | typedef struct oss_audioinfo { |
376 | int dev; /* Set by caller */ | | 401 | int dev; /* Set by caller */ |
377 | char name[OSS_LONGNAME_SIZE]; | | 402 | char name[OSS_LONGNAME_SIZE]; |
378 | int busy; | | 403 | int busy; |
379 | int pid; | | 404 | int pid; |
380 | int caps; | | 405 | int caps; |
381 | int iformats; | | 406 | int iformats; |
382 | int oformats; | | 407 | int oformats; |
383 | int magic; /* Unused */ | | 408 | int magic; /* Unused */ |
384 | char cmd[OSS_LONGNAME_SIZE]; | | 409 | char cmd[OSS_LONGNAME_SIZE]; |
385 | int card_number; | | 410 | int card_number; |
386 | int port_number; | | 411 | int port_number; |
387 | int mixer_dev; | | 412 | int mixer_dev; |
388 | int legacy_device; /* Obsolete */ | | 413 | int legacy_device; /* Obsolete */ |
389 | int enabled; | | 414 | int enabled; |
390 | int flags; /* Reserved */ | | 415 | int flags; /* Reserved */ |
391 | int min_rate; | | 416 | int min_rate; |
392 | int max_rate; | | 417 | int max_rate; |
393 | int min_channels; | | 418 | int min_channels; |
394 | int max_channels; | | 419 | int max_channels; |
395 | int binding; /* Reserved */ | | 420 | int binding; /* Reserved */ |
396 | int rate_source; | | 421 | int rate_source; |
397 | char handle[32]; | | 422 | char handle[32]; |
398 | #define OSS_MAX_SAMPLE_RATES 20 | | 423 | #define OSS_MAX_SAMPLE_RATES 20 |
399 | int nrates; | | 424 | int nrates; |
400 | int rates[OSS_MAX_SAMPLE_RATES]; | | 425 | int rates[OSS_MAX_SAMPLE_RATES]; |
401 | char song_name[OSS_LONGNAME_SIZE]; | | 426 | char song_name[OSS_LONGNAME_SIZE]; |
402 | char label[OSS_LABEL_SIZE]; | | 427 | char label[OSS_LABEL_SIZE]; |
403 | int latency; /* In usecs -1 = unknown */ | | 428 | int latency; /* In usecs -1 = unknown */ |
404 | char devnode[OSS_DEVNODE_SIZE]; | | 429 | char devnode[OSS_DEVNODE_SIZE]; |
405 | int next_play_engine; | | 430 | int next_play_engine; |
406 | int next_rec_engine; | | 431 | int next_rec_engine; |
407 | int filler[184]; /* For expansion */ | | 432 | int filler[184]; /* For expansion */ |
408 | } oss_audioinfo; | | 433 | } oss_audioinfo; |
409 | | | 434 | |
410 | typedef struct oss_card_info { | | 435 | typedef struct oss_card_info { |
411 | int card; | | 436 | int card; |
412 | char shortname[16]; | | 437 | char shortname[16]; |
413 | char longname[128]; | | 438 | char longname[128]; |
414 | int flags; | | 439 | int flags; |
415 | char hw_info[400]; | | 440 | char hw_info[400]; |
416 | int intr_count; | | 441 | int intr_count; |
417 | int ack_count; | | 442 | int ack_count; |
418 | int filler[154]; | | 443 | int filler[154]; |
419 | } oss_card_info; | | 444 | } oss_card_info; |
420 | | | 445 | |
421 | #define SNDCTL_SYSINFO _IOR ('X', 1, oss_sysinfo) | | 446 | #define SNDCTL_SYSINFO _IOR ('X', 1, oss_sysinfo) |
422 | #define OSS_SYSINFO SNDCTL_SYSINFO /* Old name */ | | 447 | #define OSS_SYSINFO SNDCTL_SYSINFO /* Old name */ |
423 | #define SNDCTL_MIX_NRMIX _IOR ('X',2, int) | | 448 | #define SNDCTL_MIX_NRMIX _IOR ('X',2, int) |
424 | #define SNDCTL_MIX_NREXT _IOWR ('X',3, int) | | 449 | #define SNDCTL_MIX_NREXT _IOWR ('X',3, int) |
425 | #define SNDCTL_MIX_EXTINFO _IOWR ('X',4, oss_mixext) | | 450 | #define SNDCTL_MIX_EXTINFO _IOWR ('X',4, oss_mixext) |
426 | #define SNDCTL_MIX_READ _IOWR ('X',5, oss_mixer_value) | | 451 | #define SNDCTL_MIX_READ _IOWR ('X',5, oss_mixer_value) |
427 | #define SNDCTL_MIX_WRITE _IOWR ('X',6, oss_mixer_value) | | 452 | #define SNDCTL_MIX_WRITE _IOWR ('X',6, oss_mixer_value) |
428 | #define SNDCTL_AUDIOINFO _IOWR ('X',7, oss_audioinfo) | | 453 | #define SNDCTL_AUDIOINFO _IOWR ('X',7, oss_audioinfo) |
429 | #define SNDCTL_MIX_ENUMINFO _IOWR ('X',8, oss_mixer_enuminfo) | | 454 | #define SNDCTL_MIX_ENUMINFO _IOWR ('X',8, oss_mixer_enuminfo) |
430 | #define SNDCTL_MIXERINFO _IOWR ('X',10, oss_mixerinfo) | | 455 | #define SNDCTL_MIXERINFO _IOWR ('X',10, oss_mixerinfo) |
431 | #define SNDCTL_CARDINFO _IOWR ('X',11, oss_card_info) | | 456 | #define SNDCTL_CARDINFO _IOWR ('X',11, oss_card_info) |
432 | #define SNDCTL_ENGINEINFO _IOWR ('X',12, oss_audioinfo) | | 457 | #define SNDCTL_ENGINEINFO _IOWR ('X',12, oss_audioinfo) |
433 | #define SNDCTL_AUDIOINFO_EX _IOWR ('X',13, oss_audioinfo) | | 458 | #define SNDCTL_AUDIOINFO_EX _IOWR ('X',13, oss_audioinfo) |
434 | #define SNDCTL_MIX_DESCRIPTION _IOWR ('X',14, oss_mixer_enuminfo) | | 459 | #define SNDCTL_MIX_DESCRIPTION _IOWR ('X',14, oss_mixer_enuminfo) |
435 | | | 460 | |
436 | #define MIXT_DEVROOT 0 /* Used for default classes */ | | 461 | #define MIXT_DEVROOT 0 /* Used for default classes */ |
437 | #define MIXT_GROUP 1 /* Used for classes */ | | 462 | #define MIXT_GROUP 1 /* Used for classes */ |
438 | #define MIXT_ONOFF 2 /* Used for mute controls */ | | 463 | #define MIXT_ONOFF 2 /* Used for mute controls */ |
439 | #define MIXT_ENUM 3 /* Used for enum controls */ | | 464 | #define MIXT_ENUM 3 /* Used for enum controls */ |
440 | #define MIXT_MONOSLIDER 4 /* Used for mono and surround controls */ | | 465 | #define MIXT_MONOSLIDER 4 /* Used for mono and surround controls */ |
441 | #define MIXT_STEREOSLIDER 5 /* Used for stereo controls */ | | 466 | #define MIXT_STEREOSLIDER 5 /* Used for stereo controls */ |
442 | #define MIXT_MESSAGE 6 /* OSS compat, unused on NetBSD */ | | 467 | #define MIXT_MESSAGE 6 /* OSS compat, unused on NetBSD */ |
443 | #define MIXT_MONOVU 7 /* OSS compat, unused on NetBSD */ | | 468 | #define MIXT_MONOVU 7 /* OSS compat, unused on NetBSD */ |
444 | #define MIXT_STEREOVU 8 /* OSS compat, unused on NetBSD */ | | 469 | #define MIXT_STEREOVU 8 /* OSS compat, unused on NetBSD */ |
445 | #define MIXT_MONOPEAK 9 /* OSS compat, unused on NetBSD */ | | 470 | #define MIXT_MONOPEAK 9 /* OSS compat, unused on NetBSD */ |
446 | #define MIXT_STEREOPEAK 10 /* OSS compat, unused on NetBSD */ | | 471 | #define MIXT_STEREOPEAK 10 /* OSS compat, unused on NetBSD */ |
447 | #define MIXT_RADIOGROUP 11 /* OSS compat, unused on NetBSD */ | | 472 | #define MIXT_RADIOGROUP 11 /* OSS compat, unused on NetBSD */ |
448 | #define MIXT_MARKER 12 /* OSS compat, unused on NetBSD */ | | 473 | #define MIXT_MARKER 12 /* OSS compat, unused on NetBSD */ |
449 | #define MIXT_VALUE 13 /* OSS compat, unused on NetBSD */ | | 474 | #define MIXT_VALUE 13 /* OSS compat, unused on NetBSD */ |
450 | #define MIXT_HEXVALUE 14 /* OSS compat, unused on NetBSD */ | | 475 | #define MIXT_HEXVALUE 14 /* OSS compat, unused on NetBSD */ |
451 | #define MIXT_MONODB 15 /* OSS compat, unused on NetBSD */ | | 476 | #define MIXT_MONODB 15 /* OSS compat, unused on NetBSD */ |
452 | #define MIXT_STEREODB 16 /* OSS compat, unused on NetBSD */ | | 477 | #define MIXT_STEREODB 16 /* OSS compat, unused on NetBSD */ |
453 | #define MIXT_SLIDER 17 /* OSS compat, unused on NetBSD */ | | 478 | #define MIXT_SLIDER 17 /* OSS compat, unused on NetBSD */ |
454 | #define MIXT_3D 18 /* OSS compat, unused on NetBSD */ | | 479 | #define MIXT_3D 18 /* OSS compat, unused on NetBSD */ |
455 | #define MIXT_MONOSLIDER16 19 /* OSS compat, unused on NetBSD */ | | 480 | #define MIXT_MONOSLIDER16 19 /* OSS compat, unused on NetBSD */ |
456 | #define MIXT_STEREOSLIDER16 20 /* OSS compat, unused on NetBSD */ | | 481 | #define MIXT_STEREOSLIDER16 20 /* OSS compat, unused on NetBSD */ |
457 | #define MIXT_MUTE 21 /* OSS compat, unused on NetBSD */ | | 482 | #define MIXT_MUTE 21 /* OSS compat, unused on NetBSD */ |
458 | /* | | 483 | /* |
459 | * Should be used for Set controls. | | 484 | * Should be used for Set controls. |
460 | * In practice nothing uses this because it's "reserved for Sun's | | 485 | * In practice nothing uses this because it's "reserved for Sun's |
461 | * implementation". | | 486 | * implementation". |
462 | */ | | 487 | */ |
463 | #define MIXT_ENUM_MULTI 22 | | 488 | #define MIXT_ENUM_MULTI 22 |
464 | | | 489 | |
465 | #define MIXF_READABLE 0x00000001 /* Value is readable: always true */ | | 490 | #define MIXF_READABLE 0x00000001 /* Value is readable: always true */ |
466 | #define MIXF_WRITEABLE 0x00000002 /* Value is writable: always true */ | | 491 | #define MIXF_WRITEABLE 0x00000002 /* Value is writable: always true */ |
467 | #define MIXF_POLL 0x00000004 /* Can change between reads: always true */ | | 492 | #define MIXF_POLL 0x00000004 /* Can change between reads: always true */ |
468 | #define MIXF_HZ 0x00000008 /* OSS compat, unused on NetBSD */ | | 493 | #define MIXF_HZ 0x00000008 /* OSS compat, unused on NetBSD */ |
469 | #define MIXF_STRING 0x00000010 /* OSS compat, unused on NetBSD */ | | 494 | #define MIXF_STRING 0x00000010 /* OSS compat, unused on NetBSD */ |
470 | #define MIXF_DYNAMIC 0x00000010 /* OSS compat, unused on NetBSD */ | | 495 | #define MIXF_DYNAMIC 0x00000010 /* OSS compat, unused on NetBSD */ |
471 | #define MIXF_OKFAIL 0x00000020 /* OSS compat, unused on NetBSD */ | | 496 | #define MIXF_OKFAIL 0x00000020 /* OSS compat, unused on NetBSD */ |
472 | #define MIXF_FLAT 0x00000040 /* OSS compat, unused on NetBSD */ | | 497 | #define MIXF_FLAT 0x00000040 /* OSS compat, unused on NetBSD */ |
473 | #define MIXF_LEGACY 0x00000080 /* OSS compat, unused on NetBSD */ | | 498 | #define MIXF_LEGACY 0x00000080 /* OSS compat, unused on NetBSD */ |
474 | #define MIXF_CENTIBEL 0x00000100 /* OSS compat, unused on NetBSD */ | | 499 | #define MIXF_CENTIBEL 0x00000100 /* OSS compat, unused on NetBSD */ |
475 | #define MIXF_DECIBEL 0x00000200 /* OSS compat, unused on NetBSD */ | | 500 | #define MIXF_DECIBEL 0x00000200 /* OSS compat, unused on NetBSD */ |
476 | #define MIXF_MAINVOL 0x00000400 /* OSS compat, unused on NetBSD */ | | 501 | #define MIXF_MAINVOL 0x00000400 /* OSS compat, unused on NetBSD */ |
477 | #define MIXF_PCMVOL 0x00000800 /* OSS compat, unused on NetBSD */ | | 502 | #define MIXF_PCMVOL 0x00000800 /* OSS compat, unused on NetBSD */ |
478 | #define MIXF_RECVOL 0x00001000 /* OSS compat, unused on NetBSD */ | | 503 | #define MIXF_RECVOL 0x00001000 /* OSS compat, unused on NetBSD */ |
479 | #define MIXF_MONVOL 0x00002000 /* OSS compat, unused on NetBSD */ | | 504 | #define MIXF_MONVOL 0x00002000 /* OSS compat, unused on NetBSD */ |
480 | #define MIXF_WIDE 0x00004000 /* OSS compat, unused on NetBSD */ | | 505 | #define MIXF_WIDE 0x00004000 /* OSS compat, unused on NetBSD */ |
481 | #define MIXF_DESCR 0x00008000 /* OSS compat, unused on NetBSD */ | | 506 | #define MIXF_DESCR 0x00008000 /* OSS compat, unused on NetBSD */ |
482 | #define MIXF_DISABLED 0x00010000 /* OSS compat, unused on NetBSD */ | | 507 | #define MIXF_DISABLED 0x00010000 /* OSS compat, unused on NetBSD */ |
483 | | | 508 | |
484 | /* None of the mixer capabilities are set on NetBSD. */ | | 509 | /* None of the mixer capabilities are set on NetBSD. */ |
485 | #define MIXER_CAP_VIRTUAL 0x00000001 /* Virtual device */ | | 510 | #define MIXER_CAP_VIRTUAL 0x00000001 /* Virtual device */ |
486 | #define MIXER_CAP_LAYOUT_B 0x00000002 /* "Internal use only" */ | | 511 | #define MIXER_CAP_LAYOUT_B 0x00000002 /* "Internal use only" */ |
487 | #define MIXER_CAP_NARROW 0x00000004 /* "Conserve screen space" */ | | 512 | #define MIXER_CAP_NARROW 0x00000004 /* "Conserve screen space" */ |
488 | | | 513 | |
489 | #define OSS_ID_SIZE 16 | | 514 | #define OSS_ID_SIZE 16 |
490 | typedef char oss_id_t[OSS_ID_SIZE]; | | 515 | typedef char oss_id_t[OSS_ID_SIZE]; |
491 | #define OSS_DEVNODE_SIZE 32 | | 516 | #define OSS_DEVNODE_SIZE 32 |
492 | typedef char oss_devnode_t[OSS_DEVNODE_SIZE]; | | 517 | typedef char oss_devnode_t[OSS_DEVNODE_SIZE]; |
493 | #define OSS_HANDLE_SIZE 32 | | 518 | #define OSS_HANDLE_SIZE 32 |
494 | typedef char oss_handle_t[OSS_HANDLE_SIZE]; | | 519 | typedef char oss_handle_t[OSS_HANDLE_SIZE]; |
495 | #define OSS_LONGNAME_SIZE 64 | | 520 | #define OSS_LONGNAME_SIZE 64 |
496 | typedef char oss_longname_t[OSS_LONGNAME_SIZE]; | | 521 | typedef char oss_longname_t[OSS_LONGNAME_SIZE]; |
497 | #define OSS_LABEL_SIZE 16 | | 522 | #define OSS_LABEL_SIZE 16 |
498 | typedef char oss_label_t[OSS_LABEL_SIZE]; | | 523 | typedef char oss_label_t[OSS_LABEL_SIZE]; |
499 | | | 524 | |
500 | typedef struct oss_mixext_root { | | 525 | typedef struct oss_mixext_root { |
501 | oss_id_t id; | | 526 | oss_id_t id; |
502 | char name[48]; | | 527 | char name[48]; |
503 | } oss_mixext_root; | | 528 | } oss_mixext_root; |
504 | | | 529 | |
505 | typedef struct oss_mixerinfo { | | 530 | typedef struct oss_mixerinfo { |
506 | int dev; | | 531 | int dev; |
507 | oss_id_t id; | | 532 | oss_id_t id; |
508 | char name[32]; | | 533 | char name[32]; |
509 | int modify_counter; | | 534 | int modify_counter; |
510 | int card_number; | | 535 | int card_number; |
511 | int port_number; | | 536 | int port_number; |
512 | oss_handle_t handle; | | 537 | oss_handle_t handle; |
513 | int magic; /* "Reserved for internal use" */ | | 538 | int magic; /* "Reserved for internal use" */ |
514 | int enabled; | | 539 | int enabled; |
515 | int caps; | | 540 | int caps; |
516 | int flags; /* "Reserved for internal use" */ | | 541 | int flags; /* "Reserved for internal use" */ |
517 | int nrext; | | 542 | int nrext; |
518 | int priority; | | 543 | int priority; |
519 | oss_devnode_t devnode; | | 544 | oss_devnode_t devnode; |
520 | int legacy_device; | | 545 | int legacy_device; |
521 | int filler[245]; | | 546 | int filler[245]; |
522 | } oss_mixerinfo; | | 547 | } oss_mixerinfo; |
523 | | | 548 | |
524 | typedef struct oss_mixer_value { | | 549 | typedef struct oss_mixer_value { |
525 | int dev; /* Set by caller */ | | 550 | int dev; /* Set by caller */ |
526 | int ctrl; /* Set by caller */ | | 551 | int ctrl; /* Set by caller */ |
527 | int value; | | 552 | int value; |
528 | int flags; /* Reserved for "future use" */ | | 553 | int flags; /* Reserved for "future use" */ |
529 | int timestamp; | | 554 | int timestamp; |
530 | int filler[8]; /* Reserved for "future use" */ | | 555 | int filler[8]; /* Reserved for "future use" */ |
531 | } oss_mixer_value; | | 556 | } oss_mixer_value; |
532 | | | 557 | |
533 | #define OSS_ENUM_MAXVALUE 255 | | 558 | #define OSS_ENUM_MAXVALUE 255 |
534 | #define OSS_ENUM_STRINGSIZE 3000 | | 559 | #define OSS_ENUM_STRINGSIZE 3000 |
535 | | | 560 | |
536 | typedef struct oss_mixer_enuminfo { | | 561 | typedef struct oss_mixer_enuminfo { |
537 | int dev; /* Set by caller */ | | 562 | int dev; /* Set by caller */ |
538 | int ctrl; /* Set by caller */ | | 563 | int ctrl; /* Set by caller */ |
539 | int nvalues; | | 564 | int nvalues; |
540 | int version; | | 565 | int version; |
541 | short strindex[OSS_ENUM_MAXVALUE]; | | 566 | short strindex[OSS_ENUM_MAXVALUE]; |
542 | char strings[OSS_ENUM_STRINGSIZE]; | | 567 | char strings[OSS_ENUM_STRINGSIZE]; |
543 | } oss_mixer_enuminfo; | | 568 | } oss_mixer_enuminfo; |
544 | | | 569 | |
545 | typedef struct oss_mixext { | | 570 | typedef struct oss_mixext { |
546 | int dev; | | 571 | int dev; |
547 | int ctrl; | | 572 | int ctrl; |
548 | int type; | | 573 | int type; |
549 | int maxvalue; | | 574 | int maxvalue; |
550 | int minvalue; | | 575 | int minvalue; |
551 | int flags; | | 576 | int flags; |
552 | oss_id_t id; | | 577 | oss_id_t id; |
553 | int parent; | | 578 | int parent; |
554 | int dummy; | | 579 | int dummy; |
555 | int timestamp; | | 580 | int timestamp; |
556 | char data[64]; | | 581 | char data[64]; |
557 | unsigned char enum_present[32]; | | 582 | unsigned char enum_present[32]; |
558 | int control_no; | | 583 | int control_no; |
559 | unsigned int desc; | | 584 | unsigned int desc; |
560 | char extname[32]; | | 585 | char extname[32]; |
561 | int update_counter; | | 586 | int update_counter; |
562 | int rgbcolor; | | 587 | int rgbcolor; |
563 | int filler[6]; | | 588 | int filler[6]; |
564 | } oss_mixext; | | 589 | } oss_mixext; |
565 | | | 590 | |
566 | | | 591 | |
567 | /* | | 592 | /* |
568 | * These are no-ops on FreeBSD, NetBSD, and Solaris, | | 593 | * These are no-ops on FreeBSD, NetBSD, and Solaris, |
569 | * but are defined for compatibility with OSSv4. | | 594 | * but are defined for compatibility with OSSv4. |
570 | */ | | 595 | */ |
571 | #define SNDCTL_SETSONG _IOW ('Y',2, oss_longname_t) | | 596 | #define SNDCTL_SETSONG _IOW ('Y',2, oss_longname_t) |
572 | #define SNDCTL_GETSONG _IOR ('Y',2, oss_longname_t) | | 597 | #define SNDCTL_GETSONG _IOR ('Y',2, oss_longname_t) |
573 | #define SNDCTL_SETNAME _IOW ('Y',3, oss_longname_t) | | 598 | #define SNDCTL_SETNAME _IOW ('Y',3, oss_longname_t) |
574 | #define SNDCTL_SETLABEL _IOW ('Y',4, oss_label_t) | | 599 | #define SNDCTL_SETLABEL _IOW ('Y',4, oss_label_t) |
575 | #define SNDCTL_GETLABEL _IOR ('Y',4, oss_label_t) | | 600 | #define SNDCTL_GETLABEL _IOR ('Y',4, oss_label_t) |
576 | | | 601 | |
577 | #define ioctl _oss_ioctl | | 602 | #define ioctl _oss_ioctl |
578 | /* | | 603 | /* |
579 | * If we already included <sys/ioctl.h>, then we define our own prototype, | | 604 | * If we already included <sys/ioctl.h>, then we define our own prototype, |
580 | * else we depend on <sys/ioctl.h> to do it for us. We do it this way, so | | 605 | * else we depend on <sys/ioctl.h> to do it for us. We do it this way, so |
581 | * that we don't define the prototype twice. | | 606 | * that we don't define the prototype twice. |
582 | */ | | 607 | */ |
583 | #ifndef _SYS_IOCTL_H_ | | 608 | #ifndef _SYS_IOCTL_H_ |
584 | #include <sys/ioctl.h> | | 609 | #include <sys/ioctl.h> |
585 | #else | | 610 | #else |
586 | __BEGIN_DECLS | | 611 | __BEGIN_DECLS |
587 | int _oss_ioctl(int, unsigned long, ...); | | 612 | int _oss_ioctl(int, unsigned long, ...); |
588 | __END_DECLS | | 613 | __END_DECLS |
589 | #endif | | 614 | #endif |
590 | | | 615 | |
591 | #endif /* !_SOUNDCARD_H_ */ | | 616 | #endif /* !_SOUNDCARD_H_ */ |