aboutsummaryrefslogtreecommitdiffstats
path: root/include/sound
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2012-10-09 04:49:13 -0400
committerDavid Howells <dhowells@redhat.com>2012-10-09 04:49:13 -0400
commit674e95ca446369e9ca40e4e92b214a616a52bcd6 (patch)
treec26f11819af6715384e87e0346f37df53912e2cd /include/sound
parent9e2d8656f5e8aa214e66b462680cf86b210b74a8 (diff)
UAPI: (Scripted) Disintegrate include/sound
Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Michael Kerrisk <mtk.manpages@gmail.com> Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Acked-by: Dave Jones <davej@redhat.com>
Diffstat (limited to 'include/sound')
-rw-r--r--include/sound/Kbuild10
-rw-r--r--include/sound/asequencer.h594
-rw-r--r--include/sound/asound.h935
-rw-r--r--include/sound/asound_fm.h134
-rw-r--r--include/sound/compress_offload.h161
-rw-r--r--include/sound/compress_params.h400
-rw-r--r--include/sound/emu10k1.h355
-rw-r--r--include/sound/hdsp.h110
-rw-r--r--include/sound/hdspm.h229
-rw-r--r--include/sound/sb16_csp.h104
-rw-r--r--include/sound/sfnt_info.h212
11 files changed, 8 insertions, 3236 deletions
diff --git a/include/sound/Kbuild b/include/sound/Kbuild
index 6df30ed1581..e69de29bb2d 100644
--- a/include/sound/Kbuild
+++ b/include/sound/Kbuild
@@ -1,10 +0,0 @@
1header-y += asequencer.h
2header-y += asound.h
3header-y += asound_fm.h
4header-y += emu10k1.h
5header-y += hdsp.h
6header-y += hdspm.h
7header-y += sb16_csp.h
8header-y += sfnt_info.h
9header-y += compress_params.h
10header-y += compress_offload.h
diff --git a/include/sound/asequencer.h b/include/sound/asequencer.h
index 1505e6d5ef8..75935ce739c 100644
--- a/include/sound/asequencer.h
+++ b/include/sound/asequencer.h
@@ -22,294 +22,9 @@
22#ifndef __SOUND_ASEQUENCER_H 22#ifndef __SOUND_ASEQUENCER_H
23#define __SOUND_ASEQUENCER_H 23#define __SOUND_ASEQUENCER_H
24 24
25#ifdef __KERNEL__
26#include <linux/ioctl.h> 25#include <linux/ioctl.h>
27#include <sound/asound.h> 26#include <sound/asound.h>
28#endif 27#include <uapi/sound/asequencer.h>
29
30/** version of the sequencer */
31#define SNDRV_SEQ_VERSION SNDRV_PROTOCOL_VERSION (1, 0, 1)
32
33/**
34 * definition of sequencer event types
35 */
36
37/** system messages
38 * event data type = #snd_seq_result
39 */
40#define SNDRV_SEQ_EVENT_SYSTEM 0
41#define SNDRV_SEQ_EVENT_RESULT 1
42
43/** note messages (channel specific)
44 * event data type = #snd_seq_ev_note
45 */
46#define SNDRV_SEQ_EVENT_NOTE 5
47#define SNDRV_SEQ_EVENT_NOTEON 6
48#define SNDRV_SEQ_EVENT_NOTEOFF 7
49#define SNDRV_SEQ_EVENT_KEYPRESS 8
50
51/** control messages (channel specific)
52 * event data type = #snd_seq_ev_ctrl
53 */
54#define SNDRV_SEQ_EVENT_CONTROLLER 10
55#define SNDRV_SEQ_EVENT_PGMCHANGE 11
56#define SNDRV_SEQ_EVENT_CHANPRESS 12
57#define SNDRV_SEQ_EVENT_PITCHBEND 13 /**< from -8192 to 8191 */
58#define SNDRV_SEQ_EVENT_CONTROL14 14 /**< 14 bit controller value */
59#define SNDRV_SEQ_EVENT_NONREGPARAM 15 /**< 14 bit NRPN address + 14 bit unsigned value */
60#define SNDRV_SEQ_EVENT_REGPARAM 16 /**< 14 bit RPN address + 14 bit unsigned value */
61
62/** synchronisation messages
63 * event data type = #snd_seq_ev_ctrl
64 */
65#define SNDRV_SEQ_EVENT_SONGPOS 20 /* Song Position Pointer with LSB and MSB values */
66#define SNDRV_SEQ_EVENT_SONGSEL 21 /* Song Select with song ID number */
67#define SNDRV_SEQ_EVENT_QFRAME 22 /* midi time code quarter frame */
68#define SNDRV_SEQ_EVENT_TIMESIGN 23 /* SMF Time Signature event */
69#define SNDRV_SEQ_EVENT_KEYSIGN 24 /* SMF Key Signature event */
70
71/** timer messages
72 * event data type = snd_seq_ev_queue_control
73 */
74#define SNDRV_SEQ_EVENT_START 30 /* midi Real Time Start message */
75#define SNDRV_SEQ_EVENT_CONTINUE 31 /* midi Real Time Continue message */
76#define SNDRV_SEQ_EVENT_STOP 32 /* midi Real Time Stop message */
77#define SNDRV_SEQ_EVENT_SETPOS_TICK 33 /* set tick queue position */
78#define SNDRV_SEQ_EVENT_SETPOS_TIME 34 /* set realtime queue position */
79#define SNDRV_SEQ_EVENT_TEMPO 35 /* (SMF) Tempo event */
80#define SNDRV_SEQ_EVENT_CLOCK 36 /* midi Real Time Clock message */
81#define SNDRV_SEQ_EVENT_TICK 37 /* midi Real Time Tick message */
82#define SNDRV_SEQ_EVENT_QUEUE_SKEW 38 /* skew queue tempo */
83
84/** others
85 * event data type = none
86 */
87#define SNDRV_SEQ_EVENT_TUNE_REQUEST 40 /* tune request */
88#define SNDRV_SEQ_EVENT_RESET 41 /* reset to power-on state */
89#define SNDRV_SEQ_EVENT_SENSING 42 /* "active sensing" event */
90
91/** echo back, kernel private messages
92 * event data type = any type
93 */
94#define SNDRV_SEQ_EVENT_ECHO 50 /* echo event */
95#define SNDRV_SEQ_EVENT_OSS 51 /* OSS raw event */
96
97/** system status messages (broadcast for subscribers)
98 * event data type = snd_seq_addr
99 */
100#define SNDRV_SEQ_EVENT_CLIENT_START 60 /* new client has connected */
101#define SNDRV_SEQ_EVENT_CLIENT_EXIT 61 /* client has left the system */
102#define SNDRV_SEQ_EVENT_CLIENT_CHANGE 62 /* client status/info has changed */
103#define SNDRV_SEQ_EVENT_PORT_START 63 /* new port was created */
104#define SNDRV_SEQ_EVENT_PORT_EXIT 64 /* port was deleted from system */
105#define SNDRV_SEQ_EVENT_PORT_CHANGE 65 /* port status/info has changed */
106
107/** port connection changes
108 * event data type = snd_seq_connect
109 */
110#define SNDRV_SEQ_EVENT_PORT_SUBSCRIBED 66 /* ports connected */
111#define SNDRV_SEQ_EVENT_PORT_UNSUBSCRIBED 67 /* ports disconnected */
112
113/* 70-89: synthesizer events - obsoleted */
114
115/** user-defined events with fixed length
116 * event data type = any
117 */
118#define SNDRV_SEQ_EVENT_USR0 90
119#define SNDRV_SEQ_EVENT_USR1 91
120#define SNDRV_SEQ_EVENT_USR2 92
121#define SNDRV_SEQ_EVENT_USR3 93
122#define SNDRV_SEQ_EVENT_USR4 94
123#define SNDRV_SEQ_EVENT_USR5 95
124#define SNDRV_SEQ_EVENT_USR6 96
125#define SNDRV_SEQ_EVENT_USR7 97
126#define SNDRV_SEQ_EVENT_USR8 98
127#define SNDRV_SEQ_EVENT_USR9 99
128
129/* 100-118: instrument layer - obsoleted */
130/* 119-129: reserved */
131
132/* 130-139: variable length events
133 * event data type = snd_seq_ev_ext
134 * (SNDRV_SEQ_EVENT_LENGTH_VARIABLE must be set)
135 */
136#define SNDRV_SEQ_EVENT_SYSEX 130 /* system exclusive data (variable length) */
137#define SNDRV_SEQ_EVENT_BOUNCE 131 /* error event */
138/* 132-134: reserved */
139#define SNDRV_SEQ_EVENT_USR_VAR0 135
140#define SNDRV_SEQ_EVENT_USR_VAR1 136
141#define SNDRV_SEQ_EVENT_USR_VAR2 137
142#define SNDRV_SEQ_EVENT_USR_VAR3 138
143#define SNDRV_SEQ_EVENT_USR_VAR4 139
144
145/* 150-151: kernel events with quote - DO NOT use in user clients */
146#define SNDRV_SEQ_EVENT_KERNEL_ERROR 150
147#define SNDRV_SEQ_EVENT_KERNEL_QUOTE 151 /* obsolete */
148
149/* 152-191: reserved */
150
151/* 192-254: hardware specific events */
152
153/* 255: special event */
154#define SNDRV_SEQ_EVENT_NONE 255
155
156
157typedef unsigned char snd_seq_event_type_t;
158
159/** event address */
160struct snd_seq_addr {
161 unsigned char client; /**< Client number: 0..255, 255 = broadcast to all clients */
162 unsigned char port; /**< Port within client: 0..255, 255 = broadcast to all ports */
163};
164
165/** port connection */
166struct snd_seq_connect {
167 struct snd_seq_addr sender;
168 struct snd_seq_addr dest;
169};
170
171
172#define SNDRV_SEQ_ADDRESS_UNKNOWN 253 /* unknown source */
173#define SNDRV_SEQ_ADDRESS_SUBSCRIBERS 254 /* send event to all subscribed ports */
174#define SNDRV_SEQ_ADDRESS_BROADCAST 255 /* send event to all queues/clients/ports/channels */
175#define SNDRV_SEQ_QUEUE_DIRECT 253 /* direct dispatch */
176
177 /* event mode flag - NOTE: only 8 bits available! */
178#define SNDRV_SEQ_TIME_STAMP_TICK (0<<0) /* timestamp in clock ticks */
179#define SNDRV_SEQ_TIME_STAMP_REAL (1<<0) /* timestamp in real time */
180#define SNDRV_SEQ_TIME_STAMP_MASK (1<<0)
181
182#define SNDRV_SEQ_TIME_MODE_ABS (0<<1) /* absolute timestamp */
183#define SNDRV_SEQ_TIME_MODE_REL (1<<1) /* relative to current time */
184#define SNDRV_SEQ_TIME_MODE_MASK (1<<1)
185
186#define SNDRV_SEQ_EVENT_LENGTH_FIXED (0<<2) /* fixed event size */
187#define SNDRV_SEQ_EVENT_LENGTH_VARIABLE (1<<2) /* variable event size */
188#define SNDRV_SEQ_EVENT_LENGTH_VARUSR (2<<2) /* variable event size - user memory space */
189#define SNDRV_SEQ_EVENT_LENGTH_MASK (3<<2)
190
191#define SNDRV_SEQ_PRIORITY_NORMAL (0<<4) /* normal priority */
192#define SNDRV_SEQ_PRIORITY_HIGH (1<<4) /* event should be processed before others */
193#define SNDRV_SEQ_PRIORITY_MASK (1<<4)
194
195
196 /* note event */
197struct snd_seq_ev_note {
198 unsigned char channel;
199 unsigned char note;
200 unsigned char velocity;
201 unsigned char off_velocity; /* only for SNDRV_SEQ_EVENT_NOTE */
202 unsigned int duration; /* only for SNDRV_SEQ_EVENT_NOTE */
203};
204
205 /* controller event */
206struct snd_seq_ev_ctrl {
207 unsigned char channel;
208 unsigned char unused1, unused2, unused3; /* pad */
209 unsigned int param;
210 signed int value;
211};
212
213 /* generic set of bytes (12x8 bit) */
214struct snd_seq_ev_raw8 {
215 unsigned char d[12]; /* 8 bit value */
216};
217
218 /* generic set of integers (3x32 bit) */
219struct snd_seq_ev_raw32 {
220 unsigned int d[3]; /* 32 bit value */
221};
222
223 /* external stored data */
224struct snd_seq_ev_ext {
225 unsigned int len; /* length of data */
226 void *ptr; /* pointer to data (note: maybe 64-bit) */
227} __attribute__((packed));
228
229struct snd_seq_result {
230 int event; /* processed event type */
231 int result;
232};
233
234
235struct snd_seq_real_time {
236 unsigned int tv_sec; /* seconds */
237 unsigned int tv_nsec; /* nanoseconds */
238};
239
240typedef unsigned int snd_seq_tick_time_t; /* midi ticks */
241
242union snd_seq_timestamp {
243 snd_seq_tick_time_t tick;
244 struct snd_seq_real_time time;
245};
246
247struct snd_seq_queue_skew {
248 unsigned int value;
249 unsigned int base;
250};
251
252 /* queue timer control */
253struct snd_seq_ev_queue_control {
254 unsigned char queue; /* affected queue */
255 unsigned char pad[3]; /* reserved */
256 union {
257 signed int value; /* affected value (e.g. tempo) */
258 union snd_seq_timestamp time; /* time */
259 unsigned int position; /* sync position */
260 struct snd_seq_queue_skew skew;
261 unsigned int d32[2];
262 unsigned char d8[8];
263 } param;
264};
265
266 /* quoted event - inside the kernel only */
267struct snd_seq_ev_quote {
268 struct snd_seq_addr origin; /* original sender */
269 unsigned short value; /* optional data */
270 struct snd_seq_event *event; /* quoted event */
271} __attribute__((packed));
272
273
274 /* sequencer event */
275struct snd_seq_event {
276 snd_seq_event_type_t type; /* event type */
277 unsigned char flags; /* event flags */
278 char tag;
279
280 unsigned char queue; /* schedule queue */
281 union snd_seq_timestamp time; /* schedule time */
282
283
284 struct snd_seq_addr source; /* source address */
285 struct snd_seq_addr dest; /* destination address */
286
287 union { /* event data... */
288 struct snd_seq_ev_note note;
289 struct snd_seq_ev_ctrl control;
290 struct snd_seq_ev_raw8 raw8;
291 struct snd_seq_ev_raw32 raw32;
292 struct snd_seq_ev_ext ext;
293 struct snd_seq_ev_queue_control queue;
294 union snd_seq_timestamp time;
295 struct snd_seq_addr addr;
296 struct snd_seq_connect connect;
297 struct snd_seq_result result;
298 struct snd_seq_ev_quote quote;
299 } data;
300};
301
302
303/*
304 * bounce event - stored as variable size data
305 */
306struct snd_seq_event_bounce {
307 int err;
308 struct snd_seq_event event;
309 /* external data follows here. */
310};
311
312#ifdef __KERNEL__
313 28
314/* helper macro */ 29/* helper macro */
315#define snd_seq_event_bounce_ext_data(ev) ((void*)((char *)(ev)->data.ext.ptr + sizeof(struct snd_seq_event_bounce))) 30#define snd_seq_event_bounce_ext_data(ev) ((void*)((char *)(ev)->data.ext.ptr + sizeof(struct snd_seq_event_bounce)))
@@ -368,311 +83,4 @@ struct snd_seq_event_bounce {
368/* queue sync port */ 83/* queue sync port */
369#define snd_seq_queue_sync_port(q) ((q) + 16) 84#define snd_seq_queue_sync_port(q) ((q) + 16)
370 85
371#endif /* __KERNEL__ */
372
373 /* system information */
374struct snd_seq_system_info {
375 int queues; /* maximum queues count */
376 int clients; /* maximum clients count */
377 int ports; /* maximum ports per client */
378 int channels; /* maximum channels per port */
379 int cur_clients; /* current clients */
380 int cur_queues; /* current queues */
381 char reserved[24];
382};
383
384
385 /* system running information */
386struct snd_seq_running_info {
387 unsigned char client; /* client id */
388 unsigned char big_endian; /* 1 = big-endian */
389 unsigned char cpu_mode; /* 4 = 32bit, 8 = 64bit */
390 unsigned char pad; /* reserved */
391 unsigned char reserved[12];
392};
393
394
395 /* known client numbers */
396#define SNDRV_SEQ_CLIENT_SYSTEM 0
397 /* internal client numbers */
398#define SNDRV_SEQ_CLIENT_DUMMY 14 /* midi through */
399#define SNDRV_SEQ_CLIENT_OSS 15 /* oss sequencer emulator */
400
401
402 /* client types */
403typedef int __bitwise snd_seq_client_type_t;
404#define NO_CLIENT ((__force snd_seq_client_type_t) 0)
405#define USER_CLIENT ((__force snd_seq_client_type_t) 1)
406#define KERNEL_CLIENT ((__force snd_seq_client_type_t) 2)
407
408 /* event filter flags */
409#define SNDRV_SEQ_FILTER_BROADCAST (1<<0) /* accept broadcast messages */
410#define SNDRV_SEQ_FILTER_MULTICAST (1<<1) /* accept multicast messages */
411#define SNDRV_SEQ_FILTER_BOUNCE (1<<2) /* accept bounce event in error */
412#define SNDRV_SEQ_FILTER_USE_EVENT (1<<31) /* use event filter */
413
414struct snd_seq_client_info {
415 int client; /* client number to inquire */
416 snd_seq_client_type_t type; /* client type */
417 char name[64]; /* client name */
418 unsigned int filter; /* filter flags */
419 unsigned char multicast_filter[8]; /* multicast filter bitmap */
420 unsigned char event_filter[32]; /* event filter bitmap */
421 int num_ports; /* RO: number of ports */
422 int event_lost; /* number of lost events */
423 char reserved[64]; /* for future use */
424};
425
426
427/* client pool size */
428struct snd_seq_client_pool {
429 int client; /* client number to inquire */
430 int output_pool; /* outgoing (write) pool size */
431 int input_pool; /* incoming (read) pool size */
432 int output_room; /* minimum free pool size for select/blocking mode */
433 int output_free; /* unused size */
434 int input_free; /* unused size */
435 char reserved[64];
436};
437
438
439/* Remove events by specified criteria */
440
441#define SNDRV_SEQ_REMOVE_INPUT (1<<0) /* Flush input queues */
442#define SNDRV_SEQ_REMOVE_OUTPUT (1<<1) /* Flush output queues */
443#define SNDRV_SEQ_REMOVE_DEST (1<<2) /* Restrict by destination q:client:port */
444#define SNDRV_SEQ_REMOVE_DEST_CHANNEL (1<<3) /* Restrict by channel */
445#define SNDRV_SEQ_REMOVE_TIME_BEFORE (1<<4) /* Restrict to before time */
446#define SNDRV_SEQ_REMOVE_TIME_AFTER (1<<5) /* Restrict to time or after */
447#define SNDRV_SEQ_REMOVE_TIME_TICK (1<<6) /* Time is in ticks */
448#define SNDRV_SEQ_REMOVE_EVENT_TYPE (1<<7) /* Restrict to event type */
449#define SNDRV_SEQ_REMOVE_IGNORE_OFF (1<<8) /* Do not flush off events */
450#define SNDRV_SEQ_REMOVE_TAG_MATCH (1<<9) /* Restrict to events with given tag */
451
452struct snd_seq_remove_events {
453 unsigned int remove_mode; /* Flags that determine what gets removed */
454
455 union snd_seq_timestamp time;
456
457 unsigned char queue; /* Queue for REMOVE_DEST */
458 struct snd_seq_addr dest; /* Address for REMOVE_DEST */
459 unsigned char channel; /* Channel for REMOVE_DEST */
460
461 int type; /* For REMOVE_EVENT_TYPE */
462 char tag; /* Tag for REMOVE_TAG */
463
464 int reserved[10]; /* To allow for future binary compatibility */
465
466};
467
468
469 /* known port numbers */
470#define SNDRV_SEQ_PORT_SYSTEM_TIMER 0
471#define SNDRV_SEQ_PORT_SYSTEM_ANNOUNCE 1
472
473 /* port capabilities (32 bits) */
474#define SNDRV_SEQ_PORT_CAP_READ (1<<0) /* readable from this port */
475#define SNDRV_SEQ_PORT_CAP_WRITE (1<<1) /* writable to this port */
476
477#define SNDRV_SEQ_PORT_CAP_SYNC_READ (1<<2)
478#define SNDRV_SEQ_PORT_CAP_SYNC_WRITE (1<<3)
479
480#define SNDRV_SEQ_PORT_CAP_DUPLEX (1<<4)
481
482#define SNDRV_SEQ_PORT_CAP_SUBS_READ (1<<5) /* allow read subscription */
483#define SNDRV_SEQ_PORT_CAP_SUBS_WRITE (1<<6) /* allow write subscription */
484#define SNDRV_SEQ_PORT_CAP_NO_EXPORT (1<<7) /* routing not allowed */
485
486 /* port type */
487#define SNDRV_SEQ_PORT_TYPE_SPECIFIC (1<<0) /* hardware specific */
488#define SNDRV_SEQ_PORT_TYPE_MIDI_GENERIC (1<<1) /* generic MIDI device */
489#define SNDRV_SEQ_PORT_TYPE_MIDI_GM (1<<2) /* General MIDI compatible device */
490#define SNDRV_SEQ_PORT_TYPE_MIDI_GS (1<<3) /* GS compatible device */
491#define SNDRV_SEQ_PORT_TYPE_MIDI_XG (1<<4) /* XG compatible device */
492#define SNDRV_SEQ_PORT_TYPE_MIDI_MT32 (1<<5) /* MT-32 compatible device */
493#define SNDRV_SEQ_PORT_TYPE_MIDI_GM2 (1<<6) /* General MIDI 2 compatible device */
494
495/* other standards...*/
496#define SNDRV_SEQ_PORT_TYPE_SYNTH (1<<10) /* Synth device (no MIDI compatible - direct wavetable) */
497#define SNDRV_SEQ_PORT_TYPE_DIRECT_SAMPLE (1<<11) /* Sampling device (support sample download) */
498#define SNDRV_SEQ_PORT_TYPE_SAMPLE (1<<12) /* Sampling device (sample can be downloaded at any time) */
499/*...*/
500#define SNDRV_SEQ_PORT_TYPE_HARDWARE (1<<16) /* driver for a hardware device */
501#define SNDRV_SEQ_PORT_TYPE_SOFTWARE (1<<17) /* implemented in software */
502#define SNDRV_SEQ_PORT_TYPE_SYNTHESIZER (1<<18) /* generates sound */
503#define SNDRV_SEQ_PORT_TYPE_PORT (1<<19) /* connects to other device(s) */
504#define SNDRV_SEQ_PORT_TYPE_APPLICATION (1<<20) /* application (sequencer/editor) */
505
506/* misc. conditioning flags */
507#define SNDRV_SEQ_PORT_FLG_GIVEN_PORT (1<<0)
508#define SNDRV_SEQ_PORT_FLG_TIMESTAMP (1<<1)
509#define SNDRV_SEQ_PORT_FLG_TIME_REAL (1<<2)
510
511struct snd_seq_port_info {
512 struct snd_seq_addr addr; /* client/port numbers */
513 char name[64]; /* port name */
514
515 unsigned int capability; /* port capability bits */
516 unsigned int type; /* port type bits */
517 int midi_channels; /* channels per MIDI port */
518 int midi_voices; /* voices per MIDI port */
519 int synth_voices; /* voices per SYNTH port */
520
521 int read_use; /* R/O: subscribers for output (from this port) */
522 int write_use; /* R/O: subscribers for input (to this port) */
523
524 void *kernel; /* reserved for kernel use (must be NULL) */
525 unsigned int flags; /* misc. conditioning */
526 unsigned char time_queue; /* queue # for timestamping */
527 char reserved[59]; /* for future use */
528};
529
530
531/* queue flags */
532#define SNDRV_SEQ_QUEUE_FLG_SYNC (1<<0) /* sync enabled */
533
534/* queue information */
535struct snd_seq_queue_info {
536 int queue; /* queue id */
537
538 /*
539 * security settings, only owner of this queue can start/stop timer
540 * etc. if the queue is locked for other clients
541 */
542 int owner; /* client id for owner of the queue */
543 unsigned locked:1; /* timing queue locked for other queues */
544 char name[64]; /* name of this queue */
545 unsigned int flags; /* flags */
546 char reserved[60]; /* for future use */
547
548};
549
550/* queue info/status */
551struct snd_seq_queue_status {
552 int queue; /* queue id */
553 int events; /* read-only - queue size */
554 snd_seq_tick_time_t tick; /* current tick */
555 struct snd_seq_real_time time; /* current time */
556 int running; /* running state of queue */
557 int flags; /* various flags */
558 char reserved[64]; /* for the future */
559};
560
561
562/* queue tempo */
563struct snd_seq_queue_tempo {
564 int queue; /* sequencer queue */
565 unsigned int tempo; /* current tempo, us/tick */
566 int ppq; /* time resolution, ticks/quarter */
567 unsigned int skew_value; /* queue skew */
568 unsigned int skew_base; /* queue skew base */
569 char reserved[24]; /* for the future */
570};
571
572
573/* sequencer timer sources */
574#define SNDRV_SEQ_TIMER_ALSA 0 /* ALSA timer */
575#define SNDRV_SEQ_TIMER_MIDI_CLOCK 1 /* Midi Clock (CLOCK event) */
576#define SNDRV_SEQ_TIMER_MIDI_TICK 2 /* Midi Timer Tick (TICK event) */
577
578/* queue timer info */
579struct snd_seq_queue_timer {
580 int queue; /* sequencer queue */
581 int type; /* source timer type */
582 union {
583 struct {
584 struct snd_timer_id id; /* ALSA's timer ID */
585 unsigned int resolution; /* resolution in Hz */
586 } alsa;
587 } u;
588 char reserved[64]; /* for the future use */
589};
590
591
592struct snd_seq_queue_client {
593 int queue; /* sequencer queue */
594 int client; /* sequencer client */
595 int used; /* queue is used with this client
596 (must be set for accepting events) */
597 /* per client watermarks */
598 char reserved[64]; /* for future use */
599};
600
601
602#define SNDRV_SEQ_PORT_SUBS_EXCLUSIVE (1<<0) /* exclusive connection */
603#define SNDRV_SEQ_PORT_SUBS_TIMESTAMP (1<<1)
604#define SNDRV_SEQ_PORT_SUBS_TIME_REAL (1<<2)
605
606struct snd_seq_port_subscribe {
607 struct snd_seq_addr sender; /* sender address */
608 struct snd_seq_addr dest; /* destination address */
609 unsigned int voices; /* number of voices to be allocated (0 = don't care) */
610 unsigned int flags; /* modes */
611 unsigned char queue; /* input time-stamp queue (optional) */
612 unsigned char pad[3]; /* reserved */
613 char reserved[64];
614};
615
616/* type of query subscription */
617#define SNDRV_SEQ_QUERY_SUBS_READ 0
618#define SNDRV_SEQ_QUERY_SUBS_WRITE 1
619
620struct snd_seq_query_subs {
621 struct snd_seq_addr root; /* client/port id to be searched */
622 int type; /* READ or WRITE */
623 int index; /* 0..N-1 */
624 int num_subs; /* R/O: number of subscriptions on this port */
625 struct snd_seq_addr addr; /* R/O: result */
626 unsigned char queue; /* R/O: result */
627 unsigned int flags; /* R/O: result */
628 char reserved[64]; /* for future use */
629};
630
631
632/*
633 * IOCTL commands
634 */
635
636#define SNDRV_SEQ_IOCTL_PVERSION _IOR ('S', 0x00, int)
637#define SNDRV_SEQ_IOCTL_CLIENT_ID _IOR ('S', 0x01, int)
638#define SNDRV_SEQ_IOCTL_SYSTEM_INFO _IOWR('S', 0x02, struct snd_seq_system_info)
639#define SNDRV_SEQ_IOCTL_RUNNING_MODE _IOWR('S', 0x03, struct snd_seq_running_info)
640
641#define SNDRV_SEQ_IOCTL_GET_CLIENT_INFO _IOWR('S', 0x10, struct snd_seq_client_info)
642#define SNDRV_SEQ_IOCTL_SET_CLIENT_INFO _IOW ('S', 0x11, struct snd_seq_client_info)
643
644#define SNDRV_SEQ_IOCTL_CREATE_PORT _IOWR('S', 0x20, struct snd_seq_port_info)
645#define SNDRV_SEQ_IOCTL_DELETE_PORT _IOW ('S', 0x21, struct snd_seq_port_info)
646#define SNDRV_SEQ_IOCTL_GET_PORT_INFO _IOWR('S', 0x22, struct snd_seq_port_info)
647#define SNDRV_SEQ_IOCTL_SET_PORT_INFO _IOW ('S', 0x23, struct snd_seq_port_info)
648
649#define SNDRV_SEQ_IOCTL_SUBSCRIBE_PORT _IOW ('S', 0x30, struct snd_seq_port_subscribe)
650#define SNDRV_SEQ_IOCTL_UNSUBSCRIBE_PORT _IOW ('S', 0x31, struct snd_seq_port_subscribe)
651
652#define SNDRV_SEQ_IOCTL_CREATE_QUEUE _IOWR('S', 0x32, struct snd_seq_queue_info)
653#define SNDRV_SEQ_IOCTL_DELETE_QUEUE _IOW ('S', 0x33, struct snd_seq_queue_info)
654#define SNDRV_SEQ_IOCTL_GET_QUEUE_INFO _IOWR('S', 0x34, struct snd_seq_queue_info)
655#define SNDRV_SEQ_IOCTL_SET_QUEUE_INFO _IOWR('S', 0x35, struct snd_seq_queue_info)
656#define SNDRV_SEQ_IOCTL_GET_NAMED_QUEUE _IOWR('S', 0x36, struct snd_seq_queue_info)
657#define SNDRV_SEQ_IOCTL_GET_QUEUE_STATUS _IOWR('S', 0x40, struct snd_seq_queue_status)
658#define SNDRV_SEQ_IOCTL_GET_QUEUE_TEMPO _IOWR('S', 0x41, struct snd_seq_queue_tempo)
659#define SNDRV_SEQ_IOCTL_SET_QUEUE_TEMPO _IOW ('S', 0x42, struct snd_seq_queue_tempo)
660#define SNDRV_SEQ_IOCTL_GET_QUEUE_OWNER _IOWR('S', 0x43, struct snd_seq_queue_owner)
661#define SNDRV_SEQ_IOCTL_SET_QUEUE_OWNER _IOW ('S', 0x44, struct snd_seq_queue_owner)
662#define SNDRV_SEQ_IOCTL_GET_QUEUE_TIMER _IOWR('S', 0x45, struct snd_seq_queue_timer)
663#define SNDRV_SEQ_IOCTL_SET_QUEUE_TIMER _IOW ('S', 0x46, struct snd_seq_queue_timer)
664/* XXX
665#define SNDRV_SEQ_IOCTL_GET_QUEUE_SYNC _IOWR('S', 0x53, struct snd_seq_queue_sync)
666#define SNDRV_SEQ_IOCTL_SET_QUEUE_SYNC _IOW ('S', 0x54, struct snd_seq_queue_sync)
667*/
668#define SNDRV_SEQ_IOCTL_GET_QUEUE_CLIENT _IOWR('S', 0x49, struct snd_seq_queue_client)
669#define SNDRV_SEQ_IOCTL_SET_QUEUE_CLIENT _IOW ('S', 0x4a, struct snd_seq_queue_client)
670#define SNDRV_SEQ_IOCTL_GET_CLIENT_POOL _IOWR('S', 0x4b, struct snd_seq_client_pool)
671#define SNDRV_SEQ_IOCTL_SET_CLIENT_POOL _IOW ('S', 0x4c, struct snd_seq_client_pool)
672#define SNDRV_SEQ_IOCTL_REMOVE_EVENTS _IOW ('S', 0x4e, struct snd_seq_remove_events)
673#define SNDRV_SEQ_IOCTL_QUERY_SUBS _IOWR('S', 0x4f, struct snd_seq_query_subs)
674#define SNDRV_SEQ_IOCTL_GET_SUBSCRIPTION _IOWR('S', 0x50, struct snd_seq_port_subscribe)
675#define SNDRV_SEQ_IOCTL_QUERY_NEXT_CLIENT _IOWR('S', 0x51, struct snd_seq_client_info)
676#define SNDRV_SEQ_IOCTL_QUERY_NEXT_PORT _IOWR('S', 0x52, struct snd_seq_port_info)
677
678#endif /* __SOUND_ASEQUENCER_H */ 86#endif /* __SOUND_ASEQUENCER_H */
diff --git a/include/sound/asound.h b/include/sound/asound.h
index dfe7d441748..c2dff5369d3 100644
--- a/include/sound/asound.h
+++ b/include/sound/asound.h
@@ -19,13 +19,9 @@
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 * 20 *
21 */ 21 */
22
23#ifndef __SOUND_ASOUND_H 22#ifndef __SOUND_ASOUND_H
24#define __SOUND_ASOUND_H 23#define __SOUND_ASOUND_H
25 24
26#include <linux/types.h>
27
28#ifdef __KERNEL__
29#include <linux/ioctl.h> 25#include <linux/ioctl.h>
30#include <linux/time.h> 26#include <linux/time.h>
31#include <asm/byteorder.h> 27#include <asm/byteorder.h>
@@ -40,934 +36,5 @@
40#endif 36#endif
41#endif 37#endif
42 38
43#endif /* __KERNEL__ **/ 39#include <uapi/sound/asound.h>
44
45/*
46 * protocol version
47 */
48
49#define SNDRV_PROTOCOL_VERSION(major, minor, subminor) (((major)<<16)|((minor)<<8)|(subminor))
50#define SNDRV_PROTOCOL_MAJOR(version) (((version)>>16)&0xffff)
51#define SNDRV_PROTOCOL_MINOR(version) (((version)>>8)&0xff)
52#define SNDRV_PROTOCOL_MICRO(version) ((version)&0xff)
53#define SNDRV_PROTOCOL_INCOMPATIBLE(kversion, uversion) \
54 (SNDRV_PROTOCOL_MAJOR(kversion) != SNDRV_PROTOCOL_MAJOR(uversion) || \
55 (SNDRV_PROTOCOL_MAJOR(kversion) == SNDRV_PROTOCOL_MAJOR(uversion) && \
56 SNDRV_PROTOCOL_MINOR(kversion) != SNDRV_PROTOCOL_MINOR(uversion)))
57
58/****************************************************************************
59 * *
60 * Digital audio interface *
61 * *
62 ****************************************************************************/
63
64struct snd_aes_iec958 {
65 unsigned char status[24]; /* AES/IEC958 channel status bits */
66 unsigned char subcode[147]; /* AES/IEC958 subcode bits */
67 unsigned char pad; /* nothing */
68 unsigned char dig_subframe[4]; /* AES/IEC958 subframe bits */
69};
70
71/****************************************************************************
72 * *
73 * CEA-861 Audio InfoFrame. Used in HDMI and DisplayPort *
74 * *
75 ****************************************************************************/
76
77struct snd_cea_861_aud_if {
78 unsigned char db1_ct_cc; /* coding type and channel count */
79 unsigned char db2_sf_ss; /* sample frequency and size */
80 unsigned char db3; /* not used, all zeros */
81 unsigned char db4_ca; /* channel allocation code */
82 unsigned char db5_dminh_lsv; /* downmix inhibit & level-shit values */
83};
84
85/****************************************************************************
86 * *
87 * Section for driver hardware dependent interface - /dev/snd/hw? *
88 * *
89 ****************************************************************************/
90
91#define SNDRV_HWDEP_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 1)
92
93enum {
94 SNDRV_HWDEP_IFACE_OPL2 = 0,
95 SNDRV_HWDEP_IFACE_OPL3,
96 SNDRV_HWDEP_IFACE_OPL4,
97 SNDRV_HWDEP_IFACE_SB16CSP, /* Creative Signal Processor */
98 SNDRV_HWDEP_IFACE_EMU10K1, /* FX8010 processor in EMU10K1 chip */
99 SNDRV_HWDEP_IFACE_YSS225, /* Yamaha FX processor */
100 SNDRV_HWDEP_IFACE_ICS2115, /* Wavetable synth */
101 SNDRV_HWDEP_IFACE_SSCAPE, /* Ensoniq SoundScape ISA card (MC68EC000) */
102 SNDRV_HWDEP_IFACE_VX, /* Digigram VX cards */
103 SNDRV_HWDEP_IFACE_MIXART, /* Digigram miXart cards */
104 SNDRV_HWDEP_IFACE_USX2Y, /* Tascam US122, US224 & US428 usb */
105 SNDRV_HWDEP_IFACE_EMUX_WAVETABLE, /* EmuX wavetable */
106 SNDRV_HWDEP_IFACE_BLUETOOTH, /* Bluetooth audio */
107 SNDRV_HWDEP_IFACE_USX2Y_PCM, /* Tascam US122, US224 & US428 rawusb pcm */
108 SNDRV_HWDEP_IFACE_PCXHR, /* Digigram PCXHR */
109 SNDRV_HWDEP_IFACE_SB_RC, /* SB Extigy/Audigy2NX remote control */
110 SNDRV_HWDEP_IFACE_HDA, /* HD-audio */
111 SNDRV_HWDEP_IFACE_USB_STREAM, /* direct access to usb stream */
112
113 /* Don't forget to change the following: */
114 SNDRV_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_USB_STREAM
115};
116
117struct snd_hwdep_info {
118 unsigned int device; /* WR: device number */
119 int card; /* R: card number */
120 unsigned char id[64]; /* ID (user selectable) */
121 unsigned char name[80]; /* hwdep name */
122 int iface; /* hwdep interface */
123 unsigned char reserved[64]; /* reserved for future */
124};
125
126/* generic DSP loader */
127struct snd_hwdep_dsp_status {
128 unsigned int version; /* R: driver-specific version */
129 unsigned char id[32]; /* R: driver-specific ID string */
130 unsigned int num_dsps; /* R: number of DSP images to transfer */
131 unsigned int dsp_loaded; /* R: bit flags indicating the loaded DSPs */
132 unsigned int chip_ready; /* R: 1 = initialization finished */
133 unsigned char reserved[16]; /* reserved for future use */
134};
135
136struct snd_hwdep_dsp_image {
137 unsigned int index; /* W: DSP index */
138 unsigned char name[64]; /* W: ID (e.g. file name) */
139 unsigned char __user *image; /* W: binary image */
140 size_t length; /* W: size of image in bytes */
141 unsigned long driver_data; /* W: driver-specific data */
142};
143
144#define SNDRV_HWDEP_IOCTL_PVERSION _IOR ('H', 0x00, int)
145#define SNDRV_HWDEP_IOCTL_INFO _IOR ('H', 0x01, struct snd_hwdep_info)
146#define SNDRV_HWDEP_IOCTL_DSP_STATUS _IOR('H', 0x02, struct snd_hwdep_dsp_status)
147#define SNDRV_HWDEP_IOCTL_DSP_LOAD _IOW('H', 0x03, struct snd_hwdep_dsp_image)
148
149/*****************************************************************************
150 * *
151 * Digital Audio (PCM) interface - /dev/snd/pcm?? *
152 * *
153 *****************************************************************************/
154
155#define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 10)
156
157typedef unsigned long snd_pcm_uframes_t;
158typedef signed long snd_pcm_sframes_t;
159
160enum {
161 SNDRV_PCM_CLASS_GENERIC = 0, /* standard mono or stereo device */
162 SNDRV_PCM_CLASS_MULTI, /* multichannel device */
163 SNDRV_PCM_CLASS_MODEM, /* software modem class */
164 SNDRV_PCM_CLASS_DIGITIZER, /* digitizer class */
165 /* Don't forget to change the following: */
166 SNDRV_PCM_CLASS_LAST = SNDRV_PCM_CLASS_DIGITIZER,
167};
168
169enum {
170 SNDRV_PCM_SUBCLASS_GENERIC_MIX = 0, /* mono or stereo subdevices are mixed together */
171 SNDRV_PCM_SUBCLASS_MULTI_MIX, /* multichannel subdevices are mixed together */
172 /* Don't forget to change the following: */
173 SNDRV_PCM_SUBCLASS_LAST = SNDRV_PCM_SUBCLASS_MULTI_MIX,
174};
175
176enum {
177 SNDRV_PCM_STREAM_PLAYBACK = 0,
178 SNDRV_PCM_STREAM_CAPTURE,
179 SNDRV_PCM_STREAM_LAST = SNDRV_PCM_STREAM_CAPTURE,
180};
181
182typedef int __bitwise snd_pcm_access_t;
183#define SNDRV_PCM_ACCESS_MMAP_INTERLEAVED ((__force snd_pcm_access_t) 0) /* interleaved mmap */
184#define SNDRV_PCM_ACCESS_MMAP_NONINTERLEAVED ((__force snd_pcm_access_t) 1) /* noninterleaved mmap */
185#define SNDRV_PCM_ACCESS_MMAP_COMPLEX ((__force snd_pcm_access_t) 2) /* complex mmap */
186#define SNDRV_PCM_ACCESS_RW_INTERLEAVED ((__force snd_pcm_access_t) 3) /* readi/writei */
187#define SNDRV_PCM_ACCESS_RW_NONINTERLEAVED ((__force snd_pcm_access_t) 4) /* readn/writen */
188#define SNDRV_PCM_ACCESS_LAST SNDRV_PCM_ACCESS_RW_NONINTERLEAVED
189
190typedef int __bitwise snd_pcm_format_t;
191#define SNDRV_PCM_FORMAT_S8 ((__force snd_pcm_format_t) 0)
192#define SNDRV_PCM_FORMAT_U8 ((__force snd_pcm_format_t) 1)
193#define SNDRV_PCM_FORMAT_S16_LE ((__force snd_pcm_format_t) 2)
194#define SNDRV_PCM_FORMAT_S16_BE ((__force snd_pcm_format_t) 3)
195#define SNDRV_PCM_FORMAT_U16_LE ((__force snd_pcm_format_t) 4)
196#define SNDRV_PCM_FORMAT_U16_BE ((__force snd_pcm_format_t) 5)
197#define SNDRV_PCM_FORMAT_S24_LE ((__force snd_pcm_format_t) 6) /* low three bytes */
198#define SNDRV_PCM_FORMAT_S24_BE ((__force snd_pcm_format_t) 7) /* low three bytes */
199#define SNDRV_PCM_FORMAT_U24_LE ((__force snd_pcm_format_t) 8) /* low three bytes */
200#define SNDRV_PCM_FORMAT_U24_BE ((__force snd_pcm_format_t) 9) /* low three bytes */
201#define SNDRV_PCM_FORMAT_S32_LE ((__force snd_pcm_format_t) 10)
202#define SNDRV_PCM_FORMAT_S32_BE ((__force snd_pcm_format_t) 11)
203#define SNDRV_PCM_FORMAT_U32_LE ((__force snd_pcm_format_t) 12)
204#define SNDRV_PCM_FORMAT_U32_BE ((__force snd_pcm_format_t) 13)
205#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 */
206#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 */
207#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 */
208#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 */
209#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE ((__force snd_pcm_format_t) 18) /* IEC-958 subframe, Little Endian */
210#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE ((__force snd_pcm_format_t) 19) /* IEC-958 subframe, Big Endian */
211#define SNDRV_PCM_FORMAT_MU_LAW ((__force snd_pcm_format_t) 20)
212#define SNDRV_PCM_FORMAT_A_LAW ((__force snd_pcm_format_t) 21)
213#define SNDRV_PCM_FORMAT_IMA_ADPCM ((__force snd_pcm_format_t) 22)
214#define SNDRV_PCM_FORMAT_MPEG ((__force snd_pcm_format_t) 23)
215#define SNDRV_PCM_FORMAT_GSM ((__force snd_pcm_format_t) 24)
216#define SNDRV_PCM_FORMAT_SPECIAL ((__force snd_pcm_format_t) 31)
217#define SNDRV_PCM_FORMAT_S24_3LE ((__force snd_pcm_format_t) 32) /* in three bytes */
218#define SNDRV_PCM_FORMAT_S24_3BE ((__force snd_pcm_format_t) 33) /* in three bytes */
219#define SNDRV_PCM_FORMAT_U24_3LE ((__force snd_pcm_format_t) 34) /* in three bytes */
220#define SNDRV_PCM_FORMAT_U24_3BE ((__force snd_pcm_format_t) 35) /* in three bytes */
221#define SNDRV_PCM_FORMAT_S20_3LE ((__force snd_pcm_format_t) 36) /* in three bytes */
222#define SNDRV_PCM_FORMAT_S20_3BE ((__force snd_pcm_format_t) 37) /* in three bytes */
223#define SNDRV_PCM_FORMAT_U20_3LE ((__force snd_pcm_format_t) 38) /* in three bytes */
224#define SNDRV_PCM_FORMAT_U20_3BE ((__force snd_pcm_format_t) 39) /* in three bytes */
225#define SNDRV_PCM_FORMAT_S18_3LE ((__force snd_pcm_format_t) 40) /* in three bytes */
226#define SNDRV_PCM_FORMAT_S18_3BE ((__force snd_pcm_format_t) 41) /* in three bytes */
227#define SNDRV_PCM_FORMAT_U18_3LE ((__force snd_pcm_format_t) 42) /* in three bytes */
228#define SNDRV_PCM_FORMAT_U18_3BE ((__force snd_pcm_format_t) 43) /* in three bytes */
229#define SNDRV_PCM_FORMAT_G723_24 ((__force snd_pcm_format_t) 44) /* 8 samples in 3 bytes */
230#define SNDRV_PCM_FORMAT_G723_24_1B ((__force snd_pcm_format_t) 45) /* 1 sample in 1 byte */
231#define SNDRV_PCM_FORMAT_G723_40 ((__force snd_pcm_format_t) 46) /* 8 Samples in 5 bytes */
232#define SNDRV_PCM_FORMAT_G723_40_1B ((__force snd_pcm_format_t) 47) /* 1 sample in 1 byte */
233#define SNDRV_PCM_FORMAT_LAST SNDRV_PCM_FORMAT_G723_40_1B
234
235#ifdef SNDRV_LITTLE_ENDIAN
236#define SNDRV_PCM_FORMAT_S16 SNDRV_PCM_FORMAT_S16_LE
237#define SNDRV_PCM_FORMAT_U16 SNDRV_PCM_FORMAT_U16_LE
238#define SNDRV_PCM_FORMAT_S24 SNDRV_PCM_FORMAT_S24_LE
239#define SNDRV_PCM_FORMAT_U24 SNDRV_PCM_FORMAT_U24_LE
240#define SNDRV_PCM_FORMAT_S32 SNDRV_PCM_FORMAT_S32_LE
241#define SNDRV_PCM_FORMAT_U32 SNDRV_PCM_FORMAT_U32_LE
242#define SNDRV_PCM_FORMAT_FLOAT SNDRV_PCM_FORMAT_FLOAT_LE
243#define SNDRV_PCM_FORMAT_FLOAT64 SNDRV_PCM_FORMAT_FLOAT64_LE
244#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE
245#endif
246#ifdef SNDRV_BIG_ENDIAN
247#define SNDRV_PCM_FORMAT_S16 SNDRV_PCM_FORMAT_S16_BE
248#define SNDRV_PCM_FORMAT_U16 SNDRV_PCM_FORMAT_U16_BE
249#define SNDRV_PCM_FORMAT_S24 SNDRV_PCM_FORMAT_S24_BE
250#define SNDRV_PCM_FORMAT_U24 SNDRV_PCM_FORMAT_U24_BE
251#define SNDRV_PCM_FORMAT_S32 SNDRV_PCM_FORMAT_S32_BE
252#define SNDRV_PCM_FORMAT_U32 SNDRV_PCM_FORMAT_U32_BE
253#define SNDRV_PCM_FORMAT_FLOAT SNDRV_PCM_FORMAT_FLOAT_BE
254#define SNDRV_PCM_FORMAT_FLOAT64 SNDRV_PCM_FORMAT_FLOAT64_BE
255#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE
256#endif
257
258typedef int __bitwise snd_pcm_subformat_t;
259#define SNDRV_PCM_SUBFORMAT_STD ((__force snd_pcm_subformat_t) 0)
260#define SNDRV_PCM_SUBFORMAT_LAST SNDRV_PCM_SUBFORMAT_STD
261
262#define SNDRV_PCM_INFO_MMAP 0x00000001 /* hardware supports mmap */
263#define SNDRV_PCM_INFO_MMAP_VALID 0x00000002 /* period data are valid during transfer */
264#define SNDRV_PCM_INFO_DOUBLE 0x00000004 /* Double buffering needed for PCM start/stop */
265#define SNDRV_PCM_INFO_BATCH 0x00000010 /* double buffering */
266#define SNDRV_PCM_INFO_INTERLEAVED 0x00000100 /* channels are interleaved */
267#define SNDRV_PCM_INFO_NONINTERLEAVED 0x00000200 /* channels are not interleaved */
268#define SNDRV_PCM_INFO_COMPLEX 0x00000400 /* complex frame organization (mmap only) */
269#define SNDRV_PCM_INFO_BLOCK_TRANSFER 0x00010000 /* hardware transfer block of samples */
270#define SNDRV_PCM_INFO_OVERRANGE 0x00020000 /* hardware supports ADC (capture) overrange detection */
271#define SNDRV_PCM_INFO_RESUME 0x00040000 /* hardware supports stream resume after suspend */
272#define SNDRV_PCM_INFO_PAUSE 0x00080000 /* pause ioctl is supported */
273#define SNDRV_PCM_INFO_HALF_DUPLEX 0x00100000 /* only half duplex */
274#define SNDRV_PCM_INFO_JOINT_DUPLEX 0x00200000 /* playback and capture stream are somewhat correlated */
275#define SNDRV_PCM_INFO_SYNC_START 0x00400000 /* pcm support some kind of sync go */
276#define SNDRV_PCM_INFO_NO_PERIOD_WAKEUP 0x00800000 /* period wakeup can be disabled */
277#define SNDRV_PCM_INFO_FIFO_IN_FRAMES 0x80000000 /* internal kernel flag - FIFO size is in frames */
278
279typedef int __bitwise snd_pcm_state_t;
280#define SNDRV_PCM_STATE_OPEN ((__force snd_pcm_state_t) 0) /* stream is open */
281#define SNDRV_PCM_STATE_SETUP ((__force snd_pcm_state_t) 1) /* stream has a setup */
282#define SNDRV_PCM_STATE_PREPARED ((__force snd_pcm_state_t) 2) /* stream is ready to start */
283#define SNDRV_PCM_STATE_RUNNING ((__force snd_pcm_state_t) 3) /* stream is running */
284#define SNDRV_PCM_STATE_XRUN ((__force snd_pcm_state_t) 4) /* stream reached an xrun */
285#define SNDRV_PCM_STATE_DRAINING ((__force snd_pcm_state_t) 5) /* stream is draining */
286#define SNDRV_PCM_STATE_PAUSED ((__force snd_pcm_state_t) 6) /* stream is paused */
287#define SNDRV_PCM_STATE_SUSPENDED ((__force snd_pcm_state_t) 7) /* hardware is suspended */
288#define SNDRV_PCM_STATE_DISCONNECTED ((__force snd_pcm_state_t) 8) /* hardware is disconnected */
289#define SNDRV_PCM_STATE_LAST SNDRV_PCM_STATE_DISCONNECTED
290
291enum {
292 SNDRV_PCM_MMAP_OFFSET_DATA = 0x00000000,
293 SNDRV_PCM_MMAP_OFFSET_STATUS = 0x80000000,
294 SNDRV_PCM_MMAP_OFFSET_CONTROL = 0x81000000,
295};
296
297union snd_pcm_sync_id {
298 unsigned char id[16];
299 unsigned short id16[8];
300 unsigned int id32[4];
301};
302
303struct snd_pcm_info {
304 unsigned int device; /* RO/WR (control): device number */
305 unsigned int subdevice; /* RO/WR (control): subdevice number */
306 int stream; /* RO/WR (control): stream direction */
307 int card; /* R: card number */
308 unsigned char id[64]; /* ID (user selectable) */
309 unsigned char name[80]; /* name of this device */
310 unsigned char subname[32]; /* subdevice name */
311 int dev_class; /* SNDRV_PCM_CLASS_* */
312 int dev_subclass; /* SNDRV_PCM_SUBCLASS_* */
313 unsigned int subdevices_count;
314 unsigned int subdevices_avail;
315 union snd_pcm_sync_id sync; /* hardware synchronization ID */
316 unsigned char reserved[64]; /* reserved for future... */
317};
318
319typedef int snd_pcm_hw_param_t;
320#define SNDRV_PCM_HW_PARAM_ACCESS 0 /* Access type */
321#define SNDRV_PCM_HW_PARAM_FORMAT 1 /* Format */
322#define SNDRV_PCM_HW_PARAM_SUBFORMAT 2 /* Subformat */
323#define SNDRV_PCM_HW_PARAM_FIRST_MASK SNDRV_PCM_HW_PARAM_ACCESS
324#define SNDRV_PCM_HW_PARAM_LAST_MASK SNDRV_PCM_HW_PARAM_SUBFORMAT
325
326#define SNDRV_PCM_HW_PARAM_SAMPLE_BITS 8 /* Bits per sample */
327#define SNDRV_PCM_HW_PARAM_FRAME_BITS 9 /* Bits per frame */
328#define SNDRV_PCM_HW_PARAM_CHANNELS 10 /* Channels */
329#define SNDRV_PCM_HW_PARAM_RATE 11 /* Approx rate */
330#define SNDRV_PCM_HW_PARAM_PERIOD_TIME 12 /* Approx distance between
331 * interrupts in us
332 */
333#define SNDRV_PCM_HW_PARAM_PERIOD_SIZE 13 /* Approx frames between
334 * interrupts
335 */
336#define SNDRV_PCM_HW_PARAM_PERIOD_BYTES 14 /* Approx bytes between
337 * interrupts
338 */
339#define SNDRV_PCM_HW_PARAM_PERIODS 15 /* Approx interrupts per
340 * buffer
341 */
342#define SNDRV_PCM_HW_PARAM_BUFFER_TIME 16 /* Approx duration of buffer
343 * in us
344 */
345#define SNDRV_PCM_HW_PARAM_BUFFER_SIZE 17 /* Size of buffer in frames */
346#define SNDRV_PCM_HW_PARAM_BUFFER_BYTES 18 /* Size of buffer in bytes */
347#define SNDRV_PCM_HW_PARAM_TICK_TIME 19 /* Approx tick duration in us */
348#define SNDRV_PCM_HW_PARAM_FIRST_INTERVAL SNDRV_PCM_HW_PARAM_SAMPLE_BITS
349#define SNDRV_PCM_HW_PARAM_LAST_INTERVAL SNDRV_PCM_HW_PARAM_TICK_TIME
350
351#define SNDRV_PCM_HW_PARAMS_NORESAMPLE (1<<0) /* avoid rate resampling */
352#define SNDRV_PCM_HW_PARAMS_EXPORT_BUFFER (1<<1) /* export buffer */
353#define SNDRV_PCM_HW_PARAMS_NO_PERIOD_WAKEUP (1<<2) /* disable period wakeups */
354
355struct snd_interval {
356 unsigned int min, max;
357 unsigned int openmin:1,
358 openmax:1,
359 integer:1,
360 empty:1;
361};
362
363#define SNDRV_MASK_MAX 256
364
365struct snd_mask {
366 __u32 bits[(SNDRV_MASK_MAX+31)/32];
367};
368
369struct snd_pcm_hw_params {
370 unsigned int flags;
371 struct snd_mask masks[SNDRV_PCM_HW_PARAM_LAST_MASK -
372 SNDRV_PCM_HW_PARAM_FIRST_MASK + 1];
373 struct snd_mask mres[5]; /* reserved masks */
374 struct snd_interval intervals[SNDRV_PCM_HW_PARAM_LAST_INTERVAL -
375 SNDRV_PCM_HW_PARAM_FIRST_INTERVAL + 1];
376 struct snd_interval ires[9]; /* reserved intervals */
377 unsigned int rmask; /* W: requested masks */
378 unsigned int cmask; /* R: changed masks */
379 unsigned int info; /* R: Info flags for returned setup */
380 unsigned int msbits; /* R: used most significant bits */
381 unsigned int rate_num; /* R: rate numerator */
382 unsigned int rate_den; /* R: rate denominator */
383 snd_pcm_uframes_t fifo_size; /* R: chip FIFO size in frames */
384 unsigned char reserved[64]; /* reserved for future */
385};
386
387enum {
388 SNDRV_PCM_TSTAMP_NONE = 0,
389 SNDRV_PCM_TSTAMP_ENABLE,
390 SNDRV_PCM_TSTAMP_LAST = SNDRV_PCM_TSTAMP_ENABLE,
391};
392
393struct snd_pcm_sw_params {
394 int tstamp_mode; /* timestamp mode */
395 unsigned int period_step;
396 unsigned int sleep_min; /* min ticks to sleep */
397 snd_pcm_uframes_t avail_min; /* min avail frames for wakeup */
398 snd_pcm_uframes_t xfer_align; /* obsolete: xfer size need to be a multiple */
399 snd_pcm_uframes_t start_threshold; /* min hw_avail frames for automatic start */
400 snd_pcm_uframes_t stop_threshold; /* min avail frames for automatic stop */
401 snd_pcm_uframes_t silence_threshold; /* min distance from noise for silence filling */
402 snd_pcm_uframes_t silence_size; /* silence block size */
403 snd_pcm_uframes_t boundary; /* pointers wrap point */
404 unsigned char reserved[64]; /* reserved for future */
405};
406
407struct snd_pcm_channel_info {
408 unsigned int channel;
409 __kernel_off_t offset; /* mmap offset */
410 unsigned int first; /* offset to first sample in bits */
411 unsigned int step; /* samples distance in bits */
412};
413
414struct snd_pcm_status {
415 snd_pcm_state_t state; /* stream state */
416 struct timespec trigger_tstamp; /* time when stream was started/stopped/paused */
417 struct timespec tstamp; /* reference timestamp */
418 snd_pcm_uframes_t appl_ptr; /* appl ptr */
419 snd_pcm_uframes_t hw_ptr; /* hw ptr */
420 snd_pcm_sframes_t delay; /* current delay in frames */
421 snd_pcm_uframes_t avail; /* number of frames available */
422 snd_pcm_uframes_t avail_max; /* max frames available on hw since last status */
423 snd_pcm_uframes_t overrange; /* count of ADC (capture) overrange detections from last status */
424 snd_pcm_state_t suspended_state; /* suspended stream state */
425 unsigned char reserved[60]; /* must be filled with zero */
426};
427
428struct snd_pcm_mmap_status {
429 snd_pcm_state_t state; /* RO: state - SNDRV_PCM_STATE_XXXX */
430 int pad1; /* Needed for 64 bit alignment */
431 snd_pcm_uframes_t hw_ptr; /* RO: hw ptr (0...boundary-1) */
432 struct timespec tstamp; /* Timestamp */
433 snd_pcm_state_t suspended_state; /* RO: suspended stream state */
434};
435
436struct snd_pcm_mmap_control {
437 snd_pcm_uframes_t appl_ptr; /* RW: appl ptr (0...boundary-1) */
438 snd_pcm_uframes_t avail_min; /* RW: min available frames for wakeup */
439};
440
441#define SNDRV_PCM_SYNC_PTR_HWSYNC (1<<0) /* execute hwsync */
442#define SNDRV_PCM_SYNC_PTR_APPL (1<<1) /* get appl_ptr from driver (r/w op) */
443#define SNDRV_PCM_SYNC_PTR_AVAIL_MIN (1<<2) /* get avail_min from driver */
444
445struct snd_pcm_sync_ptr {
446 unsigned int flags;
447 union {
448 struct snd_pcm_mmap_status status;
449 unsigned char reserved[64];
450 } s;
451 union {
452 struct snd_pcm_mmap_control control;
453 unsigned char reserved[64];
454 } c;
455};
456
457struct snd_xferi {
458 snd_pcm_sframes_t result;
459 void __user *buf;
460 snd_pcm_uframes_t frames;
461};
462
463struct snd_xfern {
464 snd_pcm_sframes_t result;
465 void __user * __user *bufs;
466 snd_pcm_uframes_t frames;
467};
468
469enum {
470 SNDRV_PCM_TSTAMP_TYPE_GETTIMEOFDAY = 0, /* gettimeofday equivalent */
471 SNDRV_PCM_TSTAMP_TYPE_MONOTONIC, /* posix_clock_monotonic equivalent */
472 SNDRV_PCM_TSTAMP_TYPE_LAST = SNDRV_PCM_TSTAMP_TYPE_MONOTONIC,
473};
474
475/* channel positions */
476enum {
477 SNDRV_CHMAP_UNKNOWN = 0,
478 SNDRV_CHMAP_NA, /* N/A, silent */
479 SNDRV_CHMAP_MONO, /* mono stream */
480 /* this follows the alsa-lib mixer channel value + 3 */
481 SNDRV_CHMAP_FL, /* front left */
482 SNDRV_CHMAP_FR, /* front right */
483 SNDRV_CHMAP_RL, /* rear left */
484 SNDRV_CHMAP_RR, /* rear right */
485 SNDRV_CHMAP_FC, /* front center */
486 SNDRV_CHMAP_LFE, /* LFE */
487 SNDRV_CHMAP_SL, /* side left */
488 SNDRV_CHMAP_SR, /* side right */
489 SNDRV_CHMAP_RC, /* rear center */
490 /* new definitions */
491 SNDRV_CHMAP_FLC, /* front left center */
492 SNDRV_CHMAP_FRC, /* front right center */
493 SNDRV_CHMAP_RLC, /* rear left center */
494 SNDRV_CHMAP_RRC, /* rear right center */
495 SNDRV_CHMAP_FLW, /* front left wide */
496 SNDRV_CHMAP_FRW, /* front right wide */
497 SNDRV_CHMAP_FLH, /* front left high */
498 SNDRV_CHMAP_FCH, /* front center high */
499 SNDRV_CHMAP_FRH, /* front right high */
500 SNDRV_CHMAP_TC, /* top center */
501 SNDRV_CHMAP_TFL, /* top front left */
502 SNDRV_CHMAP_TFR, /* top front right */
503 SNDRV_CHMAP_TFC, /* top front center */
504 SNDRV_CHMAP_TRL, /* top rear left */
505 SNDRV_CHMAP_TRR, /* top rear right */
506 SNDRV_CHMAP_TRC, /* top rear center */
507 SNDRV_CHMAP_LAST = SNDRV_CHMAP_TRC,
508};
509
510#define SNDRV_CHMAP_POSITION_MASK 0xffff
511#define SNDRV_CHMAP_PHASE_INVERSE (0x01 << 16)
512#define SNDRV_CHMAP_DRIVER_SPEC (0x02 << 16)
513
514#define SNDRV_PCM_IOCTL_PVERSION _IOR('A', 0x00, int)
515#define SNDRV_PCM_IOCTL_INFO _IOR('A', 0x01, struct snd_pcm_info)
516#define SNDRV_PCM_IOCTL_TSTAMP _IOW('A', 0x02, int)
517#define SNDRV_PCM_IOCTL_TTSTAMP _IOW('A', 0x03, int)
518#define SNDRV_PCM_IOCTL_HW_REFINE _IOWR('A', 0x10, struct snd_pcm_hw_params)
519#define SNDRV_PCM_IOCTL_HW_PARAMS _IOWR('A', 0x11, struct snd_pcm_hw_params)
520#define SNDRV_PCM_IOCTL_HW_FREE _IO('A', 0x12)
521#define SNDRV_PCM_IOCTL_SW_PARAMS _IOWR('A', 0x13, struct snd_pcm_sw_params)
522#define SNDRV_PCM_IOCTL_STATUS _IOR('A', 0x20, struct snd_pcm_status)
523#define SNDRV_PCM_IOCTL_DELAY _IOR('A', 0x21, snd_pcm_sframes_t)
524#define SNDRV_PCM_IOCTL_HWSYNC _IO('A', 0x22)
525#define SNDRV_PCM_IOCTL_SYNC_PTR _IOWR('A', 0x23, struct snd_pcm_sync_ptr)
526#define SNDRV_PCM_IOCTL_CHANNEL_INFO _IOR('A', 0x32, struct snd_pcm_channel_info)
527#define SNDRV_PCM_IOCTL_PREPARE _IO('A', 0x40)
528#define SNDRV_PCM_IOCTL_RESET _IO('A', 0x41)
529#define SNDRV_PCM_IOCTL_START _IO('A', 0x42)
530#define SNDRV_PCM_IOCTL_DROP _IO('A', 0x43)
531#define SNDRV_PCM_IOCTL_DRAIN _IO('A', 0x44)
532#define SNDRV_PCM_IOCTL_PAUSE _IOW('A', 0x45, int)
533#define SNDRV_PCM_IOCTL_REWIND _IOW('A', 0x46, snd_pcm_uframes_t)
534#define SNDRV_PCM_IOCTL_RESUME _IO('A', 0x47)
535#define SNDRV_PCM_IOCTL_XRUN _IO('A', 0x48)
536#define SNDRV_PCM_IOCTL_FORWARD _IOW('A', 0x49, snd_pcm_uframes_t)
537#define SNDRV_PCM_IOCTL_WRITEI_FRAMES _IOW('A', 0x50, struct snd_xferi)
538#define SNDRV_PCM_IOCTL_READI_FRAMES _IOR('A', 0x51, struct snd_xferi)
539#define SNDRV_PCM_IOCTL_WRITEN_FRAMES _IOW('A', 0x52, struct snd_xfern)
540#define SNDRV_PCM_IOCTL_READN_FRAMES _IOR('A', 0x53, struct snd_xfern)
541#define SNDRV_PCM_IOCTL_LINK _IOW('A', 0x60, int)
542#define SNDRV_PCM_IOCTL_UNLINK _IO('A', 0x61)
543
544/*****************************************************************************
545 * *
546 * MIDI v1.0 interface *
547 * *
548 *****************************************************************************/
549
550/*
551 * Raw MIDI section - /dev/snd/midi??
552 */
553
554#define SNDRV_RAWMIDI_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 0)
555
556enum {
557 SNDRV_RAWMIDI_STREAM_OUTPUT = 0,
558 SNDRV_RAWMIDI_STREAM_INPUT,
559 SNDRV_RAWMIDI_STREAM_LAST = SNDRV_RAWMIDI_STREAM_INPUT,
560};
561
562#define SNDRV_RAWMIDI_INFO_OUTPUT 0x00000001
563#define SNDRV_RAWMIDI_INFO_INPUT 0x00000002
564#define SNDRV_RAWMIDI_INFO_DUPLEX 0x00000004
565
566struct snd_rawmidi_info {
567 unsigned int device; /* RO/WR (control): device number */
568 unsigned int subdevice; /* RO/WR (control): subdevice number */
569 int stream; /* WR: stream */
570 int card; /* R: card number */
571 unsigned int flags; /* SNDRV_RAWMIDI_INFO_XXXX */
572 unsigned char id[64]; /* ID (user selectable) */
573 unsigned char name[80]; /* name of device */
574 unsigned char subname[32]; /* name of active or selected subdevice */
575 unsigned int subdevices_count;
576 unsigned int subdevices_avail;
577 unsigned char reserved[64]; /* reserved for future use */
578};
579
580struct snd_rawmidi_params {
581 int stream;
582 size_t buffer_size; /* queue size in bytes */
583 size_t avail_min; /* minimum avail bytes for wakeup */
584 unsigned int no_active_sensing: 1; /* do not send active sensing byte in close() */
585 unsigned char reserved[16]; /* reserved for future use */
586};
587
588struct snd_rawmidi_status {
589 int stream;
590 struct timespec tstamp; /* Timestamp */
591 size_t avail; /* available bytes */
592 size_t xruns; /* count of overruns since last status (in bytes) */
593 unsigned char reserved[16]; /* reserved for future use */
594};
595
596#define SNDRV_RAWMIDI_IOCTL_PVERSION _IOR('W', 0x00, int)
597#define SNDRV_RAWMIDI_IOCTL_INFO _IOR('W', 0x01, struct snd_rawmidi_info)
598#define SNDRV_RAWMIDI_IOCTL_PARAMS _IOWR('W', 0x10, struct snd_rawmidi_params)
599#define SNDRV_RAWMIDI_IOCTL_STATUS _IOWR('W', 0x20, struct snd_rawmidi_status)
600#define SNDRV_RAWMIDI_IOCTL_DROP _IOW('W', 0x30, int)
601#define SNDRV_RAWMIDI_IOCTL_DRAIN _IOW('W', 0x31, int)
602
603/*
604 * Timer section - /dev/snd/timer
605 */
606
607#define SNDRV_TIMER_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 6)
608
609enum {
610 SNDRV_TIMER_CLASS_NONE = -1,
611 SNDRV_TIMER_CLASS_SLAVE = 0,
612 SNDRV_TIMER_CLASS_GLOBAL,
613 SNDRV_TIMER_CLASS_CARD,
614 SNDRV_TIMER_CLASS_PCM,
615 SNDRV_TIMER_CLASS_LAST = SNDRV_TIMER_CLASS_PCM,
616};
617
618/* slave timer classes */
619enum {
620 SNDRV_TIMER_SCLASS_NONE = 0,
621 SNDRV_TIMER_SCLASS_APPLICATION,
622 SNDRV_TIMER_SCLASS_SEQUENCER, /* alias */
623 SNDRV_TIMER_SCLASS_OSS_SEQUENCER, /* alias */
624 SNDRV_TIMER_SCLASS_LAST = SNDRV_TIMER_SCLASS_OSS_SEQUENCER,
625};
626
627/* global timers (device member) */
628#define SNDRV_TIMER_GLOBAL_SYSTEM 0
629#define SNDRV_TIMER_GLOBAL_RTC 1
630#define SNDRV_TIMER_GLOBAL_HPET 2
631#define SNDRV_TIMER_GLOBAL_HRTIMER 3
632
633/* info flags */
634#define SNDRV_TIMER_FLG_SLAVE (1<<0) /* cannot be controlled */
635
636struct snd_timer_id {
637 int dev_class;
638 int dev_sclass;
639 int card;
640 int device;
641 int subdevice;
642};
643
644struct snd_timer_ginfo {
645 struct snd_timer_id tid; /* requested timer ID */
646 unsigned int flags; /* timer flags - SNDRV_TIMER_FLG_* */
647 int card; /* card number */
648 unsigned char id[64]; /* timer identification */
649 unsigned char name[80]; /* timer name */
650 unsigned long reserved0; /* reserved for future use */
651 unsigned long resolution; /* average period resolution in ns */
652 unsigned long resolution_min; /* minimal period resolution in ns */
653 unsigned long resolution_max; /* maximal period resolution in ns */
654 unsigned int clients; /* active timer clients */
655 unsigned char reserved[32];
656};
657
658struct snd_timer_gparams {
659 struct snd_timer_id tid; /* requested timer ID */
660 unsigned long period_num; /* requested precise period duration (in seconds) - numerator */
661 unsigned long period_den; /* requested precise period duration (in seconds) - denominator */
662 unsigned char reserved[32];
663};
664
665struct snd_timer_gstatus {
666 struct snd_timer_id tid; /* requested timer ID */
667 unsigned long resolution; /* current period resolution in ns */
668 unsigned long resolution_num; /* precise current period resolution (in seconds) - numerator */
669 unsigned long resolution_den; /* precise current period resolution (in seconds) - denominator */
670 unsigned char reserved[32];
671};
672
673struct snd_timer_select {
674 struct snd_timer_id id; /* bind to timer ID */
675 unsigned char reserved[32]; /* reserved */
676};
677
678struct snd_timer_info {
679 unsigned int flags; /* timer flags - SNDRV_TIMER_FLG_* */
680 int card; /* card number */
681 unsigned char id[64]; /* timer identificator */
682 unsigned char name[80]; /* timer name */
683 unsigned long reserved0; /* reserved for future use */
684 unsigned long resolution; /* average period resolution in ns */
685 unsigned char reserved[64]; /* reserved */
686};
687
688#define SNDRV_TIMER_PSFLG_AUTO (1<<0) /* auto start, otherwise one-shot */
689#define SNDRV_TIMER_PSFLG_EXCLUSIVE (1<<1) /* exclusive use, precise start/stop/pause/continue */
690#define SNDRV_TIMER_PSFLG_EARLY_EVENT (1<<2) /* write early event to the poll queue */
691
692struct snd_timer_params {
693 unsigned int flags; /* flags - SNDRV_MIXER_PSFLG_* */
694 unsigned int ticks; /* requested resolution in ticks */
695 unsigned int queue_size; /* total size of queue (32-1024) */
696 unsigned int reserved0; /* reserved, was: failure locations */
697 unsigned int filter; /* event filter (bitmask of SNDRV_TIMER_EVENT_*) */
698 unsigned char reserved[60]; /* reserved */
699};
700
701struct snd_timer_status {
702 struct timespec tstamp; /* Timestamp - last update */
703 unsigned int resolution; /* current period resolution in ns */
704 unsigned int lost; /* counter of master tick lost */
705 unsigned int overrun; /* count of read queue overruns */
706 unsigned int queue; /* used queue size */
707 unsigned char reserved[64]; /* reserved */
708};
709
710#define SNDRV_TIMER_IOCTL_PVERSION _IOR('T', 0x00, int)
711#define SNDRV_TIMER_IOCTL_NEXT_DEVICE _IOWR('T', 0x01, struct snd_timer_id)
712#define SNDRV_TIMER_IOCTL_TREAD _IOW('T', 0x02, int)
713#define SNDRV_TIMER_IOCTL_GINFO _IOWR('T', 0x03, struct snd_timer_ginfo)
714#define SNDRV_TIMER_IOCTL_GPARAMS _IOW('T', 0x04, struct snd_timer_gparams)
715#define SNDRV_TIMER_IOCTL_GSTATUS _IOWR('T', 0x05, struct snd_timer_gstatus)
716#define SNDRV_TIMER_IOCTL_SELECT _IOW('T', 0x10, struct snd_timer_select)
717#define SNDRV_TIMER_IOCTL_INFO _IOR('T', 0x11, struct snd_timer_info)
718#define SNDRV_TIMER_IOCTL_PARAMS _IOW('T', 0x12, struct snd_timer_params)
719#define SNDRV_TIMER_IOCTL_STATUS _IOR('T', 0x14, struct snd_timer_status)
720/* The following four ioctls are changed since 1.0.9 due to confliction */
721#define SNDRV_TIMER_IOCTL_START _IO('T', 0xa0)
722#define SNDRV_TIMER_IOCTL_STOP _IO('T', 0xa1)
723#define SNDRV_TIMER_IOCTL_CONTINUE _IO('T', 0xa2)
724#define SNDRV_TIMER_IOCTL_PAUSE _IO('T', 0xa3)
725
726struct snd_timer_read {
727 unsigned int resolution;
728 unsigned int ticks;
729};
730
731enum {
732 SNDRV_TIMER_EVENT_RESOLUTION = 0, /* val = resolution in ns */
733 SNDRV_TIMER_EVENT_TICK, /* val = ticks */
734 SNDRV_TIMER_EVENT_START, /* val = resolution in ns */
735 SNDRV_TIMER_EVENT_STOP, /* val = 0 */
736 SNDRV_TIMER_EVENT_CONTINUE, /* val = resolution in ns */
737 SNDRV_TIMER_EVENT_PAUSE, /* val = 0 */
738 SNDRV_TIMER_EVENT_EARLY, /* val = 0, early event */
739 SNDRV_TIMER_EVENT_SUSPEND, /* val = 0 */
740 SNDRV_TIMER_EVENT_RESUME, /* val = resolution in ns */
741 /* master timer events for slave timer instances */
742 SNDRV_TIMER_EVENT_MSTART = SNDRV_TIMER_EVENT_START + 10,
743 SNDRV_TIMER_EVENT_MSTOP = SNDRV_TIMER_EVENT_STOP + 10,
744 SNDRV_TIMER_EVENT_MCONTINUE = SNDRV_TIMER_EVENT_CONTINUE + 10,
745 SNDRV_TIMER_EVENT_MPAUSE = SNDRV_TIMER_EVENT_PAUSE + 10,
746 SNDRV_TIMER_EVENT_MSUSPEND = SNDRV_TIMER_EVENT_SUSPEND + 10,
747 SNDRV_TIMER_EVENT_MRESUME = SNDRV_TIMER_EVENT_RESUME + 10,
748};
749
750struct snd_timer_tread {
751 int event;
752 struct timespec tstamp;
753 unsigned int val;
754};
755
756/****************************************************************************
757 * *
758 * Section for driver control interface - /dev/snd/control? *
759 * *
760 ****************************************************************************/
761
762#define SNDRV_CTL_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 7)
763
764struct snd_ctl_card_info {
765 int card; /* card number */
766 int pad; /* reserved for future (was type) */
767 unsigned char id[16]; /* ID of card (user selectable) */
768 unsigned char driver[16]; /* Driver name */
769 unsigned char name[32]; /* Short name of soundcard */
770 unsigned char longname[80]; /* name + info text about soundcard */
771 unsigned char reserved_[16]; /* reserved for future (was ID of mixer) */
772 unsigned char mixername[80]; /* visual mixer identification */
773 unsigned char components[128]; /* card components / fine identification, delimited with one space (AC97 etc..) */
774};
775
776typedef int __bitwise snd_ctl_elem_type_t;
777#define SNDRV_CTL_ELEM_TYPE_NONE ((__force snd_ctl_elem_type_t) 0) /* invalid */
778#define SNDRV_CTL_ELEM_TYPE_BOOLEAN ((__force snd_ctl_elem_type_t) 1) /* boolean type */
779#define SNDRV_CTL_ELEM_TYPE_INTEGER ((__force snd_ctl_elem_type_t) 2) /* integer type */
780#define SNDRV_CTL_ELEM_TYPE_ENUMERATED ((__force snd_ctl_elem_type_t) 3) /* enumerated type */
781#define SNDRV_CTL_ELEM_TYPE_BYTES ((__force snd_ctl_elem_type_t) 4) /* byte array */
782#define SNDRV_CTL_ELEM_TYPE_IEC958 ((__force snd_ctl_elem_type_t) 5) /* IEC958 (S/PDIF) setup */
783#define SNDRV_CTL_ELEM_TYPE_INTEGER64 ((__force snd_ctl_elem_type_t) 6) /* 64-bit integer type */
784#define SNDRV_CTL_ELEM_TYPE_LAST SNDRV_CTL_ELEM_TYPE_INTEGER64
785
786typedef int __bitwise snd_ctl_elem_iface_t;
787#define SNDRV_CTL_ELEM_IFACE_CARD ((__force snd_ctl_elem_iface_t) 0) /* global control */
788#define SNDRV_CTL_ELEM_IFACE_HWDEP ((__force snd_ctl_elem_iface_t) 1) /* hardware dependent device */
789#define SNDRV_CTL_ELEM_IFACE_MIXER ((__force snd_ctl_elem_iface_t) 2) /* virtual mixer device */
790#define SNDRV_CTL_ELEM_IFACE_PCM ((__force snd_ctl_elem_iface_t) 3) /* PCM device */
791#define SNDRV_CTL_ELEM_IFACE_RAWMIDI ((__force snd_ctl_elem_iface_t) 4) /* RawMidi device */
792#define SNDRV_CTL_ELEM_IFACE_TIMER ((__force snd_ctl_elem_iface_t) 5) /* timer device */
793#define SNDRV_CTL_ELEM_IFACE_SEQUENCER ((__force snd_ctl_elem_iface_t) 6) /* sequencer client */
794#define SNDRV_CTL_ELEM_IFACE_LAST SNDRV_CTL_ELEM_IFACE_SEQUENCER
795
796#define SNDRV_CTL_ELEM_ACCESS_READ (1<<0)
797#define SNDRV_CTL_ELEM_ACCESS_WRITE (1<<1)
798#define SNDRV_CTL_ELEM_ACCESS_READWRITE (SNDRV_CTL_ELEM_ACCESS_READ|SNDRV_CTL_ELEM_ACCESS_WRITE)
799#define SNDRV_CTL_ELEM_ACCESS_VOLATILE (1<<2) /* control value may be changed without a notification */
800#define SNDRV_CTL_ELEM_ACCESS_TIMESTAMP (1<<3) /* when was control changed */
801#define SNDRV_CTL_ELEM_ACCESS_TLV_READ (1<<4) /* TLV read is possible */
802#define SNDRV_CTL_ELEM_ACCESS_TLV_WRITE (1<<5) /* TLV write is possible */
803#define SNDRV_CTL_ELEM_ACCESS_TLV_READWRITE (SNDRV_CTL_ELEM_ACCESS_TLV_READ|SNDRV_CTL_ELEM_ACCESS_TLV_WRITE)
804#define SNDRV_CTL_ELEM_ACCESS_TLV_COMMAND (1<<6) /* TLV command is possible */
805#define SNDRV_CTL_ELEM_ACCESS_INACTIVE (1<<8) /* control does actually nothing, but may be updated */
806#define SNDRV_CTL_ELEM_ACCESS_LOCK (1<<9) /* write lock */
807#define SNDRV_CTL_ELEM_ACCESS_OWNER (1<<10) /* write lock owner */
808#define SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK (1<<28) /* kernel use a TLV callback */
809#define SNDRV_CTL_ELEM_ACCESS_USER (1<<29) /* user space element */
810/* bits 30 and 31 are obsoleted (for indirect access) */
811
812/* for further details see the ACPI and PCI power management specification */
813#define SNDRV_CTL_POWER_D0 0x0000 /* full On */
814#define SNDRV_CTL_POWER_D1 0x0100 /* partial On */
815#define SNDRV_CTL_POWER_D2 0x0200 /* partial On */
816#define SNDRV_CTL_POWER_D3 0x0300 /* Off */
817#define SNDRV_CTL_POWER_D3hot (SNDRV_CTL_POWER_D3|0x0000) /* Off, with power */
818#define SNDRV_CTL_POWER_D3cold (SNDRV_CTL_POWER_D3|0x0001) /* Off, without power */
819
820struct snd_ctl_elem_id {
821 unsigned int numid; /* numeric identifier, zero = invalid */
822 snd_ctl_elem_iface_t iface; /* interface identifier */
823 unsigned int device; /* device/client number */
824 unsigned int subdevice; /* subdevice (substream) number */
825 unsigned char name[44]; /* ASCII name of item */
826 unsigned int index; /* index of item */
827};
828
829struct snd_ctl_elem_list {
830 unsigned int offset; /* W: first element ID to get */
831 unsigned int space; /* W: count of element IDs to get */
832 unsigned int used; /* R: count of element IDs set */
833 unsigned int count; /* R: count of all elements */
834 struct snd_ctl_elem_id __user *pids; /* R: IDs */
835 unsigned char reserved[50];
836};
837
838struct snd_ctl_elem_info {
839 struct snd_ctl_elem_id id; /* W: element ID */
840 snd_ctl_elem_type_t type; /* R: value type - SNDRV_CTL_ELEM_TYPE_* */
841 unsigned int access; /* R: value access (bitmask) - SNDRV_CTL_ELEM_ACCESS_* */
842 unsigned int count; /* count of values */
843 __kernel_pid_t owner; /* owner's PID of this control */
844 union {
845 struct {
846 long min; /* R: minimum value */
847 long max; /* R: maximum value */
848 long step; /* R: step (0 variable) */
849 } integer;
850 struct {
851 long long min; /* R: minimum value */
852 long long max; /* R: maximum value */
853 long long step; /* R: step (0 variable) */
854 } integer64;
855 struct {
856 unsigned int items; /* R: number of items */
857 unsigned int item; /* W: item number */
858 char name[64]; /* R: value name */
859 __u64 names_ptr; /* W: names list (ELEM_ADD only) */
860 unsigned int names_length;
861 } enumerated;
862 unsigned char reserved[128];
863 } value;
864 union {
865 unsigned short d[4]; /* dimensions */
866 unsigned short *d_ptr; /* indirect - obsoleted */
867 } dimen;
868 unsigned char reserved[64-4*sizeof(unsigned short)];
869};
870
871struct snd_ctl_elem_value {
872 struct snd_ctl_elem_id id; /* W: element ID */
873 unsigned int indirect: 1; /* W: indirect access - obsoleted */
874 union {
875 union {
876 long value[128];
877 long *value_ptr; /* obsoleted */
878 } integer;
879 union {
880 long long value[64];
881 long long *value_ptr; /* obsoleted */
882 } integer64;
883 union {
884 unsigned int item[128];
885 unsigned int *item_ptr; /* obsoleted */
886 } enumerated;
887 union {
888 unsigned char data[512];
889 unsigned char *data_ptr; /* obsoleted */
890 } bytes;
891 struct snd_aes_iec958 iec958;
892 } value; /* RO */
893 struct timespec tstamp;
894 unsigned char reserved[128-sizeof(struct timespec)];
895};
896
897struct snd_ctl_tlv {
898 unsigned int numid; /* control element numeric identification */
899 unsigned int length; /* in bytes aligned to 4 */
900 unsigned int tlv[0]; /* first TLV */
901};
902
903#define SNDRV_CTL_IOCTL_PVERSION _IOR('U', 0x00, int)
904#define SNDRV_CTL_IOCTL_CARD_INFO _IOR('U', 0x01, struct snd_ctl_card_info)
905#define SNDRV_CTL_IOCTL_ELEM_LIST _IOWR('U', 0x10, struct snd_ctl_elem_list)
906#define SNDRV_CTL_IOCTL_ELEM_INFO _IOWR('U', 0x11, struct snd_ctl_elem_info)
907#define SNDRV_CTL_IOCTL_ELEM_READ _IOWR('U', 0x12, struct snd_ctl_elem_value)
908#define SNDRV_CTL_IOCTL_ELEM_WRITE _IOWR('U', 0x13, struct snd_ctl_elem_value)
909#define SNDRV_CTL_IOCTL_ELEM_LOCK _IOW('U', 0x14, struct snd_ctl_elem_id)
910#define SNDRV_CTL_IOCTL_ELEM_UNLOCK _IOW('U', 0x15, struct snd_ctl_elem_id)
911#define SNDRV_CTL_IOCTL_SUBSCRIBE_EVENTS _IOWR('U', 0x16, int)
912#define SNDRV_CTL_IOCTL_ELEM_ADD _IOWR('U', 0x17, struct snd_ctl_elem_info)
913#define SNDRV_CTL_IOCTL_ELEM_REPLACE _IOWR('U', 0x18, struct snd_ctl_elem_info)
914#define SNDRV_CTL_IOCTL_ELEM_REMOVE _IOWR('U', 0x19, struct snd_ctl_elem_id)
915#define SNDRV_CTL_IOCTL_TLV_READ _IOWR('U', 0x1a, struct snd_ctl_tlv)
916#define SNDRV_CTL_IOCTL_TLV_WRITE _IOWR('U', 0x1b, struct snd_ctl_tlv)
917#define SNDRV_CTL_IOCTL_TLV_COMMAND _IOWR('U', 0x1c, struct snd_ctl_tlv)
918#define SNDRV_CTL_IOCTL_HWDEP_NEXT_DEVICE _IOWR('U', 0x20, int)
919#define SNDRV_CTL_IOCTL_HWDEP_INFO _IOR('U', 0x21, struct snd_hwdep_info)
920#define SNDRV_CTL_IOCTL_PCM_NEXT_DEVICE _IOR('U', 0x30, int)
921#define SNDRV_CTL_IOCTL_PCM_INFO _IOWR('U', 0x31, struct snd_pcm_info)
922#define SNDRV_CTL_IOCTL_PCM_PREFER_SUBDEVICE _IOW('U', 0x32, int)
923#define SNDRV_CTL_IOCTL_RAWMIDI_NEXT_DEVICE _IOWR('U', 0x40, int)
924#define SNDRV_CTL_IOCTL_RAWMIDI_INFO _IOWR('U', 0x41, struct snd_rawmidi_info)
925#define SNDRV_CTL_IOCTL_RAWMIDI_PREFER_SUBDEVICE _IOW('U', 0x42, int)
926#define SNDRV_CTL_IOCTL_POWER _IOWR('U', 0xd0, int)
927#define SNDRV_CTL_IOCTL_POWER_STATE _IOR('U', 0xd1, int)
928
929/*
930 * Read interface.
931 */
932
933enum sndrv_ctl_event_type {
934 SNDRV_CTL_EVENT_ELEM = 0,
935 SNDRV_CTL_EVENT_LAST = SNDRV_CTL_EVENT_ELEM,
936};
937
938#define SNDRV_CTL_EVENT_MASK_VALUE (1<<0) /* element value was changed */
939#define SNDRV_CTL_EVENT_MASK_INFO (1<<1) /* element info was changed */
940#define SNDRV_CTL_EVENT_MASK_ADD (1<<2) /* element was added */
941#define SNDRV_CTL_EVENT_MASK_TLV (1<<3) /* element TLV tree was changed */
942#define SNDRV_CTL_EVENT_MASK_REMOVE (~0U) /* element was removed */
943
944struct snd_ctl_event {
945 int type; /* event type - SNDRV_CTL_EVENT_* */
946 union {
947 struct {
948 unsigned int mask;
949 struct snd_ctl_elem_id id;
950 } elem;
951 unsigned char data8[60];
952 } data;
953};
954
955/*
956 * Control names
957 */
958
959#define SNDRV_CTL_NAME_NONE ""
960#define SNDRV_CTL_NAME_PLAYBACK "Playback "
961#define SNDRV_CTL_NAME_CAPTURE "Capture "
962
963#define SNDRV_CTL_NAME_IEC958_NONE ""
964#define SNDRV_CTL_NAME_IEC958_SWITCH "Switch"
965#define SNDRV_CTL_NAME_IEC958_VOLUME "Volume"
966#define SNDRV_CTL_NAME_IEC958_DEFAULT "Default"
967#define SNDRV_CTL_NAME_IEC958_MASK "Mask"
968#define SNDRV_CTL_NAME_IEC958_CON_MASK "Con Mask"
969#define SNDRV_CTL_NAME_IEC958_PRO_MASK "Pro Mask"
970#define SNDRV_CTL_NAME_IEC958_PCM_STREAM "PCM Stream"
971#define SNDRV_CTL_NAME_IEC958(expl,direction,what) "IEC958 " expl SNDRV_CTL_NAME_##direction SNDRV_CTL_NAME_IEC958_##what
972
973#endif /* __SOUND_ASOUND_H */ 40#endif /* __SOUND_ASOUND_H */
diff --git a/include/sound/asound_fm.h b/include/sound/asound_fm.h
deleted file mode 100644
index c2a4b967d5b..00000000000
--- a/include/sound/asound_fm.h
+++ /dev/null
@@ -1,134 +0,0 @@
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
32struct 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
41struct 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
70struct 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
81struct 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
125struct 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/sound/compress_offload.h b/include/sound/compress_offload.h
deleted file mode 100644
index 05341a43fed..00000000000
--- a/include/sound/compress_offload.h
+++ /dev/null
@@ -1,161 +0,0 @@
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 */
39struct 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 */
50struct 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 */
67struct 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 */
80struct snd_compr_avail {
81 __u64 avail;
82 struct snd_compr_tstamp tstamp;
83};
84
85enum 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 */
101struct 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 */
118struct 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/sound/compress_params.h b/include/sound/compress_params.h
deleted file mode 100644
index 602dc6c45d1..00000000000
--- a/include/sound/compress_params.h
+++ /dev/null
@@ -1,400 +0,0 @@
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
239struct 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
264struct 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
282struct 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
307struct snd_enc_flac {
308 __u32 num;
309 __u32 gain;
310};
311
312struct snd_enc_generic {
313 __u32 bw; /* encoder bandwidth */
314 __s32 reserved[15];
315};
316
317union 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
347struct 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
384struct 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/sound/emu10k1.h b/include/sound/emu10k1.h
index 1a33f48ebe7..3707288ae9b 100644
--- a/include/sound/emu10k1.h
+++ b/include/sound/emu10k1.h
@@ -1,8 +1,3 @@
1#ifndef __SOUND_EMU10K1_H
2#define __SOUND_EMU10K1_H
3
4#include <linux/types.h>
5
6/* 1/*
7 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>, 2 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>,
8 * Creative Labs, Inc. 3 * Creative Labs, Inc.
@@ -24,8 +19,9 @@
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 * 20 *
26 */ 21 */
22#ifndef __SOUND_EMU10K1_H
23#define __SOUND_EMU10K1_H
27 24
28#ifdef __KERNEL__
29 25
30#include <sound/pcm.h> 26#include <sound/pcm.h>
31#include <sound/rawmidi.h> 27#include <sound/rawmidi.h>
@@ -38,6 +34,7 @@
38#include <linux/mutex.h> 34#include <linux/mutex.h>
39 35
40#include <asm/io.h> 36#include <asm/io.h>
37#include <uapi/sound/emu10k1.h>
41 38
42/* ------------------- DEFINES -------------------- */ 39/* ------------------- DEFINES -------------------- */
43 40
@@ -1899,350 +1896,4 @@ int snd_emu10k1_fx8010_register_irq_handler(struct snd_emu10k1 *emu,
1899int snd_emu10k1_fx8010_unregister_irq_handler(struct snd_emu10k1 *emu, 1896int snd_emu10k1_fx8010_unregister_irq_handler(struct snd_emu10k1 *emu,
1900 struct snd_emu10k1_fx8010_irq *irq); 1897 struct snd_emu10k1_fx8010_irq *irq);
1901 1898
1902#endif /* __KERNEL__ */
1903
1904/*
1905 * ---- FX8010 ----
1906 */
1907
1908#define EMU10K1_CARD_CREATIVE 0x00000000
1909#define EMU10K1_CARD_EMUAPS 0x00000001
1910
1911#define EMU10K1_FX8010_PCM_COUNT 8
1912
1913/* instruction set */
1914#define iMAC0 0x00 /* R = A + (X * Y >> 31) ; saturation */
1915#define iMAC1 0x01 /* R = A + (-X * Y >> 31) ; saturation */
1916#define iMAC2 0x02 /* R = A + (X * Y >> 31) ; wraparound */
1917#define iMAC3 0x03 /* R = A + (-X * Y >> 31) ; wraparound */
1918#define iMACINT0 0x04 /* R = A + X * Y ; saturation */
1919#define iMACINT1 0x05 /* R = A + X * Y ; wraparound (31-bit) */
1920#define iACC3 0x06 /* R = A + X + Y ; saturation */
1921#define iMACMV 0x07 /* R = A, acc += X * Y >> 31 */
1922#define iANDXOR 0x08 /* R = (A & X) ^ Y */
1923#define iTSTNEG 0x09 /* R = (A >= Y) ? X : ~X */
1924#define iLIMITGE 0x0a /* R = (A >= Y) ? X : Y */
1925#define iLIMITLT 0x0b /* R = (A < Y) ? X : Y */
1926#define iLOG 0x0c /* R = linear_data, A (log_data), X (max_exp), Y (format_word) */
1927#define iEXP 0x0d /* R = log_data, A (linear_data), X (max_exp), Y (format_word) */
1928#define iINTERP 0x0e /* R = A + (X * (Y - A) >> 31) ; saturation */
1929#define iSKIP 0x0f /* R = A (cc_reg), X (count), Y (cc_test) */
1930
1931/* GPRs */
1932#define FXBUS(x) (0x00 + (x)) /* x = 0x00 - 0x0f */
1933#define EXTIN(x) (0x10 + (x)) /* x = 0x00 - 0x0f */
1934#define EXTOUT(x) (0x20 + (x)) /* x = 0x00 - 0x0f physical outs -> FXWC low 16 bits */
1935#define FXBUS2(x) (0x30 + (x)) /* x = 0x00 - 0x0f copies of fx buses for capture -> FXWC high 16 bits */
1936 /* NB: 0x31 and 0x32 are shared with Center/LFE on SB live 5.1 */
1937
1938#define C_00000000 0x40
1939#define C_00000001 0x41
1940#define C_00000002 0x42
1941#define C_00000003 0x43
1942#define C_00000004 0x44
1943#define C_00000008 0x45
1944#define C_00000010 0x46
1945#define C_00000020 0x47
1946#define C_00000100 0x48
1947#define C_00010000 0x49
1948#define C_00080000 0x4a
1949#define C_10000000 0x4b
1950#define C_20000000 0x4c
1951#define C_40000000 0x4d
1952#define C_80000000 0x4e
1953#define C_7fffffff 0x4f
1954#define C_ffffffff 0x50
1955#define C_fffffffe 0x51
1956#define C_c0000000 0x52
1957#define C_4f1bbcdc 0x53
1958#define C_5a7ef9db 0x54
1959#define C_00100000 0x55 /* ?? */
1960#define GPR_ACCU 0x56 /* ACCUM, accumulator */
1961#define GPR_COND 0x57 /* CCR, condition register */
1962#define GPR_NOISE0 0x58 /* noise source */
1963#define GPR_NOISE1 0x59 /* noise source */
1964#define GPR_IRQ 0x5a /* IRQ register */
1965#define GPR_DBAC 0x5b /* TRAM Delay Base Address Counter */
1966#define GPR(x) (FXGPREGBASE + (x)) /* free GPRs: x = 0x00 - 0xff */
1967#define ITRAM_DATA(x) (TANKMEMDATAREGBASE + 0x00 + (x)) /* x = 0x00 - 0x7f */
1968#define ETRAM_DATA(x) (TANKMEMDATAREGBASE + 0x80 + (x)) /* x = 0x00 - 0x1f */
1969#define ITRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x00 + (x)) /* x = 0x00 - 0x7f */
1970#define ETRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x80 + (x)) /* x = 0x00 - 0x1f */
1971
1972#define A_ITRAM_DATA(x) (TANKMEMDATAREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */
1973#define A_ETRAM_DATA(x) (TANKMEMDATAREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */
1974#define A_ITRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */
1975#define A_ETRAM_ADDR(x) (TANKMEMADDRREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */
1976#define A_ITRAM_CTL(x) (A_TANKMEMCTLREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */
1977#define A_ETRAM_CTL(x) (A_TANKMEMCTLREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */
1978
1979#define A_FXBUS(x) (0x00 + (x)) /* x = 0x00 - 0x3f FX buses */
1980#define A_EXTIN(x) (0x40 + (x)) /* x = 0x00 - 0x0f physical ins */
1981#define A_P16VIN(x) (0x50 + (x)) /* x = 0x00 - 0x0f p16v ins (A2 only) "EMU32 inputs" */
1982#define A_EXTOUT(x) (0x60 + (x)) /* x = 0x00 - 0x1f physical outs -> A_FXWC1 0x79-7f unknown */
1983#define A_FXBUS2(x) (0x80 + (x)) /* x = 0x00 - 0x1f extra outs used for EFX capture -> A_FXWC2 */
1984#define A_EMU32OUTH(x) (0xa0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_10 - _1F" - ??? */
1985#define A_EMU32OUTL(x) (0xb0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_1 - _F" - ??? */
1986#define A3_EMU32IN(x) (0x160 + (x)) /* x = 0x00 - 0x3f "EMU32_IN_00 - _3F" - Only when .device = 0x0008 */
1987#define A3_EMU32OUT(x) (0x1E0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_00 - _3F" - Only when .device = 0x0008 */
1988#define A_GPR(x) (A_FXGPREGBASE + (x))
1989
1990/* cc_reg constants */
1991#define CC_REG_NORMALIZED C_00000001
1992#define CC_REG_BORROW C_00000002
1993#define CC_REG_MINUS C_00000004
1994#define CC_REG_ZERO C_00000008
1995#define CC_REG_SATURATE C_00000010
1996#define CC_REG_NONZERO C_00000100
1997
1998/* FX buses */
1999#define FXBUS_PCM_LEFT 0x00
2000#define FXBUS_PCM_RIGHT 0x01
2001#define FXBUS_PCM_LEFT_REAR 0x02
2002#define FXBUS_PCM_RIGHT_REAR 0x03
2003#define FXBUS_MIDI_LEFT 0x04
2004#define FXBUS_MIDI_RIGHT 0x05
2005#define FXBUS_PCM_CENTER 0x06
2006#define FXBUS_PCM_LFE 0x07
2007#define FXBUS_PCM_LEFT_FRONT 0x08
2008#define FXBUS_PCM_RIGHT_FRONT 0x09
2009#define FXBUS_MIDI_REVERB 0x0c
2010#define FXBUS_MIDI_CHORUS 0x0d
2011#define FXBUS_PCM_LEFT_SIDE 0x0e
2012#define FXBUS_PCM_RIGHT_SIDE 0x0f
2013#define FXBUS_PT_LEFT 0x14
2014#define FXBUS_PT_RIGHT 0x15
2015
2016/* Inputs */
2017#define EXTIN_AC97_L 0x00 /* AC'97 capture channel - left */
2018#define EXTIN_AC97_R 0x01 /* AC'97 capture channel - right */
2019#define EXTIN_SPDIF_CD_L 0x02 /* internal S/PDIF CD - onboard - left */
2020#define EXTIN_SPDIF_CD_R 0x03 /* internal S/PDIF CD - onboard - right */
2021#define EXTIN_ZOOM_L 0x04 /* Zoom Video I2S - left */
2022#define EXTIN_ZOOM_R 0x05 /* Zoom Video I2S - right */
2023#define EXTIN_TOSLINK_L 0x06 /* LiveDrive - TOSLink Optical - left */
2024#define EXTIN_TOSLINK_R 0x07 /* LiveDrive - TOSLink Optical - right */
2025#define EXTIN_LINE1_L 0x08 /* LiveDrive - Line/Mic 1 - left */
2026#define EXTIN_LINE1_R 0x09 /* LiveDrive - Line/Mic 1 - right */
2027#define EXTIN_COAX_SPDIF_L 0x0a /* LiveDrive - Coaxial S/PDIF - left */
2028#define EXTIN_COAX_SPDIF_R 0x0b /* LiveDrive - Coaxial S/PDIF - right */
2029#define EXTIN_LINE2_L 0x0c /* LiveDrive - Line/Mic 2 - left */
2030#define EXTIN_LINE2_R 0x0d /* LiveDrive - Line/Mic 2 - right */
2031
2032/* Outputs */
2033#define EXTOUT_AC97_L 0x00 /* AC'97 playback channel - left */
2034#define EXTOUT_AC97_R 0x01 /* AC'97 playback channel - right */
2035#define EXTOUT_TOSLINK_L 0x02 /* LiveDrive - TOSLink Optical - left */
2036#define EXTOUT_TOSLINK_R 0x03 /* LiveDrive - TOSLink Optical - right */
2037#define EXTOUT_AC97_CENTER 0x04 /* SB Live 5.1 - center */
2038#define EXTOUT_AC97_LFE 0x05 /* SB Live 5.1 - LFE */
2039#define EXTOUT_HEADPHONE_L 0x06 /* LiveDrive - Headphone - left */
2040#define EXTOUT_HEADPHONE_R 0x07 /* LiveDrive - Headphone - right */
2041#define EXTOUT_REAR_L 0x08 /* Rear channel - left */
2042#define EXTOUT_REAR_R 0x09 /* Rear channel - right */
2043#define EXTOUT_ADC_CAP_L 0x0a /* ADC Capture buffer - left */
2044#define EXTOUT_ADC_CAP_R 0x0b /* ADC Capture buffer - right */
2045#define EXTOUT_MIC_CAP 0x0c /* MIC Capture buffer */
2046#define EXTOUT_AC97_REAR_L 0x0d /* SB Live 5.1 (c) 2003 - Rear Left */
2047#define EXTOUT_AC97_REAR_R 0x0e /* SB Live 5.1 (c) 2003 - Rear Right */
2048#define EXTOUT_ACENTER 0x11 /* Analog Center */
2049#define EXTOUT_ALFE 0x12 /* Analog LFE */
2050
2051/* Audigy Inputs */
2052#define A_EXTIN_AC97_L 0x00 /* AC'97 capture channel - left */
2053#define A_EXTIN_AC97_R 0x01 /* AC'97 capture channel - right */
2054#define A_EXTIN_SPDIF_CD_L 0x02 /* digital CD left */
2055#define A_EXTIN_SPDIF_CD_R 0x03 /* digital CD left */
2056#define A_EXTIN_OPT_SPDIF_L 0x04 /* audigy drive Optical SPDIF - left */
2057#define A_EXTIN_OPT_SPDIF_R 0x05 /* right */
2058#define A_EXTIN_LINE2_L 0x08 /* audigy drive line2/mic2 - left */
2059#define A_EXTIN_LINE2_R 0x09 /* right */
2060#define A_EXTIN_ADC_L 0x0a /* Philips ADC - left */
2061#define A_EXTIN_ADC_R 0x0b /* right */
2062#define A_EXTIN_AUX2_L 0x0c /* audigy drive aux2 - left */
2063#define A_EXTIN_AUX2_R 0x0d /* - right */
2064
2065/* Audigiy Outputs */
2066#define A_EXTOUT_FRONT_L 0x00 /* digital front left */
2067#define A_EXTOUT_FRONT_R 0x01 /* right */
2068#define A_EXTOUT_CENTER 0x02 /* digital front center */
2069#define A_EXTOUT_LFE 0x03 /* digital front lfe */
2070#define A_EXTOUT_HEADPHONE_L 0x04 /* headphone audigy drive left */
2071#define A_EXTOUT_HEADPHONE_R 0x05 /* right */
2072#define A_EXTOUT_REAR_L 0x06 /* digital rear left */
2073#define A_EXTOUT_REAR_R 0x07 /* right */
2074#define A_EXTOUT_AFRONT_L 0x08 /* analog front left */
2075#define A_EXTOUT_AFRONT_R 0x09 /* right */
2076#define A_EXTOUT_ACENTER 0x0a /* analog center */
2077#define A_EXTOUT_ALFE 0x0b /* analog LFE */
2078#define A_EXTOUT_ASIDE_L 0x0c /* analog side left - Audigy 2 ZS */
2079#define A_EXTOUT_ASIDE_R 0x0d /* right - Audigy 2 ZS */
2080#define A_EXTOUT_AREAR_L 0x0e /* analog rear left */
2081#define A_EXTOUT_AREAR_R 0x0f /* right */
2082#define A_EXTOUT_AC97_L 0x10 /* AC97 left (front) */
2083#define A_EXTOUT_AC97_R 0x11 /* right */
2084#define A_EXTOUT_ADC_CAP_L 0x16 /* ADC capture buffer left */
2085#define A_EXTOUT_ADC_CAP_R 0x17 /* right */
2086#define A_EXTOUT_MIC_CAP 0x18 /* Mic capture buffer */
2087
2088/* Audigy constants */
2089#define A_C_00000000 0xc0
2090#define A_C_00000001 0xc1
2091#define A_C_00000002 0xc2
2092#define A_C_00000003 0xc3
2093#define A_C_00000004 0xc4
2094#define A_C_00000008 0xc5
2095#define A_C_00000010 0xc6
2096#define A_C_00000020 0xc7
2097#define A_C_00000100 0xc8
2098#define A_C_00010000 0xc9
2099#define A_C_00000800 0xca
2100#define A_C_10000000 0xcb
2101#define A_C_20000000 0xcc
2102#define A_C_40000000 0xcd
2103#define A_C_80000000 0xce
2104#define A_C_7fffffff 0xcf
2105#define A_C_ffffffff 0xd0
2106#define A_C_fffffffe 0xd1
2107#define A_C_c0000000 0xd2
2108#define A_C_4f1bbcdc 0xd3
2109#define A_C_5a7ef9db 0xd4
2110#define A_C_00100000 0xd5
2111#define A_GPR_ACCU 0xd6 /* ACCUM, accumulator */
2112#define A_GPR_COND 0xd7 /* CCR, condition register */
2113#define A_GPR_NOISE0 0xd8 /* noise source */
2114#define A_GPR_NOISE1 0xd9 /* noise source */
2115#define A_GPR_IRQ 0xda /* IRQ register */
2116#define A_GPR_DBAC 0xdb /* TRAM Delay Base Address Counter - internal */
2117#define A_GPR_DBACE 0xde /* TRAM Delay Base Address Counter - external */
2118
2119/* definitions for debug register */
2120#define EMU10K1_DBG_ZC 0x80000000 /* zero tram counter */
2121#define EMU10K1_DBG_SATURATION_OCCURED 0x02000000 /* saturation control */
2122#define EMU10K1_DBG_SATURATION_ADDR 0x01ff0000 /* saturation address */
2123#define EMU10K1_DBG_SINGLE_STEP 0x00008000 /* single step mode */
2124#define EMU10K1_DBG_STEP 0x00004000 /* start single step */
2125#define EMU10K1_DBG_CONDITION_CODE 0x00003e00 /* condition code */
2126#define EMU10K1_DBG_SINGLE_STEP_ADDR 0x000001ff /* single step address */
2127
2128/* tank memory address line */
2129#ifndef __KERNEL__
2130#define TANKMEMADDRREG_ADDR_MASK 0x000fffff /* 20 bit tank address field */
2131#define TANKMEMADDRREG_CLEAR 0x00800000 /* Clear tank memory */
2132#define TANKMEMADDRREG_ALIGN 0x00400000 /* Align read or write relative to tank access */
2133#define TANKMEMADDRREG_WRITE 0x00200000 /* Write to tank memory */
2134#define TANKMEMADDRREG_READ 0x00100000 /* Read from tank memory */
2135#endif
2136
2137struct snd_emu10k1_fx8010_info {
2138 unsigned int internal_tram_size; /* in samples */
2139 unsigned int external_tram_size; /* in samples */
2140 char fxbus_names[16][32]; /* names of FXBUSes */
2141 char extin_names[16][32]; /* names of external inputs */
2142 char extout_names[32][32]; /* names of external outputs */
2143 unsigned int gpr_controls; /* count of GPR controls */
2144};
2145
2146#define EMU10K1_GPR_TRANSLATION_NONE 0
2147#define EMU10K1_GPR_TRANSLATION_TABLE100 1
2148#define EMU10K1_GPR_TRANSLATION_BASS 2
2149#define EMU10K1_GPR_TRANSLATION_TREBLE 3
2150#define EMU10K1_GPR_TRANSLATION_ONOFF 4
2151
2152struct snd_emu10k1_fx8010_control_gpr {
2153 struct snd_ctl_elem_id id; /* full control ID definition */
2154 unsigned int vcount; /* visible count */
2155 unsigned int count; /* count of GPR (1..16) */
2156 unsigned short gpr[32]; /* GPR number(s) */
2157 unsigned int value[32]; /* initial values */
2158 unsigned int min; /* minimum range */
2159 unsigned int max; /* maximum range */
2160 unsigned int translation; /* translation type (EMU10K1_GPR_TRANSLATION*) */
2161 const unsigned int *tlv;
2162};
2163
2164/* old ABI without TLV support */
2165struct snd_emu10k1_fx8010_control_old_gpr {
2166 struct snd_ctl_elem_id id;
2167 unsigned int vcount;
2168 unsigned int count;
2169 unsigned short gpr[32];
2170 unsigned int value[32];
2171 unsigned int min;
2172 unsigned int max;
2173 unsigned int translation;
2174};
2175
2176struct snd_emu10k1_fx8010_code {
2177 char name[128];
2178
2179 DECLARE_BITMAP(gpr_valid, 0x200); /* bitmask of valid initializers */
2180 __u32 __user *gpr_map; /* initializers */
2181
2182 unsigned int gpr_add_control_count; /* count of GPR controls to add/replace */
2183 struct snd_emu10k1_fx8010_control_gpr __user *gpr_add_controls; /* GPR controls to add/replace */
2184
2185 unsigned int gpr_del_control_count; /* count of GPR controls to remove */
2186 struct snd_ctl_elem_id __user *gpr_del_controls; /* IDs of GPR controls to remove */
2187
2188 unsigned int gpr_list_control_count; /* count of GPR controls to list */
2189 unsigned int gpr_list_control_total; /* total count of GPR controls */
2190 struct snd_emu10k1_fx8010_control_gpr __user *gpr_list_controls; /* listed GPR controls */
2191
2192 DECLARE_BITMAP(tram_valid, 0x100); /* bitmask of valid initializers */
2193 __u32 __user *tram_data_map; /* data initializers */
2194 __u32 __user *tram_addr_map; /* map initializers */
2195
2196 DECLARE_BITMAP(code_valid, 1024); /* bitmask of valid instructions */
2197 __u32 __user *code; /* one instruction - 64 bits */
2198};
2199
2200struct snd_emu10k1_fx8010_tram {
2201 unsigned int address; /* 31.bit == 1 -> external TRAM */
2202 unsigned int size; /* size in samples (4 bytes) */
2203 unsigned int *samples; /* pointer to samples (20-bit) */
2204 /* NULL->clear memory */
2205};
2206
2207struct snd_emu10k1_fx8010_pcm_rec {
2208 unsigned int substream; /* substream number */
2209 unsigned int res1; /* reserved */
2210 unsigned int channels; /* 16-bit channels count, zero = remove this substream */
2211 unsigned int tram_start; /* ring buffer position in TRAM (in samples) */
2212 unsigned int buffer_size; /* count of buffered samples */
2213 unsigned short gpr_size; /* GPR containing size of ringbuffer in samples (host) */
2214 unsigned short gpr_ptr; /* GPR containing current pointer in the ring buffer (host = reset, FX8010) */
2215 unsigned short gpr_count; /* GPR containing count of samples between two interrupts (host) */
2216 unsigned short gpr_tmpcount; /* GPR containing current count of samples to interrupt (host = set, FX8010) */
2217 unsigned short gpr_trigger; /* GPR containing trigger (activate) information (host) */
2218 unsigned short gpr_running; /* GPR containing info if PCM is running (FX8010) */
2219 unsigned char pad; /* reserved */
2220 unsigned char etram[32]; /* external TRAM address & data (one per channel) */
2221 unsigned int res2; /* reserved */
2222};
2223
2224#define SNDRV_EMU10K1_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 1)
2225
2226#define SNDRV_EMU10K1_IOCTL_INFO _IOR ('H', 0x10, struct snd_emu10k1_fx8010_info)
2227#define SNDRV_EMU10K1_IOCTL_CODE_POKE _IOW ('H', 0x11, struct snd_emu10k1_fx8010_code)
2228#define SNDRV_EMU10K1_IOCTL_CODE_PEEK _IOWR('H', 0x12, struct snd_emu10k1_fx8010_code)
2229#define SNDRV_EMU10K1_IOCTL_TRAM_SETUP _IOW ('H', 0x20, int)
2230#define SNDRV_EMU10K1_IOCTL_TRAM_POKE _IOW ('H', 0x21, struct snd_emu10k1_fx8010_tram)
2231#define SNDRV_EMU10K1_IOCTL_TRAM_PEEK _IOWR('H', 0x22, struct snd_emu10k1_fx8010_tram)
2232#define SNDRV_EMU10K1_IOCTL_PCM_POKE _IOW ('H', 0x30, struct snd_emu10k1_fx8010_pcm_rec)
2233#define SNDRV_EMU10K1_IOCTL_PCM_PEEK _IOWR('H', 0x31, struct snd_emu10k1_fx8010_pcm_rec)
2234#define SNDRV_EMU10K1_IOCTL_PVERSION _IOR ('H', 0x40, int)
2235#define SNDRV_EMU10K1_IOCTL_STOP _IO ('H', 0x80)
2236#define SNDRV_EMU10K1_IOCTL_CONTINUE _IO ('H', 0x81)
2237#define SNDRV_EMU10K1_IOCTL_ZERO_TRAM_COUNTER _IO ('H', 0x82)
2238#define SNDRV_EMU10K1_IOCTL_SINGLE_STEP _IOW ('H', 0x83, int)
2239#define SNDRV_EMU10K1_IOCTL_DBG_READ _IOR ('H', 0x84, int)
2240
2241/* typedefs for compatibility to user-space */
2242typedef struct snd_emu10k1_fx8010_info emu10k1_fx8010_info_t;
2243typedef struct snd_emu10k1_fx8010_control_gpr emu10k1_fx8010_control_gpr_t;
2244typedef struct snd_emu10k1_fx8010_code emu10k1_fx8010_code_t;
2245typedef struct snd_emu10k1_fx8010_tram emu10k1_fx8010_tram_t;
2246typedef struct snd_emu10k1_fx8010_pcm_rec emu10k1_fx8010_pcm_t;
2247
2248#endif /* __SOUND_EMU10K1_H */ 1899#endif /* __SOUND_EMU10K1_H */
diff --git a/include/sound/hdsp.h b/include/sound/hdsp.h
deleted file mode 100644
index 0909a384347..00000000000
--- a/include/sound/hdsp.h
+++ /dev/null
@@ -1,110 +0,0 @@
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
26enum HDSP_IO_Type {
27 Digiface,
28 Multiface,
29 H9652,
30 H9632,
31 RPM,
32 Undefined,
33};
34
35struct 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
47struct 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
75struct 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
81struct 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
88struct 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
94struct 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 */
102typedef enum HDSP_IO_Type HDSP_IO_Type;
103typedef struct hdsp_peak_rms hdsp_peak_rms_t;
104typedef struct hdsp_config_info hdsp_config_info_t;
105typedef struct hdsp_firmware hdsp_firmware_t;
106typedef struct hdsp_version hdsp_version_t;
107typedef struct hdsp_mixer hdsp_mixer_t;
108typedef struct hdsp_9632_aeb hdsp_9632_aeb_t;
109
110#endif /* __SOUND_HDSP_H */
diff --git a/include/sound/hdspm.h b/include/sound/hdspm.h
deleted file mode 100644
index 1f59ea2a4a7..00000000000
--- a/include/sound/hdspm.h
+++ /dev/null
@@ -1,229 +0,0 @@
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
26enum hdspm_io_type {
27 MADI,
28 MADIface,
29 AIO,
30 AES32,
31 RayDAT
32};
33
34enum hdspm_speed {
35 ss,
36 ds,
37 qs
38};
39
40/* -------------------- IOCTL Peak/RMS Meters -------------------- */
41
42struct 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
60struct 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
86enum hdspm_ltc_format {
87 format_invalid,
88 fps_24,
89 fps_25,
90 fps_2997,
91 fps_30
92};
93
94enum hdspm_ltc_frame {
95 frame_invalid,
96 drop_frame,
97 full_frame
98};
99
100enum hdspm_ltc_input_format {
101 ntsc,
102 pal,
103 no_video
104};
105
106struct 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
122enum hdspm_sync {
123 hdspm_sync_no_lock = 0,
124 hdspm_sync_lock = 1,
125 hdspm_sync_sync = 2
126};
127
128enum hdspm_madi_input {
129 hdspm_input_optical = 0,
130 hdspm_input_coax = 1
131};
132
133enum hdspm_madi_channel_format {
134 hdspm_format_ch_64 = 0,
135 hdspm_format_ch_56 = 1
136};
137
138enum hdspm_madi_frame_format {
139 hdspm_frame_48 = 0,
140 hdspm_frame_96 = 1
141};
142
143enum hdspm_syncsource {
144 syncsource_wc = 0,
145 syncsource_madi = 1,
146 syncsource_tco = 2,
147 syncsource_sync = 3,
148 syncsource_none = 4
149};
150
151struct 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
180struct 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
205struct hdspm_channelfader {
206 unsigned int in[HDSPM_MIXER_CHANNELS];
207 unsigned int pb[HDSPM_MIXER_CHANNELS];
208};
209
210struct hdspm_mixer {
211 struct hdspm_channelfader ch[HDSPM_MIXER_CHANNELS];
212};
213
214struct 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 */
222typedef struct hdspm_peak_rms hdspm_peak_rms_t;
223typedef struct hdspm_config_info hdspm_config_info_t;
224typedef struct hdspm_version hdspm_version_t;
225typedef struct hdspm_channelfader snd_hdspm_channelfader_t;
226typedef struct hdspm_mixer hdspm_mixer_t;
227
228
229#endif
diff --git a/include/sound/sb16_csp.h b/include/sound/sb16_csp.h
index 7e950560e59..c7c7788005e 100644
--- a/include/sound/sb16_csp.h
+++ b/include/sound/sb16_csp.h
@@ -1,6 +1,3 @@
1#ifndef __SOUND_SB16_CSP_H
2#define __SOUND_SB16_CSP_H
3
4/* 1/*
5 * Copyright (c) 1999 by Uros Bizjak <uros@kss-loka.si> 2 * Copyright (c) 1999 by Uros Bizjak <uros@kss-loka.si>
6 * Takashi Iwai <tiwai@suse.de> 3 * Takashi Iwai <tiwai@suse.de>
@@ -22,106 +19,13 @@
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 * 20 *
24 */ 21 */
22#ifndef __SOUND_SB16_CSP_H
23#define __SOUND_SB16_CSP_H
25 24
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 */
66struct 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 */
72struct 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 */
78struct snd_sb_csp_start {
79 int sample_width; /* sample width, look above */
80 int channels; /* channels, look above */
81};
82
83/* CSP information */
84struct 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#ifdef __KERNEL__
122#include <sound/sb.h> 25#include <sound/sb.h>
123#include <sound/hwdep.h> 26#include <sound/hwdep.h>
124#include <linux/firmware.h> 27#include <linux/firmware.h>
28#include <uapi/sound/sb16_csp.h>
125 29
126struct snd_sb_csp; 30struct snd_sb_csp;
127 31
@@ -183,6 +87,4 @@ struct snd_sb_csp {
183}; 87};
184 88
185int snd_sb_csp_new(struct snd_sb *chip, int device, struct snd_hwdep ** rhwdep); 89int snd_sb_csp_new(struct snd_sb *chip, int device, struct snd_hwdep ** rhwdep);
186#endif
187
188#endif /* __SOUND_SB16_CSP */ 90#endif /* __SOUND_SB16_CSP */
diff --git a/include/sound/sfnt_info.h b/include/sound/sfnt_info.h
deleted file mode 100644
index 1bce7fd1725..00000000000
--- a/include/sound/sfnt_info.h
+++ /dev/null
@@ -1,212 +0,0 @@
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 */
38struct 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
71struct 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 */
89struct 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 */
115struct 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 */
144struct 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 */
160struct 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
184struct 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
198struct 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 */