openbox lab initialized
This commit is contained in:
615
openflow/usr/include/sound/asequencer.h
Normal file
615
openflow/usr/include/sound/asequencer.h
Normal file
@@ -0,0 +1,615 @@
|
||||
/*
|
||||
* Main header file for the ALSA sequencer
|
||||
* Copyright (c) 1998-1999 by Frank van de Pol <fvdpol@coil.demon.nl>
|
||||
* (c) 1998-1999 by Jaroslav Kysela <perex@perex.cz>
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
#ifndef __SOUND_ASEQUENCER_H
|
||||
#define __SOUND_ASEQUENCER_H
|
||||
|
||||
#include <sound/asound.h>
|
||||
|
||||
/** version of the sequencer */
|
||||
#define SNDRV_SEQ_VERSION SNDRV_PROTOCOL_VERSION (1, 0, 1)
|
||||
|
||||
/**
|
||||
* definition of sequencer event types
|
||||
*/
|
||||
|
||||
/** system messages
|
||||
* event data type = #snd_seq_result
|
||||
*/
|
||||
#define SNDRV_SEQ_EVENT_SYSTEM 0
|
||||
#define SNDRV_SEQ_EVENT_RESULT 1
|
||||
|
||||
/** note messages (channel specific)
|
||||
* event data type = #snd_seq_ev_note
|
||||
*/
|
||||
#define SNDRV_SEQ_EVENT_NOTE 5
|
||||
#define SNDRV_SEQ_EVENT_NOTEON 6
|
||||
#define SNDRV_SEQ_EVENT_NOTEOFF 7
|
||||
#define SNDRV_SEQ_EVENT_KEYPRESS 8
|
||||
|
||||
/** control messages (channel specific)
|
||||
* event data type = #snd_seq_ev_ctrl
|
||||
*/
|
||||
#define SNDRV_SEQ_EVENT_CONTROLLER 10
|
||||
#define SNDRV_SEQ_EVENT_PGMCHANGE 11
|
||||
#define SNDRV_SEQ_EVENT_CHANPRESS 12
|
||||
#define SNDRV_SEQ_EVENT_PITCHBEND 13 /**< from -8192 to 8191 */
|
||||
#define SNDRV_SEQ_EVENT_CONTROL14 14 /**< 14 bit controller value */
|
||||
#define SNDRV_SEQ_EVENT_NONREGPARAM 15 /**< 14 bit NRPN address + 14 bit unsigned value */
|
||||
#define SNDRV_SEQ_EVENT_REGPARAM 16 /**< 14 bit RPN address + 14 bit unsigned value */
|
||||
|
||||
/** synchronisation messages
|
||||
* event data type = #snd_seq_ev_ctrl
|
||||
*/
|
||||
#define SNDRV_SEQ_EVENT_SONGPOS 20 /* Song Position Pointer with LSB and MSB values */
|
||||
#define SNDRV_SEQ_EVENT_SONGSEL 21 /* Song Select with song ID number */
|
||||
#define SNDRV_SEQ_EVENT_QFRAME 22 /* midi time code quarter frame */
|
||||
#define SNDRV_SEQ_EVENT_TIMESIGN 23 /* SMF Time Signature event */
|
||||
#define SNDRV_SEQ_EVENT_KEYSIGN 24 /* SMF Key Signature event */
|
||||
|
||||
/** timer messages
|
||||
* event data type = snd_seq_ev_queue_control
|
||||
*/
|
||||
#define SNDRV_SEQ_EVENT_START 30 /* midi Real Time Start message */
|
||||
#define SNDRV_SEQ_EVENT_CONTINUE 31 /* midi Real Time Continue message */
|
||||
#define SNDRV_SEQ_EVENT_STOP 32 /* midi Real Time Stop message */
|
||||
#define SNDRV_SEQ_EVENT_SETPOS_TICK 33 /* set tick queue position */
|
||||
#define SNDRV_SEQ_EVENT_SETPOS_TIME 34 /* set realtime queue position */
|
||||
#define SNDRV_SEQ_EVENT_TEMPO 35 /* (SMF) Tempo event */
|
||||
#define SNDRV_SEQ_EVENT_CLOCK 36 /* midi Real Time Clock message */
|
||||
#define SNDRV_SEQ_EVENT_TICK 37 /* midi Real Time Tick message */
|
||||
#define SNDRV_SEQ_EVENT_QUEUE_SKEW 38 /* skew queue tempo */
|
||||
|
||||
/** others
|
||||
* event data type = none
|
||||
*/
|
||||
#define SNDRV_SEQ_EVENT_TUNE_REQUEST 40 /* tune request */
|
||||
#define SNDRV_SEQ_EVENT_RESET 41 /* reset to power-on state */
|
||||
#define SNDRV_SEQ_EVENT_SENSING 42 /* "active sensing" event */
|
||||
|
||||
/** echo back, kernel private messages
|
||||
* event data type = any type
|
||||
*/
|
||||
#define SNDRV_SEQ_EVENT_ECHO 50 /* echo event */
|
||||
#define SNDRV_SEQ_EVENT_OSS 51 /* OSS raw event */
|
||||
|
||||
/** system status messages (broadcast for subscribers)
|
||||
* event data type = snd_seq_addr
|
||||
*/
|
||||
#define SNDRV_SEQ_EVENT_CLIENT_START 60 /* new client has connected */
|
||||
#define SNDRV_SEQ_EVENT_CLIENT_EXIT 61 /* client has left the system */
|
||||
#define SNDRV_SEQ_EVENT_CLIENT_CHANGE 62 /* client status/info has changed */
|
||||
#define SNDRV_SEQ_EVENT_PORT_START 63 /* new port was created */
|
||||
#define SNDRV_SEQ_EVENT_PORT_EXIT 64 /* port was deleted from system */
|
||||
#define SNDRV_SEQ_EVENT_PORT_CHANGE 65 /* port status/info has changed */
|
||||
|
||||
/** port connection changes
|
||||
* event data type = snd_seq_connect
|
||||
*/
|
||||
#define SNDRV_SEQ_EVENT_PORT_SUBSCRIBED 66 /* ports connected */
|
||||
#define SNDRV_SEQ_EVENT_PORT_UNSUBSCRIBED 67 /* ports disconnected */
|
||||
|
||||
/* 70-89: synthesizer events - obsoleted */
|
||||
|
||||
/** user-defined events with fixed length
|
||||
* event data type = any
|
||||
*/
|
||||
#define SNDRV_SEQ_EVENT_USR0 90
|
||||
#define SNDRV_SEQ_EVENT_USR1 91
|
||||
#define SNDRV_SEQ_EVENT_USR2 92
|
||||
#define SNDRV_SEQ_EVENT_USR3 93
|
||||
#define SNDRV_SEQ_EVENT_USR4 94
|
||||
#define SNDRV_SEQ_EVENT_USR5 95
|
||||
#define SNDRV_SEQ_EVENT_USR6 96
|
||||
#define SNDRV_SEQ_EVENT_USR7 97
|
||||
#define SNDRV_SEQ_EVENT_USR8 98
|
||||
#define SNDRV_SEQ_EVENT_USR9 99
|
||||
|
||||
/* 100-118: instrument layer - obsoleted */
|
||||
/* 119-129: reserved */
|
||||
|
||||
/* 130-139: variable length events
|
||||
* event data type = snd_seq_ev_ext
|
||||
* (SNDRV_SEQ_EVENT_LENGTH_VARIABLE must be set)
|
||||
*/
|
||||
#define SNDRV_SEQ_EVENT_SYSEX 130 /* system exclusive data (variable length) */
|
||||
#define SNDRV_SEQ_EVENT_BOUNCE 131 /* error event */
|
||||
/* 132-134: reserved */
|
||||
#define SNDRV_SEQ_EVENT_USR_VAR0 135
|
||||
#define SNDRV_SEQ_EVENT_USR_VAR1 136
|
||||
#define SNDRV_SEQ_EVENT_USR_VAR2 137
|
||||
#define SNDRV_SEQ_EVENT_USR_VAR3 138
|
||||
#define SNDRV_SEQ_EVENT_USR_VAR4 139
|
||||
|
||||
/* 150-151: kernel events with quote - DO NOT use in user clients */
|
||||
#define SNDRV_SEQ_EVENT_KERNEL_ERROR 150
|
||||
#define SNDRV_SEQ_EVENT_KERNEL_QUOTE 151 /* obsolete */
|
||||
|
||||
/* 152-191: reserved */
|
||||
|
||||
/* 192-254: hardware specific events */
|
||||
|
||||
/* 255: special event */
|
||||
#define SNDRV_SEQ_EVENT_NONE 255
|
||||
|
||||
|
||||
typedef unsigned char snd_seq_event_type_t;
|
||||
|
||||
/** event address */
|
||||
struct snd_seq_addr {
|
||||
unsigned char client; /**< Client number: 0..255, 255 = broadcast to all clients */
|
||||
unsigned char port; /**< Port within client: 0..255, 255 = broadcast to all ports */
|
||||
};
|
||||
|
||||
/** port connection */
|
||||
struct snd_seq_connect {
|
||||
struct snd_seq_addr sender;
|
||||
struct snd_seq_addr dest;
|
||||
};
|
||||
|
||||
|
||||
#define SNDRV_SEQ_ADDRESS_UNKNOWN 253 /* unknown source */
|
||||
#define SNDRV_SEQ_ADDRESS_SUBSCRIBERS 254 /* send event to all subscribed ports */
|
||||
#define SNDRV_SEQ_ADDRESS_BROADCAST 255 /* send event to all queues/clients/ports/channels */
|
||||
#define SNDRV_SEQ_QUEUE_DIRECT 253 /* direct dispatch */
|
||||
|
||||
/* event mode flag - NOTE: only 8 bits available! */
|
||||
#define SNDRV_SEQ_TIME_STAMP_TICK (0<<0) /* timestamp in clock ticks */
|
||||
#define SNDRV_SEQ_TIME_STAMP_REAL (1<<0) /* timestamp in real time */
|
||||
#define SNDRV_SEQ_TIME_STAMP_MASK (1<<0)
|
||||
|
||||
#define SNDRV_SEQ_TIME_MODE_ABS (0<<1) /* absolute timestamp */
|
||||
#define SNDRV_SEQ_TIME_MODE_REL (1<<1) /* relative to current time */
|
||||
#define SNDRV_SEQ_TIME_MODE_MASK (1<<1)
|
||||
|
||||
#define SNDRV_SEQ_EVENT_LENGTH_FIXED (0<<2) /* fixed event size */
|
||||
#define SNDRV_SEQ_EVENT_LENGTH_VARIABLE (1<<2) /* variable event size */
|
||||
#define SNDRV_SEQ_EVENT_LENGTH_VARUSR (2<<2) /* variable event size - user memory space */
|
||||
#define SNDRV_SEQ_EVENT_LENGTH_MASK (3<<2)
|
||||
|
||||
#define SNDRV_SEQ_PRIORITY_NORMAL (0<<4) /* normal priority */
|
||||
#define SNDRV_SEQ_PRIORITY_HIGH (1<<4) /* event should be processed before others */
|
||||
#define SNDRV_SEQ_PRIORITY_MASK (1<<4)
|
||||
|
||||
|
||||
/* note event */
|
||||
struct snd_seq_ev_note {
|
||||
unsigned char channel;
|
||||
unsigned char note;
|
||||
unsigned char velocity;
|
||||
unsigned char off_velocity; /* only for SNDRV_SEQ_EVENT_NOTE */
|
||||
unsigned int duration; /* only for SNDRV_SEQ_EVENT_NOTE */
|
||||
};
|
||||
|
||||
/* controller event */
|
||||
struct snd_seq_ev_ctrl {
|
||||
unsigned char channel;
|
||||
unsigned char unused1, unused2, unused3; /* pad */
|
||||
unsigned int param;
|
||||
signed int value;
|
||||
};
|
||||
|
||||
/* generic set of bytes (12x8 bit) */
|
||||
struct snd_seq_ev_raw8 {
|
||||
unsigned char d[12]; /* 8 bit value */
|
||||
};
|
||||
|
||||
/* generic set of integers (3x32 bit) */
|
||||
struct snd_seq_ev_raw32 {
|
||||
unsigned int d[3]; /* 32 bit value */
|
||||
};
|
||||
|
||||
/* external stored data */
|
||||
struct snd_seq_ev_ext {
|
||||
unsigned int len; /* length of data */
|
||||
void *ptr; /* pointer to data (note: maybe 64-bit) */
|
||||
} __attribute__((packed));
|
||||
|
||||
struct snd_seq_result {
|
||||
int event; /* processed event type */
|
||||
int result;
|
||||
};
|
||||
|
||||
|
||||
struct snd_seq_real_time {
|
||||
unsigned int tv_sec; /* seconds */
|
||||
unsigned int tv_nsec; /* nanoseconds */
|
||||
};
|
||||
|
||||
typedef unsigned int snd_seq_tick_time_t; /* midi ticks */
|
||||
|
||||
union snd_seq_timestamp {
|
||||
snd_seq_tick_time_t tick;
|
||||
struct snd_seq_real_time time;
|
||||
};
|
||||
|
||||
struct snd_seq_queue_skew {
|
||||
unsigned int value;
|
||||
unsigned int base;
|
||||
};
|
||||
|
||||
/* queue timer control */
|
||||
struct snd_seq_ev_queue_control {
|
||||
unsigned char queue; /* affected queue */
|
||||
unsigned char pad[3]; /* reserved */
|
||||
union {
|
||||
signed int value; /* affected value (e.g. tempo) */
|
||||
union snd_seq_timestamp time; /* time */
|
||||
unsigned int position; /* sync position */
|
||||
struct snd_seq_queue_skew skew;
|
||||
unsigned int d32[2];
|
||||
unsigned char d8[8];
|
||||
} param;
|
||||
};
|
||||
|
||||
/* quoted event - inside the kernel only */
|
||||
struct snd_seq_ev_quote {
|
||||
struct snd_seq_addr origin; /* original sender */
|
||||
unsigned short value; /* optional data */
|
||||
struct snd_seq_event *event; /* quoted event */
|
||||
} __attribute__((packed));
|
||||
|
||||
|
||||
/* sequencer event */
|
||||
struct snd_seq_event {
|
||||
snd_seq_event_type_t type; /* event type */
|
||||
unsigned char flags; /* event flags */
|
||||
char tag;
|
||||
|
||||
unsigned char queue; /* schedule queue */
|
||||
union snd_seq_timestamp time; /* schedule time */
|
||||
|
||||
|
||||
struct snd_seq_addr source; /* source address */
|
||||
struct snd_seq_addr dest; /* destination address */
|
||||
|
||||
union { /* event data... */
|
||||
struct snd_seq_ev_note note;
|
||||
struct snd_seq_ev_ctrl control;
|
||||
struct snd_seq_ev_raw8 raw8;
|
||||
struct snd_seq_ev_raw32 raw32;
|
||||
struct snd_seq_ev_ext ext;
|
||||
struct snd_seq_ev_queue_control queue;
|
||||
union snd_seq_timestamp time;
|
||||
struct snd_seq_addr addr;
|
||||
struct snd_seq_connect connect;
|
||||
struct snd_seq_result result;
|
||||
struct snd_seq_ev_quote quote;
|
||||
} data;
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* bounce event - stored as variable size data
|
||||
*/
|
||||
struct snd_seq_event_bounce {
|
||||
int err;
|
||||
struct snd_seq_event event;
|
||||
/* external data follows here. */
|
||||
};
|
||||
|
||||
|
||||
/* system information */
|
||||
struct snd_seq_system_info {
|
||||
int queues; /* maximum queues count */
|
||||
int clients; /* maximum clients count */
|
||||
int ports; /* maximum ports per client */
|
||||
int channels; /* maximum channels per port */
|
||||
int cur_clients; /* current clients */
|
||||
int cur_queues; /* current queues */
|
||||
char reserved[24];
|
||||
};
|
||||
|
||||
|
||||
/* system running information */
|
||||
struct snd_seq_running_info {
|
||||
unsigned char client; /* client id */
|
||||
unsigned char big_endian; /* 1 = big-endian */
|
||||
unsigned char cpu_mode; /* 4 = 32bit, 8 = 64bit */
|
||||
unsigned char pad; /* reserved */
|
||||
unsigned char reserved[12];
|
||||
};
|
||||
|
||||
|
||||
/* known client numbers */
|
||||
#define SNDRV_SEQ_CLIENT_SYSTEM 0
|
||||
/* internal client numbers */
|
||||
#define SNDRV_SEQ_CLIENT_DUMMY 14 /* midi through */
|
||||
#define SNDRV_SEQ_CLIENT_OSS 15 /* oss sequencer emulator */
|
||||
|
||||
|
||||
/* client types */
|
||||
typedef int __bitwise snd_seq_client_type_t;
|
||||
#define NO_CLIENT ((snd_seq_client_type_t) 0)
|
||||
#define USER_CLIENT ((snd_seq_client_type_t) 1)
|
||||
#define KERNEL_CLIENT ((snd_seq_client_type_t) 2)
|
||||
|
||||
/* event filter flags */
|
||||
#define SNDRV_SEQ_FILTER_BROADCAST (1<<0) /* accept broadcast messages */
|
||||
#define SNDRV_SEQ_FILTER_MULTICAST (1<<1) /* accept multicast messages */
|
||||
#define SNDRV_SEQ_FILTER_BOUNCE (1<<2) /* accept bounce event in error */
|
||||
#define SNDRV_SEQ_FILTER_USE_EVENT (1<<31) /* use event filter */
|
||||
|
||||
struct snd_seq_client_info {
|
||||
int client; /* client number to inquire */
|
||||
snd_seq_client_type_t type; /* client type */
|
||||
char name[64]; /* client name */
|
||||
unsigned int filter; /* filter flags */
|
||||
unsigned char multicast_filter[8]; /* multicast filter bitmap */
|
||||
unsigned char event_filter[32]; /* event filter bitmap */
|
||||
int num_ports; /* RO: number of ports */
|
||||
int event_lost; /* number of lost events */
|
||||
char reserved[64]; /* for future use */
|
||||
};
|
||||
|
||||
|
||||
/* client pool size */
|
||||
struct snd_seq_client_pool {
|
||||
int client; /* client number to inquire */
|
||||
int output_pool; /* outgoing (write) pool size */
|
||||
int input_pool; /* incoming (read) pool size */
|
||||
int output_room; /* minimum free pool size for select/blocking mode */
|
||||
int output_free; /* unused size */
|
||||
int input_free; /* unused size */
|
||||
char reserved[64];
|
||||
};
|
||||
|
||||
|
||||
/* Remove events by specified criteria */
|
||||
|
||||
#define SNDRV_SEQ_REMOVE_INPUT (1<<0) /* Flush input queues */
|
||||
#define SNDRV_SEQ_REMOVE_OUTPUT (1<<1) /* Flush output queues */
|
||||
#define SNDRV_SEQ_REMOVE_DEST (1<<2) /* Restrict by destination q:client:port */
|
||||
#define SNDRV_SEQ_REMOVE_DEST_CHANNEL (1<<3) /* Restrict by channel */
|
||||
#define SNDRV_SEQ_REMOVE_TIME_BEFORE (1<<4) /* Restrict to before time */
|
||||
#define SNDRV_SEQ_REMOVE_TIME_AFTER (1<<5) /* Restrict to time or after */
|
||||
#define SNDRV_SEQ_REMOVE_TIME_TICK (1<<6) /* Time is in ticks */
|
||||
#define SNDRV_SEQ_REMOVE_EVENT_TYPE (1<<7) /* Restrict to event type */
|
||||
#define SNDRV_SEQ_REMOVE_IGNORE_OFF (1<<8) /* Do not flush off events */
|
||||
#define SNDRV_SEQ_REMOVE_TAG_MATCH (1<<9) /* Restrict to events with given tag */
|
||||
|
||||
struct snd_seq_remove_events {
|
||||
unsigned int remove_mode; /* Flags that determine what gets removed */
|
||||
|
||||
union snd_seq_timestamp time;
|
||||
|
||||
unsigned char queue; /* Queue for REMOVE_DEST */
|
||||
struct snd_seq_addr dest; /* Address for REMOVE_DEST */
|
||||
unsigned char channel; /* Channel for REMOVE_DEST */
|
||||
|
||||
int type; /* For REMOVE_EVENT_TYPE */
|
||||
char tag; /* Tag for REMOVE_TAG */
|
||||
|
||||
int reserved[10]; /* To allow for future binary compatibility */
|
||||
|
||||
};
|
||||
|
||||
|
||||
/* known port numbers */
|
||||
#define SNDRV_SEQ_PORT_SYSTEM_TIMER 0
|
||||
#define SNDRV_SEQ_PORT_SYSTEM_ANNOUNCE 1
|
||||
|
||||
/* port capabilities (32 bits) */
|
||||
#define SNDRV_SEQ_PORT_CAP_READ (1<<0) /* readable from this port */
|
||||
#define SNDRV_SEQ_PORT_CAP_WRITE (1<<1) /* writable to this port */
|
||||
|
||||
#define SNDRV_SEQ_PORT_CAP_SYNC_READ (1<<2)
|
||||
#define SNDRV_SEQ_PORT_CAP_SYNC_WRITE (1<<3)
|
||||
|
||||
#define SNDRV_SEQ_PORT_CAP_DUPLEX (1<<4)
|
||||
|
||||
#define SNDRV_SEQ_PORT_CAP_SUBS_READ (1<<5) /* allow read subscription */
|
||||
#define SNDRV_SEQ_PORT_CAP_SUBS_WRITE (1<<6) /* allow write subscription */
|
||||
#define SNDRV_SEQ_PORT_CAP_NO_EXPORT (1<<7) /* routing not allowed */
|
||||
|
||||
/* port type */
|
||||
#define SNDRV_SEQ_PORT_TYPE_SPECIFIC (1<<0) /* hardware specific */
|
||||
#define SNDRV_SEQ_PORT_TYPE_MIDI_GENERIC (1<<1) /* generic MIDI device */
|
||||
#define SNDRV_SEQ_PORT_TYPE_MIDI_GM (1<<2) /* General MIDI compatible device */
|
||||
#define SNDRV_SEQ_PORT_TYPE_MIDI_GS (1<<3) /* GS compatible device */
|
||||
#define SNDRV_SEQ_PORT_TYPE_MIDI_XG (1<<4) /* XG compatible device */
|
||||
#define SNDRV_SEQ_PORT_TYPE_MIDI_MT32 (1<<5) /* MT-32 compatible device */
|
||||
#define SNDRV_SEQ_PORT_TYPE_MIDI_GM2 (1<<6) /* General MIDI 2 compatible device */
|
||||
|
||||
/* other standards...*/
|
||||
#define SNDRV_SEQ_PORT_TYPE_SYNTH (1<<10) /* Synth device (no MIDI compatible - direct wavetable) */
|
||||
#define SNDRV_SEQ_PORT_TYPE_DIRECT_SAMPLE (1<<11) /* Sampling device (support sample download) */
|
||||
#define SNDRV_SEQ_PORT_TYPE_SAMPLE (1<<12) /* Sampling device (sample can be downloaded at any time) */
|
||||
/*...*/
|
||||
#define SNDRV_SEQ_PORT_TYPE_HARDWARE (1<<16) /* driver for a hardware device */
|
||||
#define SNDRV_SEQ_PORT_TYPE_SOFTWARE (1<<17) /* implemented in software */
|
||||
#define SNDRV_SEQ_PORT_TYPE_SYNTHESIZER (1<<18) /* generates sound */
|
||||
#define SNDRV_SEQ_PORT_TYPE_PORT (1<<19) /* connects to other device(s) */
|
||||
#define SNDRV_SEQ_PORT_TYPE_APPLICATION (1<<20) /* application (sequencer/editor) */
|
||||
|
||||
/* misc. conditioning flags */
|
||||
#define SNDRV_SEQ_PORT_FLG_GIVEN_PORT (1<<0)
|
||||
#define SNDRV_SEQ_PORT_FLG_TIMESTAMP (1<<1)
|
||||
#define SNDRV_SEQ_PORT_FLG_TIME_REAL (1<<2)
|
||||
|
||||
struct snd_seq_port_info {
|
||||
struct snd_seq_addr addr; /* client/port numbers */
|
||||
char name[64]; /* port name */
|
||||
|
||||
unsigned int capability; /* port capability bits */
|
||||
unsigned int type; /* port type bits */
|
||||
int midi_channels; /* channels per MIDI port */
|
||||
int midi_voices; /* voices per MIDI port */
|
||||
int synth_voices; /* voices per SYNTH port */
|
||||
|
||||
int read_use; /* R/O: subscribers for output (from this port) */
|
||||
int write_use; /* R/O: subscribers for input (to this port) */
|
||||
|
||||
void *kernel; /* reserved for kernel use (must be NULL) */
|
||||
unsigned int flags; /* misc. conditioning */
|
||||
unsigned char time_queue; /* queue # for timestamping */
|
||||
char reserved[59]; /* for future use */
|
||||
};
|
||||
|
||||
|
||||
/* queue flags */
|
||||
#define SNDRV_SEQ_QUEUE_FLG_SYNC (1<<0) /* sync enabled */
|
||||
|
||||
/* queue information */
|
||||
struct snd_seq_queue_info {
|
||||
int queue; /* queue id */
|
||||
|
||||
/*
|
||||
* security settings, only owner of this queue can start/stop timer
|
||||
* etc. if the queue is locked for other clients
|
||||
*/
|
||||
int owner; /* client id for owner of the queue */
|
||||
unsigned locked:1; /* timing queue locked for other queues */
|
||||
char name[64]; /* name of this queue */
|
||||
unsigned int flags; /* flags */
|
||||
char reserved[60]; /* for future use */
|
||||
|
||||
};
|
||||
|
||||
/* queue info/status */
|
||||
struct snd_seq_queue_status {
|
||||
int queue; /* queue id */
|
||||
int events; /* read-only - queue size */
|
||||
snd_seq_tick_time_t tick; /* current tick */
|
||||
struct snd_seq_real_time time; /* current time */
|
||||
int running; /* running state of queue */
|
||||
int flags; /* various flags */
|
||||
char reserved[64]; /* for the future */
|
||||
};
|
||||
|
||||
|
||||
/* queue tempo */
|
||||
struct snd_seq_queue_tempo {
|
||||
int queue; /* sequencer queue */
|
||||
unsigned int tempo; /* current tempo, us/tick */
|
||||
int ppq; /* time resolution, ticks/quarter */
|
||||
unsigned int skew_value; /* queue skew */
|
||||
unsigned int skew_base; /* queue skew base */
|
||||
char reserved[24]; /* for the future */
|
||||
};
|
||||
|
||||
|
||||
/* sequencer timer sources */
|
||||
#define SNDRV_SEQ_TIMER_ALSA 0 /* ALSA timer */
|
||||
#define SNDRV_SEQ_TIMER_MIDI_CLOCK 1 /* Midi Clock (CLOCK event) */
|
||||
#define SNDRV_SEQ_TIMER_MIDI_TICK 2 /* Midi Timer Tick (TICK event) */
|
||||
|
||||
/* queue timer info */
|
||||
struct snd_seq_queue_timer {
|
||||
int queue; /* sequencer queue */
|
||||
int type; /* source timer type */
|
||||
union {
|
||||
struct {
|
||||
struct snd_timer_id id; /* ALSA's timer ID */
|
||||
unsigned int resolution; /* resolution in Hz */
|
||||
} alsa;
|
||||
} u;
|
||||
char reserved[64]; /* for the future use */
|
||||
};
|
||||
|
||||
|
||||
struct snd_seq_queue_client {
|
||||
int queue; /* sequencer queue */
|
||||
int client; /* sequencer client */
|
||||
int used; /* queue is used with this client
|
||||
(must be set for accepting events) */
|
||||
/* per client watermarks */
|
||||
char reserved[64]; /* for future use */
|
||||
};
|
||||
|
||||
|
||||
#define SNDRV_SEQ_PORT_SUBS_EXCLUSIVE (1<<0) /* exclusive connection */
|
||||
#define SNDRV_SEQ_PORT_SUBS_TIMESTAMP (1<<1)
|
||||
#define SNDRV_SEQ_PORT_SUBS_TIME_REAL (1<<2)
|
||||
|
||||
struct snd_seq_port_subscribe {
|
||||
struct snd_seq_addr sender; /* sender address */
|
||||
struct snd_seq_addr dest; /* destination address */
|
||||
unsigned int voices; /* number of voices to be allocated (0 = don't care) */
|
||||
unsigned int flags; /* modes */
|
||||
unsigned char queue; /* input time-stamp queue (optional) */
|
||||
unsigned char pad[3]; /* reserved */
|
||||
char reserved[64];
|
||||
};
|
||||
|
||||
/* type of query subscription */
|
||||
#define SNDRV_SEQ_QUERY_SUBS_READ 0
|
||||
#define SNDRV_SEQ_QUERY_SUBS_WRITE 1
|
||||
|
||||
struct snd_seq_query_subs {
|
||||
struct snd_seq_addr root; /* client/port id to be searched */
|
||||
int type; /* READ or WRITE */
|
||||
int index; /* 0..N-1 */
|
||||
int num_subs; /* R/O: number of subscriptions on this port */
|
||||
struct snd_seq_addr addr; /* R/O: result */
|
||||
unsigned char queue; /* R/O: result */
|
||||
unsigned int flags; /* R/O: result */
|
||||
char reserved[64]; /* for future use */
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* IOCTL commands
|
||||
*/
|
||||
|
||||
#define SNDRV_SEQ_IOCTL_PVERSION _IOR ('S', 0x00, int)
|
||||
#define SNDRV_SEQ_IOCTL_CLIENT_ID _IOR ('S', 0x01, int)
|
||||
#define SNDRV_SEQ_IOCTL_SYSTEM_INFO _IOWR('S', 0x02, struct snd_seq_system_info)
|
||||
#define SNDRV_SEQ_IOCTL_RUNNING_MODE _IOWR('S', 0x03, struct snd_seq_running_info)
|
||||
|
||||
#define SNDRV_SEQ_IOCTL_GET_CLIENT_INFO _IOWR('S', 0x10, struct snd_seq_client_info)
|
||||
#define SNDRV_SEQ_IOCTL_SET_CLIENT_INFO _IOW ('S', 0x11, struct snd_seq_client_info)
|
||||
|
||||
#define SNDRV_SEQ_IOCTL_CREATE_PORT _IOWR('S', 0x20, struct snd_seq_port_info)
|
||||
#define SNDRV_SEQ_IOCTL_DELETE_PORT _IOW ('S', 0x21, struct snd_seq_port_info)
|
||||
#define SNDRV_SEQ_IOCTL_GET_PORT_INFO _IOWR('S', 0x22, struct snd_seq_port_info)
|
||||
#define SNDRV_SEQ_IOCTL_SET_PORT_INFO _IOW ('S', 0x23, struct snd_seq_port_info)
|
||||
|
||||
#define SNDRV_SEQ_IOCTL_SUBSCRIBE_PORT _IOW ('S', 0x30, struct snd_seq_port_subscribe)
|
||||
#define SNDRV_SEQ_IOCTL_UNSUBSCRIBE_PORT _IOW ('S', 0x31, struct snd_seq_port_subscribe)
|
||||
|
||||
#define SNDRV_SEQ_IOCTL_CREATE_QUEUE _IOWR('S', 0x32, struct snd_seq_queue_info)
|
||||
#define SNDRV_SEQ_IOCTL_DELETE_QUEUE _IOW ('S', 0x33, struct snd_seq_queue_info)
|
||||
#define SNDRV_SEQ_IOCTL_GET_QUEUE_INFO _IOWR('S', 0x34, struct snd_seq_queue_info)
|
||||
#define SNDRV_SEQ_IOCTL_SET_QUEUE_INFO _IOWR('S', 0x35, struct snd_seq_queue_info)
|
||||
#define SNDRV_SEQ_IOCTL_GET_NAMED_QUEUE _IOWR('S', 0x36, struct snd_seq_queue_info)
|
||||
#define SNDRV_SEQ_IOCTL_GET_QUEUE_STATUS _IOWR('S', 0x40, struct snd_seq_queue_status)
|
||||
#define SNDRV_SEQ_IOCTL_GET_QUEUE_TEMPO _IOWR('S', 0x41, struct snd_seq_queue_tempo)
|
||||
#define SNDRV_SEQ_IOCTL_SET_QUEUE_TEMPO _IOW ('S', 0x42, struct snd_seq_queue_tempo)
|
||||
#define SNDRV_SEQ_IOCTL_GET_QUEUE_OWNER _IOWR('S', 0x43, struct snd_seq_queue_owner)
|
||||
#define SNDRV_SEQ_IOCTL_SET_QUEUE_OWNER _IOW ('S', 0x44, struct snd_seq_queue_owner)
|
||||
#define SNDRV_SEQ_IOCTL_GET_QUEUE_TIMER _IOWR('S', 0x45, struct snd_seq_queue_timer)
|
||||
#define SNDRV_SEQ_IOCTL_SET_QUEUE_TIMER _IOW ('S', 0x46, struct snd_seq_queue_timer)
|
||||
/* XXX
|
||||
#define SNDRV_SEQ_IOCTL_GET_QUEUE_SYNC _IOWR('S', 0x53, struct snd_seq_queue_sync)
|
||||
#define SNDRV_SEQ_IOCTL_SET_QUEUE_SYNC _IOW ('S', 0x54, struct snd_seq_queue_sync)
|
||||
*/
|
||||
#define SNDRV_SEQ_IOCTL_GET_QUEUE_CLIENT _IOWR('S', 0x49, struct snd_seq_queue_client)
|
||||
#define SNDRV_SEQ_IOCTL_SET_QUEUE_CLIENT _IOW ('S', 0x4a, struct snd_seq_queue_client)
|
||||
#define SNDRV_SEQ_IOCTL_GET_CLIENT_POOL _IOWR('S', 0x4b, struct snd_seq_client_pool)
|
||||
#define SNDRV_SEQ_IOCTL_SET_CLIENT_POOL _IOW ('S', 0x4c, struct snd_seq_client_pool)
|
||||
#define SNDRV_SEQ_IOCTL_REMOVE_EVENTS _IOW ('S', 0x4e, struct snd_seq_remove_events)
|
||||
#define SNDRV_SEQ_IOCTL_QUERY_SUBS _IOWR('S', 0x4f, struct snd_seq_query_subs)
|
||||
#define SNDRV_SEQ_IOCTL_GET_SUBSCRIPTION _IOWR('S', 0x50, struct snd_seq_port_subscribe)
|
||||
#define SNDRV_SEQ_IOCTL_QUERY_NEXT_CLIENT _IOWR('S', 0x51, struct snd_seq_client_info)
|
||||
#define SNDRV_SEQ_IOCTL_QUERY_NEXT_PORT _IOWR('S', 0x52, struct snd_seq_port_info)
|
||||
|
||||
#endif /* __SOUND_ASEQUENCER_H */
|
||||
1015
openflow/usr/include/sound/asound.h
Normal file
1015
openflow/usr/include/sound/asound.h
Normal file
File diff suppressed because it is too large
Load Diff
134
openflow/usr/include/sound/asound_fm.h
Normal file
134
openflow/usr/include/sound/asound_fm.h
Normal file
@@ -0,0 +1,134 @@
|
||||
#ifndef __SOUND_ASOUND_FM_H
|
||||
#define __SOUND_ASOUND_FM_H
|
||||
|
||||
/*
|
||||
* Advanced Linux Sound Architecture - ALSA
|
||||
*
|
||||
* Interface file between ALSA driver & user space
|
||||
* Copyright (c) 1994-98 by Jaroslav Kysela <perex@perex.cz>,
|
||||
* 4Front Technologies
|
||||
*
|
||||
* Direct FM control
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
#define SNDRV_DM_FM_MODE_OPL2 0x00
|
||||
#define SNDRV_DM_FM_MODE_OPL3 0x01
|
||||
|
||||
struct snd_dm_fm_info {
|
||||
unsigned char fm_mode; /* OPL mode, see SNDRV_DM_FM_MODE_XXX */
|
||||
unsigned char rhythm; /* percussion mode flag */
|
||||
};
|
||||
|
||||
/*
|
||||
* Data structure composing an FM "note" or sound event.
|
||||
*/
|
||||
|
||||
struct snd_dm_fm_voice {
|
||||
unsigned char op; /* operator cell (0 or 1) */
|
||||
unsigned char voice; /* FM voice (0 to 17) */
|
||||
|
||||
unsigned char am; /* amplitude modulation */
|
||||
unsigned char vibrato; /* vibrato effect */
|
||||
unsigned char do_sustain; /* sustain phase */
|
||||
unsigned char kbd_scale; /* keyboard scaling */
|
||||
unsigned char harmonic; /* 4 bits: harmonic and multiplier */
|
||||
unsigned char scale_level; /* 2 bits: decrease output freq rises */
|
||||
unsigned char volume; /* 6 bits: volume */
|
||||
|
||||
unsigned char attack; /* 4 bits: attack rate */
|
||||
unsigned char decay; /* 4 bits: decay rate */
|
||||
unsigned char sustain; /* 4 bits: sustain level */
|
||||
unsigned char release; /* 4 bits: release rate */
|
||||
|
||||
unsigned char feedback; /* 3 bits: feedback for op0 */
|
||||
unsigned char connection; /* 0 for serial, 1 for parallel */
|
||||
unsigned char left; /* stereo left */
|
||||
unsigned char right; /* stereo right */
|
||||
unsigned char waveform; /* 3 bits: waveform shape */
|
||||
};
|
||||
|
||||
/*
|
||||
* This describes an FM note by its voice, octave, frequency number (10bit)
|
||||
* and key on/off.
|
||||
*/
|
||||
|
||||
struct snd_dm_fm_note {
|
||||
unsigned char voice; /* 0-17 voice channel */
|
||||
unsigned char octave; /* 3 bits: what octave to play */
|
||||
unsigned int fnum; /* 10 bits: frequency number */
|
||||
unsigned char key_on; /* set for active, clear for silent */
|
||||
};
|
||||
|
||||
/*
|
||||
* FM parameters that apply globally to all voices, and thus are not "notes"
|
||||
*/
|
||||
|
||||
struct snd_dm_fm_params {
|
||||
unsigned char am_depth; /* amplitude modulation depth (1=hi) */
|
||||
unsigned char vib_depth; /* vibrato depth (1=hi) */
|
||||
unsigned char kbd_split; /* keyboard split */
|
||||
unsigned char rhythm; /* percussion mode select */
|
||||
|
||||
/* This block is the percussion instrument data */
|
||||
unsigned char bass;
|
||||
unsigned char snare;
|
||||
unsigned char tomtom;
|
||||
unsigned char cymbal;
|
||||
unsigned char hihat;
|
||||
};
|
||||
|
||||
/*
|
||||
* FM mode ioctl settings
|
||||
*/
|
||||
|
||||
#define SNDRV_DM_FM_IOCTL_INFO _IOR('H', 0x20, struct snd_dm_fm_info)
|
||||
#define SNDRV_DM_FM_IOCTL_RESET _IO ('H', 0x21)
|
||||
#define SNDRV_DM_FM_IOCTL_PLAY_NOTE _IOW('H', 0x22, struct snd_dm_fm_note)
|
||||
#define SNDRV_DM_FM_IOCTL_SET_VOICE _IOW('H', 0x23, struct snd_dm_fm_voice)
|
||||
#define SNDRV_DM_FM_IOCTL_SET_PARAMS _IOW('H', 0x24, struct snd_dm_fm_params)
|
||||
#define SNDRV_DM_FM_IOCTL_SET_MODE _IOW('H', 0x25, int)
|
||||
/* for OPL3 only */
|
||||
#define SNDRV_DM_FM_IOCTL_SET_CONNECTION _IOW('H', 0x26, int)
|
||||
/* SBI patch management */
|
||||
#define SNDRV_DM_FM_IOCTL_CLEAR_PATCHES _IO ('H', 0x40)
|
||||
|
||||
#define SNDRV_DM_FM_OSS_IOCTL_RESET 0x20
|
||||
#define SNDRV_DM_FM_OSS_IOCTL_PLAY_NOTE 0x21
|
||||
#define SNDRV_DM_FM_OSS_IOCTL_SET_VOICE 0x22
|
||||
#define SNDRV_DM_FM_OSS_IOCTL_SET_PARAMS 0x23
|
||||
#define SNDRV_DM_FM_OSS_IOCTL_SET_MODE 0x24
|
||||
#define SNDRV_DM_FM_OSS_IOCTL_SET_OPL 0x25
|
||||
|
||||
/*
|
||||
* Patch Record - fixed size for write
|
||||
*/
|
||||
|
||||
#define FM_KEY_SBI "SBI\032"
|
||||
#define FM_KEY_2OP "2OP\032"
|
||||
#define FM_KEY_4OP "4OP\032"
|
||||
|
||||
struct sbi_patch {
|
||||
unsigned char prog;
|
||||
unsigned char bank;
|
||||
char key[4];
|
||||
char name[25];
|
||||
char extension[7];
|
||||
unsigned char data[32];
|
||||
};
|
||||
|
||||
#endif /* __SOUND_ASOUND_FM_H */
|
||||
191
openflow/usr/include/sound/compress_offload.h
Normal file
191
openflow/usr/include/sound/compress_offload.h
Normal file
@@ -0,0 +1,191 @@
|
||||
/*
|
||||
* compress_offload.h - compress offload header definations
|
||||
*
|
||||
* Copyright (C) 2011 Intel Corporation
|
||||
* Authors: Vinod Koul <vinod.koul@linux.intel.com>
|
||||
* Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
|
||||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; version 2 of the License.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
*
|
||||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
*
|
||||
*/
|
||||
#ifndef __COMPRESS_OFFLOAD_H
|
||||
#define __COMPRESS_OFFLOAD_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <sound/asound.h>
|
||||
#include <sound/compress_params.h>
|
||||
|
||||
|
||||
#define SNDRV_COMPRESS_VERSION SNDRV_PROTOCOL_VERSION(0, 1, 2)
|
||||
/**
|
||||
* struct snd_compressed_buffer - compressed buffer
|
||||
* @fragment_size: size of buffer fragment in bytes
|
||||
* @fragments: number of such fragments
|
||||
*/
|
||||
struct snd_compressed_buffer {
|
||||
__u32 fragment_size;
|
||||
__u32 fragments;
|
||||
} __attribute__((packed, aligned(4)));
|
||||
|
||||
/**
|
||||
* struct snd_compr_params - compressed stream params
|
||||
* @buffer: buffer description
|
||||
* @codec: codec parameters
|
||||
* @no_wake_mode: dont wake on fragment elapsed
|
||||
*/
|
||||
struct snd_compr_params {
|
||||
struct snd_compressed_buffer buffer;
|
||||
struct snd_codec codec;
|
||||
__u8 no_wake_mode;
|
||||
} __attribute__((packed, aligned(4)));
|
||||
|
||||
/**
|
||||
* struct snd_compr_tstamp - timestamp descriptor
|
||||
* @byte_offset: Byte offset in ring buffer to DSP
|
||||
* @copied_total: Total number of bytes copied from/to ring buffer to/by DSP
|
||||
* @pcm_frames: Frames decoded or encoded by DSP. This field will evolve by
|
||||
* large steps and should only be used to monitor encoding/decoding
|
||||
* progress. It shall not be used for timing estimates.
|
||||
* @pcm_io_frames: Frames rendered or received by DSP into a mixer or an audio
|
||||
* output/input. This field should be used for A/V sync or time estimates.
|
||||
* @sampling_rate: sampling rate of audio
|
||||
*/
|
||||
struct snd_compr_tstamp {
|
||||
__u32 byte_offset;
|
||||
__u32 copied_total;
|
||||
__u32 pcm_frames;
|
||||
__u32 pcm_io_frames;
|
||||
__u32 sampling_rate;
|
||||
} __attribute__((packed, aligned(4)));
|
||||
|
||||
/**
|
||||
* struct snd_compr_avail - avail descriptor
|
||||
* @avail: Number of bytes available in ring buffer for writing/reading
|
||||
* @tstamp: timestamp information
|
||||
*/
|
||||
struct snd_compr_avail {
|
||||
__u64 avail;
|
||||
struct snd_compr_tstamp tstamp;
|
||||
} __attribute__((packed, aligned(4)));
|
||||
|
||||
enum snd_compr_direction {
|
||||
SND_COMPRESS_PLAYBACK = 0,
|
||||
SND_COMPRESS_CAPTURE
|
||||
};
|
||||
|
||||
/**
|
||||
* struct snd_compr_caps - caps descriptor
|
||||
* @codecs: pointer to array of codecs
|
||||
* @direction: direction supported. Of type snd_compr_direction
|
||||
* @min_fragment_size: minimum fragment supported by DSP
|
||||
* @max_fragment_size: maximum fragment supported by DSP
|
||||
* @min_fragments: min fragments supported by DSP
|
||||
* @max_fragments: max fragments supported by DSP
|
||||
* @num_codecs: number of codecs supported
|
||||
* @reserved: reserved field
|
||||
*/
|
||||
struct snd_compr_caps {
|
||||
__u32 num_codecs;
|
||||
__u32 direction;
|
||||
__u32 min_fragment_size;
|
||||
__u32 max_fragment_size;
|
||||
__u32 min_fragments;
|
||||
__u32 max_fragments;
|
||||
__u32 codecs[MAX_NUM_CODECS];
|
||||
__u32 reserved[11];
|
||||
} __attribute__((packed, aligned(4)));
|
||||
|
||||
/**
|
||||
* struct snd_compr_codec_caps - query capability of codec
|
||||
* @codec: codec for which capability is queried
|
||||
* @num_descriptors: number of codec descriptors
|
||||
* @descriptor: array of codec capability descriptor
|
||||
*/
|
||||
struct snd_compr_codec_caps {
|
||||
__u32 codec;
|
||||
__u32 num_descriptors;
|
||||
struct snd_codec_desc descriptor[MAX_NUM_CODEC_DESCRIPTORS];
|
||||
} __attribute__((packed, aligned(4)));
|
||||
|
||||
/**
|
||||
* enum sndrv_compress_encoder
|
||||
* @SNDRV_COMPRESS_ENCODER_PADDING: no of samples appended by the encoder at the
|
||||
* end of the track
|
||||
* @SNDRV_COMPRESS_ENCODER_DELAY: no of samples inserted by the encoder at the
|
||||
* beginning of the track
|
||||
*/
|
||||
enum sndrv_compress_encoder {
|
||||
SNDRV_COMPRESS_ENCODER_PADDING = 1,
|
||||
SNDRV_COMPRESS_ENCODER_DELAY = 2,
|
||||
};
|
||||
|
||||
/**
|
||||
* struct snd_compr_metadata - compressed stream metadata
|
||||
* @key: key id
|
||||
* @value: key value
|
||||
*/
|
||||
struct snd_compr_metadata {
|
||||
__u32 key;
|
||||
__u32 value[8];
|
||||
} __attribute__((packed, aligned(4)));
|
||||
|
||||
/**
|
||||
* compress path ioctl definitions
|
||||
* SNDRV_COMPRESS_GET_CAPS: Query capability of DSP
|
||||
* SNDRV_COMPRESS_GET_CODEC_CAPS: Query capability of a codec
|
||||
* SNDRV_COMPRESS_SET_PARAMS: Set codec and stream parameters
|
||||
* Note: only codec params can be changed runtime and stream params cant be
|
||||
* SNDRV_COMPRESS_GET_PARAMS: Query codec params
|
||||
* SNDRV_COMPRESS_TSTAMP: get the current timestamp value
|
||||
* SNDRV_COMPRESS_AVAIL: get the current buffer avail value.
|
||||
* This also queries the tstamp properties
|
||||
* SNDRV_COMPRESS_PAUSE: Pause the running stream
|
||||
* SNDRV_COMPRESS_RESUME: resume a paused stream
|
||||
* SNDRV_COMPRESS_START: Start a stream
|
||||
* SNDRV_COMPRESS_STOP: stop a running stream, discarding ring buffer content
|
||||
* and the buffers currently with DSP
|
||||
* SNDRV_COMPRESS_DRAIN: Play till end of buffers and stop after that
|
||||
* SNDRV_COMPRESS_IOCTL_VERSION: Query the API version
|
||||
*/
|
||||
#define SNDRV_COMPRESS_IOCTL_VERSION _IOR('C', 0x00, int)
|
||||
#define SNDRV_COMPRESS_GET_CAPS _IOWR('C', 0x10, struct snd_compr_caps)
|
||||
#define SNDRV_COMPRESS_GET_CODEC_CAPS _IOWR('C', 0x11,\
|
||||
struct snd_compr_codec_caps)
|
||||
#define SNDRV_COMPRESS_SET_PARAMS _IOW('C', 0x12, struct snd_compr_params)
|
||||
#define SNDRV_COMPRESS_GET_PARAMS _IOR('C', 0x13, struct snd_codec)
|
||||
#define SNDRV_COMPRESS_SET_METADATA _IOW('C', 0x14,\
|
||||
struct snd_compr_metadata)
|
||||
#define SNDRV_COMPRESS_GET_METADATA _IOWR('C', 0x15,\
|
||||
struct snd_compr_metadata)
|
||||
#define SNDRV_COMPRESS_TSTAMP _IOR('C', 0x20, struct snd_compr_tstamp)
|
||||
#define SNDRV_COMPRESS_AVAIL _IOR('C', 0x21, struct snd_compr_avail)
|
||||
#define SNDRV_COMPRESS_PAUSE _IO('C', 0x30)
|
||||
#define SNDRV_COMPRESS_RESUME _IO('C', 0x31)
|
||||
#define SNDRV_COMPRESS_START _IO('C', 0x32)
|
||||
#define SNDRV_COMPRESS_STOP _IO('C', 0x33)
|
||||
#define SNDRV_COMPRESS_DRAIN _IO('C', 0x34)
|
||||
#define SNDRV_COMPRESS_NEXT_TRACK _IO('C', 0x35)
|
||||
#define SNDRV_COMPRESS_PARTIAL_DRAIN _IO('C', 0x36)
|
||||
/*
|
||||
* TODO
|
||||
* 1. add mmap support
|
||||
*
|
||||
*/
|
||||
#define SND_COMPR_TRIGGER_DRAIN 7 /*FIXME move this to pcm.h */
|
||||
#define SND_COMPR_TRIGGER_NEXT_TRACK 8
|
||||
#define SND_COMPR_TRIGGER_PARTIAL_DRAIN 9
|
||||
#endif
|
||||
404
openflow/usr/include/sound/compress_params.h
Normal file
404
openflow/usr/include/sound/compress_params.h
Normal file
@@ -0,0 +1,404 @@
|
||||
/*
|
||||
* compress_params.h - codec types and parameters for compressed data
|
||||
* streaming interface
|
||||
*
|
||||
* Copyright (C) 2011 Intel Corporation
|
||||
* Authors: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
|
||||
* Vinod Koul <vinod.koul@linux.intel.com>
|
||||
*
|
||||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; version 2 of the License.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
*
|
||||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
*
|
||||
* The definitions in this file are derived from the OpenMAX AL version 1.1
|
||||
* and OpenMAX IL v 1.1.2 header files which contain the copyright notice below.
|
||||
*
|
||||
* Copyright (c) 2007-2010 The Khronos Group Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and/or associated documentation files (the
|
||||
* "Materials "), to deal in the Materials without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
* permit persons to whom the Materials are furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Materials.
|
||||
*
|
||||
* THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
*
|
||||
*/
|
||||
#ifndef __SND_COMPRESS_PARAMS_H
|
||||
#define __SND_COMPRESS_PARAMS_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
/* AUDIO CODECS SUPPORTED */
|
||||
#define MAX_NUM_CODECS 32
|
||||
#define MAX_NUM_CODEC_DESCRIPTORS 32
|
||||
#define MAX_NUM_BITRATES 32
|
||||
#define MAX_NUM_SAMPLE_RATES 32
|
||||
|
||||
/* Codecs are listed linearly to allow for extensibility */
|
||||
#define SND_AUDIOCODEC_PCM ((__u32) 0x00000001)
|
||||
#define SND_AUDIOCODEC_MP3 ((__u32) 0x00000002)
|
||||
#define SND_AUDIOCODEC_AMR ((__u32) 0x00000003)
|
||||
#define SND_AUDIOCODEC_AMRWB ((__u32) 0x00000004)
|
||||
#define SND_AUDIOCODEC_AMRWBPLUS ((__u32) 0x00000005)
|
||||
#define SND_AUDIOCODEC_AAC ((__u32) 0x00000006)
|
||||
#define SND_AUDIOCODEC_WMA ((__u32) 0x00000007)
|
||||
#define SND_AUDIOCODEC_REAL ((__u32) 0x00000008)
|
||||
#define SND_AUDIOCODEC_VORBIS ((__u32) 0x00000009)
|
||||
#define SND_AUDIOCODEC_FLAC ((__u32) 0x0000000A)
|
||||
#define SND_AUDIOCODEC_IEC61937 ((__u32) 0x0000000B)
|
||||
#define SND_AUDIOCODEC_G723_1 ((__u32) 0x0000000C)
|
||||
#define SND_AUDIOCODEC_G729 ((__u32) 0x0000000D)
|
||||
#define SND_AUDIOCODEC_MAX SND_AUDIOCODEC_G729
|
||||
|
||||
/*
|
||||
* Profile and modes are listed with bit masks. This allows for a
|
||||
* more compact representation of fields that will not evolve
|
||||
* (in contrast to the list of codecs)
|
||||
*/
|
||||
|
||||
#define SND_AUDIOPROFILE_PCM ((__u32) 0x00000001)
|
||||
|
||||
/* MP3 modes are only useful for encoders */
|
||||
#define SND_AUDIOCHANMODE_MP3_MONO ((__u32) 0x00000001)
|
||||
#define SND_AUDIOCHANMODE_MP3_STEREO ((__u32) 0x00000002)
|
||||
#define SND_AUDIOCHANMODE_MP3_JOINTSTEREO ((__u32) 0x00000004)
|
||||
#define SND_AUDIOCHANMODE_MP3_DUAL ((__u32) 0x00000008)
|
||||
|
||||
#define SND_AUDIOPROFILE_AMR ((__u32) 0x00000001)
|
||||
|
||||
/* AMR modes are only useful for encoders */
|
||||
#define SND_AUDIOMODE_AMR_DTX_OFF ((__u32) 0x00000001)
|
||||
#define SND_AUDIOMODE_AMR_VAD1 ((__u32) 0x00000002)
|
||||
#define SND_AUDIOMODE_AMR_VAD2 ((__u32) 0x00000004)
|
||||
|
||||
#define SND_AUDIOSTREAMFORMAT_UNDEFINED ((__u32) 0x00000000)
|
||||
#define SND_AUDIOSTREAMFORMAT_CONFORMANCE ((__u32) 0x00000001)
|
||||
#define SND_AUDIOSTREAMFORMAT_IF1 ((__u32) 0x00000002)
|
||||
#define SND_AUDIOSTREAMFORMAT_IF2 ((__u32) 0x00000004)
|
||||
#define SND_AUDIOSTREAMFORMAT_FSF ((__u32) 0x00000008)
|
||||
#define SND_AUDIOSTREAMFORMAT_RTPPAYLOAD ((__u32) 0x00000010)
|
||||
#define SND_AUDIOSTREAMFORMAT_ITU ((__u32) 0x00000020)
|
||||
|
||||
#define SND_AUDIOPROFILE_AMRWB ((__u32) 0x00000001)
|
||||
|
||||
/* AMRWB modes are only useful for encoders */
|
||||
#define SND_AUDIOMODE_AMRWB_DTX_OFF ((__u32) 0x00000001)
|
||||
#define SND_AUDIOMODE_AMRWB_VAD1 ((__u32) 0x00000002)
|
||||
#define SND_AUDIOMODE_AMRWB_VAD2 ((__u32) 0x00000004)
|
||||
|
||||
#define SND_AUDIOPROFILE_AMRWBPLUS ((__u32) 0x00000001)
|
||||
|
||||
#define SND_AUDIOPROFILE_AAC ((__u32) 0x00000001)
|
||||
|
||||
/* AAC modes are required for encoders and decoders */
|
||||
#define SND_AUDIOMODE_AAC_MAIN ((__u32) 0x00000001)
|
||||
#define SND_AUDIOMODE_AAC_LC ((__u32) 0x00000002)
|
||||
#define SND_AUDIOMODE_AAC_SSR ((__u32) 0x00000004)
|
||||
#define SND_AUDIOMODE_AAC_LTP ((__u32) 0x00000008)
|
||||
#define SND_AUDIOMODE_AAC_HE ((__u32) 0x00000010)
|
||||
#define SND_AUDIOMODE_AAC_SCALABLE ((__u32) 0x00000020)
|
||||
#define SND_AUDIOMODE_AAC_ERLC ((__u32) 0x00000040)
|
||||
#define SND_AUDIOMODE_AAC_LD ((__u32) 0x00000080)
|
||||
#define SND_AUDIOMODE_AAC_HE_PS ((__u32) 0x00000100)
|
||||
#define SND_AUDIOMODE_AAC_HE_MPS ((__u32) 0x00000200)
|
||||
|
||||
/* AAC formats are required for encoders and decoders */
|
||||
#define SND_AUDIOSTREAMFORMAT_MP2ADTS ((__u32) 0x00000001)
|
||||
#define SND_AUDIOSTREAMFORMAT_MP4ADTS ((__u32) 0x00000002)
|
||||
#define SND_AUDIOSTREAMFORMAT_MP4LOAS ((__u32) 0x00000004)
|
||||
#define SND_AUDIOSTREAMFORMAT_MP4LATM ((__u32) 0x00000008)
|
||||
#define SND_AUDIOSTREAMFORMAT_ADIF ((__u32) 0x00000010)
|
||||
#define SND_AUDIOSTREAMFORMAT_MP4FF ((__u32) 0x00000020)
|
||||
#define SND_AUDIOSTREAMFORMAT_RAW ((__u32) 0x00000040)
|
||||
|
||||
#define SND_AUDIOPROFILE_WMA7 ((__u32) 0x00000001)
|
||||
#define SND_AUDIOPROFILE_WMA8 ((__u32) 0x00000002)
|
||||
#define SND_AUDIOPROFILE_WMA9 ((__u32) 0x00000004)
|
||||
#define SND_AUDIOPROFILE_WMA10 ((__u32) 0x00000008)
|
||||
|
||||
#define SND_AUDIOMODE_WMA_LEVEL1 ((__u32) 0x00000001)
|
||||
#define SND_AUDIOMODE_WMA_LEVEL2 ((__u32) 0x00000002)
|
||||
#define SND_AUDIOMODE_WMA_LEVEL3 ((__u32) 0x00000004)
|
||||
#define SND_AUDIOMODE_WMA_LEVEL4 ((__u32) 0x00000008)
|
||||
#define SND_AUDIOMODE_WMAPRO_LEVELM0 ((__u32) 0x00000010)
|
||||
#define SND_AUDIOMODE_WMAPRO_LEVELM1 ((__u32) 0x00000020)
|
||||
#define SND_AUDIOMODE_WMAPRO_LEVELM2 ((__u32) 0x00000040)
|
||||
#define SND_AUDIOMODE_WMAPRO_LEVELM3 ((__u32) 0x00000080)
|
||||
|
||||
#define SND_AUDIOSTREAMFORMAT_WMA_ASF ((__u32) 0x00000001)
|
||||
/*
|
||||
* Some implementations strip the ASF header and only send ASF packets
|
||||
* to the DSP
|
||||
*/
|
||||
#define SND_AUDIOSTREAMFORMAT_WMA_NOASF_HDR ((__u32) 0x00000002)
|
||||
|
||||
#define SND_AUDIOPROFILE_REALAUDIO ((__u32) 0x00000001)
|
||||
|
||||
#define SND_AUDIOMODE_REALAUDIO_G2 ((__u32) 0x00000001)
|
||||
#define SND_AUDIOMODE_REALAUDIO_8 ((__u32) 0x00000002)
|
||||
#define SND_AUDIOMODE_REALAUDIO_10 ((__u32) 0x00000004)
|
||||
#define SND_AUDIOMODE_REALAUDIO_SURROUND ((__u32) 0x00000008)
|
||||
|
||||
#define SND_AUDIOPROFILE_VORBIS ((__u32) 0x00000001)
|
||||
|
||||
#define SND_AUDIOMODE_VORBIS ((__u32) 0x00000001)
|
||||
|
||||
#define SND_AUDIOPROFILE_FLAC ((__u32) 0x00000001)
|
||||
|
||||
/*
|
||||
* Define quality levels for FLAC encoders, from LEVEL0 (fast)
|
||||
* to LEVEL8 (best)
|
||||
*/
|
||||
#define SND_AUDIOMODE_FLAC_LEVEL0 ((__u32) 0x00000001)
|
||||
#define SND_AUDIOMODE_FLAC_LEVEL1 ((__u32) 0x00000002)
|
||||
#define SND_AUDIOMODE_FLAC_LEVEL2 ((__u32) 0x00000004)
|
||||
#define SND_AUDIOMODE_FLAC_LEVEL3 ((__u32) 0x00000008)
|
||||
#define SND_AUDIOMODE_FLAC_LEVEL4 ((__u32) 0x00000010)
|
||||
#define SND_AUDIOMODE_FLAC_LEVEL5 ((__u32) 0x00000020)
|
||||
#define SND_AUDIOMODE_FLAC_LEVEL6 ((__u32) 0x00000040)
|
||||
#define SND_AUDIOMODE_FLAC_LEVEL7 ((__u32) 0x00000080)
|
||||
#define SND_AUDIOMODE_FLAC_LEVEL8 ((__u32) 0x00000100)
|
||||
|
||||
#define SND_AUDIOSTREAMFORMAT_FLAC ((__u32) 0x00000001)
|
||||
#define SND_AUDIOSTREAMFORMAT_FLAC_OGG ((__u32) 0x00000002)
|
||||
|
||||
/* IEC61937 payloads without CUVP and preambles */
|
||||
#define SND_AUDIOPROFILE_IEC61937 ((__u32) 0x00000001)
|
||||
/* IEC61937 with S/PDIF preambles+CUVP bits in 32-bit containers */
|
||||
#define SND_AUDIOPROFILE_IEC61937_SPDIF ((__u32) 0x00000002)
|
||||
|
||||
/*
|
||||
* IEC modes are mandatory for decoders. Format autodetection
|
||||
* will only happen on the DSP side with mode 0. The PCM mode should
|
||||
* not be used, the PCM codec should be used instead.
|
||||
*/
|
||||
#define SND_AUDIOMODE_IEC_REF_STREAM_HEADER ((__u32) 0x00000000)
|
||||
#define SND_AUDIOMODE_IEC_LPCM ((__u32) 0x00000001)
|
||||
#define SND_AUDIOMODE_IEC_AC3 ((__u32) 0x00000002)
|
||||
#define SND_AUDIOMODE_IEC_MPEG1 ((__u32) 0x00000004)
|
||||
#define SND_AUDIOMODE_IEC_MP3 ((__u32) 0x00000008)
|
||||
#define SND_AUDIOMODE_IEC_MPEG2 ((__u32) 0x00000010)
|
||||
#define SND_AUDIOMODE_IEC_AACLC ((__u32) 0x00000020)
|
||||
#define SND_AUDIOMODE_IEC_DTS ((__u32) 0x00000040)
|
||||
#define SND_AUDIOMODE_IEC_ATRAC ((__u32) 0x00000080)
|
||||
#define SND_AUDIOMODE_IEC_SACD ((__u32) 0x00000100)
|
||||
#define SND_AUDIOMODE_IEC_EAC3 ((__u32) 0x00000200)
|
||||
#define SND_AUDIOMODE_IEC_DTS_HD ((__u32) 0x00000400)
|
||||
#define SND_AUDIOMODE_IEC_MLP ((__u32) 0x00000800)
|
||||
#define SND_AUDIOMODE_IEC_DST ((__u32) 0x00001000)
|
||||
#define SND_AUDIOMODE_IEC_WMAPRO ((__u32) 0x00002000)
|
||||
#define SND_AUDIOMODE_IEC_REF_CXT ((__u32) 0x00004000)
|
||||
#define SND_AUDIOMODE_IEC_HE_AAC ((__u32) 0x00008000)
|
||||
#define SND_AUDIOMODE_IEC_HE_AAC2 ((__u32) 0x00010000)
|
||||
#define SND_AUDIOMODE_IEC_MPEG_SURROUND ((__u32) 0x00020000)
|
||||
|
||||
#define SND_AUDIOPROFILE_G723_1 ((__u32) 0x00000001)
|
||||
|
||||
#define SND_AUDIOMODE_G723_1_ANNEX_A ((__u32) 0x00000001)
|
||||
#define SND_AUDIOMODE_G723_1_ANNEX_B ((__u32) 0x00000002)
|
||||
#define SND_AUDIOMODE_G723_1_ANNEX_C ((__u32) 0x00000004)
|
||||
|
||||
#define SND_AUDIOPROFILE_G729 ((__u32) 0x00000001)
|
||||
|
||||
#define SND_AUDIOMODE_G729_ANNEX_A ((__u32) 0x00000001)
|
||||
#define SND_AUDIOMODE_G729_ANNEX_B ((__u32) 0x00000002)
|
||||
|
||||
/* <FIXME: multichannel encoders aren't supported for now. Would need
|
||||
an additional definition of channel arrangement> */
|
||||
|
||||
/* VBR/CBR definitions */
|
||||
#define SND_RATECONTROLMODE_CONSTANTBITRATE ((__u32) 0x00000001)
|
||||
#define SND_RATECONTROLMODE_VARIABLEBITRATE ((__u32) 0x00000002)
|
||||
|
||||
/* Encoder options */
|
||||
|
||||
struct snd_enc_wma {
|
||||
__u32 super_block_align; /* WMA Type-specific data */
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* struct snd_enc_vorbis
|
||||
* @quality: Sets encoding quality to n, between -1 (low) and 10 (high).
|
||||
* In the default mode of operation, the quality level is 3.
|
||||
* Normal quality range is 0 - 10.
|
||||
* @managed: Boolean. Set bitrate management mode. This turns off the
|
||||
* normal VBR encoding, but allows hard or soft bitrate constraints to be
|
||||
* enforced by the encoder. This mode can be slower, and may also be
|
||||
* lower quality. It is primarily useful for streaming.
|
||||
* @max_bit_rate: Enabled only if managed is TRUE
|
||||
* @min_bit_rate: Enabled only if managed is TRUE
|
||||
* @downmix: Boolean. Downmix input from stereo to mono (has no effect on
|
||||
* non-stereo streams). Useful for lower-bitrate encoding.
|
||||
*
|
||||
* These options were extracted from the OpenMAX IL spec and Gstreamer vorbisenc
|
||||
* properties
|
||||
*
|
||||
* For best quality users should specify VBR mode and set quality levels.
|
||||
*/
|
||||
|
||||
struct snd_enc_vorbis {
|
||||
__s32 quality;
|
||||
__u32 managed;
|
||||
__u32 max_bit_rate;
|
||||
__u32 min_bit_rate;
|
||||
__u32 downmix;
|
||||
} __attribute__((packed, aligned(4)));
|
||||
|
||||
|
||||
/**
|
||||
* struct snd_enc_real
|
||||
* @quant_bits: number of coupling quantization bits in the stream
|
||||
* @start_region: coupling start region in the stream
|
||||
* @num_regions: number of regions value
|
||||
*
|
||||
* These options were extracted from the OpenMAX IL spec
|
||||
*/
|
||||
|
||||
struct snd_enc_real {
|
||||
__u32 quant_bits;
|
||||
__u32 start_region;
|
||||
__u32 num_regions;
|
||||
} __attribute__((packed, aligned(4)));
|
||||
|
||||
/**
|
||||
* struct snd_enc_flac
|
||||
* @num: serial number, valid only for OGG formats
|
||||
* needs to be set by application
|
||||
* @gain: Add replay gain tags
|
||||
*
|
||||
* These options were extracted from the FLAC online documentation
|
||||
* at http://flac.sourceforge.net/documentation_tools_flac.html
|
||||
*
|
||||
* To make the API simpler, it is assumed that the user will select quality
|
||||
* profiles. Additional options that affect encoding quality and speed can
|
||||
* be added at a later stage if needed.
|
||||
*
|
||||
* By default the Subset format is used by encoders.
|
||||
*
|
||||
* TAGS such as pictures, etc, cannot be handled by an offloaded encoder and are
|
||||
* not supported in this API.
|
||||
*/
|
||||
|
||||
struct snd_enc_flac {
|
||||
__u32 num;
|
||||
__u32 gain;
|
||||
} __attribute__((packed, aligned(4)));
|
||||
|
||||
struct snd_enc_generic {
|
||||
__u32 bw; /* encoder bandwidth */
|
||||
__s32 reserved[15];
|
||||
} __attribute__((packed, aligned(4)));
|
||||
|
||||
union snd_codec_options {
|
||||
struct snd_enc_wma wma;
|
||||
struct snd_enc_vorbis vorbis;
|
||||
struct snd_enc_real real;
|
||||
struct snd_enc_flac flac;
|
||||
struct snd_enc_generic generic;
|
||||
} __attribute__((packed, aligned(4)));
|
||||
|
||||
/** struct snd_codec_desc - description of codec capabilities
|
||||
* @max_ch: Maximum number of audio channels
|
||||
* @sample_rates: Sampling rates in Hz, use values like 48000 for this
|
||||
* @num_sample_rates: Number of valid values in sample_rates array
|
||||
* @bit_rate: Indexed array containing supported bit rates
|
||||
* @num_bitrates: Number of valid values in bit_rate array
|
||||
* @rate_control: value is specified by SND_RATECONTROLMODE defines.
|
||||
* @profiles: Supported profiles. See SND_AUDIOPROFILE defines.
|
||||
* @modes: Supported modes. See SND_AUDIOMODE defines
|
||||
* @formats: Supported formats. See SND_AUDIOSTREAMFORMAT defines
|
||||
* @min_buffer: Minimum buffer size handled by codec implementation
|
||||
* @reserved: reserved for future use
|
||||
*
|
||||
* This structure provides a scalar value for profiles, modes and stream
|
||||
* format fields.
|
||||
* If an implementation supports multiple combinations, they will be listed as
|
||||
* codecs with different descriptors, for example there would be 2 descriptors
|
||||
* for AAC-RAW and AAC-ADTS.
|
||||
* This entails some redundancy but makes it easier to avoid invalid
|
||||
* configurations.
|
||||
*
|
||||
*/
|
||||
|
||||
struct snd_codec_desc {
|
||||
__u32 max_ch;
|
||||
__u32 sample_rates[MAX_NUM_SAMPLE_RATES];
|
||||
__u32 num_sample_rates;
|
||||
__u32 bit_rate[MAX_NUM_BITRATES];
|
||||
__u32 num_bitrates;
|
||||
__u32 rate_control;
|
||||
__u32 profiles;
|
||||
__u32 modes;
|
||||
__u32 formats;
|
||||
__u32 min_buffer;
|
||||
__u32 reserved[15];
|
||||
} __attribute__((packed, aligned(4)));
|
||||
|
||||
/** struct snd_codec
|
||||
* @id: Identifies the supported audio encoder/decoder.
|
||||
* See SND_AUDIOCODEC macros.
|
||||
* @ch_in: Number of input audio channels
|
||||
* @ch_out: Number of output channels. In case of contradiction between
|
||||
* this field and the channelMode field, the channelMode field
|
||||
* overrides.
|
||||
* @sample_rate: Audio sample rate of input data in Hz, use values like 48000
|
||||
* for this.
|
||||
* @bit_rate: Bitrate of encoded data. May be ignored by decoders
|
||||
* @rate_control: Encoding rate control. See SND_RATECONTROLMODE defines.
|
||||
* Encoders may rely on profiles for quality levels.
|
||||
* May be ignored by decoders.
|
||||
* @profile: Mandatory for encoders, can be mandatory for specific
|
||||
* decoders as well. See SND_AUDIOPROFILE defines.
|
||||
* @level: Supported level (Only used by WMA at the moment)
|
||||
* @ch_mode: Channel mode for encoder. See SND_AUDIOCHANMODE defines
|
||||
* @format: Format of encoded bistream. Mandatory when defined.
|
||||
* See SND_AUDIOSTREAMFORMAT defines.
|
||||
* @align: Block alignment in bytes of an audio sample.
|
||||
* Only required for PCM or IEC formats.
|
||||
* @options: encoder-specific settings
|
||||
* @reserved: reserved for future use
|
||||
*/
|
||||
|
||||
struct snd_codec {
|
||||
__u32 id;
|
||||
__u32 ch_in;
|
||||
__u32 ch_out;
|
||||
__u32 sample_rate;
|
||||
__u32 bit_rate;
|
||||
__u32 rate_control;
|
||||
__u32 profile;
|
||||
__u32 level;
|
||||
__u32 ch_mode;
|
||||
__u32 format;
|
||||
__u32 align;
|
||||
union snd_codec_options options;
|
||||
__u32 reserved[3];
|
||||
} __attribute__((packed, aligned(4)));
|
||||
|
||||
#endif
|
||||
378
openflow/usr/include/sound/emu10k1.h
Normal file
378
openflow/usr/include/sound/emu10k1.h
Normal file
@@ -0,0 +1,378 @@
|
||||
/*
|
||||
* Copyright (c) by Jaroslav Kysela <perex@perex.cz>,
|
||||
* Creative Labs, Inc.
|
||||
* Definitions for EMU10K1 (SB Live!) chips
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
#ifndef __SOUND_EMU10K1_H
|
||||
#define __SOUND_EMU10K1_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <sound/asound.h>
|
||||
|
||||
/*
|
||||
* ---- FX8010 ----
|
||||
*/
|
||||
|
||||
#define EMU10K1_CARD_CREATIVE 0x00000000
|
||||
#define EMU10K1_CARD_EMUAPS 0x00000001
|
||||
|
||||
#define EMU10K1_FX8010_PCM_COUNT 8
|
||||
|
||||
/*
|
||||
* Following definition is copied from linux/types.h to support compiling
|
||||
* this header file in userspace since they are not generally available for
|
||||
* uapi headers.
|
||||
*/
|
||||
#define __EMU10K1_DECLARE_BITMAP(name,bits) \
|
||||
unsigned long name[(bits) / (sizeof(unsigned long) * 8)]
|
||||
|
||||
/* instruction set */
|
||||
#define iMAC0 0x00 /* R = A + (X * Y >> 31) ; saturation */
|
||||
#define iMAC1 0x01 /* R = A + (-X * Y >> 31) ; saturation */
|
||||
#define iMAC2 0x02 /* R = A + (X * Y >> 31) ; wraparound */
|
||||
#define iMAC3 0x03 /* R = A + (-X * Y >> 31) ; wraparound */
|
||||
#define iMACINT0 0x04 /* R = A + X * Y ; saturation */
|
||||
#define iMACINT1 0x05 /* R = A + X * Y ; wraparound (31-bit) */
|
||||
#define iACC3 0x06 /* R = A + X + Y ; saturation */
|
||||
#define iMACMV 0x07 /* R = A, acc += X * Y >> 31 */
|
||||
#define iANDXOR 0x08 /* R = (A & X) ^ Y */
|
||||
#define iTSTNEG 0x09 /* R = (A >= Y) ? X : ~X */
|
||||
#define iLIMITGE 0x0a /* R = (A >= Y) ? X : Y */
|
||||
#define iLIMITLT 0x0b /* R = (A < Y) ? X : Y */
|
||||
#define iLOG 0x0c /* R = linear_data, A (log_data), X (max_exp), Y (format_word) */
|
||||
#define iEXP 0x0d /* R = log_data, A (linear_data), X (max_exp), Y (format_word) */
|
||||
#define iINTERP 0x0e /* R = A + (X * (Y - A) >> 31) ; saturation */
|
||||
#define iSKIP 0x0f /* R = A (cc_reg), X (count), Y (cc_test) */
|
||||
|
||||
/* GPRs */
|
||||
#define FXBUS(x) (0x00 + (x)) /* x = 0x00 - 0x0f */
|
||||
#define EXTIN(x) (0x10 + (x)) /* x = 0x00 - 0x0f */
|
||||
#define EXTOUT(x) (0x20 + (x)) /* x = 0x00 - 0x0f physical outs -> FXWC low 16 bits */
|
||||
#define FXBUS2(x) (0x30 + (x)) /* x = 0x00 - 0x0f copies of fx buses for capture -> FXWC high 16 bits */
|
||||
/* NB: 0x31 and 0x32 are shared with Center/LFE on SB live 5.1 */
|
||||
|
||||
#define C_00000000 0x40
|
||||
#define C_00000001 0x41
|
||||
#define C_00000002 0x42
|
||||
#define C_00000003 0x43
|
||||
#define C_00000004 0x44
|
||||
#define C_00000008 0x45
|
||||
#define C_00000010 0x46
|
||||
#define C_00000020 0x47
|
||||
#define C_00000100 0x48
|
||||
#define C_00010000 0x49
|
||||
#define C_00080000 0x4a
|
||||
#define C_10000000 0x4b
|
||||
#define C_20000000 0x4c
|
||||
#define C_40000000 0x4d
|
||||
#define C_80000000 0x4e
|
||||
#define C_7fffffff 0x4f
|
||||
#define C_ffffffff 0x50
|
||||
#define C_fffffffe 0x51
|
||||
#define C_c0000000 0x52
|
||||
#define C_4f1bbcdc 0x53
|
||||
#define C_5a7ef9db 0x54
|
||||
#define C_00100000 0x55 /* ?? */
|
||||
#define GPR_ACCU 0x56 /* ACCUM, accumulator */
|
||||
#define GPR_COND 0x57 /* CCR, condition register */
|
||||
#define GPR_NOISE0 0x58 /* noise source */
|
||||
#define GPR_NOISE1 0x59 /* noise source */
|
||||
#define GPR_IRQ 0x5a /* IRQ register */
|
||||
#define GPR_DBAC 0x5b /* TRAM Delay Base Address Counter */
|
||||
#define GPR(x) (FXGPREGBASE + (x)) /* free GPRs: x = 0x00 - 0xff */
|
||||
#define ITRAM_DATA(x) (TANKMEMDATAREGBASE + 0x00 + (x)) /* x = 0x00 - 0x7f */
|
||||
#define ETRAM_DATA(x) (TANKMEMDATAREGBASE + 0x80 + (x)) /* x = 0x00 - 0x1f */
|
||||
#define ITRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x00 + (x)) /* x = 0x00 - 0x7f */
|
||||
#define ETRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x80 + (x)) /* x = 0x00 - 0x1f */
|
||||
|
||||
#define A_ITRAM_DATA(x) (TANKMEMDATAREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */
|
||||
#define A_ETRAM_DATA(x) (TANKMEMDATAREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */
|
||||
#define A_ITRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */
|
||||
#define A_ETRAM_ADDR(x) (TANKMEMADDRREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */
|
||||
#define A_ITRAM_CTL(x) (A_TANKMEMCTLREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */
|
||||
#define A_ETRAM_CTL(x) (A_TANKMEMCTLREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */
|
||||
|
||||
#define A_FXBUS(x) (0x00 + (x)) /* x = 0x00 - 0x3f FX buses */
|
||||
#define A_EXTIN(x) (0x40 + (x)) /* x = 0x00 - 0x0f physical ins */
|
||||
#define A_P16VIN(x) (0x50 + (x)) /* x = 0x00 - 0x0f p16v ins (A2 only) "EMU32 inputs" */
|
||||
#define A_EXTOUT(x) (0x60 + (x)) /* x = 0x00 - 0x1f physical outs -> A_FXWC1 0x79-7f unknown */
|
||||
#define A_FXBUS2(x) (0x80 + (x)) /* x = 0x00 - 0x1f extra outs used for EFX capture -> A_FXWC2 */
|
||||
#define A_EMU32OUTH(x) (0xa0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_10 - _1F" - ??? */
|
||||
#define A_EMU32OUTL(x) (0xb0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_1 - _F" - ??? */
|
||||
#define A3_EMU32IN(x) (0x160 + (x)) /* x = 0x00 - 0x3f "EMU32_IN_00 - _3F" - Only when .device = 0x0008 */
|
||||
#define A3_EMU32OUT(x) (0x1E0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_00 - _3F" - Only when .device = 0x0008 */
|
||||
#define A_GPR(x) (A_FXGPREGBASE + (x))
|
||||
|
||||
/* cc_reg constants */
|
||||
#define CC_REG_NORMALIZED C_00000001
|
||||
#define CC_REG_BORROW C_00000002
|
||||
#define CC_REG_MINUS C_00000004
|
||||
#define CC_REG_ZERO C_00000008
|
||||
#define CC_REG_SATURATE C_00000010
|
||||
#define CC_REG_NONZERO C_00000100
|
||||
|
||||
/* FX buses */
|
||||
#define FXBUS_PCM_LEFT 0x00
|
||||
#define FXBUS_PCM_RIGHT 0x01
|
||||
#define FXBUS_PCM_LEFT_REAR 0x02
|
||||
#define FXBUS_PCM_RIGHT_REAR 0x03
|
||||
#define FXBUS_MIDI_LEFT 0x04
|
||||
#define FXBUS_MIDI_RIGHT 0x05
|
||||
#define FXBUS_PCM_CENTER 0x06
|
||||
#define FXBUS_PCM_LFE 0x07
|
||||
#define FXBUS_PCM_LEFT_FRONT 0x08
|
||||
#define FXBUS_PCM_RIGHT_FRONT 0x09
|
||||
#define FXBUS_MIDI_REVERB 0x0c
|
||||
#define FXBUS_MIDI_CHORUS 0x0d
|
||||
#define FXBUS_PCM_LEFT_SIDE 0x0e
|
||||
#define FXBUS_PCM_RIGHT_SIDE 0x0f
|
||||
#define FXBUS_PT_LEFT 0x14
|
||||
#define FXBUS_PT_RIGHT 0x15
|
||||
|
||||
/* Inputs */
|
||||
#define EXTIN_AC97_L 0x00 /* AC'97 capture channel - left */
|
||||
#define EXTIN_AC97_R 0x01 /* AC'97 capture channel - right */
|
||||
#define EXTIN_SPDIF_CD_L 0x02 /* internal S/PDIF CD - onboard - left */
|
||||
#define EXTIN_SPDIF_CD_R 0x03 /* internal S/PDIF CD - onboard - right */
|
||||
#define EXTIN_ZOOM_L 0x04 /* Zoom Video I2S - left */
|
||||
#define EXTIN_ZOOM_R 0x05 /* Zoom Video I2S - right */
|
||||
#define EXTIN_TOSLINK_L 0x06 /* LiveDrive - TOSLink Optical - left */
|
||||
#define EXTIN_TOSLINK_R 0x07 /* LiveDrive - TOSLink Optical - right */
|
||||
#define EXTIN_LINE1_L 0x08 /* LiveDrive - Line/Mic 1 - left */
|
||||
#define EXTIN_LINE1_R 0x09 /* LiveDrive - Line/Mic 1 - right */
|
||||
#define EXTIN_COAX_SPDIF_L 0x0a /* LiveDrive - Coaxial S/PDIF - left */
|
||||
#define EXTIN_COAX_SPDIF_R 0x0b /* LiveDrive - Coaxial S/PDIF - right */
|
||||
#define EXTIN_LINE2_L 0x0c /* LiveDrive - Line/Mic 2 - left */
|
||||
#define EXTIN_LINE2_R 0x0d /* LiveDrive - Line/Mic 2 - right */
|
||||
|
||||
/* Outputs */
|
||||
#define EXTOUT_AC97_L 0x00 /* AC'97 playback channel - left */
|
||||
#define EXTOUT_AC97_R 0x01 /* AC'97 playback channel - right */
|
||||
#define EXTOUT_TOSLINK_L 0x02 /* LiveDrive - TOSLink Optical - left */
|
||||
#define EXTOUT_TOSLINK_R 0x03 /* LiveDrive - TOSLink Optical - right */
|
||||
#define EXTOUT_AC97_CENTER 0x04 /* SB Live 5.1 - center */
|
||||
#define EXTOUT_AC97_LFE 0x05 /* SB Live 5.1 - LFE */
|
||||
#define EXTOUT_HEADPHONE_L 0x06 /* LiveDrive - Headphone - left */
|
||||
#define EXTOUT_HEADPHONE_R 0x07 /* LiveDrive - Headphone - right */
|
||||
#define EXTOUT_REAR_L 0x08 /* Rear channel - left */
|
||||
#define EXTOUT_REAR_R 0x09 /* Rear channel - right */
|
||||
#define EXTOUT_ADC_CAP_L 0x0a /* ADC Capture buffer - left */
|
||||
#define EXTOUT_ADC_CAP_R 0x0b /* ADC Capture buffer - right */
|
||||
#define EXTOUT_MIC_CAP 0x0c /* MIC Capture buffer */
|
||||
#define EXTOUT_AC97_REAR_L 0x0d /* SB Live 5.1 (c) 2003 - Rear Left */
|
||||
#define EXTOUT_AC97_REAR_R 0x0e /* SB Live 5.1 (c) 2003 - Rear Right */
|
||||
#define EXTOUT_ACENTER 0x11 /* Analog Center */
|
||||
#define EXTOUT_ALFE 0x12 /* Analog LFE */
|
||||
|
||||
/* Audigy Inputs */
|
||||
#define A_EXTIN_AC97_L 0x00 /* AC'97 capture channel - left */
|
||||
#define A_EXTIN_AC97_R 0x01 /* AC'97 capture channel - right */
|
||||
#define A_EXTIN_SPDIF_CD_L 0x02 /* digital CD left */
|
||||
#define A_EXTIN_SPDIF_CD_R 0x03 /* digital CD left */
|
||||
#define A_EXTIN_OPT_SPDIF_L 0x04 /* audigy drive Optical SPDIF - left */
|
||||
#define A_EXTIN_OPT_SPDIF_R 0x05 /* right */
|
||||
#define A_EXTIN_LINE2_L 0x08 /* audigy drive line2/mic2 - left */
|
||||
#define A_EXTIN_LINE2_R 0x09 /* right */
|
||||
#define A_EXTIN_ADC_L 0x0a /* Philips ADC - left */
|
||||
#define A_EXTIN_ADC_R 0x0b /* right */
|
||||
#define A_EXTIN_AUX2_L 0x0c /* audigy drive aux2 - left */
|
||||
#define A_EXTIN_AUX2_R 0x0d /* - right */
|
||||
|
||||
/* Audigiy Outputs */
|
||||
#define A_EXTOUT_FRONT_L 0x00 /* digital front left */
|
||||
#define A_EXTOUT_FRONT_R 0x01 /* right */
|
||||
#define A_EXTOUT_CENTER 0x02 /* digital front center */
|
||||
#define A_EXTOUT_LFE 0x03 /* digital front lfe */
|
||||
#define A_EXTOUT_HEADPHONE_L 0x04 /* headphone audigy drive left */
|
||||
#define A_EXTOUT_HEADPHONE_R 0x05 /* right */
|
||||
#define A_EXTOUT_REAR_L 0x06 /* digital rear left */
|
||||
#define A_EXTOUT_REAR_R 0x07 /* right */
|
||||
#define A_EXTOUT_AFRONT_L 0x08 /* analog front left */
|
||||
#define A_EXTOUT_AFRONT_R 0x09 /* right */
|
||||
#define A_EXTOUT_ACENTER 0x0a /* analog center */
|
||||
#define A_EXTOUT_ALFE 0x0b /* analog LFE */
|
||||
#define A_EXTOUT_ASIDE_L 0x0c /* analog side left - Audigy 2 ZS */
|
||||
#define A_EXTOUT_ASIDE_R 0x0d /* right - Audigy 2 ZS */
|
||||
#define A_EXTOUT_AREAR_L 0x0e /* analog rear left */
|
||||
#define A_EXTOUT_AREAR_R 0x0f /* right */
|
||||
#define A_EXTOUT_AC97_L 0x10 /* AC97 left (front) */
|
||||
#define A_EXTOUT_AC97_R 0x11 /* right */
|
||||
#define A_EXTOUT_ADC_CAP_L 0x16 /* ADC capture buffer left */
|
||||
#define A_EXTOUT_ADC_CAP_R 0x17 /* right */
|
||||
#define A_EXTOUT_MIC_CAP 0x18 /* Mic capture buffer */
|
||||
|
||||
/* Audigy constants */
|
||||
#define A_C_00000000 0xc0
|
||||
#define A_C_00000001 0xc1
|
||||
#define A_C_00000002 0xc2
|
||||
#define A_C_00000003 0xc3
|
||||
#define A_C_00000004 0xc4
|
||||
#define A_C_00000008 0xc5
|
||||
#define A_C_00000010 0xc6
|
||||
#define A_C_00000020 0xc7
|
||||
#define A_C_00000100 0xc8
|
||||
#define A_C_00010000 0xc9
|
||||
#define A_C_00000800 0xca
|
||||
#define A_C_10000000 0xcb
|
||||
#define A_C_20000000 0xcc
|
||||
#define A_C_40000000 0xcd
|
||||
#define A_C_80000000 0xce
|
||||
#define A_C_7fffffff 0xcf
|
||||
#define A_C_ffffffff 0xd0
|
||||
#define A_C_fffffffe 0xd1
|
||||
#define A_C_c0000000 0xd2
|
||||
#define A_C_4f1bbcdc 0xd3
|
||||
#define A_C_5a7ef9db 0xd4
|
||||
#define A_C_00100000 0xd5
|
||||
#define A_GPR_ACCU 0xd6 /* ACCUM, accumulator */
|
||||
#define A_GPR_COND 0xd7 /* CCR, condition register */
|
||||
#define A_GPR_NOISE0 0xd8 /* noise source */
|
||||
#define A_GPR_NOISE1 0xd9 /* noise source */
|
||||
#define A_GPR_IRQ 0xda /* IRQ register */
|
||||
#define A_GPR_DBAC 0xdb /* TRAM Delay Base Address Counter - internal */
|
||||
#define A_GPR_DBACE 0xde /* TRAM Delay Base Address Counter - external */
|
||||
|
||||
/* definitions for debug register */
|
||||
#define EMU10K1_DBG_ZC 0x80000000 /* zero tram counter */
|
||||
#define EMU10K1_DBG_SATURATION_OCCURED 0x02000000 /* saturation control */
|
||||
#define EMU10K1_DBG_SATURATION_ADDR 0x01ff0000 /* saturation address */
|
||||
#define EMU10K1_DBG_SINGLE_STEP 0x00008000 /* single step mode */
|
||||
#define EMU10K1_DBG_STEP 0x00004000 /* start single step */
|
||||
#define EMU10K1_DBG_CONDITION_CODE 0x00003e00 /* condition code */
|
||||
#define EMU10K1_DBG_SINGLE_STEP_ADDR 0x000001ff /* single step address */
|
||||
|
||||
/* tank memory address line */
|
||||
#define TANKMEMADDRREG_ADDR_MASK 0x000fffff /* 20 bit tank address field */
|
||||
#define TANKMEMADDRREG_CLEAR 0x00800000 /* Clear tank memory */
|
||||
#define TANKMEMADDRREG_ALIGN 0x00400000 /* Align read or write relative to tank access */
|
||||
#define TANKMEMADDRREG_WRITE 0x00200000 /* Write to tank memory */
|
||||
#define TANKMEMADDRREG_READ 0x00100000 /* Read from tank memory */
|
||||
|
||||
struct snd_emu10k1_fx8010_info {
|
||||
unsigned int internal_tram_size; /* in samples */
|
||||
unsigned int external_tram_size; /* in samples */
|
||||
char fxbus_names[16][32]; /* names of FXBUSes */
|
||||
char extin_names[16][32]; /* names of external inputs */
|
||||
char extout_names[32][32]; /* names of external outputs */
|
||||
unsigned int gpr_controls; /* count of GPR controls */
|
||||
};
|
||||
|
||||
#define EMU10K1_GPR_TRANSLATION_NONE 0
|
||||
#define EMU10K1_GPR_TRANSLATION_TABLE100 1
|
||||
#define EMU10K1_GPR_TRANSLATION_BASS 2
|
||||
#define EMU10K1_GPR_TRANSLATION_TREBLE 3
|
||||
#define EMU10K1_GPR_TRANSLATION_ONOFF 4
|
||||
|
||||
struct snd_emu10k1_fx8010_control_gpr {
|
||||
struct snd_ctl_elem_id id; /* full control ID definition */
|
||||
unsigned int vcount; /* visible count */
|
||||
unsigned int count; /* count of GPR (1..16) */
|
||||
unsigned short gpr[32]; /* GPR number(s) */
|
||||
unsigned int value[32]; /* initial values */
|
||||
unsigned int min; /* minimum range */
|
||||
unsigned int max; /* maximum range */
|
||||
unsigned int translation; /* translation type (EMU10K1_GPR_TRANSLATION*) */
|
||||
const unsigned int *tlv;
|
||||
};
|
||||
|
||||
/* old ABI without TLV support */
|
||||
struct snd_emu10k1_fx8010_control_old_gpr {
|
||||
struct snd_ctl_elem_id id;
|
||||
unsigned int vcount;
|
||||
unsigned int count;
|
||||
unsigned short gpr[32];
|
||||
unsigned int value[32];
|
||||
unsigned int min;
|
||||
unsigned int max;
|
||||
unsigned int translation;
|
||||
};
|
||||
|
||||
struct snd_emu10k1_fx8010_code {
|
||||
char name[128];
|
||||
|
||||
__EMU10K1_DECLARE_BITMAP(gpr_valid, 0x200); /* bitmask of valid initializers */
|
||||
__u32 *gpr_map; /* initializers */
|
||||
|
||||
unsigned int gpr_add_control_count; /* count of GPR controls to add/replace */
|
||||
struct snd_emu10k1_fx8010_control_gpr *gpr_add_controls; /* GPR controls to add/replace */
|
||||
|
||||
unsigned int gpr_del_control_count; /* count of GPR controls to remove */
|
||||
struct snd_ctl_elem_id *gpr_del_controls; /* IDs of GPR controls to remove */
|
||||
|
||||
unsigned int gpr_list_control_count; /* count of GPR controls to list */
|
||||
unsigned int gpr_list_control_total; /* total count of GPR controls */
|
||||
struct snd_emu10k1_fx8010_control_gpr *gpr_list_controls; /* listed GPR controls */
|
||||
|
||||
__EMU10K1_DECLARE_BITMAP(tram_valid, 0x100); /* bitmask of valid initializers */
|
||||
__u32 *tram_data_map; /* data initializers */
|
||||
__u32 *tram_addr_map; /* map initializers */
|
||||
|
||||
__EMU10K1_DECLARE_BITMAP(code_valid, 1024); /* bitmask of valid instructions */
|
||||
__u32 *code; /* one instruction - 64 bits */
|
||||
};
|
||||
|
||||
struct snd_emu10k1_fx8010_tram {
|
||||
unsigned int address; /* 31.bit == 1 -> external TRAM */
|
||||
unsigned int size; /* size in samples (4 bytes) */
|
||||
unsigned int *samples; /* pointer to samples (20-bit) */
|
||||
/* NULL->clear memory */
|
||||
};
|
||||
|
||||
struct snd_emu10k1_fx8010_pcm_rec {
|
||||
unsigned int substream; /* substream number */
|
||||
unsigned int res1; /* reserved */
|
||||
unsigned int channels; /* 16-bit channels count, zero = remove this substream */
|
||||
unsigned int tram_start; /* ring buffer position in TRAM (in samples) */
|
||||
unsigned int buffer_size; /* count of buffered samples */
|
||||
unsigned short gpr_size; /* GPR containing size of ringbuffer in samples (host) */
|
||||
unsigned short gpr_ptr; /* GPR containing current pointer in the ring buffer (host = reset, FX8010) */
|
||||
unsigned short gpr_count; /* GPR containing count of samples between two interrupts (host) */
|
||||
unsigned short gpr_tmpcount; /* GPR containing current count of samples to interrupt (host = set, FX8010) */
|
||||
unsigned short gpr_trigger; /* GPR containing trigger (activate) information (host) */
|
||||
unsigned short gpr_running; /* GPR containing info if PCM is running (FX8010) */
|
||||
unsigned char pad; /* reserved */
|
||||
unsigned char etram[32]; /* external TRAM address & data (one per channel) */
|
||||
unsigned int res2; /* reserved */
|
||||
};
|
||||
|
||||
#define SNDRV_EMU10K1_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 1)
|
||||
|
||||
#define SNDRV_EMU10K1_IOCTL_INFO _IOR ('H', 0x10, struct snd_emu10k1_fx8010_info)
|
||||
#define SNDRV_EMU10K1_IOCTL_CODE_POKE _IOW ('H', 0x11, struct snd_emu10k1_fx8010_code)
|
||||
#define SNDRV_EMU10K1_IOCTL_CODE_PEEK _IOWR('H', 0x12, struct snd_emu10k1_fx8010_code)
|
||||
#define SNDRV_EMU10K1_IOCTL_TRAM_SETUP _IOW ('H', 0x20, int)
|
||||
#define SNDRV_EMU10K1_IOCTL_TRAM_POKE _IOW ('H', 0x21, struct snd_emu10k1_fx8010_tram)
|
||||
#define SNDRV_EMU10K1_IOCTL_TRAM_PEEK _IOWR('H', 0x22, struct snd_emu10k1_fx8010_tram)
|
||||
#define SNDRV_EMU10K1_IOCTL_PCM_POKE _IOW ('H', 0x30, struct snd_emu10k1_fx8010_pcm_rec)
|
||||
#define SNDRV_EMU10K1_IOCTL_PCM_PEEK _IOWR('H', 0x31, struct snd_emu10k1_fx8010_pcm_rec)
|
||||
#define SNDRV_EMU10K1_IOCTL_PVERSION _IOR ('H', 0x40, int)
|
||||
#define SNDRV_EMU10K1_IOCTL_STOP _IO ('H', 0x80)
|
||||
#define SNDRV_EMU10K1_IOCTL_CONTINUE _IO ('H', 0x81)
|
||||
#define SNDRV_EMU10K1_IOCTL_ZERO_TRAM_COUNTER _IO ('H', 0x82)
|
||||
#define SNDRV_EMU10K1_IOCTL_SINGLE_STEP _IOW ('H', 0x83, int)
|
||||
#define SNDRV_EMU10K1_IOCTL_DBG_READ _IOR ('H', 0x84, int)
|
||||
|
||||
/* typedefs for compatibility to user-space */
|
||||
typedef struct snd_emu10k1_fx8010_info emu10k1_fx8010_info_t;
|
||||
typedef struct snd_emu10k1_fx8010_control_gpr emu10k1_fx8010_control_gpr_t;
|
||||
typedef struct snd_emu10k1_fx8010_code emu10k1_fx8010_code_t;
|
||||
typedef struct snd_emu10k1_fx8010_tram emu10k1_fx8010_tram_t;
|
||||
typedef struct snd_emu10k1_fx8010_pcm_rec emu10k1_fx8010_pcm_t;
|
||||
|
||||
#endif /* __SOUND_EMU10K1_H */
|
||||
82
openflow/usr/include/sound/firewire.h
Normal file
82
openflow/usr/include/sound/firewire.h
Normal file
@@ -0,0 +1,82 @@
|
||||
#ifndef _SOUND_FIREWIRE_H_INCLUDED
|
||||
#define _SOUND_FIREWIRE_H_INCLUDED
|
||||
|
||||
#include <linux/ioctl.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
/* events can be read() from the hwdep device */
|
||||
|
||||
#define SNDRV_FIREWIRE_EVENT_LOCK_STATUS 0x000010cc
|
||||
#define SNDRV_FIREWIRE_EVENT_DICE_NOTIFICATION 0xd1ce004e
|
||||
#define SNDRV_FIREWIRE_EVENT_EFW_RESPONSE 0x4e617475
|
||||
#define SNDRV_FIREWIRE_EVENT_DIGI00X_MESSAGE 0x746e736c
|
||||
|
||||
struct snd_firewire_event_common {
|
||||
unsigned int type; /* SNDRV_FIREWIRE_EVENT_xxx */
|
||||
};
|
||||
|
||||
struct snd_firewire_event_lock_status {
|
||||
unsigned int type;
|
||||
unsigned int status; /* 0/1 = unlocked/locked */
|
||||
};
|
||||
|
||||
struct snd_firewire_event_dice_notification {
|
||||
unsigned int type;
|
||||
unsigned int notification; /* DICE-specific bits */
|
||||
};
|
||||
|
||||
#define SND_EFW_TRANSACTION_USER_SEQNUM_MAX ((__u32)((__u16)~0) - 1)
|
||||
/* each field should be in big endian */
|
||||
struct snd_efw_transaction {
|
||||
__be32 length;
|
||||
__be32 version;
|
||||
__be32 seqnum;
|
||||
__be32 category;
|
||||
__be32 command;
|
||||
__be32 status;
|
||||
__be32 params[0];
|
||||
};
|
||||
struct snd_firewire_event_efw_response {
|
||||
unsigned int type;
|
||||
__be32 response[0]; /* some responses */
|
||||
};
|
||||
|
||||
struct snd_firewire_event_digi00x_message {
|
||||
unsigned int type;
|
||||
__u32 message; /* Digi00x-specific message */
|
||||
};
|
||||
|
||||
union snd_firewire_event {
|
||||
struct snd_firewire_event_common common;
|
||||
struct snd_firewire_event_lock_status lock_status;
|
||||
struct snd_firewire_event_dice_notification dice_notification;
|
||||
struct snd_firewire_event_efw_response efw_response;
|
||||
struct snd_firewire_event_digi00x_message digi00x_message;
|
||||
};
|
||||
|
||||
|
||||
#define SNDRV_FIREWIRE_IOCTL_GET_INFO _IOR('H', 0xf8, struct snd_firewire_get_info)
|
||||
#define SNDRV_FIREWIRE_IOCTL_LOCK _IO('H', 0xf9)
|
||||
#define SNDRV_FIREWIRE_IOCTL_UNLOCK _IO('H', 0xfa)
|
||||
|
||||
#define SNDRV_FIREWIRE_TYPE_DICE 1
|
||||
#define SNDRV_FIREWIRE_TYPE_FIREWORKS 2
|
||||
#define SNDRV_FIREWIRE_TYPE_BEBOB 3
|
||||
#define SNDRV_FIREWIRE_TYPE_OXFW 4
|
||||
#define SNDRV_FIREWIRE_TYPE_DIGI00X 5
|
||||
#define SNDRV_FIREWIRE_TYPE_TASCAM 6
|
||||
/* RME, MOTU, ... */
|
||||
|
||||
struct snd_firewire_get_info {
|
||||
unsigned int type; /* SNDRV_FIREWIRE_TYPE_xxx */
|
||||
unsigned int card; /* same as fw_cdev_get_info.card */
|
||||
unsigned char guid[8];
|
||||
char device_name[16]; /* device node in /dev */
|
||||
};
|
||||
|
||||
/*
|
||||
* SNDRV_FIREWIRE_IOCTL_LOCK prevents the driver from streaming.
|
||||
* Returns -EBUSY if the driver is already streaming.
|
||||
*/
|
||||
|
||||
#endif /* _SOUND_FIREWIRE_H_INCLUDED */
|
||||
110
openflow/usr/include/sound/hdsp.h
Normal file
110
openflow/usr/include/sound/hdsp.h
Normal file
@@ -0,0 +1,110 @@
|
||||
#ifndef __SOUND_HDSP_H
|
||||
#define __SOUND_HDSP_H
|
||||
|
||||
/*
|
||||
* Copyright (C) 2003 Thomas Charbonnel (thomas@undata.org)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
#define HDSP_MATRIX_MIXER_SIZE 2048
|
||||
|
||||
enum HDSP_IO_Type {
|
||||
Digiface,
|
||||
Multiface,
|
||||
H9652,
|
||||
H9632,
|
||||
RPM,
|
||||
Undefined,
|
||||
};
|
||||
|
||||
struct hdsp_peak_rms {
|
||||
__u32 input_peaks[26];
|
||||
__u32 playback_peaks[26];
|
||||
__u32 output_peaks[28];
|
||||
__u64 input_rms[26];
|
||||
__u64 playback_rms[26];
|
||||
/* These are only used for H96xx cards */
|
||||
__u64 output_rms[26];
|
||||
};
|
||||
|
||||
#define SNDRV_HDSP_IOCTL_GET_PEAK_RMS _IOR('H', 0x40, struct hdsp_peak_rms)
|
||||
|
||||
struct hdsp_config_info {
|
||||
unsigned char pref_sync_ref;
|
||||
unsigned char wordclock_sync_check;
|
||||
unsigned char spdif_sync_check;
|
||||
unsigned char adatsync_sync_check;
|
||||
unsigned char adat_sync_check[3];
|
||||
unsigned char spdif_in;
|
||||
unsigned char spdif_out;
|
||||
unsigned char spdif_professional;
|
||||
unsigned char spdif_emphasis;
|
||||
unsigned char spdif_nonaudio;
|
||||
unsigned int spdif_sample_rate;
|
||||
unsigned int system_sample_rate;
|
||||
unsigned int autosync_sample_rate;
|
||||
unsigned char system_clock_mode;
|
||||
unsigned char clock_source;
|
||||
unsigned char autosync_ref;
|
||||
unsigned char line_out;
|
||||
unsigned char passthru;
|
||||
unsigned char da_gain;
|
||||
unsigned char ad_gain;
|
||||
unsigned char phone_gain;
|
||||
unsigned char xlr_breakout_cable;
|
||||
unsigned char analog_extension_board;
|
||||
};
|
||||
|
||||
#define SNDRV_HDSP_IOCTL_GET_CONFIG_INFO _IOR('H', 0x41, struct hdsp_config_info)
|
||||
|
||||
struct hdsp_firmware {
|
||||
void *firmware_data; /* 24413 x 4 bytes */
|
||||
};
|
||||
|
||||
#define SNDRV_HDSP_IOCTL_UPLOAD_FIRMWARE _IOW('H', 0x42, struct hdsp_firmware)
|
||||
|
||||
struct hdsp_version {
|
||||
enum HDSP_IO_Type io_type;
|
||||
unsigned short firmware_rev;
|
||||
};
|
||||
|
||||
#define SNDRV_HDSP_IOCTL_GET_VERSION _IOR('H', 0x43, struct hdsp_version)
|
||||
|
||||
struct hdsp_mixer {
|
||||
unsigned short matrix[HDSP_MATRIX_MIXER_SIZE];
|
||||
};
|
||||
|
||||
#define SNDRV_HDSP_IOCTL_GET_MIXER _IOR('H', 0x44, struct hdsp_mixer)
|
||||
|
||||
struct hdsp_9632_aeb {
|
||||
int aebi;
|
||||
int aebo;
|
||||
};
|
||||
|
||||
#define SNDRV_HDSP_IOCTL_GET_9632_AEB _IOR('H', 0x45, struct hdsp_9632_aeb)
|
||||
|
||||
/* typedefs for compatibility to user-space */
|
||||
typedef enum HDSP_IO_Type HDSP_IO_Type;
|
||||
typedef struct hdsp_peak_rms hdsp_peak_rms_t;
|
||||
typedef struct hdsp_config_info hdsp_config_info_t;
|
||||
typedef struct hdsp_firmware hdsp_firmware_t;
|
||||
typedef struct hdsp_version hdsp_version_t;
|
||||
typedef struct hdsp_mixer hdsp_mixer_t;
|
||||
typedef struct hdsp_9632_aeb hdsp_9632_aeb_t;
|
||||
|
||||
#endif /* __SOUND_HDSP_H */
|
||||
231
openflow/usr/include/sound/hdspm.h
Normal file
231
openflow/usr/include/sound/hdspm.h
Normal file
@@ -0,0 +1,231 @@
|
||||
#ifndef __SOUND_HDSPM_H
|
||||
#define __SOUND_HDSPM_H
|
||||
/*
|
||||
* Copyright (C) 2003 Winfried Ritsch (IEM)
|
||||
* based on hdsp.h from Thomas Charbonnel (thomas@undata.org)
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
/* Maximum channels is 64 even on 56Mode you have 64playbacks to matrix */
|
||||
#define HDSPM_MAX_CHANNELS 64
|
||||
|
||||
enum hdspm_io_type {
|
||||
MADI,
|
||||
MADIface,
|
||||
AIO,
|
||||
AES32,
|
||||
RayDAT
|
||||
};
|
||||
|
||||
enum hdspm_speed {
|
||||
ss,
|
||||
ds,
|
||||
qs
|
||||
};
|
||||
|
||||
/* -------------------- IOCTL Peak/RMS Meters -------------------- */
|
||||
|
||||
struct hdspm_peak_rms {
|
||||
__u32 input_peaks[64];
|
||||
__u32 playback_peaks[64];
|
||||
__u32 output_peaks[64];
|
||||
|
||||
__u64 input_rms[64];
|
||||
__u64 playback_rms[64];
|
||||
__u64 output_rms[64];
|
||||
|
||||
__u8 speed; /* enum {ss, ds, qs} */
|
||||
int status2;
|
||||
};
|
||||
|
||||
#define SNDRV_HDSPM_IOCTL_GET_PEAK_RMS \
|
||||
_IOR('H', 0x42, struct hdspm_peak_rms)
|
||||
|
||||
/* ------------ CONFIG block IOCTL ---------------------- */
|
||||
|
||||
struct hdspm_config {
|
||||
unsigned char pref_sync_ref;
|
||||
unsigned char wordclock_sync_check;
|
||||
unsigned char madi_sync_check;
|
||||
unsigned int system_sample_rate;
|
||||
unsigned int autosync_sample_rate;
|
||||
unsigned char system_clock_mode;
|
||||
unsigned char clock_source;
|
||||
unsigned char autosync_ref;
|
||||
unsigned char line_out;
|
||||
unsigned int passthru;
|
||||
unsigned int analog_out;
|
||||
};
|
||||
|
||||
#define SNDRV_HDSPM_IOCTL_GET_CONFIG \
|
||||
_IOR('H', 0x41, struct hdspm_config)
|
||||
|
||||
/*
|
||||
* If there's a TCO (TimeCode Option) board installed,
|
||||
* there are further options and status data available.
|
||||
* The hdspm_ltc structure contains the current SMPTE
|
||||
* timecode and some status information and can be
|
||||
* obtained via SNDRV_HDSPM_IOCTL_GET_LTC or in the
|
||||
* hdspm_status struct.
|
||||
*/
|
||||
|
||||
enum hdspm_ltc_format {
|
||||
format_invalid,
|
||||
fps_24,
|
||||
fps_25,
|
||||
fps_2997,
|
||||
fps_30
|
||||
};
|
||||
|
||||
enum hdspm_ltc_frame {
|
||||
frame_invalid,
|
||||
drop_frame,
|
||||
full_frame
|
||||
};
|
||||
|
||||
enum hdspm_ltc_input_format {
|
||||
ntsc,
|
||||
pal,
|
||||
no_video
|
||||
};
|
||||
|
||||
struct hdspm_ltc {
|
||||
unsigned int ltc;
|
||||
|
||||
enum hdspm_ltc_format format;
|
||||
enum hdspm_ltc_frame frame;
|
||||
enum hdspm_ltc_input_format input_format;
|
||||
};
|
||||
|
||||
#define SNDRV_HDSPM_IOCTL_GET_LTC _IOR('H', 0x46, struct hdspm_ltc)
|
||||
|
||||
/*
|
||||
* The status data reflects the device's current state
|
||||
* as determined by the card's configuration and
|
||||
* connection status.
|
||||
*/
|
||||
|
||||
enum hdspm_sync {
|
||||
hdspm_sync_no_lock = 0,
|
||||
hdspm_sync_lock = 1,
|
||||
hdspm_sync_sync = 2
|
||||
};
|
||||
|
||||
enum hdspm_madi_input {
|
||||
hdspm_input_optical = 0,
|
||||
hdspm_input_coax = 1
|
||||
};
|
||||
|
||||
enum hdspm_madi_channel_format {
|
||||
hdspm_format_ch_64 = 0,
|
||||
hdspm_format_ch_56 = 1
|
||||
};
|
||||
|
||||
enum hdspm_madi_frame_format {
|
||||
hdspm_frame_48 = 0,
|
||||
hdspm_frame_96 = 1
|
||||
};
|
||||
|
||||
enum hdspm_syncsource {
|
||||
syncsource_wc = 0,
|
||||
syncsource_madi = 1,
|
||||
syncsource_tco = 2,
|
||||
syncsource_sync = 3,
|
||||
syncsource_none = 4
|
||||
};
|
||||
|
||||
struct hdspm_status {
|
||||
__u8 card_type; /* enum hdspm_io_type */
|
||||
enum hdspm_syncsource autosync_source;
|
||||
|
||||
__u64 card_clock;
|
||||
__u32 master_period;
|
||||
|
||||
union {
|
||||
struct {
|
||||
__u8 sync_wc; /* enum hdspm_sync */
|
||||
__u8 sync_madi; /* enum hdspm_sync */
|
||||
__u8 sync_tco; /* enum hdspm_sync */
|
||||
__u8 sync_in; /* enum hdspm_sync */
|
||||
__u8 madi_input; /* enum hdspm_madi_input */
|
||||
__u8 channel_format; /* enum hdspm_madi_channel_format */
|
||||
__u8 frame_format; /* enum hdspm_madi_frame_format */
|
||||
} madi;
|
||||
} card_specific;
|
||||
};
|
||||
|
||||
#define SNDRV_HDSPM_IOCTL_GET_STATUS \
|
||||
_IOR('H', 0x47, struct hdspm_status)
|
||||
|
||||
/*
|
||||
* Get information about the card and its add-ons.
|
||||
*/
|
||||
|
||||
#define HDSPM_ADDON_TCO 1
|
||||
|
||||
struct hdspm_version {
|
||||
__u8 card_type; /* enum hdspm_io_type */
|
||||
char cardname[20];
|
||||
unsigned int serial;
|
||||
unsigned short firmware_rev;
|
||||
int addons;
|
||||
};
|
||||
|
||||
#define SNDRV_HDSPM_IOCTL_GET_VERSION _IOR('H', 0x48, struct hdspm_version)
|
||||
|
||||
/* ------------- get Matrix Mixer IOCTL --------------- */
|
||||
|
||||
/* MADI mixer: 64inputs+64playback in 64outputs = 8192 => *4Byte =
|
||||
* 32768 Bytes
|
||||
*/
|
||||
|
||||
/* organisation is 64 channelfader in a continuous memory block */
|
||||
/* equivalent to hardware definition, maybe for future feature of mmap of
|
||||
* them
|
||||
*/
|
||||
/* each of 64 outputs has 64 infader and 64 outfader:
|
||||
Ins to Outs mixer[out].in[in], Outstreams to Outs mixer[out].pb[pb] */
|
||||
|
||||
#define HDSPM_MIXER_CHANNELS HDSPM_MAX_CHANNELS
|
||||
|
||||
struct hdspm_channelfader {
|
||||
unsigned int in[HDSPM_MIXER_CHANNELS];
|
||||
unsigned int pb[HDSPM_MIXER_CHANNELS];
|
||||
};
|
||||
|
||||
struct hdspm_mixer {
|
||||
struct hdspm_channelfader ch[HDSPM_MIXER_CHANNELS];
|
||||
};
|
||||
|
||||
struct hdspm_mixer_ioctl {
|
||||
struct hdspm_mixer *mixer;
|
||||
};
|
||||
|
||||
/* use indirect access due to the limit of ioctl bit size */
|
||||
#define SNDRV_HDSPM_IOCTL_GET_MIXER _IOR('H', 0x44, struct hdspm_mixer_ioctl)
|
||||
|
||||
/* typedefs for compatibility to user-space */
|
||||
typedef struct hdspm_peak_rms hdspm_peak_rms_t;
|
||||
typedef struct hdspm_config_info hdspm_config_info_t;
|
||||
typedef struct hdspm_version hdspm_version_t;
|
||||
typedef struct hdspm_channelfader snd_hdspm_channelfader_t;
|
||||
typedef struct hdspm_mixer hdspm_mixer_t;
|
||||
|
||||
|
||||
#endif
|
||||
122
openflow/usr/include/sound/sb16_csp.h
Normal file
122
openflow/usr/include/sound/sb16_csp.h
Normal file
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
* Copyright (c) 1999 by Uros Bizjak <uros@kss-loka.si>
|
||||
* Takashi Iwai <tiwai@suse.de>
|
||||
*
|
||||
* SB16ASP/AWE32 CSP control
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
#ifndef __SOUND_SB16_CSP_H
|
||||
#define __SOUND_SB16_CSP_H
|
||||
|
||||
|
||||
/* CSP modes */
|
||||
#define SNDRV_SB_CSP_MODE_NONE 0x00
|
||||
#define SNDRV_SB_CSP_MODE_DSP_READ 0x01 /* Record from DSP */
|
||||
#define SNDRV_SB_CSP_MODE_DSP_WRITE 0x02 /* Play to DSP */
|
||||
#define SNDRV_SB_CSP_MODE_QSOUND 0x04 /* QSound */
|
||||
|
||||
/* CSP load flags */
|
||||
#define SNDRV_SB_CSP_LOAD_FROMUSER 0x01
|
||||
#define SNDRV_SB_CSP_LOAD_INITBLOCK 0x02
|
||||
|
||||
/* CSP sample width */
|
||||
#define SNDRV_SB_CSP_SAMPLE_8BIT 0x01
|
||||
#define SNDRV_SB_CSP_SAMPLE_16BIT 0x02
|
||||
|
||||
/* CSP channels */
|
||||
#define SNDRV_SB_CSP_MONO 0x01
|
||||
#define SNDRV_SB_CSP_STEREO 0x02
|
||||
|
||||
/* CSP rates */
|
||||
#define SNDRV_SB_CSP_RATE_8000 0x01
|
||||
#define SNDRV_SB_CSP_RATE_11025 0x02
|
||||
#define SNDRV_SB_CSP_RATE_22050 0x04
|
||||
#define SNDRV_SB_CSP_RATE_44100 0x08
|
||||
#define SNDRV_SB_CSP_RATE_ALL 0x0f
|
||||
|
||||
/* CSP running state */
|
||||
#define SNDRV_SB_CSP_ST_IDLE 0x00
|
||||
#define SNDRV_SB_CSP_ST_LOADED 0x01
|
||||
#define SNDRV_SB_CSP_ST_RUNNING 0x02
|
||||
#define SNDRV_SB_CSP_ST_PAUSED 0x04
|
||||
#define SNDRV_SB_CSP_ST_AUTO 0x08
|
||||
#define SNDRV_SB_CSP_ST_QSOUND 0x10
|
||||
|
||||
/* maximum QSound value (180 degrees right) */
|
||||
#define SNDRV_SB_CSP_QSOUND_MAX_RIGHT 0x20
|
||||
|
||||
/* maximum microcode RIFF file size */
|
||||
#define SNDRV_SB_CSP_MAX_MICROCODE_FILE_SIZE 0x3000
|
||||
|
||||
/* microcode header */
|
||||
struct snd_sb_csp_mc_header {
|
||||
char codec_name[16]; /* id name of codec */
|
||||
unsigned short func_req; /* requested function */
|
||||
};
|
||||
|
||||
/* microcode to be loaded */
|
||||
struct snd_sb_csp_microcode {
|
||||
struct snd_sb_csp_mc_header info;
|
||||
unsigned char data[SNDRV_SB_CSP_MAX_MICROCODE_FILE_SIZE];
|
||||
};
|
||||
|
||||
/* start CSP with sample_width in mono/stereo */
|
||||
struct snd_sb_csp_start {
|
||||
int sample_width; /* sample width, look above */
|
||||
int channels; /* channels, look above */
|
||||
};
|
||||
|
||||
/* CSP information */
|
||||
struct snd_sb_csp_info {
|
||||
char codec_name[16]; /* id name of codec */
|
||||
unsigned short func_nr; /* function number */
|
||||
unsigned int acc_format; /* accepted PCM formats */
|
||||
unsigned short acc_channels; /* accepted channels */
|
||||
unsigned short acc_width; /* accepted sample width */
|
||||
unsigned short acc_rates; /* accepted sample rates */
|
||||
unsigned short csp_mode; /* CSP mode, see above */
|
||||
unsigned short run_channels; /* current channels */
|
||||
unsigned short run_width; /* current sample width */
|
||||
unsigned short version; /* version id: 0x10 - 0x1f */
|
||||
unsigned short state; /* state bits */
|
||||
};
|
||||
|
||||
/* HWDEP controls */
|
||||
/* get CSP information */
|
||||
#define SNDRV_SB_CSP_IOCTL_INFO _IOR('H', 0x10, struct snd_sb_csp_info)
|
||||
/* load microcode to CSP */
|
||||
/* NOTE: struct snd_sb_csp_microcode overflows the max size (13 bits)
|
||||
* defined for some architectures like MIPS, and it leads to build errors.
|
||||
* (x86 and co have 14-bit size, thus it's valid, though.)
|
||||
* As a workaround for skipping the size-limit check, here we don't use the
|
||||
* normal _IOW() macro but _IOC() with the manual argument.
|
||||
*/
|
||||
#define SNDRV_SB_CSP_IOCTL_LOAD_CODE \
|
||||
_IOC(_IOC_WRITE, 'H', 0x11, sizeof(struct snd_sb_csp_microcode))
|
||||
/* unload microcode from CSP */
|
||||
#define SNDRV_SB_CSP_IOCTL_UNLOAD_CODE _IO('H', 0x12)
|
||||
/* start CSP */
|
||||
#define SNDRV_SB_CSP_IOCTL_START _IOW('H', 0x13, struct snd_sb_csp_start)
|
||||
/* stop CSP */
|
||||
#define SNDRV_SB_CSP_IOCTL_STOP _IO('H', 0x14)
|
||||
/* pause CSP and DMA transfer */
|
||||
#define SNDRV_SB_CSP_IOCTL_PAUSE _IO('H', 0x15)
|
||||
/* restart CSP and DMA transfer */
|
||||
#define SNDRV_SB_CSP_IOCTL_RESTART _IO('H', 0x16)
|
||||
|
||||
|
||||
#endif /* __SOUND_SB16_CSP_H */
|
||||
212
openflow/usr/include/sound/sfnt_info.h
Normal file
212
openflow/usr/include/sound/sfnt_info.h
Normal file
@@ -0,0 +1,212 @@
|
||||
#ifndef __SOUND_SFNT_INFO_H
|
||||
#define __SOUND_SFNT_INFO_H
|
||||
|
||||
/*
|
||||
* Patch record compatible with AWE driver on OSS
|
||||
*
|
||||
* Copyright (C) 1999-2000 Takashi Iwai
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
#include <sound/asound.h>
|
||||
|
||||
/*
|
||||
* patch information record
|
||||
*/
|
||||
|
||||
#ifdef SNDRV_BIG_ENDIAN
|
||||
#define SNDRV_OSS_PATCHKEY(id) (0xfd00|id)
|
||||
#else
|
||||
#define SNDRV_OSS_PATCHKEY(id) ((id<<8)|0xfd)
|
||||
#endif
|
||||
|
||||
/* patch interface header: 16 bytes */
|
||||
struct soundfont_patch_info {
|
||||
unsigned short key; /* use the key below */
|
||||
#define SNDRV_OSS_SOUNDFONT_PATCH SNDRV_OSS_PATCHKEY(0x07)
|
||||
|
||||
short device_no; /* synthesizer number */
|
||||
unsigned short sf_id; /* file id (should be zero) */
|
||||
short optarg; /* optional argument */
|
||||
int len; /* data length (without this header) */
|
||||
|
||||
short type; /* patch operation type */
|
||||
#define SNDRV_SFNT_LOAD_INFO 0 /* awe_voice_rec */
|
||||
#define SNDRV_SFNT_LOAD_DATA 1 /* awe_sample_info */
|
||||
#define SNDRV_SFNT_OPEN_PATCH 2 /* awe_open_parm */
|
||||
#define SNDRV_SFNT_CLOSE_PATCH 3 /* none */
|
||||
/* 4 is obsolete */
|
||||
#define SNDRV_SFNT_REPLACE_DATA 5 /* awe_sample_info (optarg=#channels)*/
|
||||
#define SNDRV_SFNT_MAP_PRESET 6 /* awe_voice_map */
|
||||
/* 7 is not used */
|
||||
#define SNDRV_SFNT_PROBE_DATA 8 /* optarg=sample */
|
||||
#define SNDRV_SFNT_REMOVE_INFO 9 /* optarg=(bank<<8)|instr */
|
||||
|
||||
short reserved; /* word alignment data */
|
||||
|
||||
/* the actual patch data begins after this */
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* open patch
|
||||
*/
|
||||
|
||||
#define SNDRV_SFNT_PATCH_NAME_LEN 32
|
||||
|
||||
struct soundfont_open_parm {
|
||||
unsigned short type; /* sample type */
|
||||
#define SNDRV_SFNT_PAT_TYPE_MISC 0
|
||||
#define SNDRV_SFNT_PAT_TYPE_GUS 6
|
||||
#define SNDRV_SFNT_PAT_TYPE_MAP 7
|
||||
#define SNDRV_SFNT_PAT_LOCKED 0x100 /* lock the samples */
|
||||
#define SNDRV_SFNT_PAT_SHARED 0x200 /* sample is shared */
|
||||
|
||||
short reserved;
|
||||
char name[SNDRV_SFNT_PATCH_NAME_LEN];
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* raw voice information record
|
||||
*/
|
||||
|
||||
/* wave table envelope & effect parameters to control EMU8000 */
|
||||
struct soundfont_voice_parm {
|
||||
unsigned short moddelay; /* modulation delay (0x8000) */
|
||||
unsigned short modatkhld; /* modulation attack & hold time (0x7f7f) */
|
||||
unsigned short moddcysus; /* modulation decay & sustain (0x7f7f) */
|
||||
unsigned short modrelease; /* modulation release time (0x807f) */
|
||||
short modkeyhold, modkeydecay; /* envelope change per key (not used) */
|
||||
unsigned short voldelay; /* volume delay (0x8000) */
|
||||
unsigned short volatkhld; /* volume attack & hold time (0x7f7f) */
|
||||
unsigned short voldcysus; /* volume decay & sustain (0x7f7f) */
|
||||
unsigned short volrelease; /* volume release time (0x807f) */
|
||||
short volkeyhold, volkeydecay; /* envelope change per key (not used) */
|
||||
unsigned short lfo1delay; /* LFO1 delay (0x8000) */
|
||||
unsigned short lfo2delay; /* LFO2 delay (0x8000) */
|
||||
unsigned short pefe; /* modulation pitch & cutoff (0x0000) */
|
||||
unsigned short fmmod; /* LFO1 pitch & cutoff (0x0000) */
|
||||
unsigned short tremfrq; /* LFO1 volume & freq (0x0000) */
|
||||
unsigned short fm2frq2; /* LFO2 pitch & freq (0x0000) */
|
||||
unsigned char cutoff; /* initial cutoff (0xff) */
|
||||
unsigned char filterQ; /* initial filter Q [0-15] (0x0) */
|
||||
unsigned char chorus; /* chorus send (0x00) */
|
||||
unsigned char reverb; /* reverb send (0x00) */
|
||||
unsigned short reserved[4]; /* not used */
|
||||
};
|
||||
|
||||
|
||||
/* wave table parameters: 92 bytes */
|
||||
struct soundfont_voice_info {
|
||||
unsigned short sf_id; /* file id (should be zero) */
|
||||
unsigned short sample; /* sample id */
|
||||
int start, end; /* sample offset correction */
|
||||
int loopstart, loopend; /* loop offset correction */
|
||||
short rate_offset; /* sample rate pitch offset */
|
||||
unsigned short mode; /* sample mode */
|
||||
#define SNDRV_SFNT_MODE_ROMSOUND 0x8000
|
||||
#define SNDRV_SFNT_MODE_STEREO 1
|
||||
#define SNDRV_SFNT_MODE_LOOPING 2
|
||||
#define SNDRV_SFNT_MODE_NORELEASE 4 /* obsolete */
|
||||
#define SNDRV_SFNT_MODE_INIT_PARM 8
|
||||
|
||||
short root; /* midi root key */
|
||||
short tune; /* pitch tuning (in cents) */
|
||||
unsigned char low, high; /* key note range */
|
||||
unsigned char vellow, velhigh; /* velocity range */
|
||||
signed char fixkey, fixvel; /* fixed key, velocity */
|
||||
signed char pan, fixpan; /* panning, fixed panning */
|
||||
short exclusiveClass; /* exclusive class (0 = none) */
|
||||
unsigned char amplitude; /* sample volume (127 max) */
|
||||
unsigned char attenuation; /* attenuation (0.375dB) */
|
||||
short scaleTuning; /* pitch scale tuning(%), normally 100 */
|
||||
struct soundfont_voice_parm parm; /* voice envelope parameters */
|
||||
unsigned short sample_mode; /* sample mode_flag (set by driver) */
|
||||
};
|
||||
|
||||
|
||||
/* instrument info header: 4 bytes */
|
||||
struct soundfont_voice_rec_hdr {
|
||||
unsigned char bank; /* midi bank number */
|
||||
unsigned char instr; /* midi preset number */
|
||||
char nvoices; /* number of voices */
|
||||
char write_mode; /* write mode; normally 0 */
|
||||
#define SNDRV_SFNT_WR_APPEND 0 /* append anyway */
|
||||
#define SNDRV_SFNT_WR_EXCLUSIVE 1 /* skip if already exists */
|
||||
#define SNDRV_SFNT_WR_REPLACE 2 /* replace if already exists */
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* sample wave information
|
||||
*/
|
||||
|
||||
/* wave table sample header: 32 bytes */
|
||||
struct soundfont_sample_info {
|
||||
unsigned short sf_id; /* file id (should be zero) */
|
||||
unsigned short sample; /* sample id */
|
||||
int start, end; /* start & end offset */
|
||||
int loopstart, loopend; /* loop start & end offset */
|
||||
int size; /* size (0 = ROM) */
|
||||
short dummy; /* not used */
|
||||
unsigned short mode_flags; /* mode flags */
|
||||
#define SNDRV_SFNT_SAMPLE_8BITS 1 /* wave data is 8bits */
|
||||
#define SNDRV_SFNT_SAMPLE_UNSIGNED 2 /* wave data is unsigned */
|
||||
#define SNDRV_SFNT_SAMPLE_NO_BLANK 4 /* no blank loop is attached */
|
||||
#define SNDRV_SFNT_SAMPLE_SINGLESHOT 8 /* single-shot w/o loop */
|
||||
#define SNDRV_SFNT_SAMPLE_BIDIR_LOOP 16 /* bidirectional looping */
|
||||
#define SNDRV_SFNT_SAMPLE_STEREO_LEFT 32 /* stereo left sound */
|
||||
#define SNDRV_SFNT_SAMPLE_STEREO_RIGHT 64 /* stereo right sound */
|
||||
#define SNDRV_SFNT_SAMPLE_REVERSE_LOOP 128 /* reverse looping */
|
||||
unsigned int truesize; /* used memory size (set by driver) */
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* voice preset mapping (aliasing)
|
||||
*/
|
||||
|
||||
struct soundfont_voice_map {
|
||||
int map_bank, map_instr, map_key; /* key = -1 means all keys */
|
||||
int src_bank, src_instr, src_key;
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* ioctls for hwdep
|
||||
*/
|
||||
|
||||
#define SNDRV_EMUX_HWDEP_NAME "Emux WaveTable"
|
||||
|
||||
#define SNDRV_EMUX_VERSION ((1 << 16) | (0 << 8) | 0) /* 1.0.0 */
|
||||
|
||||
struct snd_emux_misc_mode {
|
||||
int port; /* -1 = all */
|
||||
int mode;
|
||||
int value;
|
||||
int value2; /* reserved */
|
||||
};
|
||||
|
||||
#define SNDRV_EMUX_IOCTL_VERSION _IOR('H', 0x80, unsigned int)
|
||||
#define SNDRV_EMUX_IOCTL_LOAD_PATCH _IOWR('H', 0x81, struct soundfont_patch_info)
|
||||
#define SNDRV_EMUX_IOCTL_RESET_SAMPLES _IO('H', 0x82)
|
||||
#define SNDRV_EMUX_IOCTL_REMOVE_LAST_SAMPLES _IO('H', 0x83)
|
||||
#define SNDRV_EMUX_IOCTL_MEM_AVAIL _IOW('H', 0x84, int)
|
||||
#define SNDRV_EMUX_IOCTL_MISC_MODE _IOWR('H', 0x84, struct snd_emux_misc_mode)
|
||||
|
||||
#endif /* __SOUND_SFNT_INFO_H */
|
||||
Reference in New Issue
Block a user