0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023 #ifndef _UAPI__SOUND_ASEQUENCER_H
0024 #define _UAPI__SOUND_ASEQUENCER_H
0025
0026 #include <sound/asound.h>
0027
0028
0029 #define SNDRV_SEQ_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 2)
0030
0031
0032
0033
0034
0035
0036
0037
0038 #define SNDRV_SEQ_EVENT_SYSTEM 0
0039 #define SNDRV_SEQ_EVENT_RESULT 1
0040
0041
0042
0043
0044 #define SNDRV_SEQ_EVENT_NOTE 5
0045 #define SNDRV_SEQ_EVENT_NOTEON 6
0046 #define SNDRV_SEQ_EVENT_NOTEOFF 7
0047 #define SNDRV_SEQ_EVENT_KEYPRESS 8
0048
0049
0050
0051
0052 #define SNDRV_SEQ_EVENT_CONTROLLER 10
0053 #define SNDRV_SEQ_EVENT_PGMCHANGE 11
0054 #define SNDRV_SEQ_EVENT_CHANPRESS 12
0055 #define SNDRV_SEQ_EVENT_PITCHBEND 13
0056 #define SNDRV_SEQ_EVENT_CONTROL14 14
0057 #define SNDRV_SEQ_EVENT_NONREGPARAM 15
0058 #define SNDRV_SEQ_EVENT_REGPARAM 16
0059
0060
0061
0062
0063 #define SNDRV_SEQ_EVENT_SONGPOS 20
0064 #define SNDRV_SEQ_EVENT_SONGSEL 21
0065 #define SNDRV_SEQ_EVENT_QFRAME 22
0066 #define SNDRV_SEQ_EVENT_TIMESIGN 23
0067 #define SNDRV_SEQ_EVENT_KEYSIGN 24
0068
0069
0070
0071
0072 #define SNDRV_SEQ_EVENT_START 30
0073 #define SNDRV_SEQ_EVENT_CONTINUE 31
0074 #define SNDRV_SEQ_EVENT_STOP 32
0075 #define SNDRV_SEQ_EVENT_SETPOS_TICK 33
0076 #define SNDRV_SEQ_EVENT_SETPOS_TIME 34
0077 #define SNDRV_SEQ_EVENT_TEMPO 35
0078 #define SNDRV_SEQ_EVENT_CLOCK 36
0079 #define SNDRV_SEQ_EVENT_TICK 37
0080 #define SNDRV_SEQ_EVENT_QUEUE_SKEW 38
0081
0082
0083
0084
0085 #define SNDRV_SEQ_EVENT_TUNE_REQUEST 40
0086 #define SNDRV_SEQ_EVENT_RESET 41
0087 #define SNDRV_SEQ_EVENT_SENSING 42
0088
0089
0090
0091
0092 #define SNDRV_SEQ_EVENT_ECHO 50
0093 #define SNDRV_SEQ_EVENT_OSS 51
0094
0095
0096
0097
0098 #define SNDRV_SEQ_EVENT_CLIENT_START 60
0099 #define SNDRV_SEQ_EVENT_CLIENT_EXIT 61
0100 #define SNDRV_SEQ_EVENT_CLIENT_CHANGE 62
0101 #define SNDRV_SEQ_EVENT_PORT_START 63
0102 #define SNDRV_SEQ_EVENT_PORT_EXIT 64
0103 #define SNDRV_SEQ_EVENT_PORT_CHANGE 65
0104
0105
0106
0107
0108 #define SNDRV_SEQ_EVENT_PORT_SUBSCRIBED 66
0109 #define SNDRV_SEQ_EVENT_PORT_UNSUBSCRIBED 67
0110
0111
0112
0113
0114
0115
0116 #define SNDRV_SEQ_EVENT_USR0 90
0117 #define SNDRV_SEQ_EVENT_USR1 91
0118 #define SNDRV_SEQ_EVENT_USR2 92
0119 #define SNDRV_SEQ_EVENT_USR3 93
0120 #define SNDRV_SEQ_EVENT_USR4 94
0121 #define SNDRV_SEQ_EVENT_USR5 95
0122 #define SNDRV_SEQ_EVENT_USR6 96
0123 #define SNDRV_SEQ_EVENT_USR7 97
0124 #define SNDRV_SEQ_EVENT_USR8 98
0125 #define SNDRV_SEQ_EVENT_USR9 99
0126
0127
0128
0129
0130
0131
0132
0133
0134 #define SNDRV_SEQ_EVENT_SYSEX 130
0135 #define SNDRV_SEQ_EVENT_BOUNCE 131
0136
0137 #define SNDRV_SEQ_EVENT_USR_VAR0 135
0138 #define SNDRV_SEQ_EVENT_USR_VAR1 136
0139 #define SNDRV_SEQ_EVENT_USR_VAR2 137
0140 #define SNDRV_SEQ_EVENT_USR_VAR3 138
0141 #define SNDRV_SEQ_EVENT_USR_VAR4 139
0142
0143
0144 #define SNDRV_SEQ_EVENT_KERNEL_ERROR 150
0145 #define SNDRV_SEQ_EVENT_KERNEL_QUOTE 151
0146
0147
0148
0149
0150
0151
0152 #define SNDRV_SEQ_EVENT_NONE 255
0153
0154
0155 typedef unsigned char snd_seq_event_type_t;
0156
0157
0158 struct snd_seq_addr {
0159 unsigned char client;
0160 unsigned char port;
0161 };
0162
0163
0164 struct snd_seq_connect {
0165 struct snd_seq_addr sender;
0166 struct snd_seq_addr dest;
0167 };
0168
0169
0170 #define SNDRV_SEQ_ADDRESS_UNKNOWN 253
0171 #define SNDRV_SEQ_ADDRESS_SUBSCRIBERS 254
0172 #define SNDRV_SEQ_ADDRESS_BROADCAST 255
0173 #define SNDRV_SEQ_QUEUE_DIRECT 253
0174
0175
0176 #define SNDRV_SEQ_TIME_STAMP_TICK (0<<0)
0177 #define SNDRV_SEQ_TIME_STAMP_REAL (1<<0)
0178 #define SNDRV_SEQ_TIME_STAMP_MASK (1<<0)
0179
0180 #define SNDRV_SEQ_TIME_MODE_ABS (0<<1)
0181 #define SNDRV_SEQ_TIME_MODE_REL (1<<1)
0182 #define SNDRV_SEQ_TIME_MODE_MASK (1<<1)
0183
0184 #define SNDRV_SEQ_EVENT_LENGTH_FIXED (0<<2)
0185 #define SNDRV_SEQ_EVENT_LENGTH_VARIABLE (1<<2)
0186 #define SNDRV_SEQ_EVENT_LENGTH_VARUSR (2<<2)
0187 #define SNDRV_SEQ_EVENT_LENGTH_MASK (3<<2)
0188
0189 #define SNDRV_SEQ_PRIORITY_NORMAL (0<<4)
0190 #define SNDRV_SEQ_PRIORITY_HIGH (1<<4)
0191 #define SNDRV_SEQ_PRIORITY_MASK (1<<4)
0192
0193
0194
0195 struct snd_seq_ev_note {
0196 unsigned char channel;
0197 unsigned char note;
0198 unsigned char velocity;
0199 unsigned char off_velocity;
0200 unsigned int duration;
0201 };
0202
0203
0204 struct snd_seq_ev_ctrl {
0205 unsigned char channel;
0206 unsigned char unused1, unused2, unused3;
0207 unsigned int param;
0208 signed int value;
0209 };
0210
0211
0212 struct snd_seq_ev_raw8 {
0213 unsigned char d[12];
0214 };
0215
0216
0217 struct snd_seq_ev_raw32 {
0218 unsigned int d[3];
0219 };
0220
0221
0222 struct snd_seq_ev_ext {
0223 unsigned int len;
0224 void *ptr;
0225 } __attribute__((packed));
0226
0227 struct snd_seq_result {
0228 int event;
0229 int result;
0230 };
0231
0232
0233 struct snd_seq_real_time {
0234 unsigned int tv_sec;
0235 unsigned int tv_nsec;
0236 };
0237
0238 typedef unsigned int snd_seq_tick_time_t;
0239
0240 union snd_seq_timestamp {
0241 snd_seq_tick_time_t tick;
0242 struct snd_seq_real_time time;
0243 };
0244
0245 struct snd_seq_queue_skew {
0246 unsigned int value;
0247 unsigned int base;
0248 };
0249
0250
0251 struct snd_seq_ev_queue_control {
0252 unsigned char queue;
0253 unsigned char pad[3];
0254 union {
0255 signed int value;
0256 union snd_seq_timestamp time;
0257 unsigned int position;
0258 struct snd_seq_queue_skew skew;
0259 unsigned int d32[2];
0260 unsigned char d8[8];
0261 } param;
0262 };
0263
0264
0265 struct snd_seq_ev_quote {
0266 struct snd_seq_addr origin;
0267 unsigned short value;
0268 struct snd_seq_event *event;
0269 } __attribute__((packed));
0270
0271
0272
0273 struct snd_seq_event {
0274 snd_seq_event_type_t type;
0275 unsigned char flags;
0276 char tag;
0277
0278 unsigned char queue;
0279 union snd_seq_timestamp time;
0280
0281
0282 struct snd_seq_addr source;
0283 struct snd_seq_addr dest;
0284
0285 union {
0286 struct snd_seq_ev_note note;
0287 struct snd_seq_ev_ctrl control;
0288 struct snd_seq_ev_raw8 raw8;
0289 struct snd_seq_ev_raw32 raw32;
0290 struct snd_seq_ev_ext ext;
0291 struct snd_seq_ev_queue_control queue;
0292 union snd_seq_timestamp time;
0293 struct snd_seq_addr addr;
0294 struct snd_seq_connect connect;
0295 struct snd_seq_result result;
0296 struct snd_seq_ev_quote quote;
0297 } data;
0298 };
0299
0300
0301
0302
0303
0304 struct snd_seq_event_bounce {
0305 int err;
0306 struct snd_seq_event event;
0307
0308 };
0309
0310
0311
0312 struct snd_seq_system_info {
0313 int queues;
0314 int clients;
0315 int ports;
0316 int channels;
0317 int cur_clients;
0318 int cur_queues;
0319 char reserved[24];
0320 };
0321
0322
0323
0324 struct snd_seq_running_info {
0325 unsigned char client;
0326 unsigned char big_endian;
0327 unsigned char cpu_mode;
0328 unsigned char pad;
0329 unsigned char reserved[12];
0330 };
0331
0332
0333
0334 #define SNDRV_SEQ_CLIENT_SYSTEM 0
0335
0336 #define SNDRV_SEQ_CLIENT_DUMMY 14
0337 #define SNDRV_SEQ_CLIENT_OSS 15
0338
0339
0340
0341 typedef int __bitwise snd_seq_client_type_t;
0342 #define NO_CLIENT ((__force snd_seq_client_type_t) 0)
0343 #define USER_CLIENT ((__force snd_seq_client_type_t) 1)
0344 #define KERNEL_CLIENT ((__force snd_seq_client_type_t) 2)
0345
0346
0347 #define SNDRV_SEQ_FILTER_BROADCAST (1<<0)
0348 #define SNDRV_SEQ_FILTER_MULTICAST (1<<1)
0349 #define SNDRV_SEQ_FILTER_BOUNCE (1<<2)
0350 #define SNDRV_SEQ_FILTER_USE_EVENT (1<<31)
0351
0352 struct snd_seq_client_info {
0353 int client;
0354 snd_seq_client_type_t type;
0355 char name[64];
0356 unsigned int filter;
0357 unsigned char multicast_filter[8];
0358 unsigned char event_filter[32];
0359 int num_ports;
0360 int event_lost;
0361 int card;
0362 int pid;
0363 char reserved[56];
0364 };
0365
0366
0367
0368 struct snd_seq_client_pool {
0369 int client;
0370 int output_pool;
0371 int input_pool;
0372 int output_room;
0373 int output_free;
0374 int input_free;
0375 char reserved[64];
0376 };
0377
0378
0379
0380
0381 #define SNDRV_SEQ_REMOVE_INPUT (1<<0)
0382 #define SNDRV_SEQ_REMOVE_OUTPUT (1<<1)
0383 #define SNDRV_SEQ_REMOVE_DEST (1<<2)
0384 #define SNDRV_SEQ_REMOVE_DEST_CHANNEL (1<<3)
0385 #define SNDRV_SEQ_REMOVE_TIME_BEFORE (1<<4)
0386 #define SNDRV_SEQ_REMOVE_TIME_AFTER (1<<5)
0387 #define SNDRV_SEQ_REMOVE_TIME_TICK (1<<6)
0388 #define SNDRV_SEQ_REMOVE_EVENT_TYPE (1<<7)
0389 #define SNDRV_SEQ_REMOVE_IGNORE_OFF (1<<8)
0390 #define SNDRV_SEQ_REMOVE_TAG_MATCH (1<<9)
0391
0392 struct snd_seq_remove_events {
0393 unsigned int remove_mode;
0394
0395 union snd_seq_timestamp time;
0396
0397 unsigned char queue;
0398 struct snd_seq_addr dest;
0399 unsigned char channel;
0400
0401 int type;
0402 char tag;
0403
0404 int reserved[10];
0405
0406 };
0407
0408
0409
0410 #define SNDRV_SEQ_PORT_SYSTEM_TIMER 0
0411 #define SNDRV_SEQ_PORT_SYSTEM_ANNOUNCE 1
0412
0413
0414 #define SNDRV_SEQ_PORT_CAP_READ (1<<0)
0415 #define SNDRV_SEQ_PORT_CAP_WRITE (1<<1)
0416
0417 #define SNDRV_SEQ_PORT_CAP_SYNC_READ (1<<2)
0418 #define SNDRV_SEQ_PORT_CAP_SYNC_WRITE (1<<3)
0419
0420 #define SNDRV_SEQ_PORT_CAP_DUPLEX (1<<4)
0421
0422 #define SNDRV_SEQ_PORT_CAP_SUBS_READ (1<<5)
0423 #define SNDRV_SEQ_PORT_CAP_SUBS_WRITE (1<<6)
0424 #define SNDRV_SEQ_PORT_CAP_NO_EXPORT (1<<7)
0425
0426
0427 #define SNDRV_SEQ_PORT_TYPE_SPECIFIC (1<<0)
0428 #define SNDRV_SEQ_PORT_TYPE_MIDI_GENERIC (1<<1)
0429 #define SNDRV_SEQ_PORT_TYPE_MIDI_GM (1<<2)
0430 #define SNDRV_SEQ_PORT_TYPE_MIDI_GS (1<<3)
0431 #define SNDRV_SEQ_PORT_TYPE_MIDI_XG (1<<4)
0432 #define SNDRV_SEQ_PORT_TYPE_MIDI_MT32 (1<<5)
0433 #define SNDRV_SEQ_PORT_TYPE_MIDI_GM2 (1<<6)
0434
0435
0436 #define SNDRV_SEQ_PORT_TYPE_SYNTH (1<<10)
0437 #define SNDRV_SEQ_PORT_TYPE_DIRECT_SAMPLE (1<<11)
0438 #define SNDRV_SEQ_PORT_TYPE_SAMPLE (1<<12)
0439
0440 #define SNDRV_SEQ_PORT_TYPE_HARDWARE (1<<16)
0441 #define SNDRV_SEQ_PORT_TYPE_SOFTWARE (1<<17)
0442 #define SNDRV_SEQ_PORT_TYPE_SYNTHESIZER (1<<18)
0443 #define SNDRV_SEQ_PORT_TYPE_PORT (1<<19)
0444 #define SNDRV_SEQ_PORT_TYPE_APPLICATION (1<<20)
0445
0446
0447 #define SNDRV_SEQ_PORT_FLG_GIVEN_PORT (1<<0)
0448 #define SNDRV_SEQ_PORT_FLG_TIMESTAMP (1<<1)
0449 #define SNDRV_SEQ_PORT_FLG_TIME_REAL (1<<2)
0450
0451 struct snd_seq_port_info {
0452 struct snd_seq_addr addr;
0453 char name[64];
0454
0455 unsigned int capability;
0456 unsigned int type;
0457 int midi_channels;
0458 int midi_voices;
0459 int synth_voices;
0460
0461 int read_use;
0462 int write_use;
0463
0464 void *kernel;
0465 unsigned int flags;
0466 unsigned char time_queue;
0467 char reserved[59];
0468 };
0469
0470
0471
0472 #define SNDRV_SEQ_QUEUE_FLG_SYNC (1<<0)
0473
0474
0475 struct snd_seq_queue_info {
0476 int queue;
0477
0478
0479
0480
0481
0482 int owner;
0483 unsigned locked:1;
0484 char name[64];
0485 unsigned int flags;
0486 char reserved[60];
0487
0488 };
0489
0490
0491 struct snd_seq_queue_status {
0492 int queue;
0493 int events;
0494 snd_seq_tick_time_t tick;
0495 struct snd_seq_real_time time;
0496 int running;
0497 int flags;
0498 char reserved[64];
0499 };
0500
0501
0502
0503 struct snd_seq_queue_tempo {
0504 int queue;
0505 unsigned int tempo;
0506 int ppq;
0507 unsigned int skew_value;
0508 unsigned int skew_base;
0509 char reserved[24];
0510 };
0511
0512
0513
0514 #define SNDRV_SEQ_TIMER_ALSA 0
0515 #define SNDRV_SEQ_TIMER_MIDI_CLOCK 1
0516 #define SNDRV_SEQ_TIMER_MIDI_TICK 2
0517
0518
0519 struct snd_seq_queue_timer {
0520 int queue;
0521 int type;
0522 union {
0523 struct {
0524 struct snd_timer_id id;
0525 unsigned int resolution;
0526 } alsa;
0527 } u;
0528 char reserved[64];
0529 };
0530
0531
0532 struct snd_seq_queue_client {
0533 int queue;
0534 int client;
0535 int used;
0536
0537
0538 char reserved[64];
0539 };
0540
0541
0542 #define SNDRV_SEQ_PORT_SUBS_EXCLUSIVE (1<<0)
0543 #define SNDRV_SEQ_PORT_SUBS_TIMESTAMP (1<<1)
0544 #define SNDRV_SEQ_PORT_SUBS_TIME_REAL (1<<2)
0545
0546 struct snd_seq_port_subscribe {
0547 struct snd_seq_addr sender;
0548 struct snd_seq_addr dest;
0549 unsigned int voices;
0550 unsigned int flags;
0551 unsigned char queue;
0552 unsigned char pad[3];
0553 char reserved[64];
0554 };
0555
0556
0557 #define SNDRV_SEQ_QUERY_SUBS_READ 0
0558 #define SNDRV_SEQ_QUERY_SUBS_WRITE 1
0559
0560 struct snd_seq_query_subs {
0561 struct snd_seq_addr root;
0562 int type;
0563 int index;
0564 int num_subs;
0565 struct snd_seq_addr addr;
0566 unsigned char queue;
0567 unsigned int flags;
0568 char reserved[64];
0569 };
0570
0571
0572
0573
0574
0575
0576 #define SNDRV_SEQ_IOCTL_PVERSION _IOR ('S', 0x00, int)
0577 #define SNDRV_SEQ_IOCTL_CLIENT_ID _IOR ('S', 0x01, int)
0578 #define SNDRV_SEQ_IOCTL_SYSTEM_INFO _IOWR('S', 0x02, struct snd_seq_system_info)
0579 #define SNDRV_SEQ_IOCTL_RUNNING_MODE _IOWR('S', 0x03, struct snd_seq_running_info)
0580
0581 #define SNDRV_SEQ_IOCTL_GET_CLIENT_INFO _IOWR('S', 0x10, struct snd_seq_client_info)
0582 #define SNDRV_SEQ_IOCTL_SET_CLIENT_INFO _IOW ('S', 0x11, struct snd_seq_client_info)
0583
0584 #define SNDRV_SEQ_IOCTL_CREATE_PORT _IOWR('S', 0x20, struct snd_seq_port_info)
0585 #define SNDRV_SEQ_IOCTL_DELETE_PORT _IOW ('S', 0x21, struct snd_seq_port_info)
0586 #define SNDRV_SEQ_IOCTL_GET_PORT_INFO _IOWR('S', 0x22, struct snd_seq_port_info)
0587 #define SNDRV_SEQ_IOCTL_SET_PORT_INFO _IOW ('S', 0x23, struct snd_seq_port_info)
0588
0589 #define SNDRV_SEQ_IOCTL_SUBSCRIBE_PORT _IOW ('S', 0x30, struct snd_seq_port_subscribe)
0590 #define SNDRV_SEQ_IOCTL_UNSUBSCRIBE_PORT _IOW ('S', 0x31, struct snd_seq_port_subscribe)
0591
0592 #define SNDRV_SEQ_IOCTL_CREATE_QUEUE _IOWR('S', 0x32, struct snd_seq_queue_info)
0593 #define SNDRV_SEQ_IOCTL_DELETE_QUEUE _IOW ('S', 0x33, struct snd_seq_queue_info)
0594 #define SNDRV_SEQ_IOCTL_GET_QUEUE_INFO _IOWR('S', 0x34, struct snd_seq_queue_info)
0595 #define SNDRV_SEQ_IOCTL_SET_QUEUE_INFO _IOWR('S', 0x35, struct snd_seq_queue_info)
0596 #define SNDRV_SEQ_IOCTL_GET_NAMED_QUEUE _IOWR('S', 0x36, struct snd_seq_queue_info)
0597 #define SNDRV_SEQ_IOCTL_GET_QUEUE_STATUS _IOWR('S', 0x40, struct snd_seq_queue_status)
0598 #define SNDRV_SEQ_IOCTL_GET_QUEUE_TEMPO _IOWR('S', 0x41, struct snd_seq_queue_tempo)
0599 #define SNDRV_SEQ_IOCTL_SET_QUEUE_TEMPO _IOW ('S', 0x42, struct snd_seq_queue_tempo)
0600 #define SNDRV_SEQ_IOCTL_GET_QUEUE_TIMER _IOWR('S', 0x45, struct snd_seq_queue_timer)
0601 #define SNDRV_SEQ_IOCTL_SET_QUEUE_TIMER _IOW ('S', 0x46, struct snd_seq_queue_timer)
0602 #define SNDRV_SEQ_IOCTL_GET_QUEUE_CLIENT _IOWR('S', 0x49, struct snd_seq_queue_client)
0603 #define SNDRV_SEQ_IOCTL_SET_QUEUE_CLIENT _IOW ('S', 0x4a, struct snd_seq_queue_client)
0604 #define SNDRV_SEQ_IOCTL_GET_CLIENT_POOL _IOWR('S', 0x4b, struct snd_seq_client_pool)
0605 #define SNDRV_SEQ_IOCTL_SET_CLIENT_POOL _IOW ('S', 0x4c, struct snd_seq_client_pool)
0606 #define SNDRV_SEQ_IOCTL_REMOVE_EVENTS _IOW ('S', 0x4e, struct snd_seq_remove_events)
0607 #define SNDRV_SEQ_IOCTL_QUERY_SUBS _IOWR('S', 0x4f, struct snd_seq_query_subs)
0608 #define SNDRV_SEQ_IOCTL_GET_SUBSCRIPTION _IOWR('S', 0x50, struct snd_seq_port_subscribe)
0609 #define SNDRV_SEQ_IOCTL_QUERY_NEXT_CLIENT _IOWR('S', 0x51, struct snd_seq_client_info)
0610 #define SNDRV_SEQ_IOCTL_QUERY_NEXT_PORT _IOWR('S', 0x52, struct snd_seq_port_info)
0611
0612 #endif