1 /**************************************************************************** 2 **************************************************************************** 3 *** 4 *** This header was automatically generated from a Linux kernel header 5 *** of the same name, to make information necessary for userspace to 6 *** call into the kernel available to libc. It contains only constants, 7 *** structures, and macros generated from the original header, and thus, 8 *** contains no copyrightable information. 9 *** 10 *** To edit the content of this header, modify the corresponding 11 *** source file (e.g. under external/kernel-headers/original/) then 12 *** run bionic/libc/kernel/tools/update_all.py 13 *** 14 *** Any manual change here will be lost the next time this script will 15 *** be run. You've been warned! 16 *** 17 **************************************************************************** 18 ****************************************************************************/ 19 #ifndef _UAPISOUNDCARD_H 20 #define _UAPISOUNDCARD_H 21 #define SOUND_VERSION 0x030802 22 #define OPEN_SOUND_SYSTEM 23 #include <linux/ioctl.h> 24 #include <endian.h> 25 #define SNDCARD_ADLIB 1 26 #define SNDCARD_SB 2 27 #define SNDCARD_PAS 3 28 #define SNDCARD_GUS 4 29 #define SNDCARD_MPU401 5 30 #define SNDCARD_SB16 6 31 #define SNDCARD_SB16MIDI 7 32 #define SNDCARD_UART6850 8 33 #define SNDCARD_GUS16 9 34 #define SNDCARD_MSS 10 35 #define SNDCARD_PSS 11 36 #define SNDCARD_SSCAPE 12 37 #define SNDCARD_PSS_MPU 13 38 #define SNDCARD_PSS_MSS 14 39 #define SNDCARD_SSCAPE_MSS 15 40 #define SNDCARD_TRXPRO 16 41 #define SNDCARD_TRXPRO_SB 17 42 #define SNDCARD_TRXPRO_MPU 18 43 #define SNDCARD_MAD16 19 44 #define SNDCARD_MAD16_MPU 20 45 #define SNDCARD_CS4232 21 46 #define SNDCARD_CS4232_MPU 22 47 #define SNDCARD_MAUI 23 48 #define SNDCARD_PSEUDO_MSS 24 49 #define SNDCARD_GUSPNP 25 50 #define SNDCARD_UART401 26 51 #ifndef _SIOWR 52 #if defined(_IOWR) && (defined(_AIX) || !defined(sun) && !defined(sparc) && !defined(__sparc__) && !defined(__INCioctlh) && !defined(__Lynx__)) 53 #define SIOCPARM_MASK IOCPARM_MASK 54 #define SIOC_VOID IOC_VOID 55 #define SIOC_OUT IOC_OUT 56 #define SIOC_IN IOC_IN 57 #define SIOC_INOUT IOC_INOUT 58 #define _SIOC_SIZE _IOC_SIZE 59 #define _SIOC_DIR _IOC_DIR 60 #define _SIOC_NONE _IOC_NONE 61 #define _SIOC_READ _IOC_READ 62 #define _SIOC_WRITE _IOC_WRITE 63 #define _SIO _IO 64 #define _SIOR _IOR 65 #define _SIOW _IOW 66 #define _SIOWR _IOWR 67 #else 68 #define SIOCPARM_MASK 0x1fff 69 #define SIOC_VOID 0x00000000 70 #define SIOC_OUT 0x20000000 71 #define SIOC_IN 0x40000000 72 #define SIOC_INOUT (SIOC_IN | SIOC_OUT) 73 #define _SIO(x,y) ((int) (SIOC_VOID | (x << 8) | y)) 74 #define _SIOR(x,y,t) ((int) (SIOC_OUT | ((sizeof(t) & SIOCPARM_MASK) << 16) | (x << 8) | y)) 75 #define _SIOW(x,y,t) ((int) (SIOC_IN | ((sizeof(t) & SIOCPARM_MASK) << 16) | (x << 8) | y)) 76 #define _SIOWR(x,y,t) ((int) (SIOC_INOUT | ((sizeof(t) & SIOCPARM_MASK) << 16) | (x << 8) | y)) 77 #define _SIOC_SIZE(x) ((x >> 16) & SIOCPARM_MASK) 78 #define _SIOC_DIR(x) (x & 0xf0000000) 79 #define _SIOC_NONE SIOC_VOID 80 #define _SIOC_READ SIOC_OUT 81 #define _SIOC_WRITE SIOC_IN 82 #endif 83 #endif 84 #define SNDCTL_SEQ_RESET _SIO('Q', 0) 85 #define SNDCTL_SEQ_SYNC _SIO('Q', 1) 86 #define SNDCTL_SYNTH_INFO _SIOWR('Q', 2, struct synth_info) 87 #define SNDCTL_SEQ_CTRLRATE _SIOWR('Q', 3, int) 88 #define SNDCTL_SEQ_GETOUTCOUNT _SIOR('Q', 4, int) 89 #define SNDCTL_SEQ_GETINCOUNT _SIOR('Q', 5, int) 90 #define SNDCTL_SEQ_PERCMODE _SIOW('Q', 6, int) 91 #define SNDCTL_FM_LOAD_INSTR _SIOW('Q', 7, struct sbi_instrument) 92 #define SNDCTL_SEQ_TESTMIDI _SIOW('Q', 8, int) 93 #define SNDCTL_SEQ_RESETSAMPLES _SIOW('Q', 9, int) 94 #define SNDCTL_SEQ_NRSYNTHS _SIOR('Q', 10, int) 95 #define SNDCTL_SEQ_NRMIDIS _SIOR('Q', 11, int) 96 #define SNDCTL_MIDI_INFO _SIOWR('Q', 12, struct midi_info) 97 #define SNDCTL_SEQ_THRESHOLD _SIOW('Q', 13, int) 98 #define SNDCTL_SYNTH_MEMAVL _SIOWR('Q', 14, int) 99 #define SNDCTL_FM_4OP_ENABLE _SIOW('Q', 15, int) 100 #define SNDCTL_SEQ_PANIC _SIO('Q', 17) 101 #define SNDCTL_SEQ_OUTOFBAND _SIOW('Q', 18, struct seq_event_rec) 102 #define SNDCTL_SEQ_GETTIME _SIOR('Q', 19, int) 103 #define SNDCTL_SYNTH_ID _SIOWR('Q', 20, struct synth_info) 104 #define SNDCTL_SYNTH_CONTROL _SIOWR('Q', 21, struct synth_control) 105 #define SNDCTL_SYNTH_REMOVESAMPLE _SIOWR('Q', 22, struct remove_sample) 106 typedef struct synth_control { 107 int devno; 108 char data[4000]; 109 } synth_control; 110 typedef struct remove_sample { 111 int devno; 112 int bankno; 113 int instrno; 114 } remove_sample; 115 typedef struct seq_event_rec { 116 unsigned char arr[8]; 117 } seq_event_rec; 118 #define SNDCTL_TMR_TIMEBASE _SIOWR('T', 1, int) 119 #define SNDCTL_TMR_START _SIO('T', 2) 120 #define SNDCTL_TMR_STOP _SIO('T', 3) 121 #define SNDCTL_TMR_CONTINUE _SIO('T', 4) 122 #define SNDCTL_TMR_TEMPO _SIOWR('T', 5, int) 123 #define SNDCTL_TMR_SOURCE _SIOWR('T', 6, int) 124 #define TMR_INTERNAL 0x00000001 125 #define TMR_EXTERNAL 0x00000002 126 #define TMR_MODE_MIDI 0x00000010 127 #define TMR_MODE_FSK 0x00000020 128 #define TMR_MODE_CLS 0x00000040 129 #define TMR_MODE_SMPTE 0x00000080 130 #define SNDCTL_TMR_METRONOME _SIOW('T', 7, int) 131 #define SNDCTL_TMR_SELECT _SIOW('T', 8, int) 132 #define _LINUX_PATCHKEY_H_INDIRECT 133 #include <linux/patchkey.h> 134 #undef _LINUX_PATCHKEY_H_INDIRECT 135 #ifdef __BYTE_ORDER 136 #if __BYTE_ORDER == __BIG_ENDIAN 137 #define AFMT_S16_NE AFMT_S16_BE 138 #elif __BYTE_ORDER==__LITTLE_ENDIAN 139 #define AFMT_S16_NE AFMT_S16_LE 140 #else 141 #error "could not determine byte order" 142 #endif 143 #endif 144 struct patch_info { 145 unsigned short key; 146 #define WAVE_PATCH _PATCHKEY(0x04) 147 #define GUS_PATCH WAVE_PATCH 148 #define WAVEFRONT_PATCH _PATCHKEY(0x06) 149 short device_no; 150 short instr_no; 151 unsigned int mode; 152 #define WAVE_16_BITS 0x01 153 #define WAVE_UNSIGNED 0x02 154 #define WAVE_LOOPING 0x04 155 #define WAVE_BIDIR_LOOP 0x08 156 #define WAVE_LOOP_BACK 0x10 157 #define WAVE_SUSTAIN_ON 0x20 158 #define WAVE_ENVELOPES 0x40 159 #define WAVE_FAST_RELEASE 0x80 160 #define WAVE_VIBRATO 0x00010000 161 #define WAVE_TREMOLO 0x00020000 162 #define WAVE_SCALE 0x00040000 163 #define WAVE_FRACTIONS 0x00080000 164 #define WAVE_ROM 0x40000000 165 #define WAVE_MULAW 0x20000000 166 int len; 167 int loop_start, loop_end; 168 unsigned int base_freq; 169 unsigned int base_note; 170 unsigned int high_note; 171 unsigned int low_note; 172 int panning; 173 int detuning; 174 unsigned char env_rate[6]; 175 unsigned char env_offset[6]; 176 unsigned char tremolo_sweep; 177 unsigned char tremolo_rate; 178 unsigned char tremolo_depth; 179 unsigned char vibrato_sweep; 180 unsigned char vibrato_rate; 181 unsigned char vibrato_depth; 182 int scale_frequency; 183 unsigned int scale_factor; 184 int volume; 185 int fractions; 186 int reserved1; 187 int spare[2]; 188 char data[1]; 189 }; 190 struct sysex_info { 191 short key; 192 #define SYSEX_PATCH _PATCHKEY(0x05) 193 #define MAUI_PATCH _PATCHKEY(0x06) 194 short device_no; 195 int len; 196 unsigned char data[1]; 197 }; 198 #define SEQ_NOTEOFF 0 199 #define SEQ_FMNOTEOFF SEQ_NOTEOFF 200 #define SEQ_NOTEON 1 201 #define SEQ_FMNOTEON SEQ_NOTEON 202 #define SEQ_WAIT TMR_WAIT_ABS 203 #define SEQ_PGMCHANGE 3 204 #define SEQ_FMPGMCHANGE SEQ_PGMCHANGE 205 #define SEQ_SYNCTIMER TMR_START 206 #define SEQ_MIDIPUTC 5 207 #define SEQ_DRUMON 6 208 #define SEQ_DRUMOFF 7 209 #define SEQ_ECHO TMR_ECHO 210 #define SEQ_AFTERTOUCH 9 211 #define SEQ_CONTROLLER 10 212 #define CTL_BANK_SELECT 0x00 213 #define CTL_MODWHEEL 0x01 214 #define CTL_BREATH 0x02 215 #define CTL_FOOT 0x04 216 #define CTL_PORTAMENTO_TIME 0x05 217 #define CTL_DATA_ENTRY 0x06 218 #define CTL_MAIN_VOLUME 0x07 219 #define CTL_BALANCE 0x08 220 #define CTL_PAN 0x0a 221 #define CTL_EXPRESSION 0x0b 222 #define CTL_GENERAL_PURPOSE1 0x10 223 #define CTL_GENERAL_PURPOSE2 0x11 224 #define CTL_GENERAL_PURPOSE3 0x12 225 #define CTL_GENERAL_PURPOSE4 0x13 226 #define CTL_DAMPER_PEDAL 0x40 227 #define CTL_SUSTAIN 0x40 228 #define CTL_HOLD 0x40 229 #define CTL_PORTAMENTO 0x41 230 #define CTL_SOSTENUTO 0x42 231 #define CTL_SOFT_PEDAL 0x43 232 #define CTL_HOLD2 0x45 233 #define CTL_GENERAL_PURPOSE5 0x50 234 #define CTL_GENERAL_PURPOSE6 0x51 235 #define CTL_GENERAL_PURPOSE7 0x52 236 #define CTL_GENERAL_PURPOSE8 0x53 237 #define CTL_EXT_EFF_DEPTH 0x5b 238 #define CTL_TREMOLO_DEPTH 0x5c 239 #define CTL_CHORUS_DEPTH 0x5d 240 #define CTL_DETUNE_DEPTH 0x5e 241 #define CTL_CELESTE_DEPTH 0x5e 242 #define CTL_PHASER_DEPTH 0x5f 243 #define CTL_DATA_INCREMENT 0x60 244 #define CTL_DATA_DECREMENT 0x61 245 #define CTL_NONREG_PARM_NUM_LSB 0x62 246 #define CTL_NONREG_PARM_NUM_MSB 0x63 247 #define CTL_REGIST_PARM_NUM_LSB 0x64 248 #define CTL_REGIST_PARM_NUM_MSB 0x65 249 #define CTRL_PITCH_BENDER 255 250 #define CTRL_PITCH_BENDER_RANGE 254 251 #define CTRL_EXPRESSION 253 252 #define CTRL_MAIN_VOLUME 252 253 #define SEQ_BALANCE 11 254 #define SEQ_VOLMODE 12 255 #define VOL_METHOD_ADAGIO 1 256 #define VOL_METHOD_LINEAR 2 257 #define SEQ_FULLSIZE 0xfd 258 #define SEQ_PRIVATE 0xfe 259 #define SEQ_EXTENDED 0xff 260 typedef unsigned char sbi_instr_data[32]; 261 struct sbi_instrument { 262 unsigned short key; 263 #define FM_PATCH _PATCHKEY(0x01) 264 #define OPL3_PATCH _PATCHKEY(0x03) 265 short device; 266 int channel; 267 sbi_instr_data operators; 268 }; 269 struct synth_info { 270 char name[30]; 271 int device; 272 int synth_type; 273 #define SYNTH_TYPE_FM 0 274 #define SYNTH_TYPE_SAMPLE 1 275 #define SYNTH_TYPE_MIDI 2 276 int synth_subtype; 277 #define FM_TYPE_ADLIB 0x00 278 #define FM_TYPE_OPL3 0x01 279 #define MIDI_TYPE_MPU401 0x401 280 #define SAMPLE_TYPE_BASIC 0x10 281 #define SAMPLE_TYPE_GUS SAMPLE_TYPE_BASIC 282 #define SAMPLE_TYPE_WAVEFRONT 0x11 283 int perc_mode; 284 int nr_voices; 285 int nr_drums; 286 int instr_bank_size; 287 unsigned int capabilities; 288 #define SYNTH_CAP_PERCMODE 0x00000001 289 #define SYNTH_CAP_OPL3 0x00000002 290 #define SYNTH_CAP_INPUT 0x00000004 291 int dummies[19]; 292 }; 293 struct sound_timer_info { 294 char name[32]; 295 int caps; 296 }; 297 #define MIDI_CAP_MPU401 1 298 struct midi_info { 299 char name[30]; 300 int device; 301 unsigned int capabilities; 302 int dev_type; 303 int dummies[18]; 304 }; 305 typedef struct { 306 unsigned char cmd; 307 char nr_args, nr_returns; 308 unsigned char data[30]; 309 } mpu_command_rec; 310 #define SNDCTL_MIDI_PRETIME _SIOWR('m', 0, int) 311 #define SNDCTL_MIDI_MPUMODE _SIOWR('m', 1, int) 312 #define SNDCTL_MIDI_MPUCMD _SIOWR('m', 2, mpu_command_rec) 313 #define SNDCTL_DSP_RESET _SIO('P', 0) 314 #define SNDCTL_DSP_SYNC _SIO('P', 1) 315 #define SNDCTL_DSP_SPEED _SIOWR('P', 2, int) 316 #define SNDCTL_DSP_STEREO _SIOWR('P', 3, int) 317 #define SNDCTL_DSP_GETBLKSIZE _SIOWR('P', 4, int) 318 #define SNDCTL_DSP_SAMPLESIZE SNDCTL_DSP_SETFMT 319 #define SNDCTL_DSP_CHANNELS _SIOWR('P', 6, int) 320 #define SOUND_PCM_WRITE_CHANNELS SNDCTL_DSP_CHANNELS 321 #define SOUND_PCM_WRITE_FILTER _SIOWR('P', 7, int) 322 #define SNDCTL_DSP_POST _SIO('P', 8) 323 #define SNDCTL_DSP_SUBDIVIDE _SIOWR('P', 9, int) 324 #define SNDCTL_DSP_SETFRAGMENT _SIOWR('P', 10, int) 325 #define SNDCTL_DSP_GETFMTS _SIOR('P', 11, int) 326 #define SNDCTL_DSP_SETFMT _SIOWR('P', 5, int) 327 #define AFMT_QUERY 0x00000000 328 #define AFMT_MU_LAW 0x00000001 329 #define AFMT_A_LAW 0x00000002 330 #define AFMT_IMA_ADPCM 0x00000004 331 #define AFMT_U8 0x00000008 332 #define AFMT_S16_LE 0x00000010 333 #define AFMT_S16_BE 0x00000020 334 #define AFMT_S8 0x00000040 335 #define AFMT_U16_LE 0x00000080 336 #define AFMT_U16_BE 0x00000100 337 #define AFMT_MPEG 0x00000200 338 #define AFMT_AC3 0x00000400 339 typedef struct audio_buf_info { 340 int fragments; 341 int fragstotal; 342 int fragsize; 343 int bytes; 344 } audio_buf_info; 345 #define SNDCTL_DSP_GETOSPACE _SIOR('P', 12, audio_buf_info) 346 #define SNDCTL_DSP_GETISPACE _SIOR('P', 13, audio_buf_info) 347 #define SNDCTL_DSP_NONBLOCK _SIO('P', 14) 348 #define SNDCTL_DSP_GETCAPS _SIOR('P', 15, int) 349 #define DSP_CAP_REVISION 0x000000ff 350 #define DSP_CAP_DUPLEX 0x00000100 351 #define DSP_CAP_REALTIME 0x00000200 352 #define DSP_CAP_BATCH 0x00000400 353 #define DSP_CAP_COPROC 0x00000800 354 #define DSP_CAP_TRIGGER 0x00001000 355 #define DSP_CAP_MMAP 0x00002000 356 #define DSP_CAP_MULTI 0x00004000 357 #define DSP_CAP_BIND 0x00008000 358 #define SNDCTL_DSP_GETTRIGGER _SIOR('P', 16, int) 359 #define SNDCTL_DSP_SETTRIGGER _SIOW('P', 16, int) 360 #define PCM_ENABLE_INPUT 0x00000001 361 #define PCM_ENABLE_OUTPUT 0x00000002 362 typedef struct count_info { 363 int bytes; 364 int blocks; 365 int ptr; 366 } count_info; 367 #define SNDCTL_DSP_GETIPTR _SIOR('P', 17, count_info) 368 #define SNDCTL_DSP_GETOPTR _SIOR('P', 18, count_info) 369 typedef struct buffmem_desc { 370 unsigned * buffer; 371 int size; 372 } buffmem_desc; 373 #define SNDCTL_DSP_MAPINBUF _SIOR('P', 19, buffmem_desc) 374 #define SNDCTL_DSP_MAPOUTBUF _SIOR('P', 20, buffmem_desc) 375 #define SNDCTL_DSP_SETSYNCRO _SIO('P', 21) 376 #define SNDCTL_DSP_SETDUPLEX _SIO('P', 22) 377 #define SNDCTL_DSP_GETODELAY _SIOR('P', 23, int) 378 #define SNDCTL_DSP_GETCHANNELMASK _SIOWR('P', 64, int) 379 #define SNDCTL_DSP_BIND_CHANNEL _SIOWR('P', 65, int) 380 #define DSP_BIND_QUERY 0x00000000 381 #define DSP_BIND_FRONT 0x00000001 382 #define DSP_BIND_SURR 0x00000002 383 #define DSP_BIND_CENTER_LFE 0x00000004 384 #define DSP_BIND_HANDSET 0x00000008 385 #define DSP_BIND_MIC 0x00000010 386 #define DSP_BIND_MODEM1 0x00000020 387 #define DSP_BIND_MODEM2 0x00000040 388 #define DSP_BIND_I2S 0x00000080 389 #define DSP_BIND_SPDIF 0x00000100 390 #define SNDCTL_DSP_SETSPDIF _SIOW('P', 66, int) 391 #define SNDCTL_DSP_GETSPDIF _SIOR('P', 67, int) 392 #define SPDIF_PRO 0x0001 393 #define SPDIF_N_AUD 0x0002 394 #define SPDIF_COPY 0x0004 395 #define SPDIF_PRE 0x0008 396 #define SPDIF_CC 0x07f0 397 #define SPDIF_L 0x0800 398 #define SPDIF_DRS 0x4000 399 #define SPDIF_V 0x8000 400 #define SNDCTL_DSP_PROFILE _SIOW('P', 23, int) 401 #define APF_NORMAL 0 402 #define APF_NETWORK 1 403 #define APF_CPUINTENS 2 404 #define SOUND_PCM_READ_RATE _SIOR('P', 2, int) 405 #define SOUND_PCM_READ_CHANNELS _SIOR('P', 6, int) 406 #define SOUND_PCM_READ_BITS _SIOR('P', 5, int) 407 #define SOUND_PCM_READ_FILTER _SIOR('P', 7, int) 408 #define SOUND_PCM_WRITE_BITS SNDCTL_DSP_SETFMT 409 #define SOUND_PCM_WRITE_RATE SNDCTL_DSP_SPEED 410 #define SOUND_PCM_POST SNDCTL_DSP_POST 411 #define SOUND_PCM_RESET SNDCTL_DSP_RESET 412 #define SOUND_PCM_SYNC SNDCTL_DSP_SYNC 413 #define SOUND_PCM_SUBDIVIDE SNDCTL_DSP_SUBDIVIDE 414 #define SOUND_PCM_SETFRAGMENT SNDCTL_DSP_SETFRAGMENT 415 #define SOUND_PCM_GETFMTS SNDCTL_DSP_GETFMTS 416 #define SOUND_PCM_SETFMT SNDCTL_DSP_SETFMT 417 #define SOUND_PCM_GETOSPACE SNDCTL_DSP_GETOSPACE 418 #define SOUND_PCM_GETISPACE SNDCTL_DSP_GETISPACE 419 #define SOUND_PCM_NONBLOCK SNDCTL_DSP_NONBLOCK 420 #define SOUND_PCM_GETCAPS SNDCTL_DSP_GETCAPS 421 #define SOUND_PCM_GETTRIGGER SNDCTL_DSP_GETTRIGGER 422 #define SOUND_PCM_SETTRIGGER SNDCTL_DSP_SETTRIGGER 423 #define SOUND_PCM_SETSYNCRO SNDCTL_DSP_SETSYNCRO 424 #define SOUND_PCM_GETIPTR SNDCTL_DSP_GETIPTR 425 #define SOUND_PCM_GETOPTR SNDCTL_DSP_GETOPTR 426 #define SOUND_PCM_MAPINBUF SNDCTL_DSP_MAPINBUF 427 #define SOUND_PCM_MAPOUTBUF SNDCTL_DSP_MAPOUTBUF 428 typedef struct copr_buffer { 429 int command; 430 int flags; 431 #define CPF_NONE 0x0000 432 #define CPF_FIRST 0x0001 433 #define CPF_LAST 0x0002 434 int len; 435 int offs; 436 unsigned char data[4000]; 437 } copr_buffer; 438 typedef struct copr_debug_buf { 439 int command; 440 int parm1; 441 int parm2; 442 int flags; 443 int len; 444 } copr_debug_buf; 445 typedef struct copr_msg { 446 int len; 447 unsigned char data[4000]; 448 } copr_msg; 449 #define SNDCTL_COPR_RESET _SIO('C', 0) 450 #define SNDCTL_COPR_LOAD _SIOWR('C', 1, copr_buffer) 451 #define SNDCTL_COPR_RDATA _SIOWR('C', 2, copr_debug_buf) 452 #define SNDCTL_COPR_RCODE _SIOWR('C', 3, copr_debug_buf) 453 #define SNDCTL_COPR_WDATA _SIOW('C', 4, copr_debug_buf) 454 #define SNDCTL_COPR_WCODE _SIOW('C', 5, copr_debug_buf) 455 #define SNDCTL_COPR_RUN _SIOWR('C', 6, copr_debug_buf) 456 #define SNDCTL_COPR_HALT _SIOWR('C', 7, copr_debug_buf) 457 #define SNDCTL_COPR_SENDMSG _SIOWR('C', 8, copr_msg) 458 #define SNDCTL_COPR_RCVMSG _SIOR('C', 9, copr_msg) 459 #define SOUND_MIXER_NRDEVICES 25 460 #define SOUND_MIXER_VOLUME 0 461 #define SOUND_MIXER_BASS 1 462 #define SOUND_MIXER_TREBLE 2 463 #define SOUND_MIXER_SYNTH 3 464 #define SOUND_MIXER_PCM 4 465 #define SOUND_MIXER_SPEAKER 5 466 #define SOUND_MIXER_LINE 6 467 #define SOUND_MIXER_MIC 7 468 #define SOUND_MIXER_CD 8 469 #define SOUND_MIXER_IMIX 9 470 #define SOUND_MIXER_ALTPCM 10 471 #define SOUND_MIXER_RECLEV 11 472 #define SOUND_MIXER_IGAIN 12 473 #define SOUND_MIXER_OGAIN 13 474 #define SOUND_MIXER_LINE1 14 475 #define SOUND_MIXER_LINE2 15 476 #define SOUND_MIXER_LINE3 16 477 #define SOUND_MIXER_DIGITAL1 17 478 #define SOUND_MIXER_DIGITAL2 18 479 #define SOUND_MIXER_DIGITAL3 19 480 #define SOUND_MIXER_PHONEIN 20 481 #define SOUND_MIXER_PHONEOUT 21 482 #define SOUND_MIXER_VIDEO 22 483 #define SOUND_MIXER_RADIO 23 484 #define SOUND_MIXER_MONITOR 24 485 #define SOUND_ONOFF_MIN 28 486 #define SOUND_ONOFF_MAX 30 487 #define SOUND_MIXER_NONE 31 488 #define SOUND_MIXER_ENHANCE SOUND_MIXER_NONE 489 #define SOUND_MIXER_MUTE SOUND_MIXER_NONE 490 #define SOUND_MIXER_LOUD SOUND_MIXER_NONE 491 #define SOUND_DEVICE_LABELS { "Vol ", "Bass ", "Trebl", "Synth", "Pcm ", "Spkr ", "Line ", "Mic ", "CD ", "Mix ", "Pcm2 ", "Rec ", "IGain", "OGain", "Line1", "Line2", "Line3", "Digital1", "Digital2", "Digital3", "PhoneIn", "PhoneOut", "Video", "Radio", "Monitor" } 492 #define SOUND_DEVICE_NAMES { "vol", "bass", "treble", "synth", "pcm", "speaker", "line", "mic", "cd", "mix", "pcm2", "rec", "igain", "ogain", "line1", "line2", "line3", "dig1", "dig2", "dig3", "phin", "phout", "video", "radio", "monitor" } 493 #define SOUND_MIXER_RECSRC 0xff 494 #define SOUND_MIXER_DEVMASK 0xfe 495 #define SOUND_MIXER_RECMASK 0xfd 496 #define SOUND_MIXER_CAPS 0xfc 497 #define SOUND_CAP_EXCL_INPUT 0x00000001 498 #define SOUND_MIXER_STEREODEVS 0xfb 499 #define SOUND_MIXER_OUTSRC 0xfa 500 #define SOUND_MIXER_OUTMASK 0xf9 501 #define SOUND_MASK_VOLUME (1 << SOUND_MIXER_VOLUME) 502 #define SOUND_MASK_BASS (1 << SOUND_MIXER_BASS) 503 #define SOUND_MASK_TREBLE (1 << SOUND_MIXER_TREBLE) 504 #define SOUND_MASK_SYNTH (1 << SOUND_MIXER_SYNTH) 505 #define SOUND_MASK_PCM (1 << SOUND_MIXER_PCM) 506 #define SOUND_MASK_SPEAKER (1 << SOUND_MIXER_SPEAKER) 507 #define SOUND_MASK_LINE (1 << SOUND_MIXER_LINE) 508 #define SOUND_MASK_MIC (1 << SOUND_MIXER_MIC) 509 #define SOUND_MASK_CD (1 << SOUND_MIXER_CD) 510 #define SOUND_MASK_IMIX (1 << SOUND_MIXER_IMIX) 511 #define SOUND_MASK_ALTPCM (1 << SOUND_MIXER_ALTPCM) 512 #define SOUND_MASK_RECLEV (1 << SOUND_MIXER_RECLEV) 513 #define SOUND_MASK_IGAIN (1 << SOUND_MIXER_IGAIN) 514 #define SOUND_MASK_OGAIN (1 << SOUND_MIXER_OGAIN) 515 #define SOUND_MASK_LINE1 (1 << SOUND_MIXER_LINE1) 516 #define SOUND_MASK_LINE2 (1 << SOUND_MIXER_LINE2) 517 #define SOUND_MASK_LINE3 (1 << SOUND_MIXER_LINE3) 518 #define SOUND_MASK_DIGITAL1 (1 << SOUND_MIXER_DIGITAL1) 519 #define SOUND_MASK_DIGITAL2 (1 << SOUND_MIXER_DIGITAL2) 520 #define SOUND_MASK_DIGITAL3 (1 << SOUND_MIXER_DIGITAL3) 521 #define SOUND_MASK_PHONEIN (1 << SOUND_MIXER_PHONEIN) 522 #define SOUND_MASK_PHONEOUT (1 << SOUND_MIXER_PHONEOUT) 523 #define SOUND_MASK_RADIO (1 << SOUND_MIXER_RADIO) 524 #define SOUND_MASK_VIDEO (1 << SOUND_MIXER_VIDEO) 525 #define SOUND_MASK_MONITOR (1 << SOUND_MIXER_MONITOR) 526 #define SOUND_MASK_MUTE (1 << SOUND_MIXER_MUTE) 527 #define SOUND_MASK_ENHANCE (1 << SOUND_MIXER_ENHANCE) 528 #define SOUND_MASK_LOUD (1 << SOUND_MIXER_LOUD) 529 #define MIXER_READ(dev) _SIOR('M', dev, int) 530 #define SOUND_MIXER_READ_VOLUME MIXER_READ(SOUND_MIXER_VOLUME) 531 #define SOUND_MIXER_READ_BASS MIXER_READ(SOUND_MIXER_BASS) 532 #define SOUND_MIXER_READ_TREBLE MIXER_READ(SOUND_MIXER_TREBLE) 533 #define SOUND_MIXER_READ_SYNTH MIXER_READ(SOUND_MIXER_SYNTH) 534 #define SOUND_MIXER_READ_PCM MIXER_READ(SOUND_MIXER_PCM) 535 #define SOUND_MIXER_READ_SPEAKER MIXER_READ(SOUND_MIXER_SPEAKER) 536 #define SOUND_MIXER_READ_LINE MIXER_READ(SOUND_MIXER_LINE) 537 #define SOUND_MIXER_READ_MIC MIXER_READ(SOUND_MIXER_MIC) 538 #define SOUND_MIXER_READ_CD MIXER_READ(SOUND_MIXER_CD) 539 #define SOUND_MIXER_READ_IMIX MIXER_READ(SOUND_MIXER_IMIX) 540 #define SOUND_MIXER_READ_ALTPCM MIXER_READ(SOUND_MIXER_ALTPCM) 541 #define SOUND_MIXER_READ_RECLEV MIXER_READ(SOUND_MIXER_RECLEV) 542 #define SOUND_MIXER_READ_IGAIN MIXER_READ(SOUND_MIXER_IGAIN) 543 #define SOUND_MIXER_READ_OGAIN MIXER_READ(SOUND_MIXER_OGAIN) 544 #define SOUND_MIXER_READ_LINE1 MIXER_READ(SOUND_MIXER_LINE1) 545 #define SOUND_MIXER_READ_LINE2 MIXER_READ(SOUND_MIXER_LINE2) 546 #define SOUND_MIXER_READ_LINE3 MIXER_READ(SOUND_MIXER_LINE3) 547 #define SOUND_MIXER_READ_MUTE MIXER_READ(SOUND_MIXER_MUTE) 548 #define SOUND_MIXER_READ_ENHANCE MIXER_READ(SOUND_MIXER_ENHANCE) 549 #define SOUND_MIXER_READ_LOUD MIXER_READ(SOUND_MIXER_LOUD) 550 #define SOUND_MIXER_READ_RECSRC MIXER_READ(SOUND_MIXER_RECSRC) 551 #define SOUND_MIXER_READ_DEVMASK MIXER_READ(SOUND_MIXER_DEVMASK) 552 #define SOUND_MIXER_READ_RECMASK MIXER_READ(SOUND_MIXER_RECMASK) 553 #define SOUND_MIXER_READ_STEREODEVS MIXER_READ(SOUND_MIXER_STEREODEVS) 554 #define SOUND_MIXER_READ_CAPS MIXER_READ(SOUND_MIXER_CAPS) 555 #define MIXER_WRITE(dev) _SIOWR('M', dev, int) 556 #define SOUND_MIXER_WRITE_VOLUME MIXER_WRITE(SOUND_MIXER_VOLUME) 557 #define SOUND_MIXER_WRITE_BASS MIXER_WRITE(SOUND_MIXER_BASS) 558 #define SOUND_MIXER_WRITE_TREBLE MIXER_WRITE(SOUND_MIXER_TREBLE) 559 #define SOUND_MIXER_WRITE_SYNTH MIXER_WRITE(SOUND_MIXER_SYNTH) 560 #define SOUND_MIXER_WRITE_PCM MIXER_WRITE(SOUND_MIXER_PCM) 561 #define SOUND_MIXER_WRITE_SPEAKER MIXER_WRITE(SOUND_MIXER_SPEAKER) 562 #define SOUND_MIXER_WRITE_LINE MIXER_WRITE(SOUND_MIXER_LINE) 563 #define SOUND_MIXER_WRITE_MIC MIXER_WRITE(SOUND_MIXER_MIC) 564 #define SOUND_MIXER_WRITE_CD MIXER_WRITE(SOUND_MIXER_CD) 565 #define SOUND_MIXER_WRITE_IMIX MIXER_WRITE(SOUND_MIXER_IMIX) 566 #define SOUND_MIXER_WRITE_ALTPCM MIXER_WRITE(SOUND_MIXER_ALTPCM) 567 #define SOUND_MIXER_WRITE_RECLEV MIXER_WRITE(SOUND_MIXER_RECLEV) 568 #define SOUND_MIXER_WRITE_IGAIN MIXER_WRITE(SOUND_MIXER_IGAIN) 569 #define SOUND_MIXER_WRITE_OGAIN MIXER_WRITE(SOUND_MIXER_OGAIN) 570 #define SOUND_MIXER_WRITE_LINE1 MIXER_WRITE(SOUND_MIXER_LINE1) 571 #define SOUND_MIXER_WRITE_LINE2 MIXER_WRITE(SOUND_MIXER_LINE2) 572 #define SOUND_MIXER_WRITE_LINE3 MIXER_WRITE(SOUND_MIXER_LINE3) 573 #define SOUND_MIXER_WRITE_MUTE MIXER_WRITE(SOUND_MIXER_MUTE) 574 #define SOUND_MIXER_WRITE_ENHANCE MIXER_WRITE(SOUND_MIXER_ENHANCE) 575 #define SOUND_MIXER_WRITE_LOUD MIXER_WRITE(SOUND_MIXER_LOUD) 576 #define SOUND_MIXER_WRITE_RECSRC MIXER_WRITE(SOUND_MIXER_RECSRC) 577 typedef struct mixer_info { 578 char id[16]; 579 char name[32]; 580 int modify_counter; 581 int fillers[10]; 582 } mixer_info; 583 typedef struct _old_mixer_info { 584 char id[16]; 585 char name[32]; 586 } _old_mixer_info; 587 #define SOUND_MIXER_INFO _SIOR('M', 101, mixer_info) 588 #define SOUND_OLD_MIXER_INFO _SIOR('M', 101, _old_mixer_info) 589 typedef unsigned char mixer_record[128]; 590 #define SOUND_MIXER_ACCESS _SIOWR('M', 102, mixer_record) 591 #define SOUND_MIXER_AGC _SIOWR('M', 103, int) 592 #define SOUND_MIXER_3DSE _SIOWR('M', 104, int) 593 #define SOUND_MIXER_PRIVATE1 _SIOWR('M', 111, int) 594 #define SOUND_MIXER_PRIVATE2 _SIOWR('M', 112, int) 595 #define SOUND_MIXER_PRIVATE3 _SIOWR('M', 113, int) 596 #define SOUND_MIXER_PRIVATE4 _SIOWR('M', 114, int) 597 #define SOUND_MIXER_PRIVATE5 _SIOWR('M', 115, int) 598 typedef struct mixer_vol_table { 599 int num; 600 char name[32]; 601 int levels[32]; 602 } mixer_vol_table; 603 #define SOUND_MIXER_GETLEVELS _SIOWR('M', 116, mixer_vol_table) 604 #define SOUND_MIXER_SETLEVELS _SIOWR('M', 117, mixer_vol_table) 605 #define OSS_GETVERSION _SIOR('M', 118, int) 606 #define EV_SEQ_LOCAL 0x80 607 #define EV_TIMING 0x81 608 #define EV_CHN_COMMON 0x92 609 #define EV_CHN_VOICE 0x93 610 #define EV_SYSEX 0x94 611 #define MIDI_NOTEOFF 0x80 612 #define MIDI_NOTEON 0x90 613 #define MIDI_KEY_PRESSURE 0xA0 614 #define MIDI_CTL_CHANGE 0xB0 615 #define MIDI_PGM_CHANGE 0xC0 616 #define MIDI_CHN_PRESSURE 0xD0 617 #define MIDI_PITCH_BEND 0xE0 618 #define MIDI_SYSTEM_PREFIX 0xF0 619 #define TMR_WAIT_REL 1 620 #define TMR_WAIT_ABS 2 621 #define TMR_STOP 3 622 #define TMR_START 4 623 #define TMR_CONTINUE 5 624 #define TMR_TEMPO 6 625 #define TMR_ECHO 8 626 #define TMR_CLOCK 9 627 #define TMR_SPP 10 628 #define TMR_TIMESIG 11 629 #define LOCL_STARTAUDIO 1 630 #define SEQ_DECLAREBUF() SEQ_USE_EXTBUF() 631 #define SEQ_PM_DEFINES int __foo_bar___ 632 #define SEQ_LOAD_GMINSTR(dev,instr) 633 #define SEQ_LOAD_GMDRUM(dev,drum) 634 #define _SEQ_EXTERN extern 635 #define SEQ_USE_EXTBUF() _SEQ_EXTERN unsigned char _seqbuf[]; _SEQ_EXTERN int _seqbuflen; _SEQ_EXTERN int _seqbufptr 636 #ifndef USE_SIMPLE_MACROS 637 #define SEQ_DEFINEBUF(len) unsigned char _seqbuf[len]; int _seqbuflen = len; int _seqbufptr = 0 638 #define _SEQ_NEEDBUF(len) if((_seqbufptr + (len)) > _seqbuflen) seqbuf_dump() 639 #define _SEQ_ADVBUF(len) _seqbufptr += len 640 #define SEQ_DUMPBUF seqbuf_dump 641 #else 642 #define _SEQ_NEEDBUF(len) 643 #endif 644 #define SEQ_VOLUME_MODE(dev,mode) { _SEQ_NEEDBUF(8); _seqbuf[_seqbufptr] = SEQ_EXTENDED; _seqbuf[_seqbufptr + 1] = SEQ_VOLMODE; _seqbuf[_seqbufptr + 2] = (dev); _seqbuf[_seqbufptr + 3] = (mode); _seqbuf[_seqbufptr + 4] = 0; _seqbuf[_seqbufptr + 5] = 0; _seqbuf[_seqbufptr + 6] = 0; _seqbuf[_seqbufptr + 7] = 0; _SEQ_ADVBUF(8); } 645 #define _CHN_VOICE(dev,event,chn,note,parm) { _SEQ_NEEDBUF(8); _seqbuf[_seqbufptr] = EV_CHN_VOICE; _seqbuf[_seqbufptr + 1] = (dev); _seqbuf[_seqbufptr + 2] = (event); _seqbuf[_seqbufptr + 3] = (chn); _seqbuf[_seqbufptr + 4] = (note); _seqbuf[_seqbufptr + 5] = (parm); _seqbuf[_seqbufptr + 6] = (0); _seqbuf[_seqbufptr + 7] = 0; _SEQ_ADVBUF(8); } 646 #define SEQ_START_NOTE(dev,chn,note,vol) _CHN_VOICE(dev, MIDI_NOTEON, chn, note, vol) 647 #define SEQ_STOP_NOTE(dev,chn,note,vol) _CHN_VOICE(dev, MIDI_NOTEOFF, chn, note, vol) 648 #define SEQ_KEY_PRESSURE(dev,chn,note,pressure) _CHN_VOICE(dev, MIDI_KEY_PRESSURE, chn, note, pressure) 649 #define _CHN_COMMON(dev,event,chn,p1,p2,w14) { _SEQ_NEEDBUF(8); _seqbuf[_seqbufptr] = EV_CHN_COMMON; _seqbuf[_seqbufptr + 1] = (dev); _seqbuf[_seqbufptr + 2] = (event); _seqbuf[_seqbufptr + 3] = (chn); _seqbuf[_seqbufptr + 4] = (p1); _seqbuf[_seqbufptr + 5] = (p2); * (short *) & _seqbuf[_seqbufptr + 6] = (w14); _SEQ_ADVBUF(8); } 650 #define SEQ_SYSEX(dev,buf,len) { int ii, ll = (len); unsigned char * bufp = buf; if(ll > 6) ll = 6; _SEQ_NEEDBUF(8); _seqbuf[_seqbufptr] = EV_SYSEX; _seqbuf[_seqbufptr + 1] = (dev); for(ii = 0; ii < ll; ii ++) _seqbuf[_seqbufptr + ii + 2] = bufp[ii]; for(ii = ll; ii < 6; ii ++) _seqbuf[_seqbufptr + ii + 2] = 0xff; _SEQ_ADVBUF(8); } 651 #define SEQ_CHN_PRESSURE(dev,chn,pressure) _CHN_COMMON(dev, MIDI_CHN_PRESSURE, chn, pressure, 0, 0) 652 #define SEQ_SET_PATCH SEQ_PGM_CHANGE 653 #define SEQ_PGM_CHANGE(dev,chn,patch) _CHN_COMMON(dev, MIDI_PGM_CHANGE, chn, patch, 0, 0) 654 #define SEQ_CONTROL(dev,chn,controller,value) _CHN_COMMON(dev, MIDI_CTL_CHANGE, chn, controller, 0, value) 655 #define SEQ_BENDER(dev,chn,value) _CHN_COMMON(dev, MIDI_PITCH_BEND, chn, 0, 0, value) 656 #define SEQ_V2_X_CONTROL(dev,voice,controller,value) { _SEQ_NEEDBUF(8); _seqbuf[_seqbufptr] = SEQ_EXTENDED; _seqbuf[_seqbufptr + 1] = SEQ_CONTROLLER; _seqbuf[_seqbufptr + 2] = (dev); _seqbuf[_seqbufptr + 3] = (voice); _seqbuf[_seqbufptr + 4] = (controller); _seqbuf[_seqbufptr + 5] = ((value) & 0xff); _seqbuf[_seqbufptr + 6] = ((value >> 8) & 0xff); _seqbuf[_seqbufptr + 7] = 0; _SEQ_ADVBUF(8); } 657 #define SEQ_PITCHBEND(dev,voice,value) SEQ_V2_X_CONTROL(dev, voice, CTRL_PITCH_BENDER, value) 658 #define SEQ_BENDER_RANGE(dev,voice,value) SEQ_V2_X_CONTROL(dev, voice, CTRL_PITCH_BENDER_RANGE, value) 659 #define SEQ_EXPRESSION(dev,voice,value) SEQ_CONTROL(dev, voice, CTL_EXPRESSION, value * 128) 660 #define SEQ_MAIN_VOLUME(dev,voice,value) SEQ_CONTROL(dev, voice, CTL_MAIN_VOLUME, (value * 16383) / 100) 661 #define SEQ_PANNING(dev,voice,pos) SEQ_CONTROL(dev, voice, CTL_PAN, (pos + 128) / 2) 662 #define _TIMER_EVENT(ev,parm) { _SEQ_NEEDBUF(8); _seqbuf[_seqbufptr + 0] = EV_TIMING; _seqbuf[_seqbufptr + 1] = (ev); _seqbuf[_seqbufptr + 2] = 0; _seqbuf[_seqbufptr + 3] = 0; * (unsigned int *) & _seqbuf[_seqbufptr + 4] = (parm); _SEQ_ADVBUF(8); } 663 #define SEQ_START_TIMER() _TIMER_EVENT(TMR_START, 0) 664 #define SEQ_STOP_TIMER() _TIMER_EVENT(TMR_STOP, 0) 665 #define SEQ_CONTINUE_TIMER() _TIMER_EVENT(TMR_CONTINUE, 0) 666 #define SEQ_WAIT_TIME(ticks) _TIMER_EVENT(TMR_WAIT_ABS, ticks) 667 #define SEQ_DELTA_TIME(ticks) _TIMER_EVENT(TMR_WAIT_REL, ticks) 668 #define SEQ_ECHO_BACK(key) _TIMER_EVENT(TMR_ECHO, key) 669 #define SEQ_SET_TEMPO(value) _TIMER_EVENT(TMR_TEMPO, value) 670 #define SEQ_SONGPOS(pos) _TIMER_EVENT(TMR_SPP, pos) 671 #define SEQ_TIME_SIGNATURE(sig) _TIMER_EVENT(TMR_TIMESIG, sig) 672 #define _LOCAL_EVENT(ev,parm) { _SEQ_NEEDBUF(8); _seqbuf[_seqbufptr + 0] = EV_SEQ_LOCAL; _seqbuf[_seqbufptr + 1] = (ev); _seqbuf[_seqbufptr + 2] = 0; _seqbuf[_seqbufptr + 3] = 0; * (unsigned int *) & _seqbuf[_seqbufptr + 4] = (parm); _SEQ_ADVBUF(8); } 673 #define SEQ_PLAYAUDIO(devmask) _LOCAL_EVENT(LOCL_STARTAUDIO, devmask) 674 #define SEQ_MIDIOUT(device,byte) { _SEQ_NEEDBUF(4); _seqbuf[_seqbufptr] = SEQ_MIDIPUTC; _seqbuf[_seqbufptr + 1] = (byte); _seqbuf[_seqbufptr + 2] = (device); _seqbuf[_seqbufptr + 3] = 0; _SEQ_ADVBUF(4); } 675 #define SEQ_WRPATCH(patchx,len) { if(_seqbufptr) SEQ_DUMPBUF(); if(write(seqfd, (char *) (patchx), len) == - 1) perror("Write patch: /dev/sequencer"); } 676 #define SEQ_WRPATCH2(patchx,len) (SEQ_DUMPBUF(), write(seqfd, (char *) (patchx), len)) 677 #endif 678