Home | History | Annotate | Download | only in libaudio
      1 /****************************************************************************
      2  ****************************************************************************
      3  ***
      4  ***   This header was automatically generated from a Linux kernel header
      5  ***   of the same name, to make information necessary for userspace to
      6  ***   call into the kernel available to libc.  It contains only constants,
      7  ***   structures, and macros generated from the original header, and thus,
      8  ***   contains no copyrightable information.
      9  ***
     10  ****************************************************************************
     11  ****************************************************************************/
     12 #ifndef __SOUND_ASOUND_H
     13 #define __SOUND_ASOUND_H
     14 
     15 #include <linux/types.h>
     16 
     17 #define SNDRV_PROTOCOL_VERSION(major, minor, subminor) (((major)<<16)|((minor)<<8)|(subminor))
     18 #define SNDRV_PROTOCOL_MAJOR(version) (((version)>>16)&0xffff)
     19 #define SNDRV_PROTOCOL_MINOR(version) (((version)>>8)&0xff)
     20 #define SNDRV_PROTOCOL_MICRO(version) ((version)&0xff)
     21 #define SNDRV_PROTOCOL_INCOMPATIBLE(kversion, uversion)   (SNDRV_PROTOCOL_MAJOR(kversion) != SNDRV_PROTOCOL_MAJOR(uversion) ||   (SNDRV_PROTOCOL_MAJOR(kversion) == SNDRV_PROTOCOL_MAJOR(uversion) &&   SNDRV_PROTOCOL_MINOR(kversion) != SNDRV_PROTOCOL_MINOR(uversion)))
     22 
     23 struct snd_aes_iec958 {
     24  unsigned char status[24];
     25  unsigned char subcode[147];
     26  unsigned char pad;
     27  unsigned char dig_subframe[4];
     28 };
     29 
     30 #define SNDRV_HWDEP_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 1)
     31 
     32 enum {
     33  SNDRV_HWDEP_IFACE_OPL2 = 0,
     34  SNDRV_HWDEP_IFACE_OPL3,
     35  SNDRV_HWDEP_IFACE_OPL4,
     36  SNDRV_HWDEP_IFACE_SB16CSP,
     37  SNDRV_HWDEP_IFACE_EMU10K1,
     38  SNDRV_HWDEP_IFACE_YSS225,
     39  SNDRV_HWDEP_IFACE_ICS2115,
     40  SNDRV_HWDEP_IFACE_SSCAPE,
     41  SNDRV_HWDEP_IFACE_VX,
     42  SNDRV_HWDEP_IFACE_MIXART,
     43  SNDRV_HWDEP_IFACE_USX2Y,
     44  SNDRV_HWDEP_IFACE_EMUX_WAVETABLE,
     45  SNDRV_HWDEP_IFACE_BLUETOOTH,
     46  SNDRV_HWDEP_IFACE_USX2Y_PCM,
     47  SNDRV_HWDEP_IFACE_PCXHR,
     48  SNDRV_HWDEP_IFACE_SB_RC,
     49  SNDRV_HWDEP_IFACE_HDA,
     50  SNDRV_HWDEP_IFACE_USB_STREAM,
     51 
     52  SNDRV_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_USB_STREAM
     53 };
     54 
     55 struct snd_hwdep_info {
     56  unsigned int device;
     57  int card;
     58  unsigned char id[64];
     59  unsigned char name[80];
     60  int iface;
     61  unsigned char reserved[64];
     62 };
     63 
     64 struct snd_hwdep_dsp_status {
     65  unsigned int version;
     66  unsigned char id[32];
     67  unsigned int num_dsps;
     68  unsigned int dsp_loaded;
     69  unsigned int chip_ready;
     70  unsigned char reserved[16];
     71 };
     72 
     73 struct snd_hwdep_dsp_image {
     74  unsigned int index;
     75  unsigned char name[64];
     76  unsigned char __user *image;
     77  size_t length;
     78  unsigned long driver_data;
     79 };
     80 
     81 #define SNDRV_HWDEP_IOCTL_PVERSION _IOR ('H', 0x00, int)
     82 #define SNDRV_HWDEP_IOCTL_INFO _IOR ('H', 0x01, struct snd_hwdep_info)
     83 #define SNDRV_HWDEP_IOCTL_DSP_STATUS _IOR('H', 0x02, struct snd_hwdep_dsp_status)
     84 #define SNDRV_HWDEP_IOCTL_DSP_LOAD _IOW('H', 0x03, struct snd_hwdep_dsp_image)
     85 
     86 #define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 10)
     87 
     88 typedef unsigned long snd_pcm_uframes_t;
     89 typedef signed long snd_pcm_sframes_t;
     90 
     91 enum {
     92  SNDRV_PCM_CLASS_GENERIC = 0,
     93  SNDRV_PCM_CLASS_MULTI,
     94  SNDRV_PCM_CLASS_MODEM,
     95  SNDRV_PCM_CLASS_DIGITIZER,
     96 
     97  SNDRV_PCM_CLASS_LAST = SNDRV_PCM_CLASS_DIGITIZER,
     98 };
     99 
    100 enum {
    101  SNDRV_PCM_SUBCLASS_GENERIC_MIX = 0,
    102  SNDRV_PCM_SUBCLASS_MULTI_MIX,
    103 
    104  SNDRV_PCM_SUBCLASS_LAST = SNDRV_PCM_SUBCLASS_MULTI_MIX,
    105 };
    106 
    107 enum {
    108  SNDRV_PCM_STREAM_PLAYBACK = 0,
    109  SNDRV_PCM_STREAM_CAPTURE,
    110  SNDRV_PCM_STREAM_LAST = SNDRV_PCM_STREAM_CAPTURE,
    111 };
    112 
    113 typedef int __bitwise snd_pcm_access_t;
    114 #define SNDRV_PCM_ACCESS_MMAP_INTERLEAVED ((__force snd_pcm_access_t) 0)
    115 #define SNDRV_PCM_ACCESS_MMAP_NONINTERLEAVED ((__force snd_pcm_access_t) 1)
    116 #define SNDRV_PCM_ACCESS_MMAP_COMPLEX ((__force snd_pcm_access_t) 2)
    117 #define SNDRV_PCM_ACCESS_RW_INTERLEAVED ((__force snd_pcm_access_t) 3)
    118 #define SNDRV_PCM_ACCESS_RW_NONINTERLEAVED ((__force snd_pcm_access_t) 4)
    119 #define SNDRV_PCM_ACCESS_LAST SNDRV_PCM_ACCESS_RW_NONINTERLEAVED
    120 
    121 typedef int __bitwise snd_pcm_format_t;
    122 #define SNDRV_PCM_FORMAT_S8 ((__force snd_pcm_format_t) 0)
    123 #define SNDRV_PCM_FORMAT_U8 ((__force snd_pcm_format_t) 1)
    124 #define SNDRV_PCM_FORMAT_S16_LE ((__force snd_pcm_format_t) 2)
    125 #define SNDRV_PCM_FORMAT_S16_BE ((__force snd_pcm_format_t) 3)
    126 #define SNDRV_PCM_FORMAT_U16_LE ((__force snd_pcm_format_t) 4)
    127 #define SNDRV_PCM_FORMAT_U16_BE ((__force snd_pcm_format_t) 5)
    128 #define SNDRV_PCM_FORMAT_S24_LE ((__force snd_pcm_format_t) 6)
    129 #define SNDRV_PCM_FORMAT_S24_BE ((__force snd_pcm_format_t) 7)
    130 #define SNDRV_PCM_FORMAT_U24_LE ((__force snd_pcm_format_t) 8)
    131 #define SNDRV_PCM_FORMAT_U24_BE ((__force snd_pcm_format_t) 9)
    132 #define SNDRV_PCM_FORMAT_S32_LE ((__force snd_pcm_format_t) 10)
    133 #define SNDRV_PCM_FORMAT_S32_BE ((__force snd_pcm_format_t) 11)
    134 #define SNDRV_PCM_FORMAT_U32_LE ((__force snd_pcm_format_t) 12)
    135 #define SNDRV_PCM_FORMAT_U32_BE ((__force snd_pcm_format_t) 13)
    136 #define SNDRV_PCM_FORMAT_FLOAT_LE ((__force snd_pcm_format_t) 14)
    137 #define SNDRV_PCM_FORMAT_FLOAT_BE ((__force snd_pcm_format_t) 15)
    138 #define SNDRV_PCM_FORMAT_FLOAT64_LE ((__force snd_pcm_format_t) 16)
    139 #define SNDRV_PCM_FORMAT_FLOAT64_BE ((__force snd_pcm_format_t) 17)
    140 #define SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE ((__force snd_pcm_format_t) 18)
    141 #define SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE ((__force snd_pcm_format_t) 19)
    142 #define SNDRV_PCM_FORMAT_MU_LAW ((__force snd_pcm_format_t) 20)
    143 #define SNDRV_PCM_FORMAT_A_LAW ((__force snd_pcm_format_t) 21)
    144 #define SNDRV_PCM_FORMAT_IMA_ADPCM ((__force snd_pcm_format_t) 22)
    145 #define SNDRV_PCM_FORMAT_MPEG ((__force snd_pcm_format_t) 23)
    146 #define SNDRV_PCM_FORMAT_GSM ((__force snd_pcm_format_t) 24)
    147 #define SNDRV_PCM_FORMAT_SPECIAL ((__force snd_pcm_format_t) 31)
    148 #define SNDRV_PCM_FORMAT_S24_3LE ((__force snd_pcm_format_t) 32)
    149 #define SNDRV_PCM_FORMAT_S24_3BE ((__force snd_pcm_format_t) 33)
    150 #define SNDRV_PCM_FORMAT_U24_3LE ((__force snd_pcm_format_t) 34)
    151 #define SNDRV_PCM_FORMAT_U24_3BE ((__force snd_pcm_format_t) 35)
    152 #define SNDRV_PCM_FORMAT_S20_3LE ((__force snd_pcm_format_t) 36)
    153 #define SNDRV_PCM_FORMAT_S20_3BE ((__force snd_pcm_format_t) 37)
    154 #define SNDRV_PCM_FORMAT_U20_3LE ((__force snd_pcm_format_t) 38)
    155 #define SNDRV_PCM_FORMAT_U20_3BE ((__force snd_pcm_format_t) 39)
    156 #define SNDRV_PCM_FORMAT_S18_3LE ((__force snd_pcm_format_t) 40)
    157 #define SNDRV_PCM_FORMAT_S18_3BE ((__force snd_pcm_format_t) 41)
    158 #define SNDRV_PCM_FORMAT_U18_3LE ((__force snd_pcm_format_t) 42)
    159 #define SNDRV_PCM_FORMAT_U18_3BE ((__force snd_pcm_format_t) 43)
    160 #define SNDRV_PCM_FORMAT_LAST SNDRV_PCM_FORMAT_U18_3BE
    161 
    162 #ifdef SNDRV_LITTLE_ENDIAN
    163 #define SNDRV_PCM_FORMAT_S16 SNDRV_PCM_FORMAT_S16_LE
    164 #define SNDRV_PCM_FORMAT_U16 SNDRV_PCM_FORMAT_U16_LE
    165 #define SNDRV_PCM_FORMAT_S24 SNDRV_PCM_FORMAT_S24_LE
    166 #define SNDRV_PCM_FORMAT_U24 SNDRV_PCM_FORMAT_U24_LE
    167 #define SNDRV_PCM_FORMAT_S32 SNDRV_PCM_FORMAT_S32_LE
    168 #define SNDRV_PCM_FORMAT_U32 SNDRV_PCM_FORMAT_U32_LE
    169 #define SNDRV_PCM_FORMAT_FLOAT SNDRV_PCM_FORMAT_FLOAT_LE
    170 #define SNDRV_PCM_FORMAT_FLOAT64 SNDRV_PCM_FORMAT_FLOAT64_LE
    171 #define SNDRV_PCM_FORMAT_IEC958_SUBFRAME SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE
    172 #endif
    173 #ifdef SNDRV_BIG_ENDIAN
    174 #define SNDRV_PCM_FORMAT_S16 SNDRV_PCM_FORMAT_S16_BE
    175 #define SNDRV_PCM_FORMAT_U16 SNDRV_PCM_FORMAT_U16_BE
    176 #define SNDRV_PCM_FORMAT_S24 SNDRV_PCM_FORMAT_S24_BE
    177 #define SNDRV_PCM_FORMAT_U24 SNDRV_PCM_FORMAT_U24_BE
    178 #define SNDRV_PCM_FORMAT_S32 SNDRV_PCM_FORMAT_S32_BE
    179 #define SNDRV_PCM_FORMAT_U32 SNDRV_PCM_FORMAT_U32_BE
    180 #define SNDRV_PCM_FORMAT_FLOAT SNDRV_PCM_FORMAT_FLOAT_BE
    181 #define SNDRV_PCM_FORMAT_FLOAT64 SNDRV_PCM_FORMAT_FLOAT64_BE
    182 #define SNDRV_PCM_FORMAT_IEC958_SUBFRAME SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE
    183 #endif
    184 
    185 typedef int __bitwise snd_pcm_subformat_t;
    186 #define SNDRV_PCM_SUBFORMAT_STD ((__force snd_pcm_subformat_t) 0)
    187 #define SNDRV_PCM_SUBFORMAT_LAST SNDRV_PCM_SUBFORMAT_STD
    188 
    189 #define SNDRV_PCM_INFO_MMAP 0x00000001
    190 #define SNDRV_PCM_INFO_MMAP_VALID 0x00000002
    191 #define SNDRV_PCM_INFO_DOUBLE 0x00000004
    192 #define SNDRV_PCM_INFO_BATCH 0x00000010
    193 #define SNDRV_PCM_INFO_INTERLEAVED 0x00000100
    194 #define SNDRV_PCM_INFO_NONINTERLEAVED 0x00000200
    195 #define SNDRV_PCM_INFO_COMPLEX 0x00000400
    196 #define SNDRV_PCM_INFO_BLOCK_TRANSFER 0x00010000
    197 #define SNDRV_PCM_INFO_OVERRANGE 0x00020000
    198 #define SNDRV_PCM_INFO_RESUME 0x00040000
    199 #define SNDRV_PCM_INFO_PAUSE 0x00080000
    200 #define SNDRV_PCM_INFO_HALF_DUPLEX 0x00100000
    201 #define SNDRV_PCM_INFO_JOINT_DUPLEX 0x00200000
    202 #define SNDRV_PCM_INFO_SYNC_START 0x00400000
    203 #define SNDRV_PCM_INFO_FIFO_IN_FRAMES 0x80000000
    204 
    205 typedef int __bitwise snd_pcm_state_t;
    206 #define SNDRV_PCM_STATE_OPEN ((__force snd_pcm_state_t) 0)
    207 #define SNDRV_PCM_STATE_SETUP ((__force snd_pcm_state_t) 1)
    208 #define SNDRV_PCM_STATE_PREPARED ((__force snd_pcm_state_t) 2)
    209 #define SNDRV_PCM_STATE_RUNNING ((__force snd_pcm_state_t) 3)
    210 #define SNDRV_PCM_STATE_XRUN ((__force snd_pcm_state_t) 4)
    211 #define SNDRV_PCM_STATE_DRAINING ((__force snd_pcm_state_t) 5)
    212 #define SNDRV_PCM_STATE_PAUSED ((__force snd_pcm_state_t) 6)
    213 #define SNDRV_PCM_STATE_SUSPENDED ((__force snd_pcm_state_t) 7)
    214 #define SNDRV_PCM_STATE_DISCONNECTED ((__force snd_pcm_state_t) 8)
    215 #define SNDRV_PCM_STATE_LAST SNDRV_PCM_STATE_DISCONNECTED
    216 
    217 enum {
    218  SNDRV_PCM_MMAP_OFFSET_DATA = 0x00000000,
    219  SNDRV_PCM_MMAP_OFFSET_STATUS = 0x80000000,
    220  SNDRV_PCM_MMAP_OFFSET_CONTROL = 0x81000000,
    221 };
    222 
    223 union snd_pcm_sync_id {
    224  unsigned char id[16];
    225  unsigned short id16[8];
    226  unsigned int id32[4];
    227 };
    228 
    229 struct snd_pcm_info {
    230  unsigned int device;
    231  unsigned int subdevice;
    232  int stream;
    233  int card;
    234  unsigned char id[64];
    235  unsigned char name[80];
    236  unsigned char subname[32];
    237  int dev_class;
    238  int dev_subclass;
    239  unsigned int subdevices_count;
    240  unsigned int subdevices_avail;
    241  union snd_pcm_sync_id sync;
    242  unsigned char reserved[64];
    243 };
    244 
    245 typedef int snd_pcm_hw_param_t;
    246 #define SNDRV_PCM_HW_PARAM_ACCESS 0
    247 #define SNDRV_PCM_HW_PARAM_FORMAT 1
    248 #define SNDRV_PCM_HW_PARAM_SUBFORMAT 2
    249 #define SNDRV_PCM_HW_PARAM_FIRST_MASK SNDRV_PCM_HW_PARAM_ACCESS
    250 #define SNDRV_PCM_HW_PARAM_LAST_MASK SNDRV_PCM_HW_PARAM_SUBFORMAT
    251 
    252 #define SNDRV_PCM_HW_PARAM_SAMPLE_BITS 8
    253 #define SNDRV_PCM_HW_PARAM_FRAME_BITS 9
    254 #define SNDRV_PCM_HW_PARAM_CHANNELS 10
    255 #define SNDRV_PCM_HW_PARAM_RATE 11
    256 #define SNDRV_PCM_HW_PARAM_PERIOD_TIME 12
    257 #define SNDRV_PCM_HW_PARAM_PERIOD_SIZE 13
    258 #define SNDRV_PCM_HW_PARAM_PERIOD_BYTES 14
    259 #define SNDRV_PCM_HW_PARAM_PERIODS 15
    260 #define SNDRV_PCM_HW_PARAM_BUFFER_TIME 16
    261 #define SNDRV_PCM_HW_PARAM_BUFFER_SIZE 17
    262 #define SNDRV_PCM_HW_PARAM_BUFFER_BYTES 18
    263 #define SNDRV_PCM_HW_PARAM_TICK_TIME 19
    264 #define SNDRV_PCM_HW_PARAM_FIRST_INTERVAL SNDRV_PCM_HW_PARAM_SAMPLE_BITS
    265 #define SNDRV_PCM_HW_PARAM_LAST_INTERVAL SNDRV_PCM_HW_PARAM_TICK_TIME
    266 
    267 #define SNDRV_PCM_HW_PARAMS_NORESAMPLE (1<<0)
    268 
    269 struct snd_interval {
    270  unsigned int min, max;
    271  unsigned int openmin:1,
    272  openmax:1,
    273  integer:1,
    274  empty:1;
    275 };
    276 
    277 #define SNDRV_MASK_MAX 256
    278 
    279 struct snd_mask {
    280  __u32 bits[(SNDRV_MASK_MAX+31)/32];
    281 };
    282 
    283 struct snd_pcm_hw_params {
    284  unsigned int flags;
    285  struct snd_mask masks[SNDRV_PCM_HW_PARAM_LAST_MASK -
    286  SNDRV_PCM_HW_PARAM_FIRST_MASK + 1];
    287  struct snd_mask mres[5];
    288  struct snd_interval intervals[SNDRV_PCM_HW_PARAM_LAST_INTERVAL -
    289  SNDRV_PCM_HW_PARAM_FIRST_INTERVAL + 1];
    290  struct snd_interval ires[9];
    291  unsigned int rmask;
    292  unsigned int cmask;
    293  unsigned int info;
    294  unsigned int msbits;
    295  unsigned int rate_num;
    296  unsigned int rate_den;
    297  snd_pcm_uframes_t fifo_size;
    298  unsigned char reserved[64];
    299 };
    300 
    301 enum {
    302  SNDRV_PCM_TSTAMP_NONE = 0,
    303  SNDRV_PCM_TSTAMP_ENABLE,
    304  SNDRV_PCM_TSTAMP_LAST = SNDRV_PCM_TSTAMP_ENABLE,
    305 };
    306 
    307 struct snd_pcm_sw_params {
    308  int tstamp_mode;
    309  unsigned int period_step;
    310  unsigned int sleep_min;
    311  snd_pcm_uframes_t avail_min;
    312  snd_pcm_uframes_t xfer_align;
    313  snd_pcm_uframes_t start_threshold;
    314  snd_pcm_uframes_t stop_threshold;
    315  snd_pcm_uframes_t silence_threshold;
    316  snd_pcm_uframes_t silence_size;
    317  snd_pcm_uframes_t boundary;
    318  unsigned char reserved[64];
    319 };
    320 
    321 struct snd_pcm_channel_info {
    322  unsigned int channel;
    323  __kernel_off_t offset;
    324  unsigned int first;
    325  unsigned int step;
    326 };
    327 
    328 struct snd_pcm_status {
    329  snd_pcm_state_t state;
    330  struct timespec trigger_tstamp;
    331  struct timespec tstamp;
    332  snd_pcm_uframes_t appl_ptr;
    333  snd_pcm_uframes_t hw_ptr;
    334  snd_pcm_sframes_t delay;
    335  snd_pcm_uframes_t avail;
    336  snd_pcm_uframes_t avail_max;
    337  snd_pcm_uframes_t overrange;
    338  snd_pcm_state_t suspended_state;
    339  unsigned char reserved[60];
    340 };
    341 
    342 struct snd_pcm_mmap_status {
    343  snd_pcm_state_t state;
    344  int pad1;
    345  snd_pcm_uframes_t hw_ptr;
    346  struct timespec tstamp;
    347  snd_pcm_state_t suspended_state;
    348 };
    349 
    350 struct snd_pcm_mmap_control {
    351  snd_pcm_uframes_t appl_ptr;
    352  snd_pcm_uframes_t avail_min;
    353 };
    354 
    355 #define SNDRV_PCM_SYNC_PTR_HWSYNC (1<<0)
    356 #define SNDRV_PCM_SYNC_PTR_APPL (1<<1)
    357 #define SNDRV_PCM_SYNC_PTR_AVAIL_MIN (1<<2)
    358 
    359 struct snd_pcm_sync_ptr {
    360  unsigned int flags;
    361  union {
    362  struct snd_pcm_mmap_status status;
    363  unsigned char reserved[64];
    364  } s;
    365  union {
    366  struct snd_pcm_mmap_control control;
    367  unsigned char reserved[64];
    368  } c;
    369 };
    370 
    371 struct snd_xferi {
    372  snd_pcm_sframes_t result;
    373  void __user *buf;
    374  snd_pcm_uframes_t frames;
    375 };
    376 
    377 struct snd_xfern {
    378  snd_pcm_sframes_t result;
    379  void __user * __user *bufs;
    380  snd_pcm_uframes_t frames;
    381 };
    382 
    383 enum {
    384  SNDRV_PCM_TSTAMP_TYPE_GETTIMEOFDAY = 0,
    385  SNDRV_PCM_TSTAMP_TYPE_MONOTONIC,
    386  SNDRV_PCM_TSTAMP_TYPE_LAST = SNDRV_PCM_TSTAMP_TYPE_MONOTONIC,
    387 };
    388 
    389 #define SNDRV_PCM_IOCTL_PVERSION _IOR('A', 0x00, int)
    390 #define SNDRV_PCM_IOCTL_INFO _IOR('A', 0x01, struct snd_pcm_info)
    391 #define SNDRV_PCM_IOCTL_TSTAMP _IOW('A', 0x02, int)
    392 #define SNDRV_PCM_IOCTL_TTSTAMP _IOW('A', 0x03, int)
    393 #define SNDRV_PCM_IOCTL_HW_REFINE _IOWR('A', 0x10, struct snd_pcm_hw_params)
    394 #define SNDRV_PCM_IOCTL_HW_PARAMS _IOWR('A', 0x11, struct snd_pcm_hw_params)
    395 #define SNDRV_PCM_IOCTL_HW_FREE _IO('A', 0x12)
    396 #define SNDRV_PCM_IOCTL_SW_PARAMS _IOWR('A', 0x13, struct snd_pcm_sw_params)
    397 #define SNDRV_PCM_IOCTL_STATUS _IOR('A', 0x20, struct snd_pcm_status)
    398 #define SNDRV_PCM_IOCTL_DELAY _IOR('A', 0x21, snd_pcm_sframes_t)
    399 #define SNDRV_PCM_IOCTL_HWSYNC _IO('A', 0x22)
    400 #define SNDRV_PCM_IOCTL_SYNC_PTR _IOWR('A', 0x23, struct snd_pcm_sync_ptr)
    401 #define SNDRV_PCM_IOCTL_CHANNEL_INFO _IOR('A', 0x32, struct snd_pcm_channel_info)
    402 #define SNDRV_PCM_IOCTL_PREPARE _IO('A', 0x40)
    403 #define SNDRV_PCM_IOCTL_RESET _IO('A', 0x41)
    404 #define SNDRV_PCM_IOCTL_START _IO('A', 0x42)
    405 #define SNDRV_PCM_IOCTL_DROP _IO('A', 0x43)
    406 #define SNDRV_PCM_IOCTL_DRAIN _IO('A', 0x44)
    407 #define SNDRV_PCM_IOCTL_PAUSE _IOW('A', 0x45, int)
    408 #define SNDRV_PCM_IOCTL_REWIND _IOW('A', 0x46, snd_pcm_uframes_t)
    409 #define SNDRV_PCM_IOCTL_RESUME _IO('A', 0x47)
    410 #define SNDRV_PCM_IOCTL_XRUN _IO('A', 0x48)
    411 #define SNDRV_PCM_IOCTL_FORWARD _IOW('A', 0x49, snd_pcm_uframes_t)
    412 #define SNDRV_PCM_IOCTL_WRITEI_FRAMES _IOW('A', 0x50, struct snd_xferi)
    413 #define SNDRV_PCM_IOCTL_READI_FRAMES _IOR('A', 0x51, struct snd_xferi)
    414 #define SNDRV_PCM_IOCTL_WRITEN_FRAMES _IOW('A', 0x52, struct snd_xfern)
    415 #define SNDRV_PCM_IOCTL_READN_FRAMES _IOR('A', 0x53, struct snd_xfern)
    416 #define SNDRV_PCM_IOCTL_LINK _IOW('A', 0x60, int)
    417 #define SNDRV_PCM_IOCTL_UNLINK _IO('A', 0x61)
    418 
    419 #define SNDRV_RAWMIDI_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 0)
    420 
    421 enum {
    422  SNDRV_RAWMIDI_STREAM_OUTPUT = 0,
    423  SNDRV_RAWMIDI_STREAM_INPUT,
    424  SNDRV_RAWMIDI_STREAM_LAST = SNDRV_RAWMIDI_STREAM_INPUT,
    425 };
    426 
    427 #define SNDRV_RAWMIDI_INFO_OUTPUT 0x00000001
    428 #define SNDRV_RAWMIDI_INFO_INPUT 0x00000002
    429 #define SNDRV_RAWMIDI_INFO_DUPLEX 0x00000004
    430 
    431 struct snd_rawmidi_info {
    432  unsigned int device;
    433  unsigned int subdevice;
    434  int stream;
    435  int card;
    436  unsigned int flags;
    437  unsigned char id[64];
    438  unsigned char name[80];
    439  unsigned char subname[32];
    440  unsigned int subdevices_count;
    441  unsigned int subdevices_avail;
    442  unsigned char reserved[64];
    443 };
    444 
    445 struct snd_rawmidi_params {
    446  int stream;
    447  size_t buffer_size;
    448  size_t avail_min;
    449  unsigned int no_active_sensing: 1;
    450  unsigned char reserved[16];
    451 };
    452 
    453 struct snd_rawmidi_status {
    454  int stream;
    455  struct timespec tstamp;
    456  size_t avail;
    457  size_t xruns;
    458  unsigned char reserved[16];
    459 };
    460 
    461 #define SNDRV_RAWMIDI_IOCTL_PVERSION _IOR('W', 0x00, int)
    462 #define SNDRV_RAWMIDI_IOCTL_INFO _IOR('W', 0x01, struct snd_rawmidi_info)
    463 #define SNDRV_RAWMIDI_IOCTL_PARAMS _IOWR('W', 0x10, struct snd_rawmidi_params)
    464 #define SNDRV_RAWMIDI_IOCTL_STATUS _IOWR('W', 0x20, struct snd_rawmidi_status)
    465 #define SNDRV_RAWMIDI_IOCTL_DROP _IOW('W', 0x30, int)
    466 #define SNDRV_RAWMIDI_IOCTL_DRAIN _IOW('W', 0x31, int)
    467 
    468 #define SNDRV_TIMER_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 6)
    469 
    470 enum {
    471  SNDRV_TIMER_CLASS_NONE = -1,
    472  SNDRV_TIMER_CLASS_SLAVE = 0,
    473  SNDRV_TIMER_CLASS_GLOBAL,
    474  SNDRV_TIMER_CLASS_CARD,
    475  SNDRV_TIMER_CLASS_PCM,
    476  SNDRV_TIMER_CLASS_LAST = SNDRV_TIMER_CLASS_PCM,
    477 };
    478 
    479 enum {
    480  SNDRV_TIMER_SCLASS_NONE = 0,
    481  SNDRV_TIMER_SCLASS_APPLICATION,
    482  SNDRV_TIMER_SCLASS_SEQUENCER,
    483  SNDRV_TIMER_SCLASS_OSS_SEQUENCER,
    484  SNDRV_TIMER_SCLASS_LAST = SNDRV_TIMER_SCLASS_OSS_SEQUENCER,
    485 };
    486 
    487 #define SNDRV_TIMER_GLOBAL_SYSTEM 0
    488 #define SNDRV_TIMER_GLOBAL_RTC 1
    489 #define SNDRV_TIMER_GLOBAL_HPET 2
    490 #define SNDRV_TIMER_GLOBAL_HRTIMER 3
    491 
    492 #define SNDRV_TIMER_FLG_SLAVE (1<<0)
    493 
    494 struct snd_timer_id {
    495  int dev_class;
    496  int dev_sclass;
    497  int card;
    498  int device;
    499  int subdevice;
    500 };
    501 
    502 struct snd_timer_ginfo {
    503  struct snd_timer_id tid;
    504  unsigned int flags;
    505  int card;
    506  unsigned char id[64];
    507  unsigned char name[80];
    508  unsigned long reserved0;
    509  unsigned long resolution;
    510  unsigned long resolution_min;
    511  unsigned long resolution_max;
    512  unsigned int clients;
    513  unsigned char reserved[32];
    514 };
    515 
    516 struct snd_timer_gparams {
    517  struct snd_timer_id tid;
    518  unsigned long period_num;
    519  unsigned long period_den;
    520  unsigned char reserved[32];
    521 };
    522 
    523 struct snd_timer_gstatus {
    524  struct snd_timer_id tid;
    525  unsigned long resolution;
    526  unsigned long resolution_num;
    527  unsigned long resolution_den;
    528  unsigned char reserved[32];
    529 };
    530 
    531 struct snd_timer_select {
    532  struct snd_timer_id id;
    533  unsigned char reserved[32];
    534 };
    535 
    536 struct snd_timer_info {
    537  unsigned int flags;
    538  int card;
    539  unsigned char id[64];
    540  unsigned char name[80];
    541  unsigned long reserved0;
    542  unsigned long resolution;
    543  unsigned char reserved[64];
    544 };
    545 
    546 #define SNDRV_TIMER_PSFLG_AUTO (1<<0)
    547 #define SNDRV_TIMER_PSFLG_EXCLUSIVE (1<<1)
    548 #define SNDRV_TIMER_PSFLG_EARLY_EVENT (1<<2)
    549 
    550 struct snd_timer_params {
    551  unsigned int flags;
    552  unsigned int ticks;
    553  unsigned int queue_size;
    554  unsigned int reserved0;
    555  unsigned int filter;
    556  unsigned char reserved[60];
    557 };
    558 
    559 struct snd_timer_status {
    560  struct timespec tstamp;
    561  unsigned int resolution;
    562  unsigned int lost;
    563  unsigned int overrun;
    564  unsigned int queue;
    565  unsigned char reserved[64];
    566 };
    567 
    568 #define SNDRV_TIMER_IOCTL_PVERSION _IOR('T', 0x00, int)
    569 #define SNDRV_TIMER_IOCTL_NEXT_DEVICE _IOWR('T', 0x01, struct snd_timer_id)
    570 #define SNDRV_TIMER_IOCTL_TREAD _IOW('T', 0x02, int)
    571 #define SNDRV_TIMER_IOCTL_GINFO _IOWR('T', 0x03, struct snd_timer_ginfo)
    572 #define SNDRV_TIMER_IOCTL_GPARAMS _IOW('T', 0x04, struct snd_timer_gparams)
    573 #define SNDRV_TIMER_IOCTL_GSTATUS _IOWR('T', 0x05, struct snd_timer_gstatus)
    574 #define SNDRV_TIMER_IOCTL_SELECT _IOW('T', 0x10, struct snd_timer_select)
    575 #define SNDRV_TIMER_IOCTL_INFO _IOR('T', 0x11, struct snd_timer_info)
    576 #define SNDRV_TIMER_IOCTL_PARAMS _IOW('T', 0x12, struct snd_timer_params)
    577 #define SNDRV_TIMER_IOCTL_STATUS _IOR('T', 0x14, struct snd_timer_status)
    578 
    579 #define SNDRV_TIMER_IOCTL_START _IO('T', 0xa0)
    580 #define SNDRV_TIMER_IOCTL_STOP _IO('T', 0xa1)
    581 #define SNDRV_TIMER_IOCTL_CONTINUE _IO('T', 0xa2)
    582 #define SNDRV_TIMER_IOCTL_PAUSE _IO('T', 0xa3)
    583 
    584 struct snd_timer_read {
    585  unsigned int resolution;
    586  unsigned int ticks;
    587 };
    588 
    589 enum {
    590  SNDRV_TIMER_EVENT_RESOLUTION = 0,
    591  SNDRV_TIMER_EVENT_TICK,
    592  SNDRV_TIMER_EVENT_START,
    593  SNDRV_TIMER_EVENT_STOP,
    594  SNDRV_TIMER_EVENT_CONTINUE,
    595  SNDRV_TIMER_EVENT_PAUSE,
    596  SNDRV_TIMER_EVENT_EARLY,
    597  SNDRV_TIMER_EVENT_SUSPEND,
    598  SNDRV_TIMER_EVENT_RESUME,
    599 
    600  SNDRV_TIMER_EVENT_MSTART = SNDRV_TIMER_EVENT_START + 10,
    601  SNDRV_TIMER_EVENT_MSTOP = SNDRV_TIMER_EVENT_STOP + 10,
    602  SNDRV_TIMER_EVENT_MCONTINUE = SNDRV_TIMER_EVENT_CONTINUE + 10,
    603  SNDRV_TIMER_EVENT_MPAUSE = SNDRV_TIMER_EVENT_PAUSE + 10,
    604  SNDRV_TIMER_EVENT_MSUSPEND = SNDRV_TIMER_EVENT_SUSPEND + 10,
    605  SNDRV_TIMER_EVENT_MRESUME = SNDRV_TIMER_EVENT_RESUME + 10,
    606 };
    607 
    608 struct snd_timer_tread {
    609  int event;
    610  struct timespec tstamp;
    611  unsigned int val;
    612 };
    613 
    614 #define SNDRV_CTL_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 6)
    615 
    616 struct snd_ctl_card_info {
    617  int card;
    618  int pad;
    619  unsigned char id[16];
    620  unsigned char driver[16];
    621  unsigned char name[32];
    622  unsigned char longname[80];
    623  unsigned char reserved_[16];
    624  unsigned char mixername[80];
    625  unsigned char components[128];
    626 };
    627 
    628 typedef int __bitwise snd_ctl_elem_type_t;
    629 #define SNDRV_CTL_ELEM_TYPE_NONE ((__force snd_ctl_elem_type_t) 0)
    630 #define SNDRV_CTL_ELEM_TYPE_BOOLEAN ((__force snd_ctl_elem_type_t) 1)
    631 #define SNDRV_CTL_ELEM_TYPE_INTEGER ((__force snd_ctl_elem_type_t) 2)
    632 #define SNDRV_CTL_ELEM_TYPE_ENUMERATED ((__force snd_ctl_elem_type_t) 3)
    633 #define SNDRV_CTL_ELEM_TYPE_BYTES ((__force snd_ctl_elem_type_t) 4)
    634 #define SNDRV_CTL_ELEM_TYPE_IEC958 ((__force snd_ctl_elem_type_t) 5)
    635 #define SNDRV_CTL_ELEM_TYPE_INTEGER64 ((__force snd_ctl_elem_type_t) 6)
    636 #define SNDRV_CTL_ELEM_TYPE_LAST SNDRV_CTL_ELEM_TYPE_INTEGER64
    637 
    638 typedef int __bitwise snd_ctl_elem_iface_t;
    639 #define SNDRV_CTL_ELEM_IFACE_CARD ((__force snd_ctl_elem_iface_t) 0)
    640 #define SNDRV_CTL_ELEM_IFACE_HWDEP ((__force snd_ctl_elem_iface_t) 1)
    641 #define SNDRV_CTL_ELEM_IFACE_MIXER ((__force snd_ctl_elem_iface_t) 2)
    642 #define SNDRV_CTL_ELEM_IFACE_PCM ((__force snd_ctl_elem_iface_t) 3)
    643 #define SNDRV_CTL_ELEM_IFACE_RAWMIDI ((__force snd_ctl_elem_iface_t) 4)
    644 #define SNDRV_CTL_ELEM_IFACE_TIMER ((__force snd_ctl_elem_iface_t) 5)
    645 #define SNDRV_CTL_ELEM_IFACE_SEQUENCER ((__force snd_ctl_elem_iface_t) 6)
    646 #define SNDRV_CTL_ELEM_IFACE_LAST SNDRV_CTL_ELEM_IFACE_SEQUENCER
    647 
    648 #define SNDRV_CTL_ELEM_ACCESS_READ (1<<0)
    649 #define SNDRV_CTL_ELEM_ACCESS_WRITE (1<<1)
    650 #define SNDRV_CTL_ELEM_ACCESS_READWRITE (SNDRV_CTL_ELEM_ACCESS_READ|SNDRV_CTL_ELEM_ACCESS_WRITE)
    651 #define SNDRV_CTL_ELEM_ACCESS_VOLATILE (1<<2)
    652 #define SNDRV_CTL_ELEM_ACCESS_TIMESTAMP (1<<3)
    653 #define SNDRV_CTL_ELEM_ACCESS_TLV_READ (1<<4)
    654 #define SNDRV_CTL_ELEM_ACCESS_TLV_WRITE (1<<5)
    655 #define SNDRV_CTL_ELEM_ACCESS_TLV_READWRITE (SNDRV_CTL_ELEM_ACCESS_TLV_READ|SNDRV_CTL_ELEM_ACCESS_TLV_WRITE)
    656 #define SNDRV_CTL_ELEM_ACCESS_TLV_COMMAND (1<<6)
    657 #define SNDRV_CTL_ELEM_ACCESS_INACTIVE (1<<8)
    658 #define SNDRV_CTL_ELEM_ACCESS_LOCK (1<<9)
    659 #define SNDRV_CTL_ELEM_ACCESS_OWNER (1<<10)
    660 #define SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK (1<<28)
    661 #define SNDRV_CTL_ELEM_ACCESS_USER (1<<29)
    662 
    663 #define SNDRV_CTL_POWER_D0 0x0000
    664 #define SNDRV_CTL_POWER_D1 0x0100
    665 #define SNDRV_CTL_POWER_D2 0x0200
    666 #define SNDRV_CTL_POWER_D3 0x0300
    667 #define SNDRV_CTL_POWER_D3hot (SNDRV_CTL_POWER_D3|0x0000)
    668 #define SNDRV_CTL_POWER_D3cold (SNDRV_CTL_POWER_D3|0x0001)
    669 
    670 struct snd_ctl_elem_id {
    671  unsigned int numid;
    672  snd_ctl_elem_iface_t iface;
    673  unsigned int device;
    674  unsigned int subdevice;
    675  unsigned char name[44];
    676  unsigned int index;
    677 };
    678 
    679 struct snd_ctl_elem_list {
    680  unsigned int offset;
    681  unsigned int space;
    682  unsigned int used;
    683  unsigned int count;
    684  struct snd_ctl_elem_id __user *pids;
    685  unsigned char reserved[50];
    686 };
    687 
    688 struct snd_ctl_elem_info {
    689  struct snd_ctl_elem_id id;
    690  snd_ctl_elem_type_t type;
    691  unsigned int access;
    692  unsigned int count;
    693  __kernel_pid_t owner;
    694  union {
    695  struct {
    696  long min;
    697  long max;
    698  long step;
    699  } integer;
    700  struct {
    701  long long min;
    702  long long max;
    703  long long step;
    704  } integer64;
    705  struct {
    706  unsigned int items;
    707  unsigned int item;
    708  char name[64];
    709  } enumerated;
    710  unsigned char reserved[128];
    711  } value;
    712  union {
    713  unsigned short d[4];
    714  unsigned short *d_ptr;
    715  } dimen;
    716  unsigned char reserved[64-4*sizeof(unsigned short)];
    717 };
    718 
    719 struct snd_ctl_elem_value {
    720  struct snd_ctl_elem_id id;
    721  unsigned int indirect: 1;
    722  union {
    723  union {
    724  long value[128];
    725  long *value_ptr;
    726  } integer;
    727  union {
    728  long long value[64];
    729  long long *value_ptr;
    730  } integer64;
    731  union {
    732  unsigned int item[128];
    733  unsigned int *item_ptr;
    734  } enumerated;
    735  union {
    736  unsigned char data[512];
    737  unsigned char *data_ptr;
    738  } bytes;
    739  struct snd_aes_iec958 iec958;
    740  } value;
    741  struct timespec tstamp;
    742  unsigned char reserved[128-sizeof(struct timespec)];
    743 };
    744 
    745 struct snd_ctl_tlv {
    746  unsigned int numid;
    747  unsigned int length;
    748  unsigned int tlv[0];
    749 };
    750 
    751 #define SNDRV_CTL_IOCTL_PVERSION _IOR('U', 0x00, int)
    752 #define SNDRV_CTL_IOCTL_CARD_INFO _IOR('U', 0x01, struct snd_ctl_card_info)
    753 #define SNDRV_CTL_IOCTL_ELEM_LIST _IOWR('U', 0x10, struct snd_ctl_elem_list)
    754 #define SNDRV_CTL_IOCTL_ELEM_INFO _IOWR('U', 0x11, struct snd_ctl_elem_info)
    755 #define SNDRV_CTL_IOCTL_ELEM_READ _IOWR('U', 0x12, struct snd_ctl_elem_value)
    756 #define SNDRV_CTL_IOCTL_ELEM_WRITE _IOWR('U', 0x13, struct snd_ctl_elem_value)
    757 #define SNDRV_CTL_IOCTL_ELEM_LOCK _IOW('U', 0x14, struct snd_ctl_elem_id)
    758 #define SNDRV_CTL_IOCTL_ELEM_UNLOCK _IOW('U', 0x15, struct snd_ctl_elem_id)
    759 #define SNDRV_CTL_IOCTL_SUBSCRIBE_EVENTS _IOWR('U', 0x16, int)
    760 #define SNDRV_CTL_IOCTL_ELEM_ADD _IOWR('U', 0x17, struct snd_ctl_elem_info)
    761 #define SNDRV_CTL_IOCTL_ELEM_REPLACE _IOWR('U', 0x18, struct snd_ctl_elem_info)
    762 #define SNDRV_CTL_IOCTL_ELEM_REMOVE _IOWR('U', 0x19, struct snd_ctl_elem_id)
    763 #define SNDRV_CTL_IOCTL_TLV_READ _IOWR('U', 0x1a, struct snd_ctl_tlv)
    764 #define SNDRV_CTL_IOCTL_TLV_WRITE _IOWR('U', 0x1b, struct snd_ctl_tlv)
    765 #define SNDRV_CTL_IOCTL_TLV_COMMAND _IOWR('U', 0x1c, struct snd_ctl_tlv)
    766 #define SNDRV_CTL_IOCTL_HWDEP_NEXT_DEVICE _IOWR('U', 0x20, int)
    767 #define SNDRV_CTL_IOCTL_HWDEP_INFO _IOR('U', 0x21, struct snd_hwdep_info)
    768 #define SNDRV_CTL_IOCTL_PCM_NEXT_DEVICE _IOR('U', 0x30, int)
    769 #define SNDRV_CTL_IOCTL_PCM_INFO _IOWR('U', 0x31, struct snd_pcm_info)
    770 #define SNDRV_CTL_IOCTL_PCM_PREFER_SUBDEVICE _IOW('U', 0x32, int)
    771 #define SNDRV_CTL_IOCTL_RAWMIDI_NEXT_DEVICE _IOWR('U', 0x40, int)
    772 #define SNDRV_CTL_IOCTL_RAWMIDI_INFO _IOWR('U', 0x41, struct snd_rawmidi_info)
    773 #define SNDRV_CTL_IOCTL_RAWMIDI_PREFER_SUBDEVICE _IOW('U', 0x42, int)
    774 #define SNDRV_CTL_IOCTL_POWER _IOWR('U', 0xd0, int)
    775 #define SNDRV_CTL_IOCTL_POWER_STATE _IOR('U', 0xd1, int)
    776 
    777 enum sndrv_ctl_event_type {
    778  SNDRV_CTL_EVENT_ELEM = 0,
    779  SNDRV_CTL_EVENT_LAST = SNDRV_CTL_EVENT_ELEM,
    780 };
    781 
    782 #define SNDRV_CTL_EVENT_MASK_VALUE (1<<0)
    783 #define SNDRV_CTL_EVENT_MASK_INFO (1<<1)
    784 #define SNDRV_CTL_EVENT_MASK_ADD (1<<2)
    785 #define SNDRV_CTL_EVENT_MASK_TLV (1<<3)
    786 #define SNDRV_CTL_EVENT_MASK_REMOVE (~0U)
    787 
    788 struct snd_ctl_event {
    789  int type;
    790  union {
    791  struct {
    792  unsigned int mask;
    793  struct snd_ctl_elem_id id;
    794  } elem;
    795  unsigned char data8[60];
    796  } data;
    797 };
    798 
    799 #define SNDRV_CTL_NAME_NONE ""
    800 #define SNDRV_CTL_NAME_PLAYBACK "Playback "
    801 #define SNDRV_CTL_NAME_CAPTURE "Capture "
    802 
    803 #define SNDRV_CTL_NAME_IEC958_NONE ""
    804 #define SNDRV_CTL_NAME_IEC958_SWITCH "Switch"
    805 #define SNDRV_CTL_NAME_IEC958_VOLUME "Volume"
    806 #define SNDRV_CTL_NAME_IEC958_DEFAULT "Default"
    807 #define SNDRV_CTL_NAME_IEC958_MASK "Mask"
    808 #define SNDRV_CTL_NAME_IEC958_CON_MASK "Con Mask"
    809 #define SNDRV_CTL_NAME_IEC958_PRO_MASK "Pro Mask"
    810 #define SNDRV_CTL_NAME_IEC958_PCM_STREAM "PCM Stream"
    811 #define SNDRV_CTL_NAME_IEC958(expl,direction,what) "IEC958 " expl SNDRV_CTL_NAME_##direction SNDRV_CTL_NAME_IEC958_##what
    812 
    813 #endif
    814 
    815