diff options
Diffstat (limited to 'include/uapi')
-rw-r--r-- | include/uapi/sound/Kbuild | 10 | ||||
-rw-r--r-- | include/uapi/sound/asequencer.h | 614 | ||||
-rw-r--r-- | include/uapi/sound/asound.h | 957 | ||||
-rw-r--r-- | include/uapi/sound/asound_fm.h | 134 | ||||
-rw-r--r-- | include/uapi/sound/compress_offload.h | 161 | ||||
-rw-r--r-- | include/uapi/sound/compress_params.h | 400 | ||||
-rw-r--r-- | include/uapi/sound/emu10k1.h | 373 | ||||
-rw-r--r-- | include/uapi/sound/hdsp.h | 110 | ||||
-rw-r--r-- | include/uapi/sound/hdspm.h | 229 | ||||
-rw-r--r-- | include/uapi/sound/sb16_csp.h | 122 | ||||
-rw-r--r-- | include/uapi/sound/sfnt_info.h | 212 |
11 files changed, 3322 insertions, 0 deletions
diff --git a/include/uapi/sound/Kbuild b/include/uapi/sound/Kbuild index aafaa5aa54d4..0f7d279ebde3 100644 --- a/include/uapi/sound/Kbuild +++ b/include/uapi/sound/Kbuild | |||
@@ -1 +1,11 @@ | |||
1 | # UAPI Header export list | 1 | # UAPI Header export list |
2 | header-y += asequencer.h | ||
3 | header-y += asound.h | ||
4 | header-y += asound_fm.h | ||
5 | header-y += compress_offload.h | ||
6 | header-y += compress_params.h | ||
7 | header-y += emu10k1.h | ||
8 | header-y += hdsp.h | ||
9 | header-y += hdspm.h | ||
10 | header-y += sb16_csp.h | ||
11 | header-y += sfnt_info.h | ||
diff --git a/include/uapi/sound/asequencer.h b/include/uapi/sound/asequencer.h new file mode 100644 index 000000000000..09c8a00ea503 --- /dev/null +++ b/include/uapi/sound/asequencer.h | |||
@@ -0,0 +1,614 @@ | |||
1 | /* | ||
2 | * Main header file for the ALSA sequencer | ||
3 | * Copyright (c) 1998-1999 by Frank van de Pol <fvdpol@coil.demon.nl> | ||
4 | * (c) 1998-1999 by Jaroslav Kysela <perex@perex.cz> | ||
5 | * | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation; either version 2 of the License, or | ||
10 | * (at your option) any later version. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
20 | * | ||
21 | */ | ||
22 | #ifndef _UAPI__SOUND_ASEQUENCER_H | ||
23 | #define _UAPI__SOUND_ASEQUENCER_H | ||
24 | |||
25 | |||
26 | /** version of the sequencer */ | ||
27 | #define SNDRV_SEQ_VERSION SNDRV_PROTOCOL_VERSION (1, 0, 1) | ||
28 | |||
29 | /** | ||
30 | * definition of sequencer event types | ||
31 | */ | ||
32 | |||
33 | /** system messages | ||
34 | * event data type = #snd_seq_result | ||
35 | */ | ||
36 | #define SNDRV_SEQ_EVENT_SYSTEM 0 | ||
37 | #define SNDRV_SEQ_EVENT_RESULT 1 | ||
38 | |||
39 | /** note messages (channel specific) | ||
40 | * event data type = #snd_seq_ev_note | ||
41 | */ | ||
42 | #define SNDRV_SEQ_EVENT_NOTE 5 | ||
43 | #define SNDRV_SEQ_EVENT_NOTEON 6 | ||
44 | #define SNDRV_SEQ_EVENT_NOTEOFF 7 | ||
45 | #define SNDRV_SEQ_EVENT_KEYPRESS 8 | ||
46 | |||
47 | /** control messages (channel specific) | ||
48 | * event data type = #snd_seq_ev_ctrl | ||
49 | */ | ||
50 | #define SNDRV_SEQ_EVENT_CONTROLLER 10 | ||
51 | #define SNDRV_SEQ_EVENT_PGMCHANGE 11 | ||
52 | #define SNDRV_SEQ_EVENT_CHANPRESS 12 | ||
53 | #define SNDRV_SEQ_EVENT_PITCHBEND 13 /**< from -8192 to 8191 */ | ||
54 | #define SNDRV_SEQ_EVENT_CONTROL14 14 /**< 14 bit controller value */ | ||
55 | #define SNDRV_SEQ_EVENT_NONREGPARAM 15 /**< 14 bit NRPN address + 14 bit unsigned value */ | ||
56 | #define SNDRV_SEQ_EVENT_REGPARAM 16 /**< 14 bit RPN address + 14 bit unsigned value */ | ||
57 | |||
58 | /** synchronisation messages | ||
59 | * event data type = #snd_seq_ev_ctrl | ||
60 | */ | ||
61 | #define SNDRV_SEQ_EVENT_SONGPOS 20 /* Song Position Pointer with LSB and MSB values */ | ||
62 | #define SNDRV_SEQ_EVENT_SONGSEL 21 /* Song Select with song ID number */ | ||
63 | #define SNDRV_SEQ_EVENT_QFRAME 22 /* midi time code quarter frame */ | ||
64 | #define SNDRV_SEQ_EVENT_TIMESIGN 23 /* SMF Time Signature event */ | ||
65 | #define SNDRV_SEQ_EVENT_KEYSIGN 24 /* SMF Key Signature event */ | ||
66 | |||
67 | /** timer messages | ||
68 | * event data type = snd_seq_ev_queue_control | ||
69 | */ | ||
70 | #define SNDRV_SEQ_EVENT_START 30 /* midi Real Time Start message */ | ||
71 | #define SNDRV_SEQ_EVENT_CONTINUE 31 /* midi Real Time Continue message */ | ||
72 | #define SNDRV_SEQ_EVENT_STOP 32 /* midi Real Time Stop message */ | ||
73 | #define SNDRV_SEQ_EVENT_SETPOS_TICK 33 /* set tick queue position */ | ||
74 | #define SNDRV_SEQ_EVENT_SETPOS_TIME 34 /* set realtime queue position */ | ||
75 | #define SNDRV_SEQ_EVENT_TEMPO 35 /* (SMF) Tempo event */ | ||
76 | #define SNDRV_SEQ_EVENT_CLOCK 36 /* midi Real Time Clock message */ | ||
77 | #define SNDRV_SEQ_EVENT_TICK 37 /* midi Real Time Tick message */ | ||
78 | #define SNDRV_SEQ_EVENT_QUEUE_SKEW 38 /* skew queue tempo */ | ||
79 | |||
80 | /** others | ||
81 | * event data type = none | ||
82 | */ | ||
83 | #define SNDRV_SEQ_EVENT_TUNE_REQUEST 40 /* tune request */ | ||
84 | #define SNDRV_SEQ_EVENT_RESET 41 /* reset to power-on state */ | ||
85 | #define SNDRV_SEQ_EVENT_SENSING 42 /* "active sensing" event */ | ||
86 | |||
87 | /** echo back, kernel private messages | ||
88 | * event data type = any type | ||
89 | */ | ||
90 | #define SNDRV_SEQ_EVENT_ECHO 50 /* echo event */ | ||
91 | #define SNDRV_SEQ_EVENT_OSS 51 /* OSS raw event */ | ||
92 | |||
93 | /** system status messages (broadcast for subscribers) | ||
94 | * event data type = snd_seq_addr | ||
95 | */ | ||
96 | #define SNDRV_SEQ_EVENT_CLIENT_START 60 /* new client has connected */ | ||
97 | #define SNDRV_SEQ_EVENT_CLIENT_EXIT 61 /* client has left the system */ | ||
98 | #define SNDRV_SEQ_EVENT_CLIENT_CHANGE 62 /* client status/info has changed */ | ||
99 | #define SNDRV_SEQ_EVENT_PORT_START 63 /* new port was created */ | ||
100 | #define SNDRV_SEQ_EVENT_PORT_EXIT 64 /* port was deleted from system */ | ||
101 | #define SNDRV_SEQ_EVENT_PORT_CHANGE 65 /* port status/info has changed */ | ||
102 | |||
103 | /** port connection changes | ||
104 | * event data type = snd_seq_connect | ||
105 | */ | ||
106 | #define SNDRV_SEQ_EVENT_PORT_SUBSCRIBED 66 /* ports connected */ | ||
107 | #define SNDRV_SEQ_EVENT_PORT_UNSUBSCRIBED 67 /* ports disconnected */ | ||
108 | |||
109 | /* 70-89: synthesizer events - obsoleted */ | ||
110 | |||
111 | /** user-defined events with fixed length | ||
112 | * event data type = any | ||
113 | */ | ||
114 | #define SNDRV_SEQ_EVENT_USR0 90 | ||
115 | #define SNDRV_SEQ_EVENT_USR1 91 | ||
116 | #define SNDRV_SEQ_EVENT_USR2 92 | ||
117 | #define SNDRV_SEQ_EVENT_USR3 93 | ||
118 | #define SNDRV_SEQ_EVENT_USR4 94 | ||
119 | #define SNDRV_SEQ_EVENT_USR5 95 | ||
120 | #define SNDRV_SEQ_EVENT_USR6 96 | ||
121 | #define SNDRV_SEQ_EVENT_USR7 97 | ||
122 | #define SNDRV_SEQ_EVENT_USR8 98 | ||
123 | #define SNDRV_SEQ_EVENT_USR9 99 | ||
124 | |||
125 | /* 100-118: instrument layer - obsoleted */ | ||
126 | /* 119-129: reserved */ | ||
127 | |||
128 | /* 130-139: variable length events | ||
129 | * event data type = snd_seq_ev_ext | ||
130 | * (SNDRV_SEQ_EVENT_LENGTH_VARIABLE must be set) | ||
131 | */ | ||
132 | #define SNDRV_SEQ_EVENT_SYSEX 130 /* system exclusive data (variable length) */ | ||
133 | #define SNDRV_SEQ_EVENT_BOUNCE 131 /* error event */ | ||
134 | /* 132-134: reserved */ | ||
135 | #define SNDRV_SEQ_EVENT_USR_VAR0 135 | ||
136 | #define SNDRV_SEQ_EVENT_USR_VAR1 136 | ||
137 | #define SNDRV_SEQ_EVENT_USR_VAR2 137 | ||
138 | #define SNDRV_SEQ_EVENT_USR_VAR3 138 | ||
139 | #define SNDRV_SEQ_EVENT_USR_VAR4 139 | ||
140 | |||
141 | /* 150-151: kernel events with quote - DO NOT use in user clients */ | ||
142 | #define SNDRV_SEQ_EVENT_KERNEL_ERROR 150 | ||
143 | #define SNDRV_SEQ_EVENT_KERNEL_QUOTE 151 /* obsolete */ | ||
144 | |||
145 | /* 152-191: reserved */ | ||
146 | |||
147 | /* 192-254: hardware specific events */ | ||
148 | |||
149 | /* 255: special event */ | ||
150 | #define SNDRV_SEQ_EVENT_NONE 255 | ||
151 | |||
152 | |||
153 | typedef unsigned char snd_seq_event_type_t; | ||
154 | |||
155 | /** event address */ | ||
156 | struct snd_seq_addr { | ||
157 | unsigned char client; /**< Client number: 0..255, 255 = broadcast to all clients */ | ||
158 | unsigned char port; /**< Port within client: 0..255, 255 = broadcast to all ports */ | ||
159 | }; | ||
160 | |||
161 | /** port connection */ | ||
162 | struct snd_seq_connect { | ||
163 | struct snd_seq_addr sender; | ||
164 | struct snd_seq_addr dest; | ||
165 | }; | ||
166 | |||
167 | |||
168 | #define SNDRV_SEQ_ADDRESS_UNKNOWN 253 /* unknown source */ | ||
169 | #define SNDRV_SEQ_ADDRESS_SUBSCRIBERS 254 /* send event to all subscribed ports */ | ||
170 | #define SNDRV_SEQ_ADDRESS_BROADCAST 255 /* send event to all queues/clients/ports/channels */ | ||
171 | #define SNDRV_SEQ_QUEUE_DIRECT 253 /* direct dispatch */ | ||
172 | |||
173 | /* event mode flag - NOTE: only 8 bits available! */ | ||
174 | #define SNDRV_SEQ_TIME_STAMP_TICK (0<<0) /* timestamp in clock ticks */ | ||
175 | #define SNDRV_SEQ_TIME_STAMP_REAL (1<<0) /* timestamp in real time */ | ||
176 | #define SNDRV_SEQ_TIME_STAMP_MASK (1<<0) | ||
177 | |||
178 | #define SNDRV_SEQ_TIME_MODE_ABS (0<<1) /* absolute timestamp */ | ||
179 | #define SNDRV_SEQ_TIME_MODE_REL (1<<1) /* relative to current time */ | ||
180 | #define SNDRV_SEQ_TIME_MODE_MASK (1<<1) | ||
181 | |||
182 | #define SNDRV_SEQ_EVENT_LENGTH_FIXED (0<<2) /* fixed event size */ | ||
183 | #define SNDRV_SEQ_EVENT_LENGTH_VARIABLE (1<<2) /* variable event size */ | ||
184 | #define SNDRV_SEQ_EVENT_LENGTH_VARUSR (2<<2) /* variable event size - user memory space */ | ||
185 | #define SNDRV_SEQ_EVENT_LENGTH_MASK (3<<2) | ||
186 | |||
187 | #define SNDRV_SEQ_PRIORITY_NORMAL (0<<4) /* normal priority */ | ||
188 | #define SNDRV_SEQ_PRIORITY_HIGH (1<<4) /* event should be processed before others */ | ||
189 | #define SNDRV_SEQ_PRIORITY_MASK (1<<4) | ||
190 | |||
191 | |||
192 | /* note event */ | ||
193 | struct snd_seq_ev_note { | ||
194 | unsigned char channel; | ||
195 | unsigned char note; | ||
196 | unsigned char velocity; | ||
197 | unsigned char off_velocity; /* only for SNDRV_SEQ_EVENT_NOTE */ | ||
198 | unsigned int duration; /* only for SNDRV_SEQ_EVENT_NOTE */ | ||
199 | }; | ||
200 | |||
201 | /* controller event */ | ||
202 | struct snd_seq_ev_ctrl { | ||
203 | unsigned char channel; | ||
204 | unsigned char unused1, unused2, unused3; /* pad */ | ||
205 | unsigned int param; | ||
206 | signed int value; | ||
207 | }; | ||
208 | |||
209 | /* generic set of bytes (12x8 bit) */ | ||
210 | struct snd_seq_ev_raw8 { | ||
211 | unsigned char d[12]; /* 8 bit value */ | ||
212 | }; | ||
213 | |||
214 | /* generic set of integers (3x32 bit) */ | ||
215 | struct snd_seq_ev_raw32 { | ||
216 | unsigned int d[3]; /* 32 bit value */ | ||
217 | }; | ||
218 | |||
219 | /* external stored data */ | ||
220 | struct snd_seq_ev_ext { | ||
221 | unsigned int len; /* length of data */ | ||
222 | void *ptr; /* pointer to data (note: maybe 64-bit) */ | ||
223 | } __attribute__((packed)); | ||
224 | |||
225 | struct snd_seq_result { | ||
226 | int event; /* processed event type */ | ||
227 | int result; | ||
228 | }; | ||
229 | |||
230 | |||
231 | struct snd_seq_real_time { | ||
232 | unsigned int tv_sec; /* seconds */ | ||
233 | unsigned int tv_nsec; /* nanoseconds */ | ||
234 | }; | ||
235 | |||
236 | typedef unsigned int snd_seq_tick_time_t; /* midi ticks */ | ||
237 | |||
238 | union snd_seq_timestamp { | ||
239 | snd_seq_tick_time_t tick; | ||
240 | struct snd_seq_real_time time; | ||
241 | }; | ||
242 | |||
243 | struct snd_seq_queue_skew { | ||
244 | unsigned int value; | ||
245 | unsigned int base; | ||
246 | }; | ||
247 | |||
248 | /* queue timer control */ | ||
249 | struct snd_seq_ev_queue_control { | ||
250 | unsigned char queue; /* affected queue */ | ||
251 | unsigned char pad[3]; /* reserved */ | ||
252 | union { | ||
253 | signed int value; /* affected value (e.g. tempo) */ | ||
254 | union snd_seq_timestamp time; /* time */ | ||
255 | unsigned int position; /* sync position */ | ||
256 | struct snd_seq_queue_skew skew; | ||
257 | unsigned int d32[2]; | ||
258 | unsigned char d8[8]; | ||
259 | } param; | ||
260 | }; | ||
261 | |||
262 | /* quoted event - inside the kernel only */ | ||
263 | struct snd_seq_ev_quote { | ||
264 | struct snd_seq_addr origin; /* original sender */ | ||
265 | unsigned short value; /* optional data */ | ||
266 | struct snd_seq_event *event; /* quoted event */ | ||
267 | } __attribute__((packed)); | ||
268 | |||
269 | |||
270 | /* sequencer event */ | ||
271 | struct snd_seq_event { | ||
272 | snd_seq_event_type_t type; /* event type */ | ||
273 | unsigned char flags; /* event flags */ | ||
274 | char tag; | ||
275 | |||
276 | unsigned char queue; /* schedule queue */ | ||
277 | union snd_seq_timestamp time; /* schedule time */ | ||
278 | |||
279 | |||
280 | struct snd_seq_addr source; /* source address */ | ||
281 | struct snd_seq_addr dest; /* destination address */ | ||
282 | |||
283 | union { /* event data... */ | ||
284 | struct snd_seq_ev_note note; | ||
285 | struct snd_seq_ev_ctrl control; | ||
286 | struct snd_seq_ev_raw8 raw8; | ||
287 | struct snd_seq_ev_raw32 raw32; | ||
288 | struct snd_seq_ev_ext ext; | ||
289 | struct snd_seq_ev_queue_control queue; | ||
290 | union snd_seq_timestamp time; | ||
291 | struct snd_seq_addr addr; | ||
292 | struct snd_seq_connect connect; | ||
293 | struct snd_seq_result result; | ||
294 | struct snd_seq_ev_quote quote; | ||
295 | } data; | ||
296 | }; | ||
297 | |||
298 | |||
299 | /* | ||
300 | * bounce event - stored as variable size data | ||
301 | */ | ||
302 | struct snd_seq_event_bounce { | ||
303 | int err; | ||
304 | struct snd_seq_event event; | ||
305 | /* external data follows here. */ | ||
306 | }; | ||
307 | |||
308 | |||
309 | /* system information */ | ||
310 | struct snd_seq_system_info { | ||
311 | int queues; /* maximum queues count */ | ||
312 | int clients; /* maximum clients count */ | ||
313 | int ports; /* maximum ports per client */ | ||
314 | int channels; /* maximum channels per port */ | ||
315 | int cur_clients; /* current clients */ | ||
316 | int cur_queues; /* current queues */ | ||
317 | char reserved[24]; | ||
318 | }; | ||
319 | |||
320 | |||
321 | /* system running information */ | ||
322 | struct snd_seq_running_info { | ||
323 | unsigned char client; /* client id */ | ||
324 | unsigned char big_endian; /* 1 = big-endian */ | ||
325 | unsigned char cpu_mode; /* 4 = 32bit, 8 = 64bit */ | ||
326 | unsigned char pad; /* reserved */ | ||
327 | unsigned char reserved[12]; | ||
328 | }; | ||
329 | |||
330 | |||
331 | /* known client numbers */ | ||
332 | #define SNDRV_SEQ_CLIENT_SYSTEM 0 | ||
333 | /* internal client numbers */ | ||
334 | #define SNDRV_SEQ_CLIENT_DUMMY 14 /* midi through */ | ||
335 | #define SNDRV_SEQ_CLIENT_OSS 15 /* oss sequencer emulator */ | ||
336 | |||
337 | |||
338 | /* client types */ | ||
339 | typedef int __bitwise snd_seq_client_type_t; | ||
340 | #define NO_CLIENT ((__force snd_seq_client_type_t) 0) | ||
341 | #define USER_CLIENT ((__force snd_seq_client_type_t) 1) | ||
342 | #define KERNEL_CLIENT ((__force snd_seq_client_type_t) 2) | ||
343 | |||
344 | /* event filter flags */ | ||
345 | #define SNDRV_SEQ_FILTER_BROADCAST (1<<0) /* accept broadcast messages */ | ||
346 | #define SNDRV_SEQ_FILTER_MULTICAST (1<<1) /* accept multicast messages */ | ||
347 | #define SNDRV_SEQ_FILTER_BOUNCE (1<<2) /* accept bounce event in error */ | ||
348 | #define SNDRV_SEQ_FILTER_USE_EVENT (1<<31) /* use event filter */ | ||
349 | |||
350 | struct snd_seq_client_info { | ||
351 | int client; /* client number to inquire */ | ||
352 | snd_seq_client_type_t type; /* client type */ | ||
353 | char name[64]; /* client name */ | ||
354 | unsigned int filter; /* filter flags */ | ||
355 | unsigned char multicast_filter[8]; /* multicast filter bitmap */ | ||
356 | unsigned char event_filter[32]; /* event filter bitmap */ | ||
357 | int num_ports; /* RO: number of ports */ | ||
358 | int event_lost; /* number of lost events */ | ||
359 | char reserved[64]; /* for future use */ | ||
360 | }; | ||
361 | |||
362 | |||
363 | /* client pool size */ | ||
364 | struct snd_seq_client_pool { | ||
365 | int client; /* client number to inquire */ | ||
366 | int output_pool; /* outgoing (write) pool size */ | ||
367 | int input_pool; /* incoming (read) pool size */ | ||
368 | int output_room; /* minimum free pool size for select/blocking mode */ | ||
369 | int output_free; /* unused size */ | ||
370 | int input_free; /* unused size */ | ||
371 | char reserved[64]; | ||
372 | }; | ||
373 | |||
374 | |||
375 | /* Remove events by specified criteria */ | ||
376 | |||
377 | #define SNDRV_SEQ_REMOVE_INPUT (1<<0) /* Flush input queues */ | ||
378 | #define SNDRV_SEQ_REMOVE_OUTPUT (1<<1) /* Flush output queues */ | ||
379 | #define SNDRV_SEQ_REMOVE_DEST (1<<2) /* Restrict by destination q:client:port */ | ||
380 | #define SNDRV_SEQ_REMOVE_DEST_CHANNEL (1<<3) /* Restrict by channel */ | ||
381 | #define SNDRV_SEQ_REMOVE_TIME_BEFORE (1<<4) /* Restrict to before time */ | ||
382 | #define SNDRV_SEQ_REMOVE_TIME_AFTER (1<<5) /* Restrict to time or after */ | ||
383 | #define SNDRV_SEQ_REMOVE_TIME_TICK (1<<6) /* Time is in ticks */ | ||
384 | #define SNDRV_SEQ_REMOVE_EVENT_TYPE (1<<7) /* Restrict to event type */ | ||
385 | #define SNDRV_SEQ_REMOVE_IGNORE_OFF (1<<8) /* Do not flush off events */ | ||
386 | #define SNDRV_SEQ_REMOVE_TAG_MATCH (1<<9) /* Restrict to events with given tag */ | ||
387 | |||
388 | struct snd_seq_remove_events { | ||
389 | unsigned int remove_mode; /* Flags that determine what gets removed */ | ||
390 | |||
391 | union snd_seq_timestamp time; | ||
392 | |||
393 | unsigned char queue; /* Queue for REMOVE_DEST */ | ||
394 | struct snd_seq_addr dest; /* Address for REMOVE_DEST */ | ||
395 | unsigned char channel; /* Channel for REMOVE_DEST */ | ||
396 | |||
397 | int type; /* For REMOVE_EVENT_TYPE */ | ||
398 | char tag; /* Tag for REMOVE_TAG */ | ||
399 | |||
400 | int reserved[10]; /* To allow for future binary compatibility */ | ||
401 | |||
402 | }; | ||
403 | |||
404 | |||
405 | /* known port numbers */ | ||
406 | #define SNDRV_SEQ_PORT_SYSTEM_TIMER 0 | ||
407 | #define SNDRV_SEQ_PORT_SYSTEM_ANNOUNCE 1 | ||
408 | |||
409 | /* port capabilities (32 bits) */ | ||
410 | #define SNDRV_SEQ_PORT_CAP_READ (1<<0) /* readable from this port */ | ||
411 | #define SNDRV_SEQ_PORT_CAP_WRITE (1<<1) /* writable to this port */ | ||
412 | |||
413 | #define SNDRV_SEQ_PORT_CAP_SYNC_READ (1<<2) | ||
414 | #define SNDRV_SEQ_PORT_CAP_SYNC_WRITE (1<<3) | ||
415 | |||
416 | #define SNDRV_SEQ_PORT_CAP_DUPLEX (1<<4) | ||
417 | |||
418 | #define SNDRV_SEQ_PORT_CAP_SUBS_READ (1<<5) /* allow read subscription */ | ||
419 | #define SNDRV_SEQ_PORT_CAP_SUBS_WRITE (1<<6) /* allow write subscription */ | ||
420 | #define SNDRV_SEQ_PORT_CAP_NO_EXPORT (1<<7) /* routing not allowed */ | ||
421 | |||
422 | /* port type */ | ||
423 | #define SNDRV_SEQ_PORT_TYPE_SPECIFIC (1<<0) /* hardware specific */ | ||
424 | #define SNDRV_SEQ_PORT_TYPE_MIDI_GENERIC (1<<1) /* generic MIDI device */ | ||
425 | #define SNDRV_SEQ_PORT_TYPE_MIDI_GM (1<<2) /* General MIDI compatible device */ | ||
426 | #define SNDRV_SEQ_PORT_TYPE_MIDI_GS (1<<3) /* GS compatible device */ | ||
427 | #define SNDRV_SEQ_PORT_TYPE_MIDI_XG (1<<4) /* XG compatible device */ | ||
428 | #define SNDRV_SEQ_PORT_TYPE_MIDI_MT32 (1<<5) /* MT-32 compatible device */ | ||
429 | #define SNDRV_SEQ_PORT_TYPE_MIDI_GM2 (1<<6) /* General MIDI 2 compatible device */ | ||
430 | |||
431 | /* other standards...*/ | ||
432 | #define SNDRV_SEQ_PORT_TYPE_SYNTH (1<<10) /* Synth device (no MIDI compatible - direct wavetable) */ | ||
433 | #define SNDRV_SEQ_PORT_TYPE_DIRECT_SAMPLE (1<<11) /* Sampling device (support sample download) */ | ||
434 | #define SNDRV_SEQ_PORT_TYPE_SAMPLE (1<<12) /* Sampling device (sample can be downloaded at any time) */ | ||
435 | /*...*/ | ||
436 | #define SNDRV_SEQ_PORT_TYPE_HARDWARE (1<<16) /* driver for a hardware device */ | ||
437 | #define SNDRV_SEQ_PORT_TYPE_SOFTWARE (1<<17) /* implemented in software */ | ||
438 | #define SNDRV_SEQ_PORT_TYPE_SYNTHESIZER (1<<18) /* generates sound */ | ||
439 | #define SNDRV_SEQ_PORT_TYPE_PORT (1<<19) /* connects to other device(s) */ | ||
440 | #define SNDRV_SEQ_PORT_TYPE_APPLICATION (1<<20) /* application (sequencer/editor) */ | ||
441 | |||
442 | /* misc. conditioning flags */ | ||
443 | #define SNDRV_SEQ_PORT_FLG_GIVEN_PORT (1<<0) | ||
444 | #define SNDRV_SEQ_PORT_FLG_TIMESTAMP (1<<1) | ||
445 | #define SNDRV_SEQ_PORT_FLG_TIME_REAL (1<<2) | ||
446 | |||
447 | struct snd_seq_port_info { | ||
448 | struct snd_seq_addr addr; /* client/port numbers */ | ||
449 | char name[64]; /* port name */ | ||
450 | |||
451 | unsigned int capability; /* port capability bits */ | ||
452 | unsigned int type; /* port type bits */ | ||
453 | int midi_channels; /* channels per MIDI port */ | ||
454 | int midi_voices; /* voices per MIDI port */ | ||
455 | int synth_voices; /* voices per SYNTH port */ | ||
456 | |||
457 | int read_use; /* R/O: subscribers for output (from this port) */ | ||
458 | int write_use; /* R/O: subscribers for input (to this port) */ | ||
459 | |||
460 | void *kernel; /* reserved for kernel use (must be NULL) */ | ||
461 | unsigned int flags; /* misc. conditioning */ | ||
462 | unsigned char time_queue; /* queue # for timestamping */ | ||
463 | char reserved[59]; /* for future use */ | ||
464 | }; | ||
465 | |||
466 | |||
467 | /* queue flags */ | ||
468 | #define SNDRV_SEQ_QUEUE_FLG_SYNC (1<<0) /* sync enabled */ | ||
469 | |||
470 | /* queue information */ | ||
471 | struct snd_seq_queue_info { | ||
472 | int queue; /* queue id */ | ||
473 | |||
474 | /* | ||
475 | * security settings, only owner of this queue can start/stop timer | ||
476 | * etc. if the queue is locked for other clients | ||
477 | */ | ||
478 | int owner; /* client id for owner of the queue */ | ||
479 | unsigned locked:1; /* timing queue locked for other queues */ | ||
480 | char name[64]; /* name of this queue */ | ||
481 | unsigned int flags; /* flags */ | ||
482 | char reserved[60]; /* for future use */ | ||
483 | |||
484 | }; | ||
485 | |||
486 | /* queue info/status */ | ||
487 | struct snd_seq_queue_status { | ||
488 | int queue; /* queue id */ | ||
489 | int events; /* read-only - queue size */ | ||
490 | snd_seq_tick_time_t tick; /* current tick */ | ||
491 | struct snd_seq_real_time time; /* current time */ | ||
492 | int running; /* running state of queue */ | ||
493 | int flags; /* various flags */ | ||
494 | char reserved[64]; /* for the future */ | ||
495 | }; | ||
496 | |||
497 | |||
498 | /* queue tempo */ | ||
499 | struct snd_seq_queue_tempo { | ||
500 | int queue; /* sequencer queue */ | ||
501 | unsigned int tempo; /* current tempo, us/tick */ | ||
502 | int ppq; /* time resolution, ticks/quarter */ | ||
503 | unsigned int skew_value; /* queue skew */ | ||
504 | unsigned int skew_base; /* queue skew base */ | ||
505 | char reserved[24]; /* for the future */ | ||
506 | }; | ||
507 | |||
508 | |||
509 | /* sequencer timer sources */ | ||
510 | #define SNDRV_SEQ_TIMER_ALSA 0 /* ALSA timer */ | ||
511 | #define SNDRV_SEQ_TIMER_MIDI_CLOCK 1 /* Midi Clock (CLOCK event) */ | ||
512 | #define SNDRV_SEQ_TIMER_MIDI_TICK 2 /* Midi Timer Tick (TICK event) */ | ||
513 | |||
514 | /* queue timer info */ | ||
515 | struct snd_seq_queue_timer { | ||
516 | int queue; /* sequencer queue */ | ||
517 | int type; /* source timer type */ | ||
518 | union { | ||
519 | struct { | ||
520 | struct snd_timer_id id; /* ALSA's timer ID */ | ||
521 | unsigned int resolution; /* resolution in Hz */ | ||
522 | } alsa; | ||
523 | } u; | ||
524 | char reserved[64]; /* for the future use */ | ||
525 | }; | ||
526 | |||
527 | |||
528 | struct snd_seq_queue_client { | ||
529 | int queue; /* sequencer queue */ | ||
530 | int client; /* sequencer client */ | ||
531 | int used; /* queue is used with this client | ||
532 | (must be set for accepting events) */ | ||
533 | /* per client watermarks */ | ||
534 | char reserved[64]; /* for future use */ | ||
535 | }; | ||
536 | |||
537 | |||
538 | #define SNDRV_SEQ_PORT_SUBS_EXCLUSIVE (1<<0) /* exclusive connection */ | ||
539 | #define SNDRV_SEQ_PORT_SUBS_TIMESTAMP (1<<1) | ||
540 | #define SNDRV_SEQ_PORT_SUBS_TIME_REAL (1<<2) | ||
541 | |||
542 | struct snd_seq_port_subscribe { | ||
543 | struct snd_seq_addr sender; /* sender address */ | ||
544 | struct snd_seq_addr dest; /* destination address */ | ||
545 | unsigned int voices; /* number of voices to be allocated (0 = don't care) */ | ||
546 | unsigned int flags; /* modes */ | ||
547 | unsigned char queue; /* input time-stamp queue (optional) */ | ||
548 | unsigned char pad[3]; /* reserved */ | ||
549 | char reserved[64]; | ||
550 | }; | ||
551 | |||
552 | /* type of query subscription */ | ||
553 | #define SNDRV_SEQ_QUERY_SUBS_READ 0 | ||
554 | #define SNDRV_SEQ_QUERY_SUBS_WRITE 1 | ||
555 | |||
556 | struct snd_seq_query_subs { | ||
557 | struct snd_seq_addr root; /* client/port id to be searched */ | ||
558 | int type; /* READ or WRITE */ | ||
559 | int index; /* 0..N-1 */ | ||
560 | int num_subs; /* R/O: number of subscriptions on this port */ | ||
561 | struct snd_seq_addr addr; /* R/O: result */ | ||
562 | unsigned char queue; /* R/O: result */ | ||
563 | unsigned int flags; /* R/O: result */ | ||
564 | char reserved[64]; /* for future use */ | ||
565 | }; | ||
566 | |||
567 | |||
568 | /* | ||
569 | * IOCTL commands | ||
570 | */ | ||
571 | |||
572 | #define SNDRV_SEQ_IOCTL_PVERSION _IOR ('S', 0x00, int) | ||
573 | #define SNDRV_SEQ_IOCTL_CLIENT_ID _IOR ('S', 0x01, int) | ||
574 | #define SNDRV_SEQ_IOCTL_SYSTEM_INFO _IOWR('S', 0x02, struct snd_seq_system_info) | ||
575 | #define SNDRV_SEQ_IOCTL_RUNNING_MODE _IOWR('S', 0x03, struct snd_seq_running_info) | ||
576 | |||
577 | #define SNDRV_SEQ_IOCTL_GET_CLIENT_INFO _IOWR('S', 0x10, struct snd_seq_client_info) | ||
578 | #define SNDRV_SEQ_IOCTL_SET_CLIENT_INFO _IOW ('S', 0x11, struct snd_seq_client_info) | ||
579 | |||
580 | #define SNDRV_SEQ_IOCTL_CREATE_PORT _IOWR('S', 0x20, struct snd_seq_port_info) | ||
581 | #define SNDRV_SEQ_IOCTL_DELETE_PORT _IOW ('S', 0x21, struct snd_seq_port_info) | ||
582 | #define SNDRV_SEQ_IOCTL_GET_PORT_INFO _IOWR('S', 0x22, struct snd_seq_port_info) | ||
583 | #define SNDRV_SEQ_IOCTL_SET_PORT_INFO _IOW ('S', 0x23, struct snd_seq_port_info) | ||
584 | |||
585 | #define SNDRV_SEQ_IOCTL_SUBSCRIBE_PORT _IOW ('S', 0x30, struct snd_seq_port_subscribe) | ||
586 | #define SNDRV_SEQ_IOCTL_UNSUBSCRIBE_PORT _IOW ('S', 0x31, struct snd_seq_port_subscribe) | ||
587 | |||
588 | #define SNDRV_SEQ_IOCTL_CREATE_QUEUE _IOWR('S', 0x32, struct snd_seq_queue_info) | ||
589 | #define SNDRV_SEQ_IOCTL_DELETE_QUEUE _IOW ('S', 0x33, struct snd_seq_queue_info) | ||
590 | #define SNDRV_SEQ_IOCTL_GET_QUEUE_INFO _IOWR('S', 0x34, struct snd_seq_queue_info) | ||
591 | #define SNDRV_SEQ_IOCTL_SET_QUEUE_INFO _IOWR('S', 0x35, struct snd_seq_queue_info) | ||
592 | #define SNDRV_SEQ_IOCTL_GET_NAMED_QUEUE _IOWR('S', 0x36, struct snd_seq_queue_info) | ||
593 | #define SNDRV_SEQ_IOCTL_GET_QUEUE_STATUS _IOWR('S', 0x40, struct snd_seq_queue_status) | ||
594 | #define SNDRV_SEQ_IOCTL_GET_QUEUE_TEMPO _IOWR('S', 0x41, struct snd_seq_queue_tempo) | ||
595 | #define SNDRV_SEQ_IOCTL_SET_QUEUE_TEMPO _IOW ('S', 0x42, struct snd_seq_queue_tempo) | ||
596 | #define SNDRV_SEQ_IOCTL_GET_QUEUE_OWNER _IOWR('S', 0x43, struct snd_seq_queue_owner) | ||
597 | #define SNDRV_SEQ_IOCTL_SET_QUEUE_OWNER _IOW ('S', 0x44, struct snd_seq_queue_owner) | ||
598 | #define SNDRV_SEQ_IOCTL_GET_QUEUE_TIMER _IOWR('S', 0x45, struct snd_seq_queue_timer) | ||
599 | #define SNDRV_SEQ_IOCTL_SET_QUEUE_TIMER _IOW ('S', 0x46, struct snd_seq_queue_timer) | ||
600 | /* XXX | ||
601 | #define SNDRV_SEQ_IOCTL_GET_QUEUE_SYNC _IOWR('S', 0x53, struct snd_seq_queue_sync) | ||
602 | #define SNDRV_SEQ_IOCTL_SET_QUEUE_SYNC _IOW ('S', 0x54, struct snd_seq_queue_sync) | ||
603 | */ | ||
604 | #define SNDRV_SEQ_IOCTL_GET_QUEUE_CLIENT _IOWR('S', 0x49, struct snd_seq_queue_client) | ||
605 | #define SNDRV_SEQ_IOCTL_SET_QUEUE_CLIENT _IOW ('S', 0x4a, struct snd_seq_queue_client) | ||
606 | #define SNDRV_SEQ_IOCTL_GET_CLIENT_POOL _IOWR('S', 0x4b, struct snd_seq_client_pool) | ||
607 | #define SNDRV_SEQ_IOCTL_SET_CLIENT_POOL _IOW ('S', 0x4c, struct snd_seq_client_pool) | ||
608 | #define SNDRV_SEQ_IOCTL_REMOVE_EVENTS _IOW ('S', 0x4e, struct snd_seq_remove_events) | ||
609 | #define SNDRV_SEQ_IOCTL_QUERY_SUBS _IOWR('S', 0x4f, struct snd_seq_query_subs) | ||
610 | #define SNDRV_SEQ_IOCTL_GET_SUBSCRIPTION _IOWR('S', 0x50, struct snd_seq_port_subscribe) | ||
611 | #define SNDRV_SEQ_IOCTL_QUERY_NEXT_CLIENT _IOWR('S', 0x51, struct snd_seq_client_info) | ||
612 | #define SNDRV_SEQ_IOCTL_QUERY_NEXT_PORT _IOWR('S', 0x52, struct snd_seq_port_info) | ||
613 | |||
614 | #endif /* _UAPI__SOUND_ASEQUENCER_H */ | ||
diff --git a/include/uapi/sound/asound.h b/include/uapi/sound/asound.h new file mode 100644 index 000000000000..92b104e496b5 --- /dev/null +++ b/include/uapi/sound/asound.h | |||
@@ -0,0 +1,957 @@ | |||
1 | /* | ||
2 | * Advanced Linux Sound Architecture - ALSA - Driver | ||
3 | * Copyright (c) 1994-2003 by Jaroslav Kysela <perex@perex.cz>, | ||
4 | * Abramo Bagnara <abramo@alsa-project.org> | ||
5 | * | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation; either version 2 of the License, or | ||
10 | * (at your option) any later version. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
20 | * | ||
21 | */ | ||
22 | |||
23 | #ifndef _UAPI__SOUND_ASOUND_H | ||
24 | #define _UAPI__SOUND_ASOUND_H | ||
25 | |||
26 | #include <linux/types.h> | ||
27 | |||
28 | |||
29 | /* | ||
30 | * protocol version | ||
31 | */ | ||
32 | |||
33 | #define SNDRV_PROTOCOL_VERSION(major, minor, subminor) (((major)<<16)|((minor)<<8)|(subminor)) | ||
34 | #define SNDRV_PROTOCOL_MAJOR(version) (((version)>>16)&0xffff) | ||
35 | #define SNDRV_PROTOCOL_MINOR(version) (((version)>>8)&0xff) | ||
36 | #define SNDRV_PROTOCOL_MICRO(version) ((version)&0xff) | ||
37 | #define SNDRV_PROTOCOL_INCOMPATIBLE(kversion, uversion) \ | ||
38 | (SNDRV_PROTOCOL_MAJOR(kversion) != SNDRV_PROTOCOL_MAJOR(uversion) || \ | ||
39 | (SNDRV_PROTOCOL_MAJOR(kversion) == SNDRV_PROTOCOL_MAJOR(uversion) && \ | ||
40 | SNDRV_PROTOCOL_MINOR(kversion) != SNDRV_PROTOCOL_MINOR(uversion))) | ||
41 | |||
42 | /**************************************************************************** | ||
43 | * * | ||
44 | * Digital audio interface * | ||
45 | * * | ||
46 | ****************************************************************************/ | ||
47 | |||
48 | struct snd_aes_iec958 { | ||
49 | unsigned char status[24]; /* AES/IEC958 channel status bits */ | ||
50 | unsigned char subcode[147]; /* AES/IEC958 subcode bits */ | ||
51 | unsigned char pad; /* nothing */ | ||
52 | unsigned char dig_subframe[4]; /* AES/IEC958 subframe bits */ | ||
53 | }; | ||
54 | |||
55 | /**************************************************************************** | ||
56 | * * | ||
57 | * CEA-861 Audio InfoFrame. Used in HDMI and DisplayPort * | ||
58 | * * | ||
59 | ****************************************************************************/ | ||
60 | |||
61 | struct snd_cea_861_aud_if { | ||
62 | unsigned char db1_ct_cc; /* coding type and channel count */ | ||
63 | unsigned char db2_sf_ss; /* sample frequency and size */ | ||
64 | unsigned char db3; /* not used, all zeros */ | ||
65 | unsigned char db4_ca; /* channel allocation code */ | ||
66 | unsigned char db5_dminh_lsv; /* downmix inhibit & level-shit values */ | ||
67 | }; | ||
68 | |||
69 | /**************************************************************************** | ||
70 | * * | ||
71 | * Section for driver hardware dependent interface - /dev/snd/hw? * | ||
72 | * * | ||
73 | ****************************************************************************/ | ||
74 | |||
75 | #define SNDRV_HWDEP_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 1) | ||
76 | |||
77 | enum { | ||
78 | SNDRV_HWDEP_IFACE_OPL2 = 0, | ||
79 | SNDRV_HWDEP_IFACE_OPL3, | ||
80 | SNDRV_HWDEP_IFACE_OPL4, | ||
81 | SNDRV_HWDEP_IFACE_SB16CSP, /* Creative Signal Processor */ | ||
82 | SNDRV_HWDEP_IFACE_EMU10K1, /* FX8010 processor in EMU10K1 chip */ | ||
83 | SNDRV_HWDEP_IFACE_YSS225, /* Yamaha FX processor */ | ||
84 | SNDRV_HWDEP_IFACE_ICS2115, /* Wavetable synth */ | ||
85 | SNDRV_HWDEP_IFACE_SSCAPE, /* Ensoniq SoundScape ISA card (MC68EC000) */ | ||
86 | SNDRV_HWDEP_IFACE_VX, /* Digigram VX cards */ | ||
87 | SNDRV_HWDEP_IFACE_MIXART, /* Digigram miXart cards */ | ||
88 | SNDRV_HWDEP_IFACE_USX2Y, /* Tascam US122, US224 & US428 usb */ | ||
89 | SNDRV_HWDEP_IFACE_EMUX_WAVETABLE, /* EmuX wavetable */ | ||
90 | SNDRV_HWDEP_IFACE_BLUETOOTH, /* Bluetooth audio */ | ||
91 | SNDRV_HWDEP_IFACE_USX2Y_PCM, /* Tascam US122, US224 & US428 rawusb pcm */ | ||
92 | SNDRV_HWDEP_IFACE_PCXHR, /* Digigram PCXHR */ | ||
93 | SNDRV_HWDEP_IFACE_SB_RC, /* SB Extigy/Audigy2NX remote control */ | ||
94 | SNDRV_HWDEP_IFACE_HDA, /* HD-audio */ | ||
95 | SNDRV_HWDEP_IFACE_USB_STREAM, /* direct access to usb stream */ | ||
96 | |||
97 | /* Don't forget to change the following: */ | ||
98 | SNDRV_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_USB_STREAM | ||
99 | }; | ||
100 | |||
101 | struct snd_hwdep_info { | ||
102 | unsigned int device; /* WR: device number */ | ||
103 | int card; /* R: card number */ | ||
104 | unsigned char id[64]; /* ID (user selectable) */ | ||
105 | unsigned char name[80]; /* hwdep name */ | ||
106 | int iface; /* hwdep interface */ | ||
107 | unsigned char reserved[64]; /* reserved for future */ | ||
108 | }; | ||
109 | |||
110 | /* generic DSP loader */ | ||
111 | struct snd_hwdep_dsp_status { | ||
112 | unsigned int version; /* R: driver-specific version */ | ||
113 | unsigned char id[32]; /* R: driver-specific ID string */ | ||
114 | unsigned int num_dsps; /* R: number of DSP images to transfer */ | ||
115 | unsigned int dsp_loaded; /* R: bit flags indicating the loaded DSPs */ | ||
116 | unsigned int chip_ready; /* R: 1 = initialization finished */ | ||
117 | unsigned char reserved[16]; /* reserved for future use */ | ||
118 | }; | ||
119 | |||
120 | struct snd_hwdep_dsp_image { | ||
121 | unsigned int index; /* W: DSP index */ | ||
122 | unsigned char name[64]; /* W: ID (e.g. file name) */ | ||
123 | unsigned char __user *image; /* W: binary image */ | ||
124 | size_t length; /* W: size of image in bytes */ | ||
125 | unsigned long driver_data; /* W: driver-specific data */ | ||
126 | }; | ||
127 | |||
128 | #define SNDRV_HWDEP_IOCTL_PVERSION _IOR ('H', 0x00, int) | ||
129 | #define SNDRV_HWDEP_IOCTL_INFO _IOR ('H', 0x01, struct snd_hwdep_info) | ||
130 | #define SNDRV_HWDEP_IOCTL_DSP_STATUS _IOR('H', 0x02, struct snd_hwdep_dsp_status) | ||
131 | #define SNDRV_HWDEP_IOCTL_DSP_LOAD _IOW('H', 0x03, struct snd_hwdep_dsp_image) | ||
132 | |||
133 | /***************************************************************************** | ||
134 | * * | ||
135 | * Digital Audio (PCM) interface - /dev/snd/pcm?? * | ||
136 | * * | ||
137 | *****************************************************************************/ | ||
138 | |||
139 | #define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 10) | ||
140 | |||
141 | typedef unsigned long snd_pcm_uframes_t; | ||
142 | typedef signed long snd_pcm_sframes_t; | ||
143 | |||
144 | enum { | ||
145 | SNDRV_PCM_CLASS_GENERIC = 0, /* standard mono or stereo device */ | ||
146 | SNDRV_PCM_CLASS_MULTI, /* multichannel device */ | ||
147 | SNDRV_PCM_CLASS_MODEM, /* software modem class */ | ||
148 | SNDRV_PCM_CLASS_DIGITIZER, /* digitizer class */ | ||
149 | /* Don't forget to change the following: */ | ||
150 | SNDRV_PCM_CLASS_LAST = SNDRV_PCM_CLASS_DIGITIZER, | ||
151 | }; | ||
152 | |||
153 | enum { | ||
154 | SNDRV_PCM_SUBCLASS_GENERIC_MIX = 0, /* mono or stereo subdevices are mixed together */ | ||
155 | SNDRV_PCM_SUBCLASS_MULTI_MIX, /* multichannel subdevices are mixed together */ | ||
156 | /* Don't forget to change the following: */ | ||
157 | SNDRV_PCM_SUBCLASS_LAST = SNDRV_PCM_SUBCLASS_MULTI_MIX, | ||
158 | }; | ||
159 | |||
160 | enum { | ||
161 | SNDRV_PCM_STREAM_PLAYBACK = 0, | ||
162 | SNDRV_PCM_STREAM_CAPTURE, | ||
163 | SNDRV_PCM_STREAM_LAST = SNDRV_PCM_STREAM_CAPTURE, | ||
164 | }; | ||
165 | |||
166 | typedef int __bitwise snd_pcm_access_t; | ||
167 | #define SNDRV_PCM_ACCESS_MMAP_INTERLEAVED ((__force snd_pcm_access_t) 0) /* interleaved mmap */ | ||
168 | #define SNDRV_PCM_ACCESS_MMAP_NONINTERLEAVED ((__force snd_pcm_access_t) 1) /* noninterleaved mmap */ | ||
169 | #define SNDRV_PCM_ACCESS_MMAP_COMPLEX ((__force snd_pcm_access_t) 2) /* complex mmap */ | ||
170 | #define SNDRV_PCM_ACCESS_RW_INTERLEAVED ((__force snd_pcm_access_t) 3) /* readi/writei */ | ||
171 | #define SNDRV_PCM_ACCESS_RW_NONINTERLEAVED ((__force snd_pcm_access_t) 4) /* readn/writen */ | ||
172 | #define SNDRV_PCM_ACCESS_LAST SNDRV_PCM_ACCESS_RW_NONINTERLEAVED | ||
173 | |||
174 | typedef int __bitwise snd_pcm_format_t; | ||
175 | #define SNDRV_PCM_FORMAT_S8 ((__force snd_pcm_format_t) 0) | ||
176 | #define SNDRV_PCM_FORMAT_U8 ((__force snd_pcm_format_t) 1) | ||
177 | #define SNDRV_PCM_FORMAT_S16_LE ((__force snd_pcm_format_t) 2) | ||
178 | #define SNDRV_PCM_FORMAT_S16_BE ((__force snd_pcm_format_t) 3) | ||
179 | #define SNDRV_PCM_FORMAT_U16_LE ((__force snd_pcm_format_t) 4) | ||
180 | #define SNDRV_PCM_FORMAT_U16_BE ((__force snd_pcm_format_t) 5) | ||
181 | #define SNDRV_PCM_FORMAT_S24_LE ((__force snd_pcm_format_t) 6) /* low three bytes */ | ||
182 | #define SNDRV_PCM_FORMAT_S24_BE ((__force snd_pcm_format_t) 7) /* low three bytes */ | ||
183 | #define SNDRV_PCM_FORMAT_U24_LE ((__force snd_pcm_format_t) 8) /* low three bytes */ | ||
184 | #define SNDRV_PCM_FORMAT_U24_BE ((__force snd_pcm_format_t) 9) /* low three bytes */ | ||
185 | #define SNDRV_PCM_FORMAT_S32_LE ((__force snd_pcm_format_t) 10) | ||
186 | #define SNDRV_PCM_FORMAT_S32_BE ((__force snd_pcm_format_t) 11) | ||
187 | #define SNDRV_PCM_FORMAT_U32_LE ((__force snd_pcm_format_t) 12) | ||
188 | #define SNDRV_PCM_FORMAT_U32_BE ((__force snd_pcm_format_t) 13) | ||
189 | #define SNDRV_PCM_FORMAT_FLOAT_LE ((__force snd_pcm_format_t) 14) /* 4-byte float, IEEE-754 32-bit, range -1.0 to 1.0 */ | ||
190 | #define SNDRV_PCM_FORMAT_FLOAT_BE ((__force snd_pcm_format_t) 15) /* 4-byte float, IEEE-754 32-bit, range -1.0 to 1.0 */ | ||
191 | #define SNDRV_PCM_FORMAT_FLOAT64_LE ((__force snd_pcm_format_t) 16) /* 8-byte float, IEEE-754 64-bit, range -1.0 to 1.0 */ | ||
192 | #define SNDRV_PCM_FORMAT_FLOAT64_BE ((__force snd_pcm_format_t) 17) /* 8-byte float, IEEE-754 64-bit, range -1.0 to 1.0 */ | ||
193 | #define SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE ((__force snd_pcm_format_t) 18) /* IEC-958 subframe, Little Endian */ | ||
194 | #define SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE ((__force snd_pcm_format_t) 19) /* IEC-958 subframe, Big Endian */ | ||
195 | #define SNDRV_PCM_FORMAT_MU_LAW ((__force snd_pcm_format_t) 20) | ||
196 | #define SNDRV_PCM_FORMAT_A_LAW ((__force snd_pcm_format_t) 21) | ||
197 | #define SNDRV_PCM_FORMAT_IMA_ADPCM ((__force snd_pcm_format_t) 22) | ||
198 | #define SNDRV_PCM_FORMAT_MPEG ((__force snd_pcm_format_t) 23) | ||
199 | #define SNDRV_PCM_FORMAT_GSM ((__force snd_pcm_format_t) 24) | ||
200 | #define SNDRV_PCM_FORMAT_SPECIAL ((__force snd_pcm_format_t) 31) | ||
201 | #define SNDRV_PCM_FORMAT_S24_3LE ((__force snd_pcm_format_t) 32) /* in three bytes */ | ||
202 | #define SNDRV_PCM_FORMAT_S24_3BE ((__force snd_pcm_format_t) 33) /* in three bytes */ | ||
203 | #define SNDRV_PCM_FORMAT_U24_3LE ((__force snd_pcm_format_t) 34) /* in three bytes */ | ||
204 | #define SNDRV_PCM_FORMAT_U24_3BE ((__force snd_pcm_format_t) 35) /* in three bytes */ | ||
205 | #define SNDRV_PCM_FORMAT_S20_3LE ((__force snd_pcm_format_t) 36) /* in three bytes */ | ||
206 | #define SNDRV_PCM_FORMAT_S20_3BE ((__force snd_pcm_format_t) 37) /* in three bytes */ | ||
207 | #define SNDRV_PCM_FORMAT_U20_3LE ((__force snd_pcm_format_t) 38) /* in three bytes */ | ||
208 | #define SNDRV_PCM_FORMAT_U20_3BE ((__force snd_pcm_format_t) 39) /* in three bytes */ | ||
209 | #define SNDRV_PCM_FORMAT_S18_3LE ((__force snd_pcm_format_t) 40) /* in three bytes */ | ||
210 | #define SNDRV_PCM_FORMAT_S18_3BE ((__force snd_pcm_format_t) 41) /* in three bytes */ | ||
211 | #define SNDRV_PCM_FORMAT_U18_3LE ((__force snd_pcm_format_t) 42) /* in three bytes */ | ||
212 | #define SNDRV_PCM_FORMAT_U18_3BE ((__force snd_pcm_format_t) 43) /* in three bytes */ | ||
213 | #define SNDRV_PCM_FORMAT_G723_24 ((__force snd_pcm_format_t) 44) /* 8 samples in 3 bytes */ | ||
214 | #define SNDRV_PCM_FORMAT_G723_24_1B ((__force snd_pcm_format_t) 45) /* 1 sample in 1 byte */ | ||
215 | #define SNDRV_PCM_FORMAT_G723_40 ((__force snd_pcm_format_t) 46) /* 8 Samples in 5 bytes */ | ||
216 | #define SNDRV_PCM_FORMAT_G723_40_1B ((__force snd_pcm_format_t) 47) /* 1 sample in 1 byte */ | ||
217 | #define SNDRV_PCM_FORMAT_LAST SNDRV_PCM_FORMAT_G723_40_1B | ||
218 | |||
219 | #ifdef SNDRV_LITTLE_ENDIAN | ||
220 | #define SNDRV_PCM_FORMAT_S16 SNDRV_PCM_FORMAT_S16_LE | ||
221 | #define SNDRV_PCM_FORMAT_U16 SNDRV_PCM_FORMAT_U16_LE | ||
222 | #define SNDRV_PCM_FORMAT_S24 SNDRV_PCM_FORMAT_S24_LE | ||
223 | #define SNDRV_PCM_FORMAT_U24 SNDRV_PCM_FORMAT_U24_LE | ||
224 | #define SNDRV_PCM_FORMAT_S32 SNDRV_PCM_FORMAT_S32_LE | ||
225 | #define SNDRV_PCM_FORMAT_U32 SNDRV_PCM_FORMAT_U32_LE | ||
226 | #define SNDRV_PCM_FORMAT_FLOAT SNDRV_PCM_FORMAT_FLOAT_LE | ||
227 | #define SNDRV_PCM_FORMAT_FLOAT64 SNDRV_PCM_FORMAT_FLOAT64_LE | ||
228 | #define SNDRV_PCM_FORMAT_IEC958_SUBFRAME SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE | ||
229 | #endif | ||
230 | #ifdef SNDRV_BIG_ENDIAN | ||
231 | #define SNDRV_PCM_FORMAT_S16 SNDRV_PCM_FORMAT_S16_BE | ||
232 | #define SNDRV_PCM_FORMAT_U16 SNDRV_PCM_FORMAT_U16_BE | ||
233 | #define SNDRV_PCM_FORMAT_S24 SNDRV_PCM_FORMAT_S24_BE | ||
234 | #define SNDRV_PCM_FORMAT_U24 SNDRV_PCM_FORMAT_U24_BE | ||
235 | #define SNDRV_PCM_FORMAT_S32 SNDRV_PCM_FORMAT_S32_BE | ||
236 | #define SNDRV_PCM_FORMAT_U32 SNDRV_PCM_FORMAT_U32_BE | ||
237 | #define SNDRV_PCM_FORMAT_FLOAT SNDRV_PCM_FORMAT_FLOAT_BE | ||
238 | #define SNDRV_PCM_FORMAT_FLOAT64 SNDRV_PCM_FORMAT_FLOAT64_BE | ||
239 | #define SNDRV_PCM_FORMAT_IEC958_SUBFRAME SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE | ||
240 | #endif | ||
241 | |||
242 | typedef int __bitwise snd_pcm_subformat_t; | ||
243 | #define SNDRV_PCM_SUBFORMAT_STD ((__force snd_pcm_subformat_t) 0) | ||
244 | #define SNDRV_PCM_SUBFORMAT_LAST SNDRV_PCM_SUBFORMAT_STD | ||
245 | |||
246 | #define SNDRV_PCM_INFO_MMAP 0x00000001 /* hardware supports mmap */ | ||
247 | #define SNDRV_PCM_INFO_MMAP_VALID 0x00000002 /* period data are valid during transfer */ | ||
248 | #define SNDRV_PCM_INFO_DOUBLE 0x00000004 /* Double buffering needed for PCM start/stop */ | ||
249 | #define SNDRV_PCM_INFO_BATCH 0x00000010 /* double buffering */ | ||
250 | #define SNDRV_PCM_INFO_INTERLEAVED 0x00000100 /* channels are interleaved */ | ||
251 | #define SNDRV_PCM_INFO_NONINTERLEAVED 0x00000200 /* channels are not interleaved */ | ||
252 | #define SNDRV_PCM_INFO_COMPLEX 0x00000400 /* complex frame organization (mmap only) */ | ||
253 | #define SNDRV_PCM_INFO_BLOCK_TRANSFER 0x00010000 /* hardware transfer block of samples */ | ||
254 | #define SNDRV_PCM_INFO_OVERRANGE 0x00020000 /* hardware supports ADC (capture) overrange detection */ | ||
255 | #define SNDRV_PCM_INFO_RESUME 0x00040000 /* hardware supports stream resume after suspend */ | ||
256 | #define SNDRV_PCM_INFO_PAUSE 0x00080000 /* pause ioctl is supported */ | ||
257 | #define SNDRV_PCM_INFO_HALF_DUPLEX 0x00100000 /* only half duplex */ | ||
258 | #define SNDRV_PCM_INFO_JOINT_DUPLEX 0x00200000 /* playback and capture stream are somewhat correlated */ | ||
259 | #define SNDRV_PCM_INFO_SYNC_START 0x00400000 /* pcm support some kind of sync go */ | ||
260 | #define SNDRV_PCM_INFO_NO_PERIOD_WAKEUP 0x00800000 /* period wakeup can be disabled */ | ||
261 | #define SNDRV_PCM_INFO_FIFO_IN_FRAMES 0x80000000 /* internal kernel flag - FIFO size is in frames */ | ||
262 | |||
263 | typedef int __bitwise snd_pcm_state_t; | ||
264 | #define SNDRV_PCM_STATE_OPEN ((__force snd_pcm_state_t) 0) /* stream is open */ | ||
265 | #define SNDRV_PCM_STATE_SETUP ((__force snd_pcm_state_t) 1) /* stream has a setup */ | ||
266 | #define SNDRV_PCM_STATE_PREPARED ((__force snd_pcm_state_t) 2) /* stream is ready to start */ | ||
267 | #define SNDRV_PCM_STATE_RUNNING ((__force snd_pcm_state_t) 3) /* stream is running */ | ||
268 | #define SNDRV_PCM_STATE_XRUN ((__force snd_pcm_state_t) 4) /* stream reached an xrun */ | ||
269 | #define SNDRV_PCM_STATE_DRAINING ((__force snd_pcm_state_t) 5) /* stream is draining */ | ||
270 | #define SNDRV_PCM_STATE_PAUSED ((__force snd_pcm_state_t) 6) /* stream is paused */ | ||
271 | #define SNDRV_PCM_STATE_SUSPENDED ((__force snd_pcm_state_t) 7) /* hardware is suspended */ | ||
272 | #define SNDRV_PCM_STATE_DISCONNECTED ((__force snd_pcm_state_t) 8) /* hardware is disconnected */ | ||
273 | #define SNDRV_PCM_STATE_LAST SNDRV_PCM_STATE_DISCONNECTED | ||
274 | |||
275 | enum { | ||
276 | SNDRV_PCM_MMAP_OFFSET_DATA = 0x00000000, | ||
277 | SNDRV_PCM_MMAP_OFFSET_STATUS = 0x80000000, | ||
278 | SNDRV_PCM_MMAP_OFFSET_CONTROL = 0x81000000, | ||
279 | }; | ||
280 | |||
281 | union snd_pcm_sync_id { | ||
282 | unsigned char id[16]; | ||
283 | unsigned short id16[8]; | ||
284 | unsigned int id32[4]; | ||
285 | }; | ||
286 | |||
287 | struct snd_pcm_info { | ||
288 | unsigned int device; /* RO/WR (control): device number */ | ||
289 | unsigned int subdevice; /* RO/WR (control): subdevice number */ | ||
290 | int stream; /* RO/WR (control): stream direction */ | ||
291 | int card; /* R: card number */ | ||
292 | unsigned char id[64]; /* ID (user selectable) */ | ||
293 | unsigned char name[80]; /* name of this device */ | ||
294 | unsigned char subname[32]; /* subdevice name */ | ||
295 | int dev_class; /* SNDRV_PCM_CLASS_* */ | ||
296 | int dev_subclass; /* SNDRV_PCM_SUBCLASS_* */ | ||
297 | unsigned int subdevices_count; | ||
298 | unsigned int subdevices_avail; | ||
299 | union snd_pcm_sync_id sync; /* hardware synchronization ID */ | ||
300 | unsigned char reserved[64]; /* reserved for future... */ | ||
301 | }; | ||
302 | |||
303 | typedef int snd_pcm_hw_param_t; | ||
304 | #define SNDRV_PCM_HW_PARAM_ACCESS 0 /* Access type */ | ||
305 | #define SNDRV_PCM_HW_PARAM_FORMAT 1 /* Format */ | ||
306 | #define SNDRV_PCM_HW_PARAM_SUBFORMAT 2 /* Subformat */ | ||
307 | #define SNDRV_PCM_HW_PARAM_FIRST_MASK SNDRV_PCM_HW_PARAM_ACCESS | ||
308 | #define SNDRV_PCM_HW_PARAM_LAST_MASK SNDRV_PCM_HW_PARAM_SUBFORMAT | ||
309 | |||
310 | #define SNDRV_PCM_HW_PARAM_SAMPLE_BITS 8 /* Bits per sample */ | ||
311 | #define SNDRV_PCM_HW_PARAM_FRAME_BITS 9 /* Bits per frame */ | ||
312 | #define SNDRV_PCM_HW_PARAM_CHANNELS 10 /* Channels */ | ||
313 | #define SNDRV_PCM_HW_PARAM_RATE 11 /* Approx rate */ | ||
314 | #define SNDRV_PCM_HW_PARAM_PERIOD_TIME 12 /* Approx distance between | ||
315 | * interrupts in us | ||
316 | */ | ||
317 | #define SNDRV_PCM_HW_PARAM_PERIOD_SIZE 13 /* Approx frames between | ||
318 | * interrupts | ||
319 | */ | ||
320 | #define SNDRV_PCM_HW_PARAM_PERIOD_BYTES 14 /* Approx bytes between | ||
321 | * interrupts | ||
322 | */ | ||
323 | #define SNDRV_PCM_HW_PARAM_PERIODS 15 /* Approx interrupts per | ||
324 | * buffer | ||
325 | */ | ||
326 | #define SNDRV_PCM_HW_PARAM_BUFFER_TIME 16 /* Approx duration of buffer | ||
327 | * in us | ||
328 | */ | ||
329 | #define SNDRV_PCM_HW_PARAM_BUFFER_SIZE 17 /* Size of buffer in frames */ | ||
330 | #define SNDRV_PCM_HW_PARAM_BUFFER_BYTES 18 /* Size of buffer in bytes */ | ||
331 | #define SNDRV_PCM_HW_PARAM_TICK_TIME 19 /* Approx tick duration in us */ | ||
332 | #define SNDRV_PCM_HW_PARAM_FIRST_INTERVAL SNDRV_PCM_HW_PARAM_SAMPLE_BITS | ||
333 | #define SNDRV_PCM_HW_PARAM_LAST_INTERVAL SNDRV_PCM_HW_PARAM_TICK_TIME | ||
334 | |||
335 | #define SNDRV_PCM_HW_PARAMS_NORESAMPLE (1<<0) /* avoid rate resampling */ | ||
336 | #define SNDRV_PCM_HW_PARAMS_EXPORT_BUFFER (1<<1) /* export buffer */ | ||
337 | #define SNDRV_PCM_HW_PARAMS_NO_PERIOD_WAKEUP (1<<2) /* disable period wakeups */ | ||
338 | |||
339 | struct snd_interval { | ||
340 | unsigned int min, max; | ||
341 | unsigned int openmin:1, | ||
342 | openmax:1, | ||
343 | integer:1, | ||
344 | empty:1; | ||
345 | }; | ||
346 | |||
347 | #define SNDRV_MASK_MAX 256 | ||
348 | |||
349 | struct snd_mask { | ||
350 | __u32 bits[(SNDRV_MASK_MAX+31)/32]; | ||
351 | }; | ||
352 | |||
353 | struct snd_pcm_hw_params { | ||
354 | unsigned int flags; | ||
355 | struct snd_mask masks[SNDRV_PCM_HW_PARAM_LAST_MASK - | ||
356 | SNDRV_PCM_HW_PARAM_FIRST_MASK + 1]; | ||
357 | struct snd_mask mres[5]; /* reserved masks */ | ||
358 | struct snd_interval intervals[SNDRV_PCM_HW_PARAM_LAST_INTERVAL - | ||
359 | SNDRV_PCM_HW_PARAM_FIRST_INTERVAL + 1]; | ||
360 | struct snd_interval ires[9]; /* reserved intervals */ | ||
361 | unsigned int rmask; /* W: requested masks */ | ||
362 | unsigned int cmask; /* R: changed masks */ | ||
363 | unsigned int info; /* R: Info flags for returned setup */ | ||
364 | unsigned int msbits; /* R: used most significant bits */ | ||
365 | unsigned int rate_num; /* R: rate numerator */ | ||
366 | unsigned int rate_den; /* R: rate denominator */ | ||
367 | snd_pcm_uframes_t fifo_size; /* R: chip FIFO size in frames */ | ||
368 | unsigned char reserved[64]; /* reserved for future */ | ||
369 | }; | ||
370 | |||
371 | enum { | ||
372 | SNDRV_PCM_TSTAMP_NONE = 0, | ||
373 | SNDRV_PCM_TSTAMP_ENABLE, | ||
374 | SNDRV_PCM_TSTAMP_LAST = SNDRV_PCM_TSTAMP_ENABLE, | ||
375 | }; | ||
376 | |||
377 | struct snd_pcm_sw_params { | ||
378 | int tstamp_mode; /* timestamp mode */ | ||
379 | unsigned int period_step; | ||
380 | unsigned int sleep_min; /* min ticks to sleep */ | ||
381 | snd_pcm_uframes_t avail_min; /* min avail frames for wakeup */ | ||
382 | snd_pcm_uframes_t xfer_align; /* obsolete: xfer size need to be a multiple */ | ||
383 | snd_pcm_uframes_t start_threshold; /* min hw_avail frames for automatic start */ | ||
384 | snd_pcm_uframes_t stop_threshold; /* min avail frames for automatic stop */ | ||
385 | snd_pcm_uframes_t silence_threshold; /* min distance from noise for silence filling */ | ||
386 | snd_pcm_uframes_t silence_size; /* silence block size */ | ||
387 | snd_pcm_uframes_t boundary; /* pointers wrap point */ | ||
388 | unsigned char reserved[64]; /* reserved for future */ | ||
389 | }; | ||
390 | |||
391 | struct snd_pcm_channel_info { | ||
392 | unsigned int channel; | ||
393 | __kernel_off_t offset; /* mmap offset */ | ||
394 | unsigned int first; /* offset to first sample in bits */ | ||
395 | unsigned int step; /* samples distance in bits */ | ||
396 | }; | ||
397 | |||
398 | struct snd_pcm_status { | ||
399 | snd_pcm_state_t state; /* stream state */ | ||
400 | struct timespec trigger_tstamp; /* time when stream was started/stopped/paused */ | ||
401 | struct timespec tstamp; /* reference timestamp */ | ||
402 | snd_pcm_uframes_t appl_ptr; /* appl ptr */ | ||
403 | snd_pcm_uframes_t hw_ptr; /* hw ptr */ | ||
404 | snd_pcm_sframes_t delay; /* current delay in frames */ | ||
405 | snd_pcm_uframes_t avail; /* number of frames available */ | ||
406 | snd_pcm_uframes_t avail_max; /* max frames available on hw since last status */ | ||
407 | snd_pcm_uframes_t overrange; /* count of ADC (capture) overrange detections from last status */ | ||
408 | snd_pcm_state_t suspended_state; /* suspended stream state */ | ||
409 | unsigned char reserved[60]; /* must be filled with zero */ | ||
410 | }; | ||
411 | |||
412 | struct snd_pcm_mmap_status { | ||
413 | snd_pcm_state_t state; /* RO: state - SNDRV_PCM_STATE_XXXX */ | ||
414 | int pad1; /* Needed for 64 bit alignment */ | ||
415 | snd_pcm_uframes_t hw_ptr; /* RO: hw ptr (0...boundary-1) */ | ||
416 | struct timespec tstamp; /* Timestamp */ | ||
417 | snd_pcm_state_t suspended_state; /* RO: suspended stream state */ | ||
418 | }; | ||
419 | |||
420 | struct snd_pcm_mmap_control { | ||
421 | snd_pcm_uframes_t appl_ptr; /* RW: appl ptr (0...boundary-1) */ | ||
422 | snd_pcm_uframes_t avail_min; /* RW: min available frames for wakeup */ | ||
423 | }; | ||
424 | |||
425 | #define SNDRV_PCM_SYNC_PTR_HWSYNC (1<<0) /* execute hwsync */ | ||
426 | #define SNDRV_PCM_SYNC_PTR_APPL (1<<1) /* get appl_ptr from driver (r/w op) */ | ||
427 | #define SNDRV_PCM_SYNC_PTR_AVAIL_MIN (1<<2) /* get avail_min from driver */ | ||
428 | |||
429 | struct snd_pcm_sync_ptr { | ||
430 | unsigned int flags; | ||
431 | union { | ||
432 | struct snd_pcm_mmap_status status; | ||
433 | unsigned char reserved[64]; | ||
434 | } s; | ||
435 | union { | ||
436 | struct snd_pcm_mmap_control control; | ||
437 | unsigned char reserved[64]; | ||
438 | } c; | ||
439 | }; | ||
440 | |||
441 | struct snd_xferi { | ||
442 | snd_pcm_sframes_t result; | ||
443 | void __user *buf; | ||
444 | snd_pcm_uframes_t frames; | ||
445 | }; | ||
446 | |||
447 | struct snd_xfern { | ||
448 | snd_pcm_sframes_t result; | ||
449 | void __user * __user *bufs; | ||
450 | snd_pcm_uframes_t frames; | ||
451 | }; | ||
452 | |||
453 | enum { | ||
454 | SNDRV_PCM_TSTAMP_TYPE_GETTIMEOFDAY = 0, /* gettimeofday equivalent */ | ||
455 | SNDRV_PCM_TSTAMP_TYPE_MONOTONIC, /* posix_clock_monotonic equivalent */ | ||
456 | SNDRV_PCM_TSTAMP_TYPE_LAST = SNDRV_PCM_TSTAMP_TYPE_MONOTONIC, | ||
457 | }; | ||
458 | |||
459 | /* channel positions */ | ||
460 | enum { | ||
461 | SNDRV_CHMAP_UNKNOWN = 0, | ||
462 | SNDRV_CHMAP_NA, /* N/A, silent */ | ||
463 | SNDRV_CHMAP_MONO, /* mono stream */ | ||
464 | /* this follows the alsa-lib mixer channel value + 3 */ | ||
465 | SNDRV_CHMAP_FL, /* front left */ | ||
466 | SNDRV_CHMAP_FR, /* front right */ | ||
467 | SNDRV_CHMAP_RL, /* rear left */ | ||
468 | SNDRV_CHMAP_RR, /* rear right */ | ||
469 | SNDRV_CHMAP_FC, /* front center */ | ||
470 | SNDRV_CHMAP_LFE, /* LFE */ | ||
471 | SNDRV_CHMAP_SL, /* side left */ | ||
472 | SNDRV_CHMAP_SR, /* side right */ | ||
473 | SNDRV_CHMAP_RC, /* rear center */ | ||
474 | /* new definitions */ | ||
475 | SNDRV_CHMAP_FLC, /* front left center */ | ||
476 | SNDRV_CHMAP_FRC, /* front right center */ | ||
477 | SNDRV_CHMAP_RLC, /* rear left center */ | ||
478 | SNDRV_CHMAP_RRC, /* rear right center */ | ||
479 | SNDRV_CHMAP_FLW, /* front left wide */ | ||
480 | SNDRV_CHMAP_FRW, /* front right wide */ | ||
481 | SNDRV_CHMAP_FLH, /* front left high */ | ||
482 | SNDRV_CHMAP_FCH, /* front center high */ | ||
483 | SNDRV_CHMAP_FRH, /* front right high */ | ||
484 | SNDRV_CHMAP_TC, /* top center */ | ||
485 | SNDRV_CHMAP_TFL, /* top front left */ | ||
486 | SNDRV_CHMAP_TFR, /* top front right */ | ||
487 | SNDRV_CHMAP_TFC, /* top front center */ | ||
488 | SNDRV_CHMAP_TRL, /* top rear left */ | ||
489 | SNDRV_CHMAP_TRR, /* top rear right */ | ||
490 | SNDRV_CHMAP_TRC, /* top rear center */ | ||
491 | SNDRV_CHMAP_LAST = SNDRV_CHMAP_TRC, | ||
492 | }; | ||
493 | |||
494 | #define SNDRV_CHMAP_POSITION_MASK 0xffff | ||
495 | #define SNDRV_CHMAP_PHASE_INVERSE (0x01 << 16) | ||
496 | #define SNDRV_CHMAP_DRIVER_SPEC (0x02 << 16) | ||
497 | |||
498 | #define SNDRV_PCM_IOCTL_PVERSION _IOR('A', 0x00, int) | ||
499 | #define SNDRV_PCM_IOCTL_INFO _IOR('A', 0x01, struct snd_pcm_info) | ||
500 | #define SNDRV_PCM_IOCTL_TSTAMP _IOW('A', 0x02, int) | ||
501 | #define SNDRV_PCM_IOCTL_TTSTAMP _IOW('A', 0x03, int) | ||
502 | #define SNDRV_PCM_IOCTL_HW_REFINE _IOWR('A', 0x10, struct snd_pcm_hw_params) | ||
503 | #define SNDRV_PCM_IOCTL_HW_PARAMS _IOWR('A', 0x11, struct snd_pcm_hw_params) | ||
504 | #define SNDRV_PCM_IOCTL_HW_FREE _IO('A', 0x12) | ||
505 | #define SNDRV_PCM_IOCTL_SW_PARAMS _IOWR('A', 0x13, struct snd_pcm_sw_params) | ||
506 | #define SNDRV_PCM_IOCTL_STATUS _IOR('A', 0x20, struct snd_pcm_status) | ||
507 | #define SNDRV_PCM_IOCTL_DELAY _IOR('A', 0x21, snd_pcm_sframes_t) | ||
508 | #define SNDRV_PCM_IOCTL_HWSYNC _IO('A', 0x22) | ||
509 | #define SNDRV_PCM_IOCTL_SYNC_PTR _IOWR('A', 0x23, struct snd_pcm_sync_ptr) | ||
510 | #define SNDRV_PCM_IOCTL_CHANNEL_INFO _IOR('A', 0x32, struct snd_pcm_channel_info) | ||
511 | #define SNDRV_PCM_IOCTL_PREPARE _IO('A', 0x40) | ||
512 | #define SNDRV_PCM_IOCTL_RESET _IO('A', 0x41) | ||
513 | #define SNDRV_PCM_IOCTL_START _IO('A', 0x42) | ||
514 | #define SNDRV_PCM_IOCTL_DROP _IO('A', 0x43) | ||
515 | #define SNDRV_PCM_IOCTL_DRAIN _IO('A', 0x44) | ||
516 | #define SNDRV_PCM_IOCTL_PAUSE _IOW('A', 0x45, int) | ||
517 | #define SNDRV_PCM_IOCTL_REWIND _IOW('A', 0x46, snd_pcm_uframes_t) | ||
518 | #define SNDRV_PCM_IOCTL_RESUME _IO('A', 0x47) | ||
519 | #define SNDRV_PCM_IOCTL_XRUN _IO('A', 0x48) | ||
520 | #define SNDRV_PCM_IOCTL_FORWARD _IOW('A', 0x49, snd_pcm_uframes_t) | ||
521 | #define SNDRV_PCM_IOCTL_WRITEI_FRAMES _IOW('A', 0x50, struct snd_xferi) | ||
522 | #define SNDRV_PCM_IOCTL_READI_FRAMES _IOR('A', 0x51, struct snd_xferi) | ||
523 | #define SNDRV_PCM_IOCTL_WRITEN_FRAMES _IOW('A', 0x52, struct snd_xfern) | ||
524 | #define SNDRV_PCM_IOCTL_READN_FRAMES _IOR('A', 0x53, struct snd_xfern) | ||
525 | #define SNDRV_PCM_IOCTL_LINK _IOW('A', 0x60, int) | ||
526 | #define SNDRV_PCM_IOCTL_UNLINK _IO('A', 0x61) | ||
527 | |||
528 | /***************************************************************************** | ||
529 | * * | ||
530 | * MIDI v1.0 interface * | ||
531 | * * | ||
532 | *****************************************************************************/ | ||
533 | |||
534 | /* | ||
535 | * Raw MIDI section - /dev/snd/midi?? | ||
536 | */ | ||
537 | |||
538 | #define SNDRV_RAWMIDI_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 0) | ||
539 | |||
540 | enum { | ||
541 | SNDRV_RAWMIDI_STREAM_OUTPUT = 0, | ||
542 | SNDRV_RAWMIDI_STREAM_INPUT, | ||
543 | SNDRV_RAWMIDI_STREAM_LAST = SNDRV_RAWMIDI_STREAM_INPUT, | ||
544 | }; | ||
545 | |||
546 | #define SNDRV_RAWMIDI_INFO_OUTPUT 0x00000001 | ||
547 | #define SNDRV_RAWMIDI_INFO_INPUT 0x00000002 | ||
548 | #define SNDRV_RAWMIDI_INFO_DUPLEX 0x00000004 | ||
549 | |||
550 | struct snd_rawmidi_info { | ||
551 | unsigned int device; /* RO/WR (control): device number */ | ||
552 | unsigned int subdevice; /* RO/WR (control): subdevice number */ | ||
553 | int stream; /* WR: stream */ | ||
554 | int card; /* R: card number */ | ||
555 | unsigned int flags; /* SNDRV_RAWMIDI_INFO_XXXX */ | ||
556 | unsigned char id[64]; /* ID (user selectable) */ | ||
557 | unsigned char name[80]; /* name of device */ | ||
558 | unsigned char subname[32]; /* name of active or selected subdevice */ | ||
559 | unsigned int subdevices_count; | ||
560 | unsigned int subdevices_avail; | ||
561 | unsigned char reserved[64]; /* reserved for future use */ | ||
562 | }; | ||
563 | |||
564 | struct snd_rawmidi_params { | ||
565 | int stream; | ||
566 | size_t buffer_size; /* queue size in bytes */ | ||
567 | size_t avail_min; /* minimum avail bytes for wakeup */ | ||
568 | unsigned int no_active_sensing: 1; /* do not send active sensing byte in close() */ | ||
569 | unsigned char reserved[16]; /* reserved for future use */ | ||
570 | }; | ||
571 | |||
572 | struct snd_rawmidi_status { | ||
573 | int stream; | ||
574 | struct timespec tstamp; /* Timestamp */ | ||
575 | size_t avail; /* available bytes */ | ||
576 | size_t xruns; /* count of overruns since last status (in bytes) */ | ||
577 | unsigned char reserved[16]; /* reserved for future use */ | ||
578 | }; | ||
579 | |||
580 | #define SNDRV_RAWMIDI_IOCTL_PVERSION _IOR('W', 0x00, int) | ||
581 | #define SNDRV_RAWMIDI_IOCTL_INFO _IOR('W', 0x01, struct snd_rawmidi_info) | ||
582 | #define SNDRV_RAWMIDI_IOCTL_PARAMS _IOWR('W', 0x10, struct snd_rawmidi_params) | ||
583 | #define SNDRV_RAWMIDI_IOCTL_STATUS _IOWR('W', 0x20, struct snd_rawmidi_status) | ||
584 | #define SNDRV_RAWMIDI_IOCTL_DROP _IOW('W', 0x30, int) | ||
585 | #define SNDRV_RAWMIDI_IOCTL_DRAIN _IOW('W', 0x31, int) | ||
586 | |||
587 | /* | ||
588 | * Timer section - /dev/snd/timer | ||
589 | */ | ||
590 | |||
591 | #define SNDRV_TIMER_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 6) | ||
592 | |||
593 | enum { | ||
594 | SNDRV_TIMER_CLASS_NONE = -1, | ||
595 | SNDRV_TIMER_CLASS_SLAVE = 0, | ||
596 | SNDRV_TIMER_CLASS_GLOBAL, | ||
597 | SNDRV_TIMER_CLASS_CARD, | ||
598 | SNDRV_TIMER_CLASS_PCM, | ||
599 | SNDRV_TIMER_CLASS_LAST = SNDRV_TIMER_CLASS_PCM, | ||
600 | }; | ||
601 | |||
602 | /* slave timer classes */ | ||
603 | enum { | ||
604 | SNDRV_TIMER_SCLASS_NONE = 0, | ||
605 | SNDRV_TIMER_SCLASS_APPLICATION, | ||
606 | SNDRV_TIMER_SCLASS_SEQUENCER, /* alias */ | ||
607 | SNDRV_TIMER_SCLASS_OSS_SEQUENCER, /* alias */ | ||
608 | SNDRV_TIMER_SCLASS_LAST = SNDRV_TIMER_SCLASS_OSS_SEQUENCER, | ||
609 | }; | ||
610 | |||
611 | /* global timers (device member) */ | ||
612 | #define SNDRV_TIMER_GLOBAL_SYSTEM 0 | ||
613 | #define SNDRV_TIMER_GLOBAL_RTC 1 | ||
614 | #define SNDRV_TIMER_GLOBAL_HPET 2 | ||
615 | #define SNDRV_TIMER_GLOBAL_HRTIMER 3 | ||
616 | |||
617 | /* info flags */ | ||
618 | #define SNDRV_TIMER_FLG_SLAVE (1<<0) /* cannot be controlled */ | ||
619 | |||
620 | struct snd_timer_id { | ||
621 | int dev_class; | ||
622 | int dev_sclass; | ||
623 | int card; | ||
624 | int device; | ||
625 | int subdevice; | ||
626 | }; | ||
627 | |||
628 | struct snd_timer_ginfo { | ||
629 | struct snd_timer_id tid; /* requested timer ID */ | ||
630 | unsigned int flags; /* timer flags - SNDRV_TIMER_FLG_* */ | ||
631 | int card; /* card number */ | ||
632 | unsigned char id[64]; /* timer identification */ | ||
633 | unsigned char name[80]; /* timer name */ | ||
634 | unsigned long reserved0; /* reserved for future use */ | ||
635 | unsigned long resolution; /* average period resolution in ns */ | ||
636 | unsigned long resolution_min; /* minimal period resolution in ns */ | ||
637 | unsigned long resolution_max; /* maximal period resolution in ns */ | ||
638 | unsigned int clients; /* active timer clients */ | ||
639 | unsigned char reserved[32]; | ||
640 | }; | ||
641 | |||
642 | struct snd_timer_gparams { | ||
643 | struct snd_timer_id tid; /* requested timer ID */ | ||
644 | unsigned long period_num; /* requested precise period duration (in seconds) - numerator */ | ||
645 | unsigned long period_den; /* requested precise period duration (in seconds) - denominator */ | ||
646 | unsigned char reserved[32]; | ||
647 | }; | ||
648 | |||
649 | struct snd_timer_gstatus { | ||
650 | struct snd_timer_id tid; /* requested timer ID */ | ||
651 | unsigned long resolution; /* current period resolution in ns */ | ||
652 | unsigned long resolution_num; /* precise current period resolution (in seconds) - numerator */ | ||
653 | unsigned long resolution_den; /* precise current period resolution (in seconds) - denominator */ | ||
654 | unsigned char reserved[32]; | ||
655 | }; | ||
656 | |||
657 | struct snd_timer_select { | ||
658 | struct snd_timer_id id; /* bind to timer ID */ | ||
659 | unsigned char reserved[32]; /* reserved */ | ||
660 | }; | ||
661 | |||
662 | struct snd_timer_info { | ||
663 | unsigned int flags; /* timer flags - SNDRV_TIMER_FLG_* */ | ||
664 | int card; /* card number */ | ||
665 | unsigned char id[64]; /* timer identificator */ | ||
666 | unsigned char name[80]; /* timer name */ | ||
667 | unsigned long reserved0; /* reserved for future use */ | ||
668 | unsigned long resolution; /* average period resolution in ns */ | ||
669 | unsigned char reserved[64]; /* reserved */ | ||
670 | }; | ||
671 | |||
672 | #define SNDRV_TIMER_PSFLG_AUTO (1<<0) /* auto start, otherwise one-shot */ | ||
673 | #define SNDRV_TIMER_PSFLG_EXCLUSIVE (1<<1) /* exclusive use, precise start/stop/pause/continue */ | ||
674 | #define SNDRV_TIMER_PSFLG_EARLY_EVENT (1<<2) /* write early event to the poll queue */ | ||
675 | |||
676 | struct snd_timer_params { | ||
677 | unsigned int flags; /* flags - SNDRV_MIXER_PSFLG_* */ | ||
678 | unsigned int ticks; /* requested resolution in ticks */ | ||
679 | unsigned int queue_size; /* total size of queue (32-1024) */ | ||
680 | unsigned int reserved0; /* reserved, was: failure locations */ | ||
681 | unsigned int filter; /* event filter (bitmask of SNDRV_TIMER_EVENT_*) */ | ||
682 | unsigned char reserved[60]; /* reserved */ | ||
683 | }; | ||
684 | |||
685 | struct snd_timer_status { | ||
686 | struct timespec tstamp; /* Timestamp - last update */ | ||
687 | unsigned int resolution; /* current period resolution in ns */ | ||
688 | unsigned int lost; /* counter of master tick lost */ | ||
689 | unsigned int overrun; /* count of read queue overruns */ | ||
690 | unsigned int queue; /* used queue size */ | ||
691 | unsigned char reserved[64]; /* reserved */ | ||
692 | }; | ||
693 | |||
694 | #define SNDRV_TIMER_IOCTL_PVERSION _IOR('T', 0x00, int) | ||
695 | #define SNDRV_TIMER_IOCTL_NEXT_DEVICE _IOWR('T', 0x01, struct snd_timer_id) | ||
696 | #define SNDRV_TIMER_IOCTL_TREAD _IOW('T', 0x02, int) | ||
697 | #define SNDRV_TIMER_IOCTL_GINFO _IOWR('T', 0x03, struct snd_timer_ginfo) | ||
698 | #define SNDRV_TIMER_IOCTL_GPARAMS _IOW('T', 0x04, struct snd_timer_gparams) | ||
699 | #define SNDRV_TIMER_IOCTL_GSTATUS _IOWR('T', 0x05, struct snd_timer_gstatus) | ||
700 | #define SNDRV_TIMER_IOCTL_SELECT _IOW('T', 0x10, struct snd_timer_select) | ||
701 | #define SNDRV_TIMER_IOCTL_INFO _IOR('T', 0x11, struct snd_timer_info) | ||
702 | #define SNDRV_TIMER_IOCTL_PARAMS _IOW('T', 0x12, struct snd_timer_params) | ||
703 | #define SNDRV_TIMER_IOCTL_STATUS _IOR('T', 0x14, struct snd_timer_status) | ||
704 | /* The following four ioctls are changed since 1.0.9 due to confliction */ | ||
705 | #define SNDRV_TIMER_IOCTL_START _IO('T', 0xa0) | ||
706 | #define SNDRV_TIMER_IOCTL_STOP _IO('T', 0xa1) | ||
707 | #define SNDRV_TIMER_IOCTL_CONTINUE _IO('T', 0xa2) | ||
708 | #define SNDRV_TIMER_IOCTL_PAUSE _IO('T', 0xa3) | ||
709 | |||
710 | struct snd_timer_read { | ||
711 | unsigned int resolution; | ||
712 | unsigned int ticks; | ||
713 | }; | ||
714 | |||
715 | enum { | ||
716 | SNDRV_TIMER_EVENT_RESOLUTION = 0, /* val = resolution in ns */ | ||
717 | SNDRV_TIMER_EVENT_TICK, /* val = ticks */ | ||
718 | SNDRV_TIMER_EVENT_START, /* val = resolution in ns */ | ||
719 | SNDRV_TIMER_EVENT_STOP, /* val = 0 */ | ||
720 | SNDRV_TIMER_EVENT_CONTINUE, /* val = resolution in ns */ | ||
721 | SNDRV_TIMER_EVENT_PAUSE, /* val = 0 */ | ||
722 | SNDRV_TIMER_EVENT_EARLY, /* val = 0, early event */ | ||
723 | SNDRV_TIMER_EVENT_SUSPEND, /* val = 0 */ | ||
724 | SNDRV_TIMER_EVENT_RESUME, /* val = resolution in ns */ | ||
725 | /* master timer events for slave timer instances */ | ||
726 | SNDRV_TIMER_EVENT_MSTART = SNDRV_TIMER_EVENT_START + 10, | ||
727 | SNDRV_TIMER_EVENT_MSTOP = SNDRV_TIMER_EVENT_STOP + 10, | ||
728 | SNDRV_TIMER_EVENT_MCONTINUE = SNDRV_TIMER_EVENT_CONTINUE + 10, | ||
729 | SNDRV_TIMER_EVENT_MPAUSE = SNDRV_TIMER_EVENT_PAUSE + 10, | ||
730 | SNDRV_TIMER_EVENT_MSUSPEND = SNDRV_TIMER_EVENT_SUSPEND + 10, | ||
731 | SNDRV_TIMER_EVENT_MRESUME = SNDRV_TIMER_EVENT_RESUME + 10, | ||
732 | }; | ||
733 | |||
734 | struct snd_timer_tread { | ||
735 | int event; | ||
736 | struct timespec tstamp; | ||
737 | unsigned int val; | ||
738 | }; | ||
739 | |||
740 | /**************************************************************************** | ||
741 | * * | ||
742 | * Section for driver control interface - /dev/snd/control? * | ||
743 | * * | ||
744 | ****************************************************************************/ | ||
745 | |||
746 | #define SNDRV_CTL_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 7) | ||
747 | |||
748 | struct snd_ctl_card_info { | ||
749 | int card; /* card number */ | ||
750 | int pad; /* reserved for future (was type) */ | ||
751 | unsigned char id[16]; /* ID of card (user selectable) */ | ||
752 | unsigned char driver[16]; /* Driver name */ | ||
753 | unsigned char name[32]; /* Short name of soundcard */ | ||
754 | unsigned char longname[80]; /* name + info text about soundcard */ | ||
755 | unsigned char reserved_[16]; /* reserved for future (was ID of mixer) */ | ||
756 | unsigned char mixername[80]; /* visual mixer identification */ | ||
757 | unsigned char components[128]; /* card components / fine identification, delimited with one space (AC97 etc..) */ | ||
758 | }; | ||
759 | |||
760 | typedef int __bitwise snd_ctl_elem_type_t; | ||
761 | #define SNDRV_CTL_ELEM_TYPE_NONE ((__force snd_ctl_elem_type_t) 0) /* invalid */ | ||
762 | #define SNDRV_CTL_ELEM_TYPE_BOOLEAN ((__force snd_ctl_elem_type_t) 1) /* boolean type */ | ||
763 | #define SNDRV_CTL_ELEM_TYPE_INTEGER ((__force snd_ctl_elem_type_t) 2) /* integer type */ | ||
764 | #define SNDRV_CTL_ELEM_TYPE_ENUMERATED ((__force snd_ctl_elem_type_t) 3) /* enumerated type */ | ||
765 | #define SNDRV_CTL_ELEM_TYPE_BYTES ((__force snd_ctl_elem_type_t) 4) /* byte array */ | ||
766 | #define SNDRV_CTL_ELEM_TYPE_IEC958 ((__force snd_ctl_elem_type_t) 5) /* IEC958 (S/PDIF) setup */ | ||
767 | #define SNDRV_CTL_ELEM_TYPE_INTEGER64 ((__force snd_ctl_elem_type_t) 6) /* 64-bit integer type */ | ||
768 | #define SNDRV_CTL_ELEM_TYPE_LAST SNDRV_CTL_ELEM_TYPE_INTEGER64 | ||
769 | |||
770 | typedef int __bitwise snd_ctl_elem_iface_t; | ||
771 | #define SNDRV_CTL_ELEM_IFACE_CARD ((__force snd_ctl_elem_iface_t) 0) /* global control */ | ||
772 | #define SNDRV_CTL_ELEM_IFACE_HWDEP ((__force snd_ctl_elem_iface_t) 1) /* hardware dependent device */ | ||
773 | #define SNDRV_CTL_ELEM_IFACE_MIXER ((__force snd_ctl_elem_iface_t) 2) /* virtual mixer device */ | ||
774 | #define SNDRV_CTL_ELEM_IFACE_PCM ((__force snd_ctl_elem_iface_t) 3) /* PCM device */ | ||
775 | #define SNDRV_CTL_ELEM_IFACE_RAWMIDI ((__force snd_ctl_elem_iface_t) 4) /* RawMidi device */ | ||
776 | #define SNDRV_CTL_ELEM_IFACE_TIMER ((__force snd_ctl_elem_iface_t) 5) /* timer device */ | ||
777 | #define SNDRV_CTL_ELEM_IFACE_SEQUENCER ((__force snd_ctl_elem_iface_t) 6) /* sequencer client */ | ||
778 | #define SNDRV_CTL_ELEM_IFACE_LAST SNDRV_CTL_ELEM_IFACE_SEQUENCER | ||
779 | |||
780 | #define SNDRV_CTL_ELEM_ACCESS_READ (1<<0) | ||
781 | #define SNDRV_CTL_ELEM_ACCESS_WRITE (1<<1) | ||
782 | #define SNDRV_CTL_ELEM_ACCESS_READWRITE (SNDRV_CTL_ELEM_ACCESS_READ|SNDRV_CTL_ELEM_ACCESS_WRITE) | ||
783 | #define SNDRV_CTL_ELEM_ACCESS_VOLATILE (1<<2) /* control value may be changed without a notification */ | ||
784 | #define SNDRV_CTL_ELEM_ACCESS_TIMESTAMP (1<<3) /* when was control changed */ | ||
785 | #define SNDRV_CTL_ELEM_ACCESS_TLV_READ (1<<4) /* TLV read is possible */ | ||
786 | #define SNDRV_CTL_ELEM_ACCESS_TLV_WRITE (1<<5) /* TLV write is possible */ | ||
787 | #define SNDRV_CTL_ELEM_ACCESS_TLV_READWRITE (SNDRV_CTL_ELEM_ACCESS_TLV_READ|SNDRV_CTL_ELEM_ACCESS_TLV_WRITE) | ||
788 | #define SNDRV_CTL_ELEM_ACCESS_TLV_COMMAND (1<<6) /* TLV command is possible */ | ||
789 | #define SNDRV_CTL_ELEM_ACCESS_INACTIVE (1<<8) /* control does actually nothing, but may be updated */ | ||
790 | #define SNDRV_CTL_ELEM_ACCESS_LOCK (1<<9) /* write lock */ | ||
791 | #define SNDRV_CTL_ELEM_ACCESS_OWNER (1<<10) /* write lock owner */ | ||
792 | #define SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK (1<<28) /* kernel use a TLV callback */ | ||
793 | #define SNDRV_CTL_ELEM_ACCESS_USER (1<<29) /* user space element */ | ||
794 | /* bits 30 and 31 are obsoleted (for indirect access) */ | ||
795 | |||
796 | /* for further details see the ACPI and PCI power management specification */ | ||
797 | #define SNDRV_CTL_POWER_D0 0x0000 /* full On */ | ||
798 | #define SNDRV_CTL_POWER_D1 0x0100 /* partial On */ | ||
799 | #define SNDRV_CTL_POWER_D2 0x0200 /* partial On */ | ||
800 | #define SNDRV_CTL_POWER_D3 0x0300 /* Off */ | ||
801 | #define SNDRV_CTL_POWER_D3hot (SNDRV_CTL_POWER_D3|0x0000) /* Off, with power */ | ||
802 | #define SNDRV_CTL_POWER_D3cold (SNDRV_CTL_POWER_D3|0x0001) /* Off, without power */ | ||
803 | |||
804 | struct snd_ctl_elem_id { | ||
805 | unsigned int numid; /* numeric identifier, zero = invalid */ | ||
806 | snd_ctl_elem_iface_t iface; /* interface identifier */ | ||
807 | unsigned int device; /* device/client number */ | ||
808 | unsigned int subdevice; /* subdevice (substream) number */ | ||
809 | unsigned char name[44]; /* ASCII name of item */ | ||
810 | unsigned int index; /* index of item */ | ||
811 | }; | ||
812 | |||
813 | struct snd_ctl_elem_list { | ||
814 | unsigned int offset; /* W: first element ID to get */ | ||
815 | unsigned int space; /* W: count of element IDs to get */ | ||
816 | unsigned int used; /* R: count of element IDs set */ | ||
817 | unsigned int count; /* R: count of all elements */ | ||
818 | struct snd_ctl_elem_id __user *pids; /* R: IDs */ | ||
819 | unsigned char reserved[50]; | ||
820 | }; | ||
821 | |||
822 | struct snd_ctl_elem_info { | ||
823 | struct snd_ctl_elem_id id; /* W: element ID */ | ||
824 | snd_ctl_elem_type_t type; /* R: value type - SNDRV_CTL_ELEM_TYPE_* */ | ||
825 | unsigned int access; /* R: value access (bitmask) - SNDRV_CTL_ELEM_ACCESS_* */ | ||
826 | unsigned int count; /* count of values */ | ||
827 | __kernel_pid_t owner; /* owner's PID of this control */ | ||
828 | union { | ||
829 | struct { | ||
830 | long min; /* R: minimum value */ | ||
831 | long max; /* R: maximum value */ | ||
832 | long step; /* R: step (0 variable) */ | ||
833 | } integer; | ||
834 | struct { | ||
835 | long long min; /* R: minimum value */ | ||
836 | long long max; /* R: maximum value */ | ||
837 | long long step; /* R: step (0 variable) */ | ||
838 | } integer64; | ||
839 | struct { | ||
840 | unsigned int items; /* R: number of items */ | ||
841 | unsigned int item; /* W: item number */ | ||
842 | char name[64]; /* R: value name */ | ||
843 | __u64 names_ptr; /* W: names list (ELEM_ADD only) */ | ||
844 | unsigned int names_length; | ||
845 | } enumerated; | ||
846 | unsigned char reserved[128]; | ||
847 | } value; | ||
848 | union { | ||
849 | unsigned short d[4]; /* dimensions */ | ||
850 | unsigned short *d_ptr; /* indirect - obsoleted */ | ||
851 | } dimen; | ||
852 | unsigned char reserved[64-4*sizeof(unsigned short)]; | ||
853 | }; | ||
854 | |||
855 | struct snd_ctl_elem_value { | ||
856 | struct snd_ctl_elem_id id; /* W: element ID */ | ||
857 | unsigned int indirect: 1; /* W: indirect access - obsoleted */ | ||
858 | union { | ||
859 | union { | ||
860 | long value[128]; | ||
861 | long *value_ptr; /* obsoleted */ | ||
862 | } integer; | ||
863 | union { | ||
864 | long long value[64]; | ||
865 | long long *value_ptr; /* obsoleted */ | ||
866 | } integer64; | ||
867 | union { | ||
868 | unsigned int item[128]; | ||
869 | unsigned int *item_ptr; /* obsoleted */ | ||
870 | } enumerated; | ||
871 | union { | ||
872 | unsigned char data[512]; | ||
873 | unsigned char *data_ptr; /* obsoleted */ | ||
874 | } bytes; | ||
875 | struct snd_aes_iec958 iec958; | ||
876 | } value; /* RO */ | ||
877 | struct timespec tstamp; | ||
878 | unsigned char reserved[128-sizeof(struct timespec)]; | ||
879 | }; | ||
880 | |||
881 | struct snd_ctl_tlv { | ||
882 | unsigned int numid; /* control element numeric identification */ | ||
883 | unsigned int length; /* in bytes aligned to 4 */ | ||
884 | unsigned int tlv[0]; /* first TLV */ | ||
885 | }; | ||
886 | |||
887 | #define SNDRV_CTL_IOCTL_PVERSION _IOR('U', 0x00, int) | ||
888 | #define SNDRV_CTL_IOCTL_CARD_INFO _IOR('U', 0x01, struct snd_ctl_card_info) | ||
889 | #define SNDRV_CTL_IOCTL_ELEM_LIST _IOWR('U', 0x10, struct snd_ctl_elem_list) | ||
890 | #define SNDRV_CTL_IOCTL_ELEM_INFO _IOWR('U', 0x11, struct snd_ctl_elem_info) | ||
891 | #define SNDRV_CTL_IOCTL_ELEM_READ _IOWR('U', 0x12, struct snd_ctl_elem_value) | ||
892 | #define SNDRV_CTL_IOCTL_ELEM_WRITE _IOWR('U', 0x13, struct snd_ctl_elem_value) | ||
893 | #define SNDRV_CTL_IOCTL_ELEM_LOCK _IOW('U', 0x14, struct snd_ctl_elem_id) | ||
894 | #define SNDRV_CTL_IOCTL_ELEM_UNLOCK _IOW('U', 0x15, struct snd_ctl_elem_id) | ||
895 | #define SNDRV_CTL_IOCTL_SUBSCRIBE_EVENTS _IOWR('U', 0x16, int) | ||
896 | #define SNDRV_CTL_IOCTL_ELEM_ADD _IOWR('U', 0x17, struct snd_ctl_elem_info) | ||
897 | #define SNDRV_CTL_IOCTL_ELEM_REPLACE _IOWR('U', 0x18, struct snd_ctl_elem_info) | ||
898 | #define SNDRV_CTL_IOCTL_ELEM_REMOVE _IOWR('U', 0x19, struct snd_ctl_elem_id) | ||
899 | #define SNDRV_CTL_IOCTL_TLV_READ _IOWR('U', 0x1a, struct snd_ctl_tlv) | ||
900 | #define SNDRV_CTL_IOCTL_TLV_WRITE _IOWR('U', 0x1b, struct snd_ctl_tlv) | ||
901 | #define SNDRV_CTL_IOCTL_TLV_COMMAND _IOWR('U', 0x1c, struct snd_ctl_tlv) | ||
902 | #define SNDRV_CTL_IOCTL_HWDEP_NEXT_DEVICE _IOWR('U', 0x20, int) | ||
903 | #define SNDRV_CTL_IOCTL_HWDEP_INFO _IOR('U', 0x21, struct snd_hwdep_info) | ||
904 | #define SNDRV_CTL_IOCTL_PCM_NEXT_DEVICE _IOR('U', 0x30, int) | ||
905 | #define SNDRV_CTL_IOCTL_PCM_INFO _IOWR('U', 0x31, struct snd_pcm_info) | ||
906 | #define SNDRV_CTL_IOCTL_PCM_PREFER_SUBDEVICE _IOW('U', 0x32, int) | ||
907 | #define SNDRV_CTL_IOCTL_RAWMIDI_NEXT_DEVICE _IOWR('U', 0x40, int) | ||
908 | #define SNDRV_CTL_IOCTL_RAWMIDI_INFO _IOWR('U', 0x41, struct snd_rawmidi_info) | ||
909 | #define SNDRV_CTL_IOCTL_RAWMIDI_PREFER_SUBDEVICE _IOW('U', 0x42, int) | ||
910 | #define SNDRV_CTL_IOCTL_POWER _IOWR('U', 0xd0, int) | ||
911 | #define SNDRV_CTL_IOCTL_POWER_STATE _IOR('U', 0xd1, int) | ||
912 | |||
913 | /* | ||
914 | * Read interface. | ||
915 | */ | ||
916 | |||
917 | enum sndrv_ctl_event_type { | ||
918 | SNDRV_CTL_EVENT_ELEM = 0, | ||
919 | SNDRV_CTL_EVENT_LAST = SNDRV_CTL_EVENT_ELEM, | ||
920 | }; | ||
921 | |||
922 | #define SNDRV_CTL_EVENT_MASK_VALUE (1<<0) /* element value was changed */ | ||
923 | #define SNDRV_CTL_EVENT_MASK_INFO (1<<1) /* element info was changed */ | ||
924 | #define SNDRV_CTL_EVENT_MASK_ADD (1<<2) /* element was added */ | ||
925 | #define SNDRV_CTL_EVENT_MASK_TLV (1<<3) /* element TLV tree was changed */ | ||
926 | #define SNDRV_CTL_EVENT_MASK_REMOVE (~0U) /* element was removed */ | ||
927 | |||
928 | struct snd_ctl_event { | ||
929 | int type; /* event type - SNDRV_CTL_EVENT_* */ | ||
930 | union { | ||
931 | struct { | ||
932 | unsigned int mask; | ||
933 | struct snd_ctl_elem_id id; | ||
934 | } elem; | ||
935 | unsigned char data8[60]; | ||
936 | } data; | ||
937 | }; | ||
938 | |||
939 | /* | ||
940 | * Control names | ||
941 | */ | ||
942 | |||
943 | #define SNDRV_CTL_NAME_NONE "" | ||
944 | #define SNDRV_CTL_NAME_PLAYBACK "Playback " | ||
945 | #define SNDRV_CTL_NAME_CAPTURE "Capture " | ||
946 | |||
947 | #define SNDRV_CTL_NAME_IEC958_NONE "" | ||
948 | #define SNDRV_CTL_NAME_IEC958_SWITCH "Switch" | ||
949 | #define SNDRV_CTL_NAME_IEC958_VOLUME "Volume" | ||
950 | #define SNDRV_CTL_NAME_IEC958_DEFAULT "Default" | ||
951 | #define SNDRV_CTL_NAME_IEC958_MASK "Mask" | ||
952 | #define SNDRV_CTL_NAME_IEC958_CON_MASK "Con Mask" | ||
953 | #define SNDRV_CTL_NAME_IEC958_PRO_MASK "Pro Mask" | ||
954 | #define SNDRV_CTL_NAME_IEC958_PCM_STREAM "PCM Stream" | ||
955 | #define SNDRV_CTL_NAME_IEC958(expl,direction,what) "IEC958 " expl SNDRV_CTL_NAME_##direction SNDRV_CTL_NAME_IEC958_##what | ||
956 | |||
957 | #endif /* _UAPI__SOUND_ASOUND_H */ | ||
diff --git a/include/uapi/sound/asound_fm.h b/include/uapi/sound/asound_fm.h new file mode 100644 index 000000000000..c2a4b967d5be --- /dev/null +++ b/include/uapi/sound/asound_fm.h | |||
@@ -0,0 +1,134 @@ | |||
1 | #ifndef __SOUND_ASOUND_FM_H | ||
2 | #define __SOUND_ASOUND_FM_H | ||
3 | |||
4 | /* | ||
5 | * Advanced Linux Sound Architecture - ALSA | ||
6 | * | ||
7 | * Interface file between ALSA driver & user space | ||
8 | * Copyright (c) 1994-98 by Jaroslav Kysela <perex@perex.cz>, | ||
9 | * 4Front Technologies | ||
10 | * | ||
11 | * Direct FM control | ||
12 | * | ||
13 | * This program is free software; you can redistribute it and/or modify | ||
14 | * it under the terms of the GNU General Public License as published by | ||
15 | * the Free Software Foundation; either version 2 of the License, or | ||
16 | * (at your option) any later version. | ||
17 | * | ||
18 | * This program is distributed in the hope that it will be useful, | ||
19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
21 | * GNU General Public License for more details. | ||
22 | * | ||
23 | * You should have received a copy of the GNU General Public License | ||
24 | * along with this program; if not, write to the Free Software | ||
25 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
26 | * | ||
27 | */ | ||
28 | |||
29 | #define SNDRV_DM_FM_MODE_OPL2 0x00 | ||
30 | #define SNDRV_DM_FM_MODE_OPL3 0x01 | ||
31 | |||
32 | struct snd_dm_fm_info { | ||
33 | unsigned char fm_mode; /* OPL mode, see SNDRV_DM_FM_MODE_XXX */ | ||
34 | unsigned char rhythm; /* percussion mode flag */ | ||
35 | }; | ||
36 | |||
37 | /* | ||
38 | * Data structure composing an FM "note" or sound event. | ||
39 | */ | ||
40 | |||
41 | struct snd_dm_fm_voice { | ||
42 | unsigned char op; /* operator cell (0 or 1) */ | ||
43 | unsigned char voice; /* FM voice (0 to 17) */ | ||
44 | |||
45 | unsigned char am; /* amplitude modulation */ | ||
46 | unsigned char vibrato; /* vibrato effect */ | ||
47 | unsigned char do_sustain; /* sustain phase */ | ||
48 | unsigned char kbd_scale; /* keyboard scaling */ | ||
49 | unsigned char harmonic; /* 4 bits: harmonic and multiplier */ | ||
50 | unsigned char scale_level; /* 2 bits: decrease output freq rises */ | ||
51 | unsigned char volume; /* 6 bits: volume */ | ||
52 | |||
53 | unsigned char attack; /* 4 bits: attack rate */ | ||
54 | unsigned char decay; /* 4 bits: decay rate */ | ||
55 | unsigned char sustain; /* 4 bits: sustain level */ | ||
56 | unsigned char release; /* 4 bits: release rate */ | ||
57 | |||
58 | unsigned char feedback; /* 3 bits: feedback for op0 */ | ||
59 | unsigned char connection; /* 0 for serial, 1 for parallel */ | ||
60 | unsigned char left; /* stereo left */ | ||
61 | unsigned char right; /* stereo right */ | ||
62 | unsigned char waveform; /* 3 bits: waveform shape */ | ||
63 | }; | ||
64 | |||
65 | /* | ||
66 | * This describes an FM note by its voice, octave, frequency number (10bit) | ||
67 | * and key on/off. | ||
68 | */ | ||
69 | |||
70 | struct snd_dm_fm_note { | ||
71 | unsigned char voice; /* 0-17 voice channel */ | ||
72 | unsigned char octave; /* 3 bits: what octave to play */ | ||
73 | unsigned int fnum; /* 10 bits: frequency number */ | ||
74 | unsigned char key_on; /* set for active, clear for silent */ | ||
75 | }; | ||
76 | |||
77 | /* | ||
78 | * FM parameters that apply globally to all voices, and thus are not "notes" | ||
79 | */ | ||
80 | |||
81 | struct snd_dm_fm_params { | ||
82 | unsigned char am_depth; /* amplitude modulation depth (1=hi) */ | ||
83 | unsigned char vib_depth; /* vibrato depth (1=hi) */ | ||
84 | unsigned char kbd_split; /* keyboard split */ | ||
85 | unsigned char rhythm; /* percussion mode select */ | ||
86 | |||
87 | /* This block is the percussion instrument data */ | ||
88 | unsigned char bass; | ||
89 | unsigned char snare; | ||
90 | unsigned char tomtom; | ||
91 | unsigned char cymbal; | ||
92 | unsigned char hihat; | ||
93 | }; | ||
94 | |||
95 | /* | ||
96 | * FM mode ioctl settings | ||
97 | */ | ||
98 | |||
99 | #define SNDRV_DM_FM_IOCTL_INFO _IOR('H', 0x20, struct snd_dm_fm_info) | ||
100 | #define SNDRV_DM_FM_IOCTL_RESET _IO ('H', 0x21) | ||
101 | #define SNDRV_DM_FM_IOCTL_PLAY_NOTE _IOW('H', 0x22, struct snd_dm_fm_note) | ||
102 | #define SNDRV_DM_FM_IOCTL_SET_VOICE _IOW('H', 0x23, struct snd_dm_fm_voice) | ||
103 | #define SNDRV_DM_FM_IOCTL_SET_PARAMS _IOW('H', 0x24, struct snd_dm_fm_params) | ||
104 | #define SNDRV_DM_FM_IOCTL_SET_MODE _IOW('H', 0x25, int) | ||
105 | /* for OPL3 only */ | ||
106 | #define SNDRV_DM_FM_IOCTL_SET_CONNECTION _IOW('H', 0x26, int) | ||
107 | /* SBI patch management */ | ||
108 | #define SNDRV_DM_FM_IOCTL_CLEAR_PATCHES _IO ('H', 0x40) | ||
109 | |||
110 | #define SNDRV_DM_FM_OSS_IOCTL_RESET 0x20 | ||
111 | #define SNDRV_DM_FM_OSS_IOCTL_PLAY_NOTE 0x21 | ||
112 | #define SNDRV_DM_FM_OSS_IOCTL_SET_VOICE 0x22 | ||
113 | #define SNDRV_DM_FM_OSS_IOCTL_SET_PARAMS 0x23 | ||
114 | #define SNDRV_DM_FM_OSS_IOCTL_SET_MODE 0x24 | ||
115 | #define SNDRV_DM_FM_OSS_IOCTL_SET_OPL 0x25 | ||
116 | |||
117 | /* | ||
118 | * Patch Record - fixed size for write | ||
119 | */ | ||
120 | |||
121 | #define FM_KEY_SBI "SBI\032" | ||
122 | #define FM_KEY_2OP "2OP\032" | ||
123 | #define FM_KEY_4OP "4OP\032" | ||
124 | |||
125 | struct sbi_patch { | ||
126 | unsigned char prog; | ||
127 | unsigned char bank; | ||
128 | char key[4]; | ||
129 | char name[25]; | ||
130 | char extension[7]; | ||
131 | unsigned char data[32]; | ||
132 | }; | ||
133 | |||
134 | #endif /* __SOUND_ASOUND_FM_H */ | ||
diff --git a/include/uapi/sound/compress_offload.h b/include/uapi/sound/compress_offload.h new file mode 100644 index 000000000000..05341a43fedf --- /dev/null +++ b/include/uapi/sound/compress_offload.h | |||
@@ -0,0 +1,161 @@ | |||
1 | /* | ||
2 | * compress_offload.h - compress offload header definations | ||
3 | * | ||
4 | * Copyright (C) 2011 Intel Corporation | ||
5 | * Authors: Vinod Koul <vinod.koul@linux.intel.com> | ||
6 | * Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> | ||
7 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License as published by | ||
11 | * the Free Software Foundation; version 2 of the License. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, but | ||
14 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | * General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License along | ||
19 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
20 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. | ||
21 | * | ||
22 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
23 | * | ||
24 | */ | ||
25 | #ifndef __COMPRESS_OFFLOAD_H | ||
26 | #define __COMPRESS_OFFLOAD_H | ||
27 | |||
28 | #include <linux/types.h> | ||
29 | #include <sound/asound.h> | ||
30 | #include <sound/compress_params.h> | ||
31 | |||
32 | |||
33 | #define SNDRV_COMPRESS_VERSION SNDRV_PROTOCOL_VERSION(0, 1, 0) | ||
34 | /** | ||
35 | * struct snd_compressed_buffer: compressed buffer | ||
36 | * @fragment_size: size of buffer fragment in bytes | ||
37 | * @fragments: number of such fragments | ||
38 | */ | ||
39 | struct snd_compressed_buffer { | ||
40 | __u32 fragment_size; | ||
41 | __u32 fragments; | ||
42 | }; | ||
43 | |||
44 | /** | ||
45 | * struct snd_compr_params: compressed stream params | ||
46 | * @buffer: buffer description | ||
47 | * @codec: codec parameters | ||
48 | * @no_wake_mode: dont wake on fragment elapsed | ||
49 | */ | ||
50 | struct snd_compr_params { | ||
51 | struct snd_compressed_buffer buffer; | ||
52 | struct snd_codec codec; | ||
53 | __u8 no_wake_mode; | ||
54 | }; | ||
55 | |||
56 | /** | ||
57 | * struct snd_compr_tstamp: timestamp descriptor | ||
58 | * @byte_offset: Byte offset in ring buffer to DSP | ||
59 | * @copied_total: Total number of bytes copied from/to ring buffer to/by DSP | ||
60 | * @pcm_frames: Frames decoded or encoded by DSP. This field will evolve by | ||
61 | * large steps and should only be used to monitor encoding/decoding | ||
62 | * progress. It shall not be used for timing estimates. | ||
63 | * @pcm_io_frames: Frames rendered or received by DSP into a mixer or an audio | ||
64 | * output/input. This field should be used for A/V sync or time estimates. | ||
65 | * @sampling_rate: sampling rate of audio | ||
66 | */ | ||
67 | struct snd_compr_tstamp { | ||
68 | __u32 byte_offset; | ||
69 | __u32 copied_total; | ||
70 | snd_pcm_uframes_t pcm_frames; | ||
71 | snd_pcm_uframes_t pcm_io_frames; | ||
72 | __u32 sampling_rate; | ||
73 | }; | ||
74 | |||
75 | /** | ||
76 | * struct snd_compr_avail: avail descriptor | ||
77 | * @avail: Number of bytes available in ring buffer for writing/reading | ||
78 | * @tstamp: timestamp infomation | ||
79 | */ | ||
80 | struct snd_compr_avail { | ||
81 | __u64 avail; | ||
82 | struct snd_compr_tstamp tstamp; | ||
83 | }; | ||
84 | |||
85 | enum snd_compr_direction { | ||
86 | SND_COMPRESS_PLAYBACK = 0, | ||
87 | SND_COMPRESS_CAPTURE | ||
88 | }; | ||
89 | |||
90 | /** | ||
91 | * struct snd_compr_caps: caps descriptor | ||
92 | * @codecs: pointer to array of codecs | ||
93 | * @direction: direction supported. Of type snd_compr_direction | ||
94 | * @min_fragment_size: minimum fragment supported by DSP | ||
95 | * @max_fragment_size: maximum fragment supported by DSP | ||
96 | * @min_fragments: min fragments supported by DSP | ||
97 | * @max_fragments: max fragments supported by DSP | ||
98 | * @num_codecs: number of codecs supported | ||
99 | * @reserved: reserved field | ||
100 | */ | ||
101 | struct snd_compr_caps { | ||
102 | __u32 num_codecs; | ||
103 | __u32 direction; | ||
104 | __u32 min_fragment_size; | ||
105 | __u32 max_fragment_size; | ||
106 | __u32 min_fragments; | ||
107 | __u32 max_fragments; | ||
108 | __u32 codecs[MAX_NUM_CODECS]; | ||
109 | __u32 reserved[11]; | ||
110 | }; | ||
111 | |||
112 | /** | ||
113 | * struct snd_compr_codec_caps: query capability of codec | ||
114 | * @codec: codec for which capability is queried | ||
115 | * @num_descriptors: number of codec descriptors | ||
116 | * @descriptor: array of codec capability descriptor | ||
117 | */ | ||
118 | struct snd_compr_codec_caps { | ||
119 | __u32 codec; | ||
120 | __u32 num_descriptors; | ||
121 | struct snd_codec_desc descriptor[MAX_NUM_CODEC_DESCRIPTORS]; | ||
122 | }; | ||
123 | |||
124 | /** | ||
125 | * compress path ioctl definitions | ||
126 | * SNDRV_COMPRESS_GET_CAPS: Query capability of DSP | ||
127 | * SNDRV_COMPRESS_GET_CODEC_CAPS: Query capability of a codec | ||
128 | * SNDRV_COMPRESS_SET_PARAMS: Set codec and stream parameters | ||
129 | * Note: only codec params can be changed runtime and stream params cant be | ||
130 | * SNDRV_COMPRESS_GET_PARAMS: Query codec params | ||
131 | * SNDRV_COMPRESS_TSTAMP: get the current timestamp value | ||
132 | * SNDRV_COMPRESS_AVAIL: get the current buffer avail value. | ||
133 | * This also queries the tstamp properties | ||
134 | * SNDRV_COMPRESS_PAUSE: Pause the running stream | ||
135 | * SNDRV_COMPRESS_RESUME: resume a paused stream | ||
136 | * SNDRV_COMPRESS_START: Start a stream | ||
137 | * SNDRV_COMPRESS_STOP: stop a running stream, discarding ring buffer content | ||
138 | * and the buffers currently with DSP | ||
139 | * SNDRV_COMPRESS_DRAIN: Play till end of buffers and stop after that | ||
140 | * SNDRV_COMPRESS_IOCTL_VERSION: Query the API version | ||
141 | */ | ||
142 | #define SNDRV_COMPRESS_IOCTL_VERSION _IOR('C', 0x00, int) | ||
143 | #define SNDRV_COMPRESS_GET_CAPS _IOWR('C', 0x10, struct snd_compr_caps) | ||
144 | #define SNDRV_COMPRESS_GET_CODEC_CAPS _IOWR('C', 0x11,\ | ||
145 | struct snd_compr_codec_caps) | ||
146 | #define SNDRV_COMPRESS_SET_PARAMS _IOW('C', 0x12, struct snd_compr_params) | ||
147 | #define SNDRV_COMPRESS_GET_PARAMS _IOR('C', 0x13, struct snd_codec) | ||
148 | #define SNDRV_COMPRESS_TSTAMP _IOR('C', 0x20, struct snd_compr_tstamp) | ||
149 | #define SNDRV_COMPRESS_AVAIL _IOR('C', 0x21, struct snd_compr_avail) | ||
150 | #define SNDRV_COMPRESS_PAUSE _IO('C', 0x30) | ||
151 | #define SNDRV_COMPRESS_RESUME _IO('C', 0x31) | ||
152 | #define SNDRV_COMPRESS_START _IO('C', 0x32) | ||
153 | #define SNDRV_COMPRESS_STOP _IO('C', 0x33) | ||
154 | #define SNDRV_COMPRESS_DRAIN _IO('C', 0x34) | ||
155 | /* | ||
156 | * TODO | ||
157 | * 1. add mmap support | ||
158 | * | ||
159 | */ | ||
160 | #define SND_COMPR_TRIGGER_DRAIN 7 /*FIXME move this to pcm.h */ | ||
161 | #endif | ||
diff --git a/include/uapi/sound/compress_params.h b/include/uapi/sound/compress_params.h new file mode 100644 index 000000000000..602dc6c45d1a --- /dev/null +++ b/include/uapi/sound/compress_params.h | |||
@@ -0,0 +1,400 @@ | |||
1 | /* | ||
2 | * compress_params.h - codec types and parameters for compressed data | ||
3 | * streaming interface | ||
4 | * | ||
5 | * Copyright (C) 2011 Intel Corporation | ||
6 | * Authors: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> | ||
7 | * Vinod Koul <vinod.koul@linux.intel.com> | ||
8 | * | ||
9 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
10 | * | ||
11 | * This program is free software; you can redistribute it and/or modify | ||
12 | * it under the terms of the GNU General Public License as published by | ||
13 | * the Free Software Foundation; version 2 of the License. | ||
14 | * | ||
15 | * This program is distributed in the hope that it will be useful, but | ||
16 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
18 | * General Public License for more details. | ||
19 | * | ||
20 | * You should have received a copy of the GNU General Public License along | ||
21 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
22 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. | ||
23 | * | ||
24 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
25 | * | ||
26 | * The definitions in this file are derived from the OpenMAX AL version 1.1 | ||
27 | * and OpenMAX IL v 1.1.2 header files which contain the copyright notice below. | ||
28 | * | ||
29 | * Copyright (c) 2007-2010 The Khronos Group Inc. | ||
30 | * | ||
31 | * Permission is hereby granted, free of charge, to any person obtaining | ||
32 | * a copy of this software and/or associated documentation files (the | ||
33 | * "Materials "), to deal in the Materials without restriction, including | ||
34 | * without limitation the rights to use, copy, modify, merge, publish, | ||
35 | * distribute, sublicense, and/or sell copies of the Materials, and to | ||
36 | * permit persons to whom the Materials are furnished to do so, subject to | ||
37 | * the following conditions: | ||
38 | * | ||
39 | * The above copyright notice and this permission notice shall be included | ||
40 | * in all copies or substantial portions of the Materials. | ||
41 | * | ||
42 | * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | ||
43 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
44 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
45 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY | ||
46 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | ||
47 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
48 | * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. | ||
49 | * | ||
50 | */ | ||
51 | #ifndef __SND_COMPRESS_PARAMS_H | ||
52 | #define __SND_COMPRESS_PARAMS_H | ||
53 | |||
54 | #include <linux/types.h> | ||
55 | |||
56 | /* AUDIO CODECS SUPPORTED */ | ||
57 | #define MAX_NUM_CODECS 32 | ||
58 | #define MAX_NUM_CODEC_DESCRIPTORS 32 | ||
59 | #define MAX_NUM_BITRATES 32 | ||
60 | |||
61 | /* Codecs are listed linearly to allow for extensibility */ | ||
62 | #define SND_AUDIOCODEC_PCM ((__u32) 0x00000001) | ||
63 | #define SND_AUDIOCODEC_MP3 ((__u32) 0x00000002) | ||
64 | #define SND_AUDIOCODEC_AMR ((__u32) 0x00000003) | ||
65 | #define SND_AUDIOCODEC_AMRWB ((__u32) 0x00000004) | ||
66 | #define SND_AUDIOCODEC_AMRWBPLUS ((__u32) 0x00000005) | ||
67 | #define SND_AUDIOCODEC_AAC ((__u32) 0x00000006) | ||
68 | #define SND_AUDIOCODEC_WMA ((__u32) 0x00000007) | ||
69 | #define SND_AUDIOCODEC_REAL ((__u32) 0x00000008) | ||
70 | #define SND_AUDIOCODEC_VORBIS ((__u32) 0x00000009) | ||
71 | #define SND_AUDIOCODEC_FLAC ((__u32) 0x0000000A) | ||
72 | #define SND_AUDIOCODEC_IEC61937 ((__u32) 0x0000000B) | ||
73 | #define SND_AUDIOCODEC_G723_1 ((__u32) 0x0000000C) | ||
74 | #define SND_AUDIOCODEC_G729 ((__u32) 0x0000000D) | ||
75 | #define SND_AUDIOCODEC_MAX SND_AUDIOCODEC_G729 | ||
76 | |||
77 | /* | ||
78 | * Profile and modes are listed with bit masks. This allows for a | ||
79 | * more compact representation of fields that will not evolve | ||
80 | * (in contrast to the list of codecs) | ||
81 | */ | ||
82 | |||
83 | #define SND_AUDIOPROFILE_PCM ((__u32) 0x00000001) | ||
84 | |||
85 | /* MP3 modes are only useful for encoders */ | ||
86 | #define SND_AUDIOCHANMODE_MP3_MONO ((__u32) 0x00000001) | ||
87 | #define SND_AUDIOCHANMODE_MP3_STEREO ((__u32) 0x00000002) | ||
88 | #define SND_AUDIOCHANMODE_MP3_JOINTSTEREO ((__u32) 0x00000004) | ||
89 | #define SND_AUDIOCHANMODE_MP3_DUAL ((__u32) 0x00000008) | ||
90 | |||
91 | #define SND_AUDIOPROFILE_AMR ((__u32) 0x00000001) | ||
92 | |||
93 | /* AMR modes are only useful for encoders */ | ||
94 | #define SND_AUDIOMODE_AMR_DTX_OFF ((__u32) 0x00000001) | ||
95 | #define SND_AUDIOMODE_AMR_VAD1 ((__u32) 0x00000002) | ||
96 | #define SND_AUDIOMODE_AMR_VAD2 ((__u32) 0x00000004) | ||
97 | |||
98 | #define SND_AUDIOSTREAMFORMAT_UNDEFINED ((__u32) 0x00000000) | ||
99 | #define SND_AUDIOSTREAMFORMAT_CONFORMANCE ((__u32) 0x00000001) | ||
100 | #define SND_AUDIOSTREAMFORMAT_IF1 ((__u32) 0x00000002) | ||
101 | #define SND_AUDIOSTREAMFORMAT_IF2 ((__u32) 0x00000004) | ||
102 | #define SND_AUDIOSTREAMFORMAT_FSF ((__u32) 0x00000008) | ||
103 | #define SND_AUDIOSTREAMFORMAT_RTPPAYLOAD ((__u32) 0x00000010) | ||
104 | #define SND_AUDIOSTREAMFORMAT_ITU ((__u32) 0x00000020) | ||
105 | |||
106 | #define SND_AUDIOPROFILE_AMRWB ((__u32) 0x00000001) | ||
107 | |||
108 | /* AMRWB modes are only useful for encoders */ | ||
109 | #define SND_AUDIOMODE_AMRWB_DTX_OFF ((__u32) 0x00000001) | ||
110 | #define SND_AUDIOMODE_AMRWB_VAD1 ((__u32) 0x00000002) | ||
111 | #define SND_AUDIOMODE_AMRWB_VAD2 ((__u32) 0x00000004) | ||
112 | |||
113 | #define SND_AUDIOPROFILE_AMRWBPLUS ((__u32) 0x00000001) | ||
114 | |||
115 | #define SND_AUDIOPROFILE_AAC ((__u32) 0x00000001) | ||
116 | |||
117 | /* AAC modes are required for encoders and decoders */ | ||
118 | #define SND_AUDIOMODE_AAC_MAIN ((__u32) 0x00000001) | ||
119 | #define SND_AUDIOMODE_AAC_LC ((__u32) 0x00000002) | ||
120 | #define SND_AUDIOMODE_AAC_SSR ((__u32) 0x00000004) | ||
121 | #define SND_AUDIOMODE_AAC_LTP ((__u32) 0x00000008) | ||
122 | #define SND_AUDIOMODE_AAC_HE ((__u32) 0x00000010) | ||
123 | #define SND_AUDIOMODE_AAC_SCALABLE ((__u32) 0x00000020) | ||
124 | #define SND_AUDIOMODE_AAC_ERLC ((__u32) 0x00000040) | ||
125 | #define SND_AUDIOMODE_AAC_LD ((__u32) 0x00000080) | ||
126 | #define SND_AUDIOMODE_AAC_HE_PS ((__u32) 0x00000100) | ||
127 | #define SND_AUDIOMODE_AAC_HE_MPS ((__u32) 0x00000200) | ||
128 | |||
129 | /* AAC formats are required for encoders and decoders */ | ||
130 | #define SND_AUDIOSTREAMFORMAT_MP2ADTS ((__u32) 0x00000001) | ||
131 | #define SND_AUDIOSTREAMFORMAT_MP4ADTS ((__u32) 0x00000002) | ||
132 | #define SND_AUDIOSTREAMFORMAT_MP4LOAS ((__u32) 0x00000004) | ||
133 | #define SND_AUDIOSTREAMFORMAT_MP4LATM ((__u32) 0x00000008) | ||
134 | #define SND_AUDIOSTREAMFORMAT_ADIF ((__u32) 0x00000010) | ||
135 | #define SND_AUDIOSTREAMFORMAT_MP4FF ((__u32) 0x00000020) | ||
136 | #define SND_AUDIOSTREAMFORMAT_RAW ((__u32) 0x00000040) | ||
137 | |||
138 | #define SND_AUDIOPROFILE_WMA7 ((__u32) 0x00000001) | ||
139 | #define SND_AUDIOPROFILE_WMA8 ((__u32) 0x00000002) | ||
140 | #define SND_AUDIOPROFILE_WMA9 ((__u32) 0x00000004) | ||
141 | #define SND_AUDIOPROFILE_WMA10 ((__u32) 0x00000008) | ||
142 | |||
143 | #define SND_AUDIOMODE_WMA_LEVEL1 ((__u32) 0x00000001) | ||
144 | #define SND_AUDIOMODE_WMA_LEVEL2 ((__u32) 0x00000002) | ||
145 | #define SND_AUDIOMODE_WMA_LEVEL3 ((__u32) 0x00000004) | ||
146 | #define SND_AUDIOMODE_WMA_LEVEL4 ((__u32) 0x00000008) | ||
147 | #define SND_AUDIOMODE_WMAPRO_LEVELM0 ((__u32) 0x00000010) | ||
148 | #define SND_AUDIOMODE_WMAPRO_LEVELM1 ((__u32) 0x00000020) | ||
149 | #define SND_AUDIOMODE_WMAPRO_LEVELM2 ((__u32) 0x00000040) | ||
150 | #define SND_AUDIOMODE_WMAPRO_LEVELM3 ((__u32) 0x00000080) | ||
151 | |||
152 | #define SND_AUDIOSTREAMFORMAT_WMA_ASF ((__u32) 0x00000001) | ||
153 | /* | ||
154 | * Some implementations strip the ASF header and only send ASF packets | ||
155 | * to the DSP | ||
156 | */ | ||
157 | #define SND_AUDIOSTREAMFORMAT_WMA_NOASF_HDR ((__u32) 0x00000002) | ||
158 | |||
159 | #define SND_AUDIOPROFILE_REALAUDIO ((__u32) 0x00000001) | ||
160 | |||
161 | #define SND_AUDIOMODE_REALAUDIO_G2 ((__u32) 0x00000001) | ||
162 | #define SND_AUDIOMODE_REALAUDIO_8 ((__u32) 0x00000002) | ||
163 | #define SND_AUDIOMODE_REALAUDIO_10 ((__u32) 0x00000004) | ||
164 | #define SND_AUDIOMODE_REALAUDIO_SURROUND ((__u32) 0x00000008) | ||
165 | |||
166 | #define SND_AUDIOPROFILE_VORBIS ((__u32) 0x00000001) | ||
167 | |||
168 | #define SND_AUDIOMODE_VORBIS ((__u32) 0x00000001) | ||
169 | |||
170 | #define SND_AUDIOPROFILE_FLAC ((__u32) 0x00000001) | ||
171 | |||
172 | /* | ||
173 | * Define quality levels for FLAC encoders, from LEVEL0 (fast) | ||
174 | * to LEVEL8 (best) | ||
175 | */ | ||
176 | #define SND_AUDIOMODE_FLAC_LEVEL0 ((__u32) 0x00000001) | ||
177 | #define SND_AUDIOMODE_FLAC_LEVEL1 ((__u32) 0x00000002) | ||
178 | #define SND_AUDIOMODE_FLAC_LEVEL2 ((__u32) 0x00000004) | ||
179 | #define SND_AUDIOMODE_FLAC_LEVEL3 ((__u32) 0x00000008) | ||
180 | #define SND_AUDIOMODE_FLAC_LEVEL4 ((__u32) 0x00000010) | ||
181 | #define SND_AUDIOMODE_FLAC_LEVEL5 ((__u32) 0x00000020) | ||
182 | #define SND_AUDIOMODE_FLAC_LEVEL6 ((__u32) 0x00000040) | ||
183 | #define SND_AUDIOMODE_FLAC_LEVEL7 ((__u32) 0x00000080) | ||
184 | #define SND_AUDIOMODE_FLAC_LEVEL8 ((__u32) 0x00000100) | ||
185 | |||
186 | #define SND_AUDIOSTREAMFORMAT_FLAC ((__u32) 0x00000001) | ||
187 | #define SND_AUDIOSTREAMFORMAT_FLAC_OGG ((__u32) 0x00000002) | ||
188 | |||
189 | /* IEC61937 payloads without CUVP and preambles */ | ||
190 | #define SND_AUDIOPROFILE_IEC61937 ((__u32) 0x00000001) | ||
191 | /* IEC61937 with S/PDIF preambles+CUVP bits in 32-bit containers */ | ||
192 | #define SND_AUDIOPROFILE_IEC61937_SPDIF ((__u32) 0x00000002) | ||
193 | |||
194 | /* | ||
195 | * IEC modes are mandatory for decoders. Format autodetection | ||
196 | * will only happen on the DSP side with mode 0. The PCM mode should | ||
197 | * not be used, the PCM codec should be used instead. | ||
198 | */ | ||
199 | #define SND_AUDIOMODE_IEC_REF_STREAM_HEADER ((__u32) 0x00000000) | ||
200 | #define SND_AUDIOMODE_IEC_LPCM ((__u32) 0x00000001) | ||
201 | #define SND_AUDIOMODE_IEC_AC3 ((__u32) 0x00000002) | ||
202 | #define SND_AUDIOMODE_IEC_MPEG1 ((__u32) 0x00000004) | ||
203 | #define SND_AUDIOMODE_IEC_MP3 ((__u32) 0x00000008) | ||
204 | #define SND_AUDIOMODE_IEC_MPEG2 ((__u32) 0x00000010) | ||
205 | #define SND_AUDIOMODE_IEC_AACLC ((__u32) 0x00000020) | ||
206 | #define SND_AUDIOMODE_IEC_DTS ((__u32) 0x00000040) | ||
207 | #define SND_AUDIOMODE_IEC_ATRAC ((__u32) 0x00000080) | ||
208 | #define SND_AUDIOMODE_IEC_SACD ((__u32) 0x00000100) | ||
209 | #define SND_AUDIOMODE_IEC_EAC3 ((__u32) 0x00000200) | ||
210 | #define SND_AUDIOMODE_IEC_DTS_HD ((__u32) 0x00000400) | ||
211 | #define SND_AUDIOMODE_IEC_MLP ((__u32) 0x00000800) | ||
212 | #define SND_AUDIOMODE_IEC_DST ((__u32) 0x00001000) | ||
213 | #define SND_AUDIOMODE_IEC_WMAPRO ((__u32) 0x00002000) | ||
214 | #define SND_AUDIOMODE_IEC_REF_CXT ((__u32) 0x00004000) | ||
215 | #define SND_AUDIOMODE_IEC_HE_AAC ((__u32) 0x00008000) | ||
216 | #define SND_AUDIOMODE_IEC_HE_AAC2 ((__u32) 0x00010000) | ||
217 | #define SND_AUDIOMODE_IEC_MPEG_SURROUND ((__u32) 0x00020000) | ||
218 | |||
219 | #define SND_AUDIOPROFILE_G723_1 ((__u32) 0x00000001) | ||
220 | |||
221 | #define SND_AUDIOMODE_G723_1_ANNEX_A ((__u32) 0x00000001) | ||
222 | #define SND_AUDIOMODE_G723_1_ANNEX_B ((__u32) 0x00000002) | ||
223 | #define SND_AUDIOMODE_G723_1_ANNEX_C ((__u32) 0x00000004) | ||
224 | |||
225 | #define SND_AUDIOPROFILE_G729 ((__u32) 0x00000001) | ||
226 | |||
227 | #define SND_AUDIOMODE_G729_ANNEX_A ((__u32) 0x00000001) | ||
228 | #define SND_AUDIOMODE_G729_ANNEX_B ((__u32) 0x00000002) | ||
229 | |||
230 | /* <FIXME: multichannel encoders aren't supported for now. Would need | ||
231 | an additional definition of channel arrangement> */ | ||
232 | |||
233 | /* VBR/CBR definitions */ | ||
234 | #define SND_RATECONTROLMODE_CONSTANTBITRATE ((__u32) 0x00000001) | ||
235 | #define SND_RATECONTROLMODE_VARIABLEBITRATE ((__u32) 0x00000002) | ||
236 | |||
237 | /* Encoder options */ | ||
238 | |||
239 | struct snd_enc_wma { | ||
240 | __u32 super_block_align; /* WMA Type-specific data */ | ||
241 | }; | ||
242 | |||
243 | |||
244 | /** | ||
245 | * struct snd_enc_vorbis | ||
246 | * @quality: Sets encoding quality to n, between -1 (low) and 10 (high). | ||
247 | * In the default mode of operation, the quality level is 3. | ||
248 | * Normal quality range is 0 - 10. | ||
249 | * @managed: Boolean. Set bitrate management mode. This turns off the | ||
250 | * normal VBR encoding, but allows hard or soft bitrate constraints to be | ||
251 | * enforced by the encoder. This mode can be slower, and may also be | ||
252 | * lower quality. It is primarily useful for streaming. | ||
253 | * @max_bit_rate: Enabled only if managed is TRUE | ||
254 | * @min_bit_rate: Enabled only if managed is TRUE | ||
255 | * @downmix: Boolean. Downmix input from stereo to mono (has no effect on | ||
256 | * non-stereo streams). Useful for lower-bitrate encoding. | ||
257 | * | ||
258 | * These options were extracted from the OpenMAX IL spec and Gstreamer vorbisenc | ||
259 | * properties | ||
260 | * | ||
261 | * For best quality users should specify VBR mode and set quality levels. | ||
262 | */ | ||
263 | |||
264 | struct snd_enc_vorbis { | ||
265 | __s32 quality; | ||
266 | __u32 managed; | ||
267 | __u32 max_bit_rate; | ||
268 | __u32 min_bit_rate; | ||
269 | __u32 downmix; | ||
270 | }; | ||
271 | |||
272 | |||
273 | /** | ||
274 | * struct snd_enc_real | ||
275 | * @quant_bits: number of coupling quantization bits in the stream | ||
276 | * @start_region: coupling start region in the stream | ||
277 | * @num_regions: number of regions value | ||
278 | * | ||
279 | * These options were extracted from the OpenMAX IL spec | ||
280 | */ | ||
281 | |||
282 | struct snd_enc_real { | ||
283 | __u32 quant_bits; | ||
284 | __u32 start_region; | ||
285 | __u32 num_regions; | ||
286 | }; | ||
287 | |||
288 | /** | ||
289 | * struct snd_enc_flac | ||
290 | * @num: serial number, valid only for OGG formats | ||
291 | * needs to be set by application | ||
292 | * @gain: Add replay gain tags | ||
293 | * | ||
294 | * These options were extracted from the FLAC online documentation | ||
295 | * at http://flac.sourceforge.net/documentation_tools_flac.html | ||
296 | * | ||
297 | * To make the API simpler, it is assumed that the user will select quality | ||
298 | * profiles. Additional options that affect encoding quality and speed can | ||
299 | * be added at a later stage if needed. | ||
300 | * | ||
301 | * By default the Subset format is used by encoders. | ||
302 | * | ||
303 | * TAGS such as pictures, etc, cannot be handled by an offloaded encoder and are | ||
304 | * not supported in this API. | ||
305 | */ | ||
306 | |||
307 | struct snd_enc_flac { | ||
308 | __u32 num; | ||
309 | __u32 gain; | ||
310 | }; | ||
311 | |||
312 | struct snd_enc_generic { | ||
313 | __u32 bw; /* encoder bandwidth */ | ||
314 | __s32 reserved[15]; | ||
315 | }; | ||
316 | |||
317 | union snd_codec_options { | ||
318 | struct snd_enc_wma wma; | ||
319 | struct snd_enc_vorbis vorbis; | ||
320 | struct snd_enc_real real; | ||
321 | struct snd_enc_flac flac; | ||
322 | struct snd_enc_generic generic; | ||
323 | }; | ||
324 | |||
325 | /** struct snd_codec_desc - description of codec capabilities | ||
326 | * @max_ch: Maximum number of audio channels | ||
327 | * @sample_rates: Sampling rates in Hz, use SNDRV_PCM_RATE_xxx for this | ||
328 | * @bit_rate: Indexed array containing supported bit rates | ||
329 | * @num_bitrates: Number of valid values in bit_rate array | ||
330 | * @rate_control: value is specified by SND_RATECONTROLMODE defines. | ||
331 | * @profiles: Supported profiles. See SND_AUDIOPROFILE defines. | ||
332 | * @modes: Supported modes. See SND_AUDIOMODE defines | ||
333 | * @formats: Supported formats. See SND_AUDIOSTREAMFORMAT defines | ||
334 | * @min_buffer: Minimum buffer size handled by codec implementation | ||
335 | * @reserved: reserved for future use | ||
336 | * | ||
337 | * This structure provides a scalar value for profiles, modes and stream | ||
338 | * format fields. | ||
339 | * If an implementation supports multiple combinations, they will be listed as | ||
340 | * codecs with different descriptors, for example there would be 2 descriptors | ||
341 | * for AAC-RAW and AAC-ADTS. | ||
342 | * This entails some redundancy but makes it easier to avoid invalid | ||
343 | * configurations. | ||
344 | * | ||
345 | */ | ||
346 | |||
347 | struct snd_codec_desc { | ||
348 | __u32 max_ch; | ||
349 | __u32 sample_rates; | ||
350 | __u32 bit_rate[MAX_NUM_BITRATES]; | ||
351 | __u32 num_bitrates; | ||
352 | __u32 rate_control; | ||
353 | __u32 profiles; | ||
354 | __u32 modes; | ||
355 | __u32 formats; | ||
356 | __u32 min_buffer; | ||
357 | __u32 reserved[15]; | ||
358 | }; | ||
359 | |||
360 | /** struct snd_codec | ||
361 | * @id: Identifies the supported audio encoder/decoder. | ||
362 | * See SND_AUDIOCODEC macros. | ||
363 | * @ch_in: Number of input audio channels | ||
364 | * @ch_out: Number of output channels. In case of contradiction between | ||
365 | * this field and the channelMode field, the channelMode field | ||
366 | * overrides. | ||
367 | * @sample_rate: Audio sample rate of input data | ||
368 | * @bit_rate: Bitrate of encoded data. May be ignored by decoders | ||
369 | * @rate_control: Encoding rate control. See SND_RATECONTROLMODE defines. | ||
370 | * Encoders may rely on profiles for quality levels. | ||
371 | * May be ignored by decoders. | ||
372 | * @profile: Mandatory for encoders, can be mandatory for specific | ||
373 | * decoders as well. See SND_AUDIOPROFILE defines. | ||
374 | * @level: Supported level (Only used by WMA at the moment) | ||
375 | * @ch_mode: Channel mode for encoder. See SND_AUDIOCHANMODE defines | ||
376 | * @format: Format of encoded bistream. Mandatory when defined. | ||
377 | * See SND_AUDIOSTREAMFORMAT defines. | ||
378 | * @align: Block alignment in bytes of an audio sample. | ||
379 | * Only required for PCM or IEC formats. | ||
380 | * @options: encoder-specific settings | ||
381 | * @reserved: reserved for future use | ||
382 | */ | ||
383 | |||
384 | struct snd_codec { | ||
385 | __u32 id; | ||
386 | __u32 ch_in; | ||
387 | __u32 ch_out; | ||
388 | __u32 sample_rate; | ||
389 | __u32 bit_rate; | ||
390 | __u32 rate_control; | ||
391 | __u32 profile; | ||
392 | __u32 level; | ||
393 | __u32 ch_mode; | ||
394 | __u32 format; | ||
395 | __u32 align; | ||
396 | union snd_codec_options options; | ||
397 | __u32 reserved[3]; | ||
398 | }; | ||
399 | |||
400 | #endif | ||
diff --git a/include/uapi/sound/emu10k1.h b/include/uapi/sound/emu10k1.h new file mode 100644 index 000000000000..d1bbaf78457a --- /dev/null +++ b/include/uapi/sound/emu10k1.h | |||
@@ -0,0 +1,373 @@ | |||
1 | /* | ||
2 | * Copyright (c) by Jaroslav Kysela <perex@perex.cz>, | ||
3 | * Creative Labs, Inc. | ||
4 | * Definitions for EMU10K1 (SB Live!) chips | ||
5 | * | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation; either version 2 of the License, or | ||
10 | * (at your option) any later version. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
20 | * | ||
21 | */ | ||
22 | #ifndef _UAPI__SOUND_EMU10K1_H | ||
23 | #define _UAPI__SOUND_EMU10K1_H | ||
24 | |||
25 | #include <linux/types.h> | ||
26 | |||
27 | |||
28 | |||
29 | /* | ||
30 | * ---- FX8010 ---- | ||
31 | */ | ||
32 | |||
33 | #define EMU10K1_CARD_CREATIVE 0x00000000 | ||
34 | #define EMU10K1_CARD_EMUAPS 0x00000001 | ||
35 | |||
36 | #define EMU10K1_FX8010_PCM_COUNT 8 | ||
37 | |||
38 | /* instruction set */ | ||
39 | #define iMAC0 0x00 /* R = A + (X * Y >> 31) ; saturation */ | ||
40 | #define iMAC1 0x01 /* R = A + (-X * Y >> 31) ; saturation */ | ||
41 | #define iMAC2 0x02 /* R = A + (X * Y >> 31) ; wraparound */ | ||
42 | #define iMAC3 0x03 /* R = A + (-X * Y >> 31) ; wraparound */ | ||
43 | #define iMACINT0 0x04 /* R = A + X * Y ; saturation */ | ||
44 | #define iMACINT1 0x05 /* R = A + X * Y ; wraparound (31-bit) */ | ||
45 | #define iACC3 0x06 /* R = A + X + Y ; saturation */ | ||
46 | #define iMACMV 0x07 /* R = A, acc += X * Y >> 31 */ | ||
47 | #define iANDXOR 0x08 /* R = (A & X) ^ Y */ | ||
48 | #define iTSTNEG 0x09 /* R = (A >= Y) ? X : ~X */ | ||
49 | #define iLIMITGE 0x0a /* R = (A >= Y) ? X : Y */ | ||
50 | #define iLIMITLT 0x0b /* R = (A < Y) ? X : Y */ | ||
51 | #define iLOG 0x0c /* R = linear_data, A (log_data), X (max_exp), Y (format_word) */ | ||
52 | #define iEXP 0x0d /* R = log_data, A (linear_data), X (max_exp), Y (format_word) */ | ||
53 | #define iINTERP 0x0e /* R = A + (X * (Y - A) >> 31) ; saturation */ | ||
54 | #define iSKIP 0x0f /* R = A (cc_reg), X (count), Y (cc_test) */ | ||
55 | |||
56 | /* GPRs */ | ||
57 | #define FXBUS(x) (0x00 + (x)) /* x = 0x00 - 0x0f */ | ||
58 | #define EXTIN(x) (0x10 + (x)) /* x = 0x00 - 0x0f */ | ||
59 | #define EXTOUT(x) (0x20 + (x)) /* x = 0x00 - 0x0f physical outs -> FXWC low 16 bits */ | ||
60 | #define FXBUS2(x) (0x30 + (x)) /* x = 0x00 - 0x0f copies of fx buses for capture -> FXWC high 16 bits */ | ||
61 | /* NB: 0x31 and 0x32 are shared with Center/LFE on SB live 5.1 */ | ||
62 | |||
63 | #define C_00000000 0x40 | ||
64 | #define C_00000001 0x41 | ||
65 | #define C_00000002 0x42 | ||
66 | #define C_00000003 0x43 | ||
67 | #define C_00000004 0x44 | ||
68 | #define C_00000008 0x45 | ||
69 | #define C_00000010 0x46 | ||
70 | #define C_00000020 0x47 | ||
71 | #define C_00000100 0x48 | ||
72 | #define C_00010000 0x49 | ||
73 | #define C_00080000 0x4a | ||
74 | #define C_10000000 0x4b | ||
75 | #define C_20000000 0x4c | ||
76 | #define C_40000000 0x4d | ||
77 | #define C_80000000 0x4e | ||
78 | #define C_7fffffff 0x4f | ||
79 | #define C_ffffffff 0x50 | ||
80 | #define C_fffffffe 0x51 | ||
81 | #define C_c0000000 0x52 | ||
82 | #define C_4f1bbcdc 0x53 | ||
83 | #define C_5a7ef9db 0x54 | ||
84 | #define C_00100000 0x55 /* ?? */ | ||
85 | #define GPR_ACCU 0x56 /* ACCUM, accumulator */ | ||
86 | #define GPR_COND 0x57 /* CCR, condition register */ | ||
87 | #define GPR_NOISE0 0x58 /* noise source */ | ||
88 | #define GPR_NOISE1 0x59 /* noise source */ | ||
89 | #define GPR_IRQ 0x5a /* IRQ register */ | ||
90 | #define GPR_DBAC 0x5b /* TRAM Delay Base Address Counter */ | ||
91 | #define GPR(x) (FXGPREGBASE + (x)) /* free GPRs: x = 0x00 - 0xff */ | ||
92 | #define ITRAM_DATA(x) (TANKMEMDATAREGBASE + 0x00 + (x)) /* x = 0x00 - 0x7f */ | ||
93 | #define ETRAM_DATA(x) (TANKMEMDATAREGBASE + 0x80 + (x)) /* x = 0x00 - 0x1f */ | ||
94 | #define ITRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x00 + (x)) /* x = 0x00 - 0x7f */ | ||
95 | #define ETRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x80 + (x)) /* x = 0x00 - 0x1f */ | ||
96 | |||
97 | #define A_ITRAM_DATA(x) (TANKMEMDATAREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */ | ||
98 | #define A_ETRAM_DATA(x) (TANKMEMDATAREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */ | ||
99 | #define A_ITRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */ | ||
100 | #define A_ETRAM_ADDR(x) (TANKMEMADDRREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */ | ||
101 | #define A_ITRAM_CTL(x) (A_TANKMEMCTLREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */ | ||
102 | #define A_ETRAM_CTL(x) (A_TANKMEMCTLREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */ | ||
103 | |||
104 | #define A_FXBUS(x) (0x00 + (x)) /* x = 0x00 - 0x3f FX buses */ | ||
105 | #define A_EXTIN(x) (0x40 + (x)) /* x = 0x00 - 0x0f physical ins */ | ||
106 | #define A_P16VIN(x) (0x50 + (x)) /* x = 0x00 - 0x0f p16v ins (A2 only) "EMU32 inputs" */ | ||
107 | #define A_EXTOUT(x) (0x60 + (x)) /* x = 0x00 - 0x1f physical outs -> A_FXWC1 0x79-7f unknown */ | ||
108 | #define A_FXBUS2(x) (0x80 + (x)) /* x = 0x00 - 0x1f extra outs used for EFX capture -> A_FXWC2 */ | ||
109 | #define A_EMU32OUTH(x) (0xa0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_10 - _1F" - ??? */ | ||
110 | #define A_EMU32OUTL(x) (0xb0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_1 - _F" - ??? */ | ||
111 | #define A3_EMU32IN(x) (0x160 + (x)) /* x = 0x00 - 0x3f "EMU32_IN_00 - _3F" - Only when .device = 0x0008 */ | ||
112 | #define A3_EMU32OUT(x) (0x1E0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_00 - _3F" - Only when .device = 0x0008 */ | ||
113 | #define A_GPR(x) (A_FXGPREGBASE + (x)) | ||
114 | |||
115 | /* cc_reg constants */ | ||
116 | #define CC_REG_NORMALIZED C_00000001 | ||
117 | #define CC_REG_BORROW C_00000002 | ||
118 | #define CC_REG_MINUS C_00000004 | ||
119 | #define CC_REG_ZERO C_00000008 | ||
120 | #define CC_REG_SATURATE C_00000010 | ||
121 | #define CC_REG_NONZERO C_00000100 | ||
122 | |||
123 | /* FX buses */ | ||
124 | #define FXBUS_PCM_LEFT 0x00 | ||
125 | #define FXBUS_PCM_RIGHT 0x01 | ||
126 | #define FXBUS_PCM_LEFT_REAR 0x02 | ||
127 | #define FXBUS_PCM_RIGHT_REAR 0x03 | ||
128 | #define FXBUS_MIDI_LEFT 0x04 | ||
129 | #define FXBUS_MIDI_RIGHT 0x05 | ||
130 | #define FXBUS_PCM_CENTER 0x06 | ||
131 | #define FXBUS_PCM_LFE 0x07 | ||
132 | #define FXBUS_PCM_LEFT_FRONT 0x08 | ||
133 | #define FXBUS_PCM_RIGHT_FRONT 0x09 | ||
134 | #define FXBUS_MIDI_REVERB 0x0c | ||
135 | #define FXBUS_MIDI_CHORUS 0x0d | ||
136 | #define FXBUS_PCM_LEFT_SIDE 0x0e | ||
137 | #define FXBUS_PCM_RIGHT_SIDE 0x0f | ||
138 | #define FXBUS_PT_LEFT 0x14 | ||
139 | #define FXBUS_PT_RIGHT 0x15 | ||
140 | |||
141 | /* Inputs */ | ||
142 | #define EXTIN_AC97_L 0x00 /* AC'97 capture channel - left */ | ||
143 | #define EXTIN_AC97_R 0x01 /* AC'97 capture channel - right */ | ||
144 | #define EXTIN_SPDIF_CD_L 0x02 /* internal S/PDIF CD - onboard - left */ | ||
145 | #define EXTIN_SPDIF_CD_R 0x03 /* internal S/PDIF CD - onboard - right */ | ||
146 | #define EXTIN_ZOOM_L 0x04 /* Zoom Video I2S - left */ | ||
147 | #define EXTIN_ZOOM_R 0x05 /* Zoom Video I2S - right */ | ||
148 | #define EXTIN_TOSLINK_L 0x06 /* LiveDrive - TOSLink Optical - left */ | ||
149 | #define EXTIN_TOSLINK_R 0x07 /* LiveDrive - TOSLink Optical - right */ | ||
150 | #define EXTIN_LINE1_L 0x08 /* LiveDrive - Line/Mic 1 - left */ | ||
151 | #define EXTIN_LINE1_R 0x09 /* LiveDrive - Line/Mic 1 - right */ | ||
152 | #define EXTIN_COAX_SPDIF_L 0x0a /* LiveDrive - Coaxial S/PDIF - left */ | ||
153 | #define EXTIN_COAX_SPDIF_R 0x0b /* LiveDrive - Coaxial S/PDIF - right */ | ||
154 | #define EXTIN_LINE2_L 0x0c /* LiveDrive - Line/Mic 2 - left */ | ||
155 | #define EXTIN_LINE2_R 0x0d /* LiveDrive - Line/Mic 2 - right */ | ||
156 | |||
157 | /* Outputs */ | ||
158 | #define EXTOUT_AC97_L 0x00 /* AC'97 playback channel - left */ | ||
159 | #define EXTOUT_AC97_R 0x01 /* AC'97 playback channel - right */ | ||
160 | #define EXTOUT_TOSLINK_L 0x02 /* LiveDrive - TOSLink Optical - left */ | ||
161 | #define EXTOUT_TOSLINK_R 0x03 /* LiveDrive - TOSLink Optical - right */ | ||
162 | #define EXTOUT_AC97_CENTER 0x04 /* SB Live 5.1 - center */ | ||
163 | #define EXTOUT_AC97_LFE 0x05 /* SB Live 5.1 - LFE */ | ||
164 | #define EXTOUT_HEADPHONE_L 0x06 /* LiveDrive - Headphone - left */ | ||
165 | #define EXTOUT_HEADPHONE_R 0x07 /* LiveDrive - Headphone - right */ | ||
166 | #define EXTOUT_REAR_L 0x08 /* Rear channel - left */ | ||
167 | #define EXTOUT_REAR_R 0x09 /* Rear channel - right */ | ||
168 | #define EXTOUT_ADC_CAP_L 0x0a /* ADC Capture buffer - left */ | ||
169 | #define EXTOUT_ADC_CAP_R 0x0b /* ADC Capture buffer - right */ | ||
170 | #define EXTOUT_MIC_CAP 0x0c /* MIC Capture buffer */ | ||
171 | #define EXTOUT_AC97_REAR_L 0x0d /* SB Live 5.1 (c) 2003 - Rear Left */ | ||
172 | #define EXTOUT_AC97_REAR_R 0x0e /* SB Live 5.1 (c) 2003 - Rear Right */ | ||
173 | #define EXTOUT_ACENTER 0x11 /* Analog Center */ | ||
174 | #define EXTOUT_ALFE 0x12 /* Analog LFE */ | ||
175 | |||
176 | /* Audigy Inputs */ | ||
177 | #define A_EXTIN_AC97_L 0x00 /* AC'97 capture channel - left */ | ||
178 | #define A_EXTIN_AC97_R 0x01 /* AC'97 capture channel - right */ | ||
179 | #define A_EXTIN_SPDIF_CD_L 0x02 /* digital CD left */ | ||
180 | #define A_EXTIN_SPDIF_CD_R 0x03 /* digital CD left */ | ||
181 | #define A_EXTIN_OPT_SPDIF_L 0x04 /* audigy drive Optical SPDIF - left */ | ||
182 | #define A_EXTIN_OPT_SPDIF_R 0x05 /* right */ | ||
183 | #define A_EXTIN_LINE2_L 0x08 /* audigy drive line2/mic2 - left */ | ||
184 | #define A_EXTIN_LINE2_R 0x09 /* right */ | ||
185 | #define A_EXTIN_ADC_L 0x0a /* Philips ADC - left */ | ||
186 | #define A_EXTIN_ADC_R 0x0b /* right */ | ||
187 | #define A_EXTIN_AUX2_L 0x0c /* audigy drive aux2 - left */ | ||
188 | #define A_EXTIN_AUX2_R 0x0d /* - right */ | ||
189 | |||
190 | /* Audigiy Outputs */ | ||
191 | #define A_EXTOUT_FRONT_L 0x00 /* digital front left */ | ||
192 | #define A_EXTOUT_FRONT_R 0x01 /* right */ | ||
193 | #define A_EXTOUT_CENTER 0x02 /* digital front center */ | ||
194 | #define A_EXTOUT_LFE 0x03 /* digital front lfe */ | ||
195 | #define A_EXTOUT_HEADPHONE_L 0x04 /* headphone audigy drive left */ | ||
196 | #define A_EXTOUT_HEADPHONE_R 0x05 /* right */ | ||
197 | #define A_EXTOUT_REAR_L 0x06 /* digital rear left */ | ||
198 | #define A_EXTOUT_REAR_R 0x07 /* right */ | ||
199 | #define A_EXTOUT_AFRONT_L 0x08 /* analog front left */ | ||
200 | #define A_EXTOUT_AFRONT_R 0x09 /* right */ | ||
201 | #define A_EXTOUT_ACENTER 0x0a /* analog center */ | ||
202 | #define A_EXTOUT_ALFE 0x0b /* analog LFE */ | ||
203 | #define A_EXTOUT_ASIDE_L 0x0c /* analog side left - Audigy 2 ZS */ | ||
204 | #define A_EXTOUT_ASIDE_R 0x0d /* right - Audigy 2 ZS */ | ||
205 | #define A_EXTOUT_AREAR_L 0x0e /* analog rear left */ | ||
206 | #define A_EXTOUT_AREAR_R 0x0f /* right */ | ||
207 | #define A_EXTOUT_AC97_L 0x10 /* AC97 left (front) */ | ||
208 | #define A_EXTOUT_AC97_R 0x11 /* right */ | ||
209 | #define A_EXTOUT_ADC_CAP_L 0x16 /* ADC capture buffer left */ | ||
210 | #define A_EXTOUT_ADC_CAP_R 0x17 /* right */ | ||
211 | #define A_EXTOUT_MIC_CAP 0x18 /* Mic capture buffer */ | ||
212 | |||
213 | /* Audigy constants */ | ||
214 | #define A_C_00000000 0xc0 | ||
215 | #define A_C_00000001 0xc1 | ||
216 | #define A_C_00000002 0xc2 | ||
217 | #define A_C_00000003 0xc3 | ||
218 | #define A_C_00000004 0xc4 | ||
219 | #define A_C_00000008 0xc5 | ||
220 | #define A_C_00000010 0xc6 | ||
221 | #define A_C_00000020 0xc7 | ||
222 | #define A_C_00000100 0xc8 | ||
223 | #define A_C_00010000 0xc9 | ||
224 | #define A_C_00000800 0xca | ||
225 | #define A_C_10000000 0xcb | ||
226 | #define A_C_20000000 0xcc | ||
227 | #define A_C_40000000 0xcd | ||
228 | #define A_C_80000000 0xce | ||
229 | #define A_C_7fffffff 0xcf | ||
230 | #define A_C_ffffffff 0xd0 | ||
231 | #define A_C_fffffffe 0xd1 | ||
232 | #define A_C_c0000000 0xd2 | ||
233 | #define A_C_4f1bbcdc 0xd3 | ||
234 | #define A_C_5a7ef9db 0xd4 | ||
235 | #define A_C_00100000 0xd5 | ||
236 | #define A_GPR_ACCU 0xd6 /* ACCUM, accumulator */ | ||
237 | #define A_GPR_COND 0xd7 /* CCR, condition register */ | ||
238 | #define A_GPR_NOISE0 0xd8 /* noise source */ | ||
239 | #define A_GPR_NOISE1 0xd9 /* noise source */ | ||
240 | #define A_GPR_IRQ 0xda /* IRQ register */ | ||
241 | #define A_GPR_DBAC 0xdb /* TRAM Delay Base Address Counter - internal */ | ||
242 | #define A_GPR_DBACE 0xde /* TRAM Delay Base Address Counter - external */ | ||
243 | |||
244 | /* definitions for debug register */ | ||
245 | #define EMU10K1_DBG_ZC 0x80000000 /* zero tram counter */ | ||
246 | #define EMU10K1_DBG_SATURATION_OCCURED 0x02000000 /* saturation control */ | ||
247 | #define EMU10K1_DBG_SATURATION_ADDR 0x01ff0000 /* saturation address */ | ||
248 | #define EMU10K1_DBG_SINGLE_STEP 0x00008000 /* single step mode */ | ||
249 | #define EMU10K1_DBG_STEP 0x00004000 /* start single step */ | ||
250 | #define EMU10K1_DBG_CONDITION_CODE 0x00003e00 /* condition code */ | ||
251 | #define EMU10K1_DBG_SINGLE_STEP_ADDR 0x000001ff /* single step address */ | ||
252 | |||
253 | /* tank memory address line */ | ||
254 | #ifndef __KERNEL__ | ||
255 | #define TANKMEMADDRREG_ADDR_MASK 0x000fffff /* 20 bit tank address field */ | ||
256 | #define TANKMEMADDRREG_CLEAR 0x00800000 /* Clear tank memory */ | ||
257 | #define TANKMEMADDRREG_ALIGN 0x00400000 /* Align read or write relative to tank access */ | ||
258 | #define TANKMEMADDRREG_WRITE 0x00200000 /* Write to tank memory */ | ||
259 | #define TANKMEMADDRREG_READ 0x00100000 /* Read from tank memory */ | ||
260 | #endif | ||
261 | |||
262 | struct snd_emu10k1_fx8010_info { | ||
263 | unsigned int internal_tram_size; /* in samples */ | ||
264 | unsigned int external_tram_size; /* in samples */ | ||
265 | char fxbus_names[16][32]; /* names of FXBUSes */ | ||
266 | char extin_names[16][32]; /* names of external inputs */ | ||
267 | char extout_names[32][32]; /* names of external outputs */ | ||
268 | unsigned int gpr_controls; /* count of GPR controls */ | ||
269 | }; | ||
270 | |||
271 | #define EMU10K1_GPR_TRANSLATION_NONE 0 | ||
272 | #define EMU10K1_GPR_TRANSLATION_TABLE100 1 | ||
273 | #define EMU10K1_GPR_TRANSLATION_BASS 2 | ||
274 | #define EMU10K1_GPR_TRANSLATION_TREBLE 3 | ||
275 | #define EMU10K1_GPR_TRANSLATION_ONOFF 4 | ||
276 | |||
277 | struct snd_emu10k1_fx8010_control_gpr { | ||
278 | struct snd_ctl_elem_id id; /* full control ID definition */ | ||
279 | unsigned int vcount; /* visible count */ | ||
280 | unsigned int count; /* count of GPR (1..16) */ | ||
281 | unsigned short gpr[32]; /* GPR number(s) */ | ||
282 | unsigned int value[32]; /* initial values */ | ||
283 | unsigned int min; /* minimum range */ | ||
284 | unsigned int max; /* maximum range */ | ||
285 | unsigned int translation; /* translation type (EMU10K1_GPR_TRANSLATION*) */ | ||
286 | const unsigned int *tlv; | ||
287 | }; | ||
288 | |||
289 | /* old ABI without TLV support */ | ||
290 | struct snd_emu10k1_fx8010_control_old_gpr { | ||
291 | struct snd_ctl_elem_id id; | ||
292 | unsigned int vcount; | ||
293 | unsigned int count; | ||
294 | unsigned short gpr[32]; | ||
295 | unsigned int value[32]; | ||
296 | unsigned int min; | ||
297 | unsigned int max; | ||
298 | unsigned int translation; | ||
299 | }; | ||
300 | |||
301 | struct snd_emu10k1_fx8010_code { | ||
302 | char name[128]; | ||
303 | |||
304 | DECLARE_BITMAP(gpr_valid, 0x200); /* bitmask of valid initializers */ | ||
305 | __u32 __user *gpr_map; /* initializers */ | ||
306 | |||
307 | unsigned int gpr_add_control_count; /* count of GPR controls to add/replace */ | ||
308 | struct snd_emu10k1_fx8010_control_gpr __user *gpr_add_controls; /* GPR controls to add/replace */ | ||
309 | |||
310 | unsigned int gpr_del_control_count; /* count of GPR controls to remove */ | ||
311 | struct snd_ctl_elem_id __user *gpr_del_controls; /* IDs of GPR controls to remove */ | ||
312 | |||
313 | unsigned int gpr_list_control_count; /* count of GPR controls to list */ | ||
314 | unsigned int gpr_list_control_total; /* total count of GPR controls */ | ||
315 | struct snd_emu10k1_fx8010_control_gpr __user *gpr_list_controls; /* listed GPR controls */ | ||
316 | |||
317 | DECLARE_BITMAP(tram_valid, 0x100); /* bitmask of valid initializers */ | ||
318 | __u32 __user *tram_data_map; /* data initializers */ | ||
319 | __u32 __user *tram_addr_map; /* map initializers */ | ||
320 | |||
321 | DECLARE_BITMAP(code_valid, 1024); /* bitmask of valid instructions */ | ||
322 | __u32 __user *code; /* one instruction - 64 bits */ | ||
323 | }; | ||
324 | |||
325 | struct snd_emu10k1_fx8010_tram { | ||
326 | unsigned int address; /* 31.bit == 1 -> external TRAM */ | ||
327 | unsigned int size; /* size in samples (4 bytes) */ | ||
328 | unsigned int *samples; /* pointer to samples (20-bit) */ | ||
329 | /* NULL->clear memory */ | ||
330 | }; | ||
331 | |||
332 | struct snd_emu10k1_fx8010_pcm_rec { | ||
333 | unsigned int substream; /* substream number */ | ||
334 | unsigned int res1; /* reserved */ | ||
335 | unsigned int channels; /* 16-bit channels count, zero = remove this substream */ | ||
336 | unsigned int tram_start; /* ring buffer position in TRAM (in samples) */ | ||
337 | unsigned int buffer_size; /* count of buffered samples */ | ||
338 | unsigned short gpr_size; /* GPR containing size of ringbuffer in samples (host) */ | ||
339 | unsigned short gpr_ptr; /* GPR containing current pointer in the ring buffer (host = reset, FX8010) */ | ||
340 | unsigned short gpr_count; /* GPR containing count of samples between two interrupts (host) */ | ||
341 | unsigned short gpr_tmpcount; /* GPR containing current count of samples to interrupt (host = set, FX8010) */ | ||
342 | unsigned short gpr_trigger; /* GPR containing trigger (activate) information (host) */ | ||
343 | unsigned short gpr_running; /* GPR containing info if PCM is running (FX8010) */ | ||
344 | unsigned char pad; /* reserved */ | ||
345 | unsigned char etram[32]; /* external TRAM address & data (one per channel) */ | ||
346 | unsigned int res2; /* reserved */ | ||
347 | }; | ||
348 | |||
349 | #define SNDRV_EMU10K1_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 1) | ||
350 | |||
351 | #define SNDRV_EMU10K1_IOCTL_INFO _IOR ('H', 0x10, struct snd_emu10k1_fx8010_info) | ||
352 | #define SNDRV_EMU10K1_IOCTL_CODE_POKE _IOW ('H', 0x11, struct snd_emu10k1_fx8010_code) | ||
353 | #define SNDRV_EMU10K1_IOCTL_CODE_PEEK _IOWR('H', 0x12, struct snd_emu10k1_fx8010_code) | ||
354 | #define SNDRV_EMU10K1_IOCTL_TRAM_SETUP _IOW ('H', 0x20, int) | ||
355 | #define SNDRV_EMU10K1_IOCTL_TRAM_POKE _IOW ('H', 0x21, struct snd_emu10k1_fx8010_tram) | ||
356 | #define SNDRV_EMU10K1_IOCTL_TRAM_PEEK _IOWR('H', 0x22, struct snd_emu10k1_fx8010_tram) | ||
357 | #define SNDRV_EMU10K1_IOCTL_PCM_POKE _IOW ('H', 0x30, struct snd_emu10k1_fx8010_pcm_rec) | ||
358 | #define SNDRV_EMU10K1_IOCTL_PCM_PEEK _IOWR('H', 0x31, struct snd_emu10k1_fx8010_pcm_rec) | ||
359 | #define SNDRV_EMU10K1_IOCTL_PVERSION _IOR ('H', 0x40, int) | ||
360 | #define SNDRV_EMU10K1_IOCTL_STOP _IO ('H', 0x80) | ||
361 | #define SNDRV_EMU10K1_IOCTL_CONTINUE _IO ('H', 0x81) | ||
362 | #define SNDRV_EMU10K1_IOCTL_ZERO_TRAM_COUNTER _IO ('H', 0x82) | ||
363 | #define SNDRV_EMU10K1_IOCTL_SINGLE_STEP _IOW ('H', 0x83, int) | ||
364 | #define SNDRV_EMU10K1_IOCTL_DBG_READ _IOR ('H', 0x84, int) | ||
365 | |||
366 | /* typedefs for compatibility to user-space */ | ||
367 | typedef struct snd_emu10k1_fx8010_info emu10k1_fx8010_info_t; | ||
368 | typedef struct snd_emu10k1_fx8010_control_gpr emu10k1_fx8010_control_gpr_t; | ||
369 | typedef struct snd_emu10k1_fx8010_code emu10k1_fx8010_code_t; | ||
370 | typedef struct snd_emu10k1_fx8010_tram emu10k1_fx8010_tram_t; | ||
371 | typedef struct snd_emu10k1_fx8010_pcm_rec emu10k1_fx8010_pcm_t; | ||
372 | |||
373 | #endif /* _UAPI__SOUND_EMU10K1_H */ | ||
diff --git a/include/uapi/sound/hdsp.h b/include/uapi/sound/hdsp.h new file mode 100644 index 000000000000..0909a3843479 --- /dev/null +++ b/include/uapi/sound/hdsp.h | |||
@@ -0,0 +1,110 @@ | |||
1 | #ifndef __SOUND_HDSP_H | ||
2 | #define __SOUND_HDSP_H | ||
3 | |||
4 | /* | ||
5 | * Copyright (C) 2003 Thomas Charbonnel (thomas@undata.org) | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation; either version 2 of the License, or | ||
10 | * (at your option) any later version. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
20 | */ | ||
21 | |||
22 | #include <linux/types.h> | ||
23 | |||
24 | #define HDSP_MATRIX_MIXER_SIZE 2048 | ||
25 | |||
26 | enum HDSP_IO_Type { | ||
27 | Digiface, | ||
28 | Multiface, | ||
29 | H9652, | ||
30 | H9632, | ||
31 | RPM, | ||
32 | Undefined, | ||
33 | }; | ||
34 | |||
35 | struct hdsp_peak_rms { | ||
36 | __u32 input_peaks[26]; | ||
37 | __u32 playback_peaks[26]; | ||
38 | __u32 output_peaks[28]; | ||
39 | __u64 input_rms[26]; | ||
40 | __u64 playback_rms[26]; | ||
41 | /* These are only used for H96xx cards */ | ||
42 | __u64 output_rms[26]; | ||
43 | }; | ||
44 | |||
45 | #define SNDRV_HDSP_IOCTL_GET_PEAK_RMS _IOR('H', 0x40, struct hdsp_peak_rms) | ||
46 | |||
47 | struct hdsp_config_info { | ||
48 | unsigned char pref_sync_ref; | ||
49 | unsigned char wordclock_sync_check; | ||
50 | unsigned char spdif_sync_check; | ||
51 | unsigned char adatsync_sync_check; | ||
52 | unsigned char adat_sync_check[3]; | ||
53 | unsigned char spdif_in; | ||
54 | unsigned char spdif_out; | ||
55 | unsigned char spdif_professional; | ||
56 | unsigned char spdif_emphasis; | ||
57 | unsigned char spdif_nonaudio; | ||
58 | unsigned int spdif_sample_rate; | ||
59 | unsigned int system_sample_rate; | ||
60 | unsigned int autosync_sample_rate; | ||
61 | unsigned char system_clock_mode; | ||
62 | unsigned char clock_source; | ||
63 | unsigned char autosync_ref; | ||
64 | unsigned char line_out; | ||
65 | unsigned char passthru; | ||
66 | unsigned char da_gain; | ||
67 | unsigned char ad_gain; | ||
68 | unsigned char phone_gain; | ||
69 | unsigned char xlr_breakout_cable; | ||
70 | unsigned char analog_extension_board; | ||
71 | }; | ||
72 | |||
73 | #define SNDRV_HDSP_IOCTL_GET_CONFIG_INFO _IOR('H', 0x41, struct hdsp_config_info) | ||
74 | |||
75 | struct hdsp_firmware { | ||
76 | void __user *firmware_data; /* 24413 x 4 bytes */ | ||
77 | }; | ||
78 | |||
79 | #define SNDRV_HDSP_IOCTL_UPLOAD_FIRMWARE _IOW('H', 0x42, struct hdsp_firmware) | ||
80 | |||
81 | struct hdsp_version { | ||
82 | enum HDSP_IO_Type io_type; | ||
83 | unsigned short firmware_rev; | ||
84 | }; | ||
85 | |||
86 | #define SNDRV_HDSP_IOCTL_GET_VERSION _IOR('H', 0x43, struct hdsp_version) | ||
87 | |||
88 | struct hdsp_mixer { | ||
89 | unsigned short matrix[HDSP_MATRIX_MIXER_SIZE]; | ||
90 | }; | ||
91 | |||
92 | #define SNDRV_HDSP_IOCTL_GET_MIXER _IOR('H', 0x44, struct hdsp_mixer) | ||
93 | |||
94 | struct hdsp_9632_aeb { | ||
95 | int aebi; | ||
96 | int aebo; | ||
97 | }; | ||
98 | |||
99 | #define SNDRV_HDSP_IOCTL_GET_9632_AEB _IOR('H', 0x45, struct hdsp_9632_aeb) | ||
100 | |||
101 | /* typedefs for compatibility to user-space */ | ||
102 | typedef enum HDSP_IO_Type HDSP_IO_Type; | ||
103 | typedef struct hdsp_peak_rms hdsp_peak_rms_t; | ||
104 | typedef struct hdsp_config_info hdsp_config_info_t; | ||
105 | typedef struct hdsp_firmware hdsp_firmware_t; | ||
106 | typedef struct hdsp_version hdsp_version_t; | ||
107 | typedef struct hdsp_mixer hdsp_mixer_t; | ||
108 | typedef struct hdsp_9632_aeb hdsp_9632_aeb_t; | ||
109 | |||
110 | #endif /* __SOUND_HDSP_H */ | ||
diff --git a/include/uapi/sound/hdspm.h b/include/uapi/sound/hdspm.h new file mode 100644 index 000000000000..1f59ea2a4a76 --- /dev/null +++ b/include/uapi/sound/hdspm.h | |||
@@ -0,0 +1,229 @@ | |||
1 | #ifndef __SOUND_HDSPM_H | ||
2 | #define __SOUND_HDSPM_H | ||
3 | /* | ||
4 | * Copyright (C) 2003 Winfried Ritsch (IEM) | ||
5 | * based on hdsp.h from Thomas Charbonnel (thomas@undata.org) | ||
6 | * | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
21 | */ | ||
22 | |||
23 | /* Maximum channels is 64 even on 56Mode you have 64playbacks to matrix */ | ||
24 | #define HDSPM_MAX_CHANNELS 64 | ||
25 | |||
26 | enum hdspm_io_type { | ||
27 | MADI, | ||
28 | MADIface, | ||
29 | AIO, | ||
30 | AES32, | ||
31 | RayDAT | ||
32 | }; | ||
33 | |||
34 | enum hdspm_speed { | ||
35 | ss, | ||
36 | ds, | ||
37 | qs | ||
38 | }; | ||
39 | |||
40 | /* -------------------- IOCTL Peak/RMS Meters -------------------- */ | ||
41 | |||
42 | struct hdspm_peak_rms { | ||
43 | uint32_t input_peaks[64]; | ||
44 | uint32_t playback_peaks[64]; | ||
45 | uint32_t output_peaks[64]; | ||
46 | |||
47 | uint64_t input_rms[64]; | ||
48 | uint64_t playback_rms[64]; | ||
49 | uint64_t output_rms[64]; | ||
50 | |||
51 | uint8_t speed; /* enum {ss, ds, qs} */ | ||
52 | int status2; | ||
53 | }; | ||
54 | |||
55 | #define SNDRV_HDSPM_IOCTL_GET_PEAK_RMS \ | ||
56 | _IOR('H', 0x42, struct hdspm_peak_rms) | ||
57 | |||
58 | /* ------------ CONFIG block IOCTL ---------------------- */ | ||
59 | |||
60 | struct hdspm_config { | ||
61 | unsigned char pref_sync_ref; | ||
62 | unsigned char wordclock_sync_check; | ||
63 | unsigned char madi_sync_check; | ||
64 | unsigned int system_sample_rate; | ||
65 | unsigned int autosync_sample_rate; | ||
66 | unsigned char system_clock_mode; | ||
67 | unsigned char clock_source; | ||
68 | unsigned char autosync_ref; | ||
69 | unsigned char line_out; | ||
70 | unsigned int passthru; | ||
71 | unsigned int analog_out; | ||
72 | }; | ||
73 | |||
74 | #define SNDRV_HDSPM_IOCTL_GET_CONFIG \ | ||
75 | _IOR('H', 0x41, struct hdspm_config) | ||
76 | |||
77 | /** | ||
78 | * If there's a TCO (TimeCode Option) board installed, | ||
79 | * there are further options and status data available. | ||
80 | * The hdspm_ltc structure contains the current SMPTE | ||
81 | * timecode and some status information and can be | ||
82 | * obtained via SNDRV_HDSPM_IOCTL_GET_LTC or in the | ||
83 | * hdspm_status struct. | ||
84 | **/ | ||
85 | |||
86 | enum hdspm_ltc_format { | ||
87 | format_invalid, | ||
88 | fps_24, | ||
89 | fps_25, | ||
90 | fps_2997, | ||
91 | fps_30 | ||
92 | }; | ||
93 | |||
94 | enum hdspm_ltc_frame { | ||
95 | frame_invalid, | ||
96 | drop_frame, | ||
97 | full_frame | ||
98 | }; | ||
99 | |||
100 | enum hdspm_ltc_input_format { | ||
101 | ntsc, | ||
102 | pal, | ||
103 | no_video | ||
104 | }; | ||
105 | |||
106 | struct hdspm_ltc { | ||
107 | unsigned int ltc; | ||
108 | |||
109 | enum hdspm_ltc_format format; | ||
110 | enum hdspm_ltc_frame frame; | ||
111 | enum hdspm_ltc_input_format input_format; | ||
112 | }; | ||
113 | |||
114 | #define SNDRV_HDSPM_IOCTL_GET_LTC _IOR('H', 0x46, struct hdspm_mixer_ioctl) | ||
115 | |||
116 | /** | ||
117 | * The status data reflects the device's current state | ||
118 | * as determined by the card's configuration and | ||
119 | * connection status. | ||
120 | **/ | ||
121 | |||
122 | enum hdspm_sync { | ||
123 | hdspm_sync_no_lock = 0, | ||
124 | hdspm_sync_lock = 1, | ||
125 | hdspm_sync_sync = 2 | ||
126 | }; | ||
127 | |||
128 | enum hdspm_madi_input { | ||
129 | hdspm_input_optical = 0, | ||
130 | hdspm_input_coax = 1 | ||
131 | }; | ||
132 | |||
133 | enum hdspm_madi_channel_format { | ||
134 | hdspm_format_ch_64 = 0, | ||
135 | hdspm_format_ch_56 = 1 | ||
136 | }; | ||
137 | |||
138 | enum hdspm_madi_frame_format { | ||
139 | hdspm_frame_48 = 0, | ||
140 | hdspm_frame_96 = 1 | ||
141 | }; | ||
142 | |||
143 | enum hdspm_syncsource { | ||
144 | syncsource_wc = 0, | ||
145 | syncsource_madi = 1, | ||
146 | syncsource_tco = 2, | ||
147 | syncsource_sync = 3, | ||
148 | syncsource_none = 4 | ||
149 | }; | ||
150 | |||
151 | struct hdspm_status { | ||
152 | uint8_t card_type; /* enum hdspm_io_type */ | ||
153 | enum hdspm_syncsource autosync_source; | ||
154 | |||
155 | uint64_t card_clock; | ||
156 | uint32_t master_period; | ||
157 | |||
158 | union { | ||
159 | struct { | ||
160 | uint8_t sync_wc; /* enum hdspm_sync */ | ||
161 | uint8_t sync_madi; /* enum hdspm_sync */ | ||
162 | uint8_t sync_tco; /* enum hdspm_sync */ | ||
163 | uint8_t sync_in; /* enum hdspm_sync */ | ||
164 | uint8_t madi_input; /* enum hdspm_madi_input */ | ||
165 | uint8_t channel_format; /* enum hdspm_madi_channel_format */ | ||
166 | uint8_t frame_format; /* enum hdspm_madi_frame_format */ | ||
167 | } madi; | ||
168 | } card_specific; | ||
169 | }; | ||
170 | |||
171 | #define SNDRV_HDSPM_IOCTL_GET_STATUS \ | ||
172 | _IOR('H', 0x47, struct hdspm_status) | ||
173 | |||
174 | /** | ||
175 | * Get information about the card and its add-ons. | ||
176 | **/ | ||
177 | |||
178 | #define HDSPM_ADDON_TCO 1 | ||
179 | |||
180 | struct hdspm_version { | ||
181 | uint8_t card_type; /* enum hdspm_io_type */ | ||
182 | char cardname[20]; | ||
183 | unsigned int serial; | ||
184 | unsigned short firmware_rev; | ||
185 | int addons; | ||
186 | }; | ||
187 | |||
188 | #define SNDRV_HDSPM_IOCTL_GET_VERSION _IOR('H', 0x48, struct hdspm_version) | ||
189 | |||
190 | /* ------------- get Matrix Mixer IOCTL --------------- */ | ||
191 | |||
192 | /* MADI mixer: 64inputs+64playback in 64outputs = 8192 => *4Byte = | ||
193 | * 32768 Bytes | ||
194 | */ | ||
195 | |||
196 | /* organisation is 64 channelfader in a continuous memory block */ | ||
197 | /* equivalent to hardware definition, maybe for future feature of mmap of | ||
198 | * them | ||
199 | */ | ||
200 | /* each of 64 outputs has 64 infader and 64 outfader: | ||
201 | Ins to Outs mixer[out].in[in], Outstreams to Outs mixer[out].pb[pb] */ | ||
202 | |||
203 | #define HDSPM_MIXER_CHANNELS HDSPM_MAX_CHANNELS | ||
204 | |||
205 | struct hdspm_channelfader { | ||
206 | unsigned int in[HDSPM_MIXER_CHANNELS]; | ||
207 | unsigned int pb[HDSPM_MIXER_CHANNELS]; | ||
208 | }; | ||
209 | |||
210 | struct hdspm_mixer { | ||
211 | struct hdspm_channelfader ch[HDSPM_MIXER_CHANNELS]; | ||
212 | }; | ||
213 | |||
214 | struct hdspm_mixer_ioctl { | ||
215 | struct hdspm_mixer *mixer; | ||
216 | }; | ||
217 | |||
218 | /* use indirect access due to the limit of ioctl bit size */ | ||
219 | #define SNDRV_HDSPM_IOCTL_GET_MIXER _IOR('H', 0x44, struct hdspm_mixer_ioctl) | ||
220 | |||
221 | /* typedefs for compatibility to user-space */ | ||
222 | typedef struct hdspm_peak_rms hdspm_peak_rms_t; | ||
223 | typedef struct hdspm_config_info hdspm_config_info_t; | ||
224 | typedef struct hdspm_version hdspm_version_t; | ||
225 | typedef struct hdspm_channelfader snd_hdspm_channelfader_t; | ||
226 | typedef struct hdspm_mixer hdspm_mixer_t; | ||
227 | |||
228 | |||
229 | #endif | ||
diff --git a/include/uapi/sound/sb16_csp.h b/include/uapi/sound/sb16_csp.h new file mode 100644 index 000000000000..3b96907e2afb --- /dev/null +++ b/include/uapi/sound/sb16_csp.h | |||
@@ -0,0 +1,122 @@ | |||
1 | /* | ||
2 | * Copyright (c) 1999 by Uros Bizjak <uros@kss-loka.si> | ||
3 | * Takashi Iwai <tiwai@suse.de> | ||
4 | * | ||
5 | * SB16ASP/AWE32 CSP control | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation; either version 2 of the License, or | ||
10 | * (at your option) any later version. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
20 | * | ||
21 | */ | ||
22 | #ifndef _UAPI__SOUND_SB16_CSP_H | ||
23 | #define _UAPI__SOUND_SB16_CSP_H | ||
24 | |||
25 | |||
26 | /* CSP modes */ | ||
27 | #define SNDRV_SB_CSP_MODE_NONE 0x00 | ||
28 | #define SNDRV_SB_CSP_MODE_DSP_READ 0x01 /* Record from DSP */ | ||
29 | #define SNDRV_SB_CSP_MODE_DSP_WRITE 0x02 /* Play to DSP */ | ||
30 | #define SNDRV_SB_CSP_MODE_QSOUND 0x04 /* QSound */ | ||
31 | |||
32 | /* CSP load flags */ | ||
33 | #define SNDRV_SB_CSP_LOAD_FROMUSER 0x01 | ||
34 | #define SNDRV_SB_CSP_LOAD_INITBLOCK 0x02 | ||
35 | |||
36 | /* CSP sample width */ | ||
37 | #define SNDRV_SB_CSP_SAMPLE_8BIT 0x01 | ||
38 | #define SNDRV_SB_CSP_SAMPLE_16BIT 0x02 | ||
39 | |||
40 | /* CSP channels */ | ||
41 | #define SNDRV_SB_CSP_MONO 0x01 | ||
42 | #define SNDRV_SB_CSP_STEREO 0x02 | ||
43 | |||
44 | /* CSP rates */ | ||
45 | #define SNDRV_SB_CSP_RATE_8000 0x01 | ||
46 | #define SNDRV_SB_CSP_RATE_11025 0x02 | ||
47 | #define SNDRV_SB_CSP_RATE_22050 0x04 | ||
48 | #define SNDRV_SB_CSP_RATE_44100 0x08 | ||
49 | #define SNDRV_SB_CSP_RATE_ALL 0x0f | ||
50 | |||
51 | /* CSP running state */ | ||
52 | #define SNDRV_SB_CSP_ST_IDLE 0x00 | ||
53 | #define SNDRV_SB_CSP_ST_LOADED 0x01 | ||
54 | #define SNDRV_SB_CSP_ST_RUNNING 0x02 | ||
55 | #define SNDRV_SB_CSP_ST_PAUSED 0x04 | ||
56 | #define SNDRV_SB_CSP_ST_AUTO 0x08 | ||
57 | #define SNDRV_SB_CSP_ST_QSOUND 0x10 | ||
58 | |||
59 | /* maximum QSound value (180 degrees right) */ | ||
60 | #define SNDRV_SB_CSP_QSOUND_MAX_RIGHT 0x20 | ||
61 | |||
62 | /* maximum microcode RIFF file size */ | ||
63 | #define SNDRV_SB_CSP_MAX_MICROCODE_FILE_SIZE 0x3000 | ||
64 | |||
65 | /* microcode header */ | ||
66 | struct snd_sb_csp_mc_header { | ||
67 | char codec_name[16]; /* id name of codec */ | ||
68 | unsigned short func_req; /* requested function */ | ||
69 | }; | ||
70 | |||
71 | /* microcode to be loaded */ | ||
72 | struct snd_sb_csp_microcode { | ||
73 | struct snd_sb_csp_mc_header info; | ||
74 | unsigned char data[SNDRV_SB_CSP_MAX_MICROCODE_FILE_SIZE]; | ||
75 | }; | ||
76 | |||
77 | /* start CSP with sample_width in mono/stereo */ | ||
78 | struct snd_sb_csp_start { | ||
79 | int sample_width; /* sample width, look above */ | ||
80 | int channels; /* channels, look above */ | ||
81 | }; | ||
82 | |||
83 | /* CSP information */ | ||
84 | struct snd_sb_csp_info { | ||
85 | char codec_name[16]; /* id name of codec */ | ||
86 | unsigned short func_nr; /* function number */ | ||
87 | unsigned int acc_format; /* accepted PCM formats */ | ||
88 | unsigned short acc_channels; /* accepted channels */ | ||
89 | unsigned short acc_width; /* accepted sample width */ | ||
90 | unsigned short acc_rates; /* accepted sample rates */ | ||
91 | unsigned short csp_mode; /* CSP mode, see above */ | ||
92 | unsigned short run_channels; /* current channels */ | ||
93 | unsigned short run_width; /* current sample width */ | ||
94 | unsigned short version; /* version id: 0x10 - 0x1f */ | ||
95 | unsigned short state; /* state bits */ | ||
96 | }; | ||
97 | |||
98 | /* HWDEP controls */ | ||
99 | /* get CSP information */ | ||
100 | #define SNDRV_SB_CSP_IOCTL_INFO _IOR('H', 0x10, struct snd_sb_csp_info) | ||
101 | /* load microcode to CSP */ | ||
102 | /* NOTE: struct snd_sb_csp_microcode overflows the max size (13 bits) | ||
103 | * defined for some architectures like MIPS, and it leads to build errors. | ||
104 | * (x86 and co have 14-bit size, thus it's valid, though.) | ||
105 | * As a workaround for skipping the size-limit check, here we don't use the | ||
106 | * normal _IOW() macro but _IOC() with the manual argument. | ||
107 | */ | ||
108 | #define SNDRV_SB_CSP_IOCTL_LOAD_CODE \ | ||
109 | _IOC(_IOC_WRITE, 'H', 0x11, sizeof(struct snd_sb_csp_microcode)) | ||
110 | /* unload microcode from CSP */ | ||
111 | #define SNDRV_SB_CSP_IOCTL_UNLOAD_CODE _IO('H', 0x12) | ||
112 | /* start CSP */ | ||
113 | #define SNDRV_SB_CSP_IOCTL_START _IOW('H', 0x13, struct snd_sb_csp_start) | ||
114 | /* stop CSP */ | ||
115 | #define SNDRV_SB_CSP_IOCTL_STOP _IO('H', 0x14) | ||
116 | /* pause CSP and DMA transfer */ | ||
117 | #define SNDRV_SB_CSP_IOCTL_PAUSE _IO('H', 0x15) | ||
118 | /* restart CSP and DMA transfer */ | ||
119 | #define SNDRV_SB_CSP_IOCTL_RESTART _IO('H', 0x16) | ||
120 | |||
121 | |||
122 | #endif /* _UAPI__SOUND_SB16_CSP_H */ | ||
diff --git a/include/uapi/sound/sfnt_info.h b/include/uapi/sound/sfnt_info.h new file mode 100644 index 000000000000..1bce7fd1725f --- /dev/null +++ b/include/uapi/sound/sfnt_info.h | |||
@@ -0,0 +1,212 @@ | |||
1 | #ifndef __SOUND_SFNT_INFO_H | ||
2 | #define __SOUND_SFNT_INFO_H | ||
3 | |||
4 | /* | ||
5 | * Patch record compatible with AWE driver on OSS | ||
6 | * | ||
7 | * Copyright (C) 1999-2000 Takashi Iwai | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License as published by | ||
11 | * the Free Software Foundation; either version 2 of the License, or | ||
12 | * (at your option) any later version. | ||
13 | * | ||
14 | * This program is distributed in the hope that it will be useful, | ||
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
17 | * GNU General Public License for more details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this program; if not, write to the Free Software | ||
21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
22 | * | ||
23 | */ | ||
24 | |||
25 | #include <sound/asound.h> | ||
26 | |||
27 | /* | ||
28 | * patch information record | ||
29 | */ | ||
30 | |||
31 | #ifdef SNDRV_BIG_ENDIAN | ||
32 | #define SNDRV_OSS_PATCHKEY(id) (0xfd00|id) | ||
33 | #else | ||
34 | #define SNDRV_OSS_PATCHKEY(id) ((id<<8)|0xfd) | ||
35 | #endif | ||
36 | |||
37 | /* patch interface header: 16 bytes */ | ||
38 | struct soundfont_patch_info { | ||
39 | unsigned short key; /* use the key below */ | ||
40 | #define SNDRV_OSS_SOUNDFONT_PATCH SNDRV_OSS_PATCHKEY(0x07) | ||
41 | |||
42 | short device_no; /* synthesizer number */ | ||
43 | unsigned short sf_id; /* file id (should be zero) */ | ||
44 | short optarg; /* optional argument */ | ||
45 | int len; /* data length (without this header) */ | ||
46 | |||
47 | short type; /* patch operation type */ | ||
48 | #define SNDRV_SFNT_LOAD_INFO 0 /* awe_voice_rec */ | ||
49 | #define SNDRV_SFNT_LOAD_DATA 1 /* awe_sample_info */ | ||
50 | #define SNDRV_SFNT_OPEN_PATCH 2 /* awe_open_parm */ | ||
51 | #define SNDRV_SFNT_CLOSE_PATCH 3 /* none */ | ||
52 | /* 4 is obsolete */ | ||
53 | #define SNDRV_SFNT_REPLACE_DATA 5 /* awe_sample_info (optarg=#channels)*/ | ||
54 | #define SNDRV_SFNT_MAP_PRESET 6 /* awe_voice_map */ | ||
55 | /* 7 is not used */ | ||
56 | #define SNDRV_SFNT_PROBE_DATA 8 /* optarg=sample */ | ||
57 | #define SNDRV_SFNT_REMOVE_INFO 9 /* optarg=(bank<<8)|instr */ | ||
58 | |||
59 | short reserved; /* word alignment data */ | ||
60 | |||
61 | /* the actual patch data begins after this */ | ||
62 | }; | ||
63 | |||
64 | |||
65 | /* | ||
66 | * open patch | ||
67 | */ | ||
68 | |||
69 | #define SNDRV_SFNT_PATCH_NAME_LEN 32 | ||
70 | |||
71 | struct soundfont_open_parm { | ||
72 | unsigned short type; /* sample type */ | ||
73 | #define SNDRV_SFNT_PAT_TYPE_MISC 0 | ||
74 | #define SNDRV_SFNT_PAT_TYPE_GUS 6 | ||
75 | #define SNDRV_SFNT_PAT_TYPE_MAP 7 | ||
76 | #define SNDRV_SFNT_PAT_LOCKED 0x100 /* lock the samples */ | ||
77 | #define SNDRV_SFNT_PAT_SHARED 0x200 /* sample is shared */ | ||
78 | |||
79 | short reserved; | ||
80 | char name[SNDRV_SFNT_PATCH_NAME_LEN]; | ||
81 | }; | ||
82 | |||
83 | |||
84 | /* | ||
85 | * raw voice information record | ||
86 | */ | ||
87 | |||
88 | /* wave table envelope & effect parameters to control EMU8000 */ | ||
89 | struct soundfont_voice_parm { | ||
90 | unsigned short moddelay; /* modulation delay (0x8000) */ | ||
91 | unsigned short modatkhld; /* modulation attack & hold time (0x7f7f) */ | ||
92 | unsigned short moddcysus; /* modulation decay & sustain (0x7f7f) */ | ||
93 | unsigned short modrelease; /* modulation release time (0x807f) */ | ||
94 | short modkeyhold, modkeydecay; /* envelope change per key (not used) */ | ||
95 | unsigned short voldelay; /* volume delay (0x8000) */ | ||
96 | unsigned short volatkhld; /* volume attack & hold time (0x7f7f) */ | ||
97 | unsigned short voldcysus; /* volume decay & sustain (0x7f7f) */ | ||
98 | unsigned short volrelease; /* volume release time (0x807f) */ | ||
99 | short volkeyhold, volkeydecay; /* envelope change per key (not used) */ | ||
100 | unsigned short lfo1delay; /* LFO1 delay (0x8000) */ | ||
101 | unsigned short lfo2delay; /* LFO2 delay (0x8000) */ | ||
102 | unsigned short pefe; /* modulation pitch & cutoff (0x0000) */ | ||
103 | unsigned short fmmod; /* LFO1 pitch & cutoff (0x0000) */ | ||
104 | unsigned short tremfrq; /* LFO1 volume & freq (0x0000) */ | ||
105 | unsigned short fm2frq2; /* LFO2 pitch & freq (0x0000) */ | ||
106 | unsigned char cutoff; /* initial cutoff (0xff) */ | ||
107 | unsigned char filterQ; /* initial filter Q [0-15] (0x0) */ | ||
108 | unsigned char chorus; /* chorus send (0x00) */ | ||
109 | unsigned char reverb; /* reverb send (0x00) */ | ||
110 | unsigned short reserved[4]; /* not used */ | ||
111 | }; | ||
112 | |||
113 | |||
114 | /* wave table parameters: 92 bytes */ | ||
115 | struct soundfont_voice_info { | ||
116 | unsigned short sf_id; /* file id (should be zero) */ | ||
117 | unsigned short sample; /* sample id */ | ||
118 | int start, end; /* sample offset correction */ | ||
119 | int loopstart, loopend; /* loop offset correction */ | ||
120 | short rate_offset; /* sample rate pitch offset */ | ||
121 | unsigned short mode; /* sample mode */ | ||
122 | #define SNDRV_SFNT_MODE_ROMSOUND 0x8000 | ||
123 | #define SNDRV_SFNT_MODE_STEREO 1 | ||
124 | #define SNDRV_SFNT_MODE_LOOPING 2 | ||
125 | #define SNDRV_SFNT_MODE_NORELEASE 4 /* obsolete */ | ||
126 | #define SNDRV_SFNT_MODE_INIT_PARM 8 | ||
127 | |||
128 | short root; /* midi root key */ | ||
129 | short tune; /* pitch tuning (in cents) */ | ||
130 | unsigned char low, high; /* key note range */ | ||
131 | unsigned char vellow, velhigh; /* velocity range */ | ||
132 | signed char fixkey, fixvel; /* fixed key, velocity */ | ||
133 | signed char pan, fixpan; /* panning, fixed panning */ | ||
134 | short exclusiveClass; /* exclusive class (0 = none) */ | ||
135 | unsigned char amplitude; /* sample volume (127 max) */ | ||
136 | unsigned char attenuation; /* attenuation (0.375dB) */ | ||
137 | short scaleTuning; /* pitch scale tuning(%), normally 100 */ | ||
138 | struct soundfont_voice_parm parm; /* voice envelope parameters */ | ||
139 | unsigned short sample_mode; /* sample mode_flag (set by driver) */ | ||
140 | }; | ||
141 | |||
142 | |||
143 | /* instrument info header: 4 bytes */ | ||
144 | struct soundfont_voice_rec_hdr { | ||
145 | unsigned char bank; /* midi bank number */ | ||
146 | unsigned char instr; /* midi preset number */ | ||
147 | char nvoices; /* number of voices */ | ||
148 | char write_mode; /* write mode; normally 0 */ | ||
149 | #define SNDRV_SFNT_WR_APPEND 0 /* append anyway */ | ||
150 | #define SNDRV_SFNT_WR_EXCLUSIVE 1 /* skip if already exists */ | ||
151 | #define SNDRV_SFNT_WR_REPLACE 2 /* replace if already exists */ | ||
152 | }; | ||
153 | |||
154 | |||
155 | /* | ||
156 | * sample wave information | ||
157 | */ | ||
158 | |||
159 | /* wave table sample header: 32 bytes */ | ||
160 | struct soundfont_sample_info { | ||
161 | unsigned short sf_id; /* file id (should be zero) */ | ||
162 | unsigned short sample; /* sample id */ | ||
163 | int start, end; /* start & end offset */ | ||
164 | int loopstart, loopend; /* loop start & end offset */ | ||
165 | int size; /* size (0 = ROM) */ | ||
166 | short dummy; /* not used */ | ||
167 | unsigned short mode_flags; /* mode flags */ | ||
168 | #define SNDRV_SFNT_SAMPLE_8BITS 1 /* wave data is 8bits */ | ||
169 | #define SNDRV_SFNT_SAMPLE_UNSIGNED 2 /* wave data is unsigned */ | ||
170 | #define SNDRV_SFNT_SAMPLE_NO_BLANK 4 /* no blank loop is attached */ | ||
171 | #define SNDRV_SFNT_SAMPLE_SINGLESHOT 8 /* single-shot w/o loop */ | ||
172 | #define SNDRV_SFNT_SAMPLE_BIDIR_LOOP 16 /* bidirectional looping */ | ||
173 | #define SNDRV_SFNT_SAMPLE_STEREO_LEFT 32 /* stereo left sound */ | ||
174 | #define SNDRV_SFNT_SAMPLE_STEREO_RIGHT 64 /* stereo right sound */ | ||
175 | #define SNDRV_SFNT_SAMPLE_REVERSE_LOOP 128 /* reverse looping */ | ||
176 | unsigned int truesize; /* used memory size (set by driver) */ | ||
177 | }; | ||
178 | |||
179 | |||
180 | /* | ||
181 | * voice preset mapping (aliasing) | ||
182 | */ | ||
183 | |||
184 | struct soundfont_voice_map { | ||
185 | int map_bank, map_instr, map_key; /* key = -1 means all keys */ | ||
186 | int src_bank, src_instr, src_key; | ||
187 | }; | ||
188 | |||
189 | |||
190 | /* | ||
191 | * ioctls for hwdep | ||
192 | */ | ||
193 | |||
194 | #define SNDRV_EMUX_HWDEP_NAME "Emux WaveTable" | ||
195 | |||
196 | #define SNDRV_EMUX_VERSION ((1 << 16) | (0 << 8) | 0) /* 1.0.0 */ | ||
197 | |||
198 | struct snd_emux_misc_mode { | ||
199 | int port; /* -1 = all */ | ||
200 | int mode; | ||
201 | int value; | ||
202 | int value2; /* reserved */ | ||
203 | }; | ||
204 | |||
205 | #define SNDRV_EMUX_IOCTL_VERSION _IOR('H', 0x80, unsigned int) | ||
206 | #define SNDRV_EMUX_IOCTL_LOAD_PATCH _IOWR('H', 0x81, struct soundfont_patch_info) | ||
207 | #define SNDRV_EMUX_IOCTL_RESET_SAMPLES _IO('H', 0x82) | ||
208 | #define SNDRV_EMUX_IOCTL_REMOVE_LAST_SAMPLES _IO('H', 0x83) | ||
209 | #define SNDRV_EMUX_IOCTL_MEM_AVAIL _IOW('H', 0x84, int) | ||
210 | #define SNDRV_EMUX_IOCTL_MISC_MODE _IOWR('H', 0x84, struct snd_emux_misc_mode) | ||
211 | |||
212 | #endif /* __SOUND_SFNT_INFO_H */ | ||