1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22#ifndef _UAPI__SOUND_ASEQUENCER_H
23#define _UAPI__SOUND_ASEQUENCER_H
24
25#include <sound/asound.h>
26
27
28#define SNDRV_SEQ_VERSION SNDRV_PROTOCOL_VERSION (1, 0, 1)
29
30
31
32
33
34
35
36
37#define SNDRV_SEQ_EVENT_SYSTEM 0
38#define SNDRV_SEQ_EVENT_RESULT 1
39
40
41
42
43#define SNDRV_SEQ_EVENT_NOTE 5
44#define SNDRV_SEQ_EVENT_NOTEON 6
45#define SNDRV_SEQ_EVENT_NOTEOFF 7
46#define SNDRV_SEQ_EVENT_KEYPRESS 8
47
48
49
50
51#define SNDRV_SEQ_EVENT_CONTROLLER 10
52#define SNDRV_SEQ_EVENT_PGMCHANGE 11
53#define SNDRV_SEQ_EVENT_CHANPRESS 12
54#define SNDRV_SEQ_EVENT_PITCHBEND 13
55#define SNDRV_SEQ_EVENT_CONTROL14 14
56#define SNDRV_SEQ_EVENT_NONREGPARAM 15
57#define SNDRV_SEQ_EVENT_REGPARAM 16
58
59
60
61
62#define SNDRV_SEQ_EVENT_SONGPOS 20
63#define SNDRV_SEQ_EVENT_SONGSEL 21
64#define SNDRV_SEQ_EVENT_QFRAME 22
65#define SNDRV_SEQ_EVENT_TIMESIGN 23
66#define SNDRV_SEQ_EVENT_KEYSIGN 24
67
68
69
70
71#define SNDRV_SEQ_EVENT_START 30
72#define SNDRV_SEQ_EVENT_CONTINUE 31
73#define SNDRV_SEQ_EVENT_STOP 32
74#define SNDRV_SEQ_EVENT_SETPOS_TICK 33
75#define SNDRV_SEQ_EVENT_SETPOS_TIME 34
76#define SNDRV_SEQ_EVENT_TEMPO 35
77#define SNDRV_SEQ_EVENT_CLOCK 36
78#define SNDRV_SEQ_EVENT_TICK 37
79#define SNDRV_SEQ_EVENT_QUEUE_SKEW 38
80
81
82
83
84#define SNDRV_SEQ_EVENT_TUNE_REQUEST 40
85#define SNDRV_SEQ_EVENT_RESET 41
86#define SNDRV_SEQ_EVENT_SENSING 42
87
88
89
90
91#define SNDRV_SEQ_EVENT_ECHO 50
92#define SNDRV_SEQ_EVENT_OSS 51
93
94
95
96
97#define SNDRV_SEQ_EVENT_CLIENT_START 60
98#define SNDRV_SEQ_EVENT_CLIENT_EXIT 61
99#define SNDRV_SEQ_EVENT_CLIENT_CHANGE 62
100#define SNDRV_SEQ_EVENT_PORT_START 63
101#define SNDRV_SEQ_EVENT_PORT_EXIT 64
102#define SNDRV_SEQ_EVENT_PORT_CHANGE 65
103
104
105
106
107#define SNDRV_SEQ_EVENT_PORT_SUBSCRIBED 66
108#define SNDRV_SEQ_EVENT_PORT_UNSUBSCRIBED 67
109
110
111
112
113
114
115#define SNDRV_SEQ_EVENT_USR0 90
116#define SNDRV_SEQ_EVENT_USR1 91
117#define SNDRV_SEQ_EVENT_USR2 92
118#define SNDRV_SEQ_EVENT_USR3 93
119#define SNDRV_SEQ_EVENT_USR4 94
120#define SNDRV_SEQ_EVENT_USR5 95
121#define SNDRV_SEQ_EVENT_USR6 96
122#define SNDRV_SEQ_EVENT_USR7 97
123#define SNDRV_SEQ_EVENT_USR8 98
124#define SNDRV_SEQ_EVENT_USR9 99
125
126
127
128
129
130
131
132
133#define SNDRV_SEQ_EVENT_SYSEX 130
134#define SNDRV_SEQ_EVENT_BOUNCE 131
135
136#define SNDRV_SEQ_EVENT_USR_VAR0 135
137#define SNDRV_SEQ_EVENT_USR_VAR1 136
138#define SNDRV_SEQ_EVENT_USR_VAR2 137
139#define SNDRV_SEQ_EVENT_USR_VAR3 138
140#define SNDRV_SEQ_EVENT_USR_VAR4 139
141
142
143#define SNDRV_SEQ_EVENT_KERNEL_ERROR 150
144#define SNDRV_SEQ_EVENT_KERNEL_QUOTE 151
145
146
147
148
149
150
151#define SNDRV_SEQ_EVENT_NONE 255
152
153
154typedef unsigned char snd_seq_event_type_t;
155
156
157struct snd_seq_addr {
158 unsigned char client;
159 unsigned char port;
160};
161
162
163struct snd_seq_connect {
164 struct snd_seq_addr sender;
165 struct snd_seq_addr dest;
166};
167
168
169#define SNDRV_SEQ_ADDRESS_UNKNOWN 253
170#define SNDRV_SEQ_ADDRESS_SUBSCRIBERS 254
171#define SNDRV_SEQ_ADDRESS_BROADCAST 255
172#define SNDRV_SEQ_QUEUE_DIRECT 253
173
174
175#define SNDRV_SEQ_TIME_STAMP_TICK (0<<0)
176#define SNDRV_SEQ_TIME_STAMP_REAL (1<<0)
177#define SNDRV_SEQ_TIME_STAMP_MASK (1<<0)
178
179#define SNDRV_SEQ_TIME_MODE_ABS (0<<1)
180#define SNDRV_SEQ_TIME_MODE_REL (1<<1)
181#define SNDRV_SEQ_TIME_MODE_MASK (1<<1)
182
183#define SNDRV_SEQ_EVENT_LENGTH_FIXED (0<<2)
184#define SNDRV_SEQ_EVENT_LENGTH_VARIABLE (1<<2)
185#define SNDRV_SEQ_EVENT_LENGTH_VARUSR (2<<2)
186#define SNDRV_SEQ_EVENT_LENGTH_MASK (3<<2)
187
188#define SNDRV_SEQ_PRIORITY_NORMAL (0<<4)
189#define SNDRV_SEQ_PRIORITY_HIGH (1<<4)
190#define SNDRV_SEQ_PRIORITY_MASK (1<<4)
191
192
193
194struct snd_seq_ev_note {
195 unsigned char channel;
196 unsigned char note;
197 unsigned char velocity;
198 unsigned char off_velocity;
199 unsigned int duration;
200};
201
202
203struct snd_seq_ev_ctrl {
204 unsigned char channel;
205 unsigned char unused1, unused2, unused3;
206 unsigned int param;
207 signed int value;
208};
209
210
211struct snd_seq_ev_raw8 {
212 unsigned char d[12];
213};
214
215
216struct snd_seq_ev_raw32 {
217 unsigned int d[3];
218};
219
220
221struct snd_seq_ev_ext {
222 unsigned int len;
223 void *ptr;
224} __attribute__((packed));
225
226struct snd_seq_result {
227 int event;
228 int result;
229};
230
231
232struct snd_seq_real_time {
233 unsigned int tv_sec;
234 unsigned int tv_nsec;
235};
236
237typedef unsigned int snd_seq_tick_time_t;
238
239union snd_seq_timestamp {
240 snd_seq_tick_time_t tick;
241 struct snd_seq_real_time time;
242};
243
244struct snd_seq_queue_skew {
245 unsigned int value;
246 unsigned int base;
247};
248
249
250struct snd_seq_ev_queue_control {
251 unsigned char queue;
252 unsigned char pad[3];
253 union {
254 signed int value;
255 union snd_seq_timestamp time;
256 unsigned int position;
257 struct snd_seq_queue_skew skew;
258 unsigned int d32[2];
259 unsigned char d8[8];
260 } param;
261};
262
263
264struct snd_seq_ev_quote {
265 struct snd_seq_addr origin;
266 unsigned short value;
267 struct snd_seq_event *event;
268} __attribute__((packed));
269
270
271
272struct snd_seq_event {
273 snd_seq_event_type_t type;
274 unsigned char flags;
275 char tag;
276
277 unsigned char queue;
278 union snd_seq_timestamp time;
279
280
281 struct snd_seq_addr source;
282 struct snd_seq_addr dest;
283
284 union {
285 struct snd_seq_ev_note note;
286 struct snd_seq_ev_ctrl control;
287 struct snd_seq_ev_raw8 raw8;
288 struct snd_seq_ev_raw32 raw32;
289 struct snd_seq_ev_ext ext;
290 struct snd_seq_ev_queue_control queue;
291 union snd_seq_timestamp time;
292 struct snd_seq_addr addr;
293 struct snd_seq_connect connect;
294 struct snd_seq_result result;
295 struct snd_seq_ev_quote quote;
296 } data;
297};
298
299
300
301
302
303struct snd_seq_event_bounce {
304 int err;
305 struct snd_seq_event event;
306
307};
308
309
310
311struct snd_seq_system_info {
312 int queues;
313 int clients;
314 int ports;
315 int channels;
316 int cur_clients;
317 int cur_queues;
318 char reserved[24];
319};
320
321
322
323struct snd_seq_running_info {
324 unsigned char client;
325 unsigned char big_endian;
326 unsigned char cpu_mode;
327 unsigned char pad;
328 unsigned char reserved[12];
329};
330
331
332
333#define SNDRV_SEQ_CLIENT_SYSTEM 0
334
335#define SNDRV_SEQ_CLIENT_DUMMY 14
336#define SNDRV_SEQ_CLIENT_OSS 15
337
338
339
340typedef int __bitwise snd_seq_client_type_t;
341#define NO_CLIENT ((__force snd_seq_client_type_t) 0)
342#define USER_CLIENT ((__force snd_seq_client_type_t) 1)
343#define KERNEL_CLIENT ((__force snd_seq_client_type_t) 2)
344
345
346#define SNDRV_SEQ_FILTER_BROADCAST (1<<0)
347#define SNDRV_SEQ_FILTER_MULTICAST (1<<1)
348#define SNDRV_SEQ_FILTER_BOUNCE (1<<2)
349#define SNDRV_SEQ_FILTER_USE_EVENT (1<<31)
350
351struct snd_seq_client_info {
352 int client;
353 snd_seq_client_type_t type;
354 char name[64];
355 unsigned int filter;
356 unsigned char multicast_filter[8];
357 unsigned char event_filter[32];
358 int num_ports;
359 int event_lost;
360 char reserved[64];
361};
362
363
364
365struct snd_seq_client_pool {
366 int client;
367 int output_pool;
368 int input_pool;
369 int output_room;
370 int output_free;
371 int input_free;
372 char reserved[64];
373};
374
375
376
377
378#define SNDRV_SEQ_REMOVE_INPUT (1<<0)
379#define SNDRV_SEQ_REMOVE_OUTPUT (1<<1)
380#define SNDRV_SEQ_REMOVE_DEST (1<<2)
381#define SNDRV_SEQ_REMOVE_DEST_CHANNEL (1<<3)
382#define SNDRV_SEQ_REMOVE_TIME_BEFORE (1<<4)
383#define SNDRV_SEQ_REMOVE_TIME_AFTER (1<<5)
384#define SNDRV_SEQ_REMOVE_TIME_TICK (1<<6)
385#define SNDRV_SEQ_REMOVE_EVENT_TYPE (1<<7)
386#define SNDRV_SEQ_REMOVE_IGNORE_OFF (1<<8)
387#define SNDRV_SEQ_REMOVE_TAG_MATCH (1<<9)
388
389struct snd_seq_remove_events {
390 unsigned int remove_mode;
391
392 union snd_seq_timestamp time;
393
394 unsigned char queue;
395 struct snd_seq_addr dest;
396 unsigned char channel;
397
398 int type;
399 char tag;
400
401 int reserved[10];
402
403};
404
405
406
407#define SNDRV_SEQ_PORT_SYSTEM_TIMER 0
408#define SNDRV_SEQ_PORT_SYSTEM_ANNOUNCE 1
409
410
411#define SNDRV_SEQ_PORT_CAP_READ (1<<0)
412#define SNDRV_SEQ_PORT_CAP_WRITE (1<<1)
413
414#define SNDRV_SEQ_PORT_CAP_SYNC_READ (1<<2)
415#define SNDRV_SEQ_PORT_CAP_SYNC_WRITE (1<<3)
416
417#define SNDRV_SEQ_PORT_CAP_DUPLEX (1<<4)
418
419#define SNDRV_SEQ_PORT_CAP_SUBS_READ (1<<5)
420#define SNDRV_SEQ_PORT_CAP_SUBS_WRITE (1<<6)
421#define SNDRV_SEQ_PORT_CAP_NO_EXPORT (1<<7)
422
423
424#define SNDRV_SEQ_PORT_TYPE_SPECIFIC (1<<0)
425#define SNDRV_SEQ_PORT_TYPE_MIDI_GENERIC (1<<1)
426#define SNDRV_SEQ_PORT_TYPE_MIDI_GM (1<<2)
427#define SNDRV_SEQ_PORT_TYPE_MIDI_GS (1<<3)
428#define SNDRV_SEQ_PORT_TYPE_MIDI_XG (1<<4)
429#define SNDRV_SEQ_PORT_TYPE_MIDI_MT32 (1<<5)
430#define SNDRV_SEQ_PORT_TYPE_MIDI_GM2 (1<<6)
431
432
433#define SNDRV_SEQ_PORT_TYPE_SYNTH (1<<10)
434#define SNDRV_SEQ_PORT_TYPE_DIRECT_SAMPLE (1<<11)
435#define SNDRV_SEQ_PORT_TYPE_SAMPLE (1<<12)
436
437#define SNDRV_SEQ_PORT_TYPE_HARDWARE (1<<16)
438#define SNDRV_SEQ_PORT_TYPE_SOFTWARE (1<<17)
439#define SNDRV_SEQ_PORT_TYPE_SYNTHESIZER (1<<18)
440#define SNDRV_SEQ_PORT_TYPE_PORT (1<<19)
441#define SNDRV_SEQ_PORT_TYPE_APPLICATION (1<<20)
442
443
444#define SNDRV_SEQ_PORT_FLG_GIVEN_PORT (1<<0)
445#define SNDRV_SEQ_PORT_FLG_TIMESTAMP (1<<1)
446#define SNDRV_SEQ_PORT_FLG_TIME_REAL (1<<2)
447
448struct snd_seq_port_info {
449 struct snd_seq_addr addr;
450 char name[64];
451
452 unsigned int capability;
453 unsigned int type;
454 int midi_channels;
455 int midi_voices;
456 int synth_voices;
457
458 int read_use;
459 int write_use;
460
461 void *kernel;
462 unsigned int flags;
463 unsigned char time_queue;
464 char reserved[59];
465};
466
467
468
469#define SNDRV_SEQ_QUEUE_FLG_SYNC (1<<0)
470
471
472struct snd_seq_queue_info {
473 int queue;
474
475
476
477
478
479 int owner;
480 unsigned locked:1;
481 char name[64];
482 unsigned int flags;
483 char reserved[60];
484
485};
486
487
488struct snd_seq_queue_status {
489 int queue;
490 int events;
491 snd_seq_tick_time_t tick;
492 struct snd_seq_real_time time;
493 int running;
494 int flags;
495 char reserved[64];
496};
497
498
499
500struct snd_seq_queue_tempo {
501 int queue;
502 unsigned int tempo;
503 int ppq;
504 unsigned int skew_value;
505 unsigned int skew_base;
506 char reserved[24];
507};
508
509
510
511#define SNDRV_SEQ_TIMER_ALSA 0
512#define SNDRV_SEQ_TIMER_MIDI_CLOCK 1
513#define SNDRV_SEQ_TIMER_MIDI_TICK 2
514
515
516struct snd_seq_queue_timer {
517 int queue;
518 int type;
519 union {
520 struct {
521 struct snd_timer_id id;
522 unsigned int resolution;
523 } alsa;
524 } u;
525 char reserved[64];
526};
527
528
529struct snd_seq_queue_client {
530 int queue;
531 int client;
532 int used;
533
534
535 char reserved[64];
536};
537
538
539#define SNDRV_SEQ_PORT_SUBS_EXCLUSIVE (1<<0)
540#define SNDRV_SEQ_PORT_SUBS_TIMESTAMP (1<<1)
541#define SNDRV_SEQ_PORT_SUBS_TIME_REAL (1<<2)
542
543struct snd_seq_port_subscribe {
544 struct snd_seq_addr sender;
545 struct snd_seq_addr dest;
546 unsigned int voices;
547 unsigned int flags;
548 unsigned char queue;
549 unsigned char pad[3];
550 char reserved[64];
551};
552
553
554#define SNDRV_SEQ_QUERY_SUBS_READ 0
555#define SNDRV_SEQ_QUERY_SUBS_WRITE 1
556
557struct snd_seq_query_subs {
558 struct snd_seq_addr root;
559 int type;
560 int index;
561 int num_subs;
562 struct snd_seq_addr addr;
563 unsigned char queue;
564 unsigned int flags;
565 char reserved[64];
566};
567
568
569
570
571
572
573#define SNDRV_SEQ_IOCTL_PVERSION _IOR ('S', 0x00, int)
574#define SNDRV_SEQ_IOCTL_CLIENT_ID _IOR ('S', 0x01, int)
575#define SNDRV_SEQ_IOCTL_SYSTEM_INFO _IOWR('S', 0x02, struct snd_seq_system_info)
576#define SNDRV_SEQ_IOCTL_RUNNING_MODE _IOWR('S', 0x03, struct snd_seq_running_info)
577
578#define SNDRV_SEQ_IOCTL_GET_CLIENT_INFO _IOWR('S', 0x10, struct snd_seq_client_info)
579#define SNDRV_SEQ_IOCTL_SET_CLIENT_INFO _IOW ('S', 0x11, struct snd_seq_client_info)
580
581#define SNDRV_SEQ_IOCTL_CREATE_PORT _IOWR('S', 0x20, struct snd_seq_port_info)
582#define SNDRV_SEQ_IOCTL_DELETE_PORT _IOW ('S', 0x21, struct snd_seq_port_info)
583#define SNDRV_SEQ_IOCTL_GET_PORT_INFO _IOWR('S', 0x22, struct snd_seq_port_info)
584#define SNDRV_SEQ_IOCTL_SET_PORT_INFO _IOW ('S', 0x23, struct snd_seq_port_info)
585
586#define SNDRV_SEQ_IOCTL_SUBSCRIBE_PORT _IOW ('S', 0x30, struct snd_seq_port_subscribe)
587#define SNDRV_SEQ_IOCTL_UNSUBSCRIBE_PORT _IOW ('S', 0x31, struct snd_seq_port_subscribe)
588
589#define SNDRV_SEQ_IOCTL_CREATE_QUEUE _IOWR('S', 0x32, struct snd_seq_queue_info)
590#define SNDRV_SEQ_IOCTL_DELETE_QUEUE _IOW ('S', 0x33, struct snd_seq_queue_info)
591#define SNDRV_SEQ_IOCTL_GET_QUEUE_INFO _IOWR('S', 0x34, struct snd_seq_queue_info)
592#define SNDRV_SEQ_IOCTL_SET_QUEUE_INFO _IOWR('S', 0x35, struct snd_seq_queue_info)
593#define SNDRV_SEQ_IOCTL_GET_NAMED_QUEUE _IOWR('S', 0x36, struct snd_seq_queue_info)
594#define SNDRV_SEQ_IOCTL_GET_QUEUE_STATUS _IOWR('S', 0x40, struct snd_seq_queue_status)
595#define SNDRV_SEQ_IOCTL_GET_QUEUE_TEMPO _IOWR('S', 0x41, struct snd_seq_queue_tempo)
596#define SNDRV_SEQ_IOCTL_SET_QUEUE_TEMPO _IOW ('S', 0x42, struct snd_seq_queue_tempo)
597#define SNDRV_SEQ_IOCTL_GET_QUEUE_OWNER _IOWR('S', 0x43, struct snd_seq_queue_owner)
598#define SNDRV_SEQ_IOCTL_SET_QUEUE_OWNER _IOW ('S', 0x44, struct snd_seq_queue_owner)
599#define SNDRV_SEQ_IOCTL_GET_QUEUE_TIMER _IOWR('S', 0x45, struct snd_seq_queue_timer)
600#define SNDRV_SEQ_IOCTL_SET_QUEUE_TIMER _IOW ('S', 0x46, struct snd_seq_queue_timer)
601
602
603
604
605#define SNDRV_SEQ_IOCTL_GET_QUEUE_CLIENT _IOWR('S', 0x49, struct snd_seq_queue_client)
606#define SNDRV_SEQ_IOCTL_SET_QUEUE_CLIENT _IOW ('S', 0x4a, struct snd_seq_queue_client)
607#define SNDRV_SEQ_IOCTL_GET_CLIENT_POOL _IOWR('S', 0x4b, struct snd_seq_client_pool)
608#define SNDRV_SEQ_IOCTL_SET_CLIENT_POOL _IOW ('S', 0x4c, struct snd_seq_client_pool)
609#define SNDRV_SEQ_IOCTL_REMOVE_EVENTS _IOW ('S', 0x4e, struct snd_seq_remove_events)
610#define SNDRV_SEQ_IOCTL_QUERY_SUBS _IOWR('S', 0x4f, struct snd_seq_query_subs)
611#define SNDRV_SEQ_IOCTL_GET_SUBSCRIPTION _IOWR('S', 0x50, struct snd_seq_port_subscribe)
612#define SNDRV_SEQ_IOCTL_QUERY_NEXT_CLIENT _IOWR('S', 0x51, struct snd_seq_client_info)
613#define SNDRV_SEQ_IOCTL_QUERY_NEXT_PORT _IOWR('S', 0x52, struct snd_seq_port_info)
614
615#endif
616