00001
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef __ALSA_PCM_H
00030 #define __ALSA_PCM_H
00031
00032 #ifdef __cplusplus
00033 extern "C" {
00034 #endif
00035
00043 #define SND_PCM_DLSYM_VERSION _dlsym_pcm_001
00044
00046 typedef struct _snd_pcm_info snd_pcm_info_t;
00047
00062 typedef struct _snd_pcm_hw_params snd_pcm_hw_params_t;
00063
00065 typedef struct _snd_pcm_sw_params snd_pcm_sw_params_t;
00067 typedef struct _snd_pcm_status snd_pcm_status_t;
00069 typedef struct _snd_pcm_access_mask snd_pcm_access_mask_t;
00071 typedef struct _snd_pcm_format_mask snd_pcm_format_mask_t;
00073 typedef struct _snd_pcm_subformat_mask snd_pcm_subformat_mask_t;
00074
00076 typedef enum _snd_pcm_class {
00079 SND_PCM_CLASS_GENERIC = 0,
00081 SND_PCM_CLASS_MULTI,
00083 SND_PCM_CLASS_MODEM,
00085 SND_PCM_CLASS_DIGITIZER,
00086 SND_PCM_CLASS_LAST = SND_PCM_CLASS_DIGITIZER
00087 } snd_pcm_class_t;
00088
00090 typedef enum _snd_pcm_subclass {
00092 SND_PCM_SUBCLASS_GENERIC_MIX = 0,
00094 SND_PCM_SUBCLASS_MULTI_MIX,
00095 SND_PCM_SUBCLASS_LAST = SND_PCM_SUBCLASS_MULTI_MIX
00096 } snd_pcm_subclass_t;
00097
00099 typedef enum _snd_pcm_stream {
00101 SND_PCM_STREAM_PLAYBACK = 0,
00103 SND_PCM_STREAM_CAPTURE,
00104 SND_PCM_STREAM_LAST = SND_PCM_STREAM_CAPTURE
00105 } snd_pcm_stream_t;
00106
00108 typedef enum _snd_pcm_access {
00110 SND_PCM_ACCESS_MMAP_INTERLEAVED = 0,
00112 SND_PCM_ACCESS_MMAP_NONINTERLEAVED,
00114 SND_PCM_ACCESS_MMAP_COMPLEX,
00116 SND_PCM_ACCESS_RW_INTERLEAVED,
00118 SND_PCM_ACCESS_RW_NONINTERLEAVED,
00119 SND_PCM_ACCESS_LAST = SND_PCM_ACCESS_RW_NONINTERLEAVED
00120 } snd_pcm_access_t;
00121
00123 typedef enum _snd_pcm_format {
00125 SND_PCM_FORMAT_UNKNOWN = -1,
00127 SND_PCM_FORMAT_S8 = 0,
00129 SND_PCM_FORMAT_U8,
00131 SND_PCM_FORMAT_S16_LE,
00133 SND_PCM_FORMAT_S16_BE,
00135 SND_PCM_FORMAT_U16_LE,
00137 SND_PCM_FORMAT_U16_BE,
00139 SND_PCM_FORMAT_S24_LE,
00141 SND_PCM_FORMAT_S24_BE,
00143 SND_PCM_FORMAT_U24_LE,
00145 SND_PCM_FORMAT_U24_BE,
00147 SND_PCM_FORMAT_S32_LE,
00149 SND_PCM_FORMAT_S32_BE,
00151 SND_PCM_FORMAT_U32_LE,
00153 SND_PCM_FORMAT_U32_BE,
00155 SND_PCM_FORMAT_FLOAT_LE,
00157 SND_PCM_FORMAT_FLOAT_BE,
00159 SND_PCM_FORMAT_FLOAT64_LE,
00161 SND_PCM_FORMAT_FLOAT64_BE,
00163 SND_PCM_FORMAT_IEC958_SUBFRAME_LE,
00165 SND_PCM_FORMAT_IEC958_SUBFRAME_BE,
00167 SND_PCM_FORMAT_MU_LAW,
00169 SND_PCM_FORMAT_A_LAW,
00171 SND_PCM_FORMAT_IMA_ADPCM,
00173 SND_PCM_FORMAT_MPEG,
00175 SND_PCM_FORMAT_GSM,
00177 SND_PCM_FORMAT_SPECIAL = 31,
00179 SND_PCM_FORMAT_S24_3LE = 32,
00181 SND_PCM_FORMAT_S24_3BE,
00183 SND_PCM_FORMAT_U24_3LE,
00185 SND_PCM_FORMAT_U24_3BE,
00187 SND_PCM_FORMAT_S20_3LE,
00189 SND_PCM_FORMAT_S20_3BE,
00191 SND_PCM_FORMAT_U20_3LE,
00193 SND_PCM_FORMAT_U20_3BE,
00195 SND_PCM_FORMAT_S18_3LE,
00197 SND_PCM_FORMAT_S18_3BE,
00199 SND_PCM_FORMAT_U18_3LE,
00201 SND_PCM_FORMAT_U18_3BE,
00202
00203 SND_PCM_FORMAT_G723_24,
00204
00205 SND_PCM_FORMAT_G723_24_1B,
00206
00207 SND_PCM_FORMAT_G723_40,
00208
00209 SND_PCM_FORMAT_G723_40_1B,
00210
00211 SND_PCM_FORMAT_DSD_U8,
00212
00213 SND_PCM_FORMAT_DSD_U16_LE,
00214
00215 SND_PCM_FORMAT_DSD_U32_LE,
00216 SND_PCM_FORMAT_LAST = SND_PCM_FORMAT_DSD_U32_LE,
00217
00218 #if __BYTE_ORDER == __LITTLE_ENDIAN
00219
00220 SND_PCM_FORMAT_S16 = SND_PCM_FORMAT_S16_LE,
00222 SND_PCM_FORMAT_U16 = SND_PCM_FORMAT_U16_LE,
00224 SND_PCM_FORMAT_S24 = SND_PCM_FORMAT_S24_LE,
00226 SND_PCM_FORMAT_U24 = SND_PCM_FORMAT_U24_LE,
00228 SND_PCM_FORMAT_S32 = SND_PCM_FORMAT_S32_LE,
00230 SND_PCM_FORMAT_U32 = SND_PCM_FORMAT_U32_LE,
00232 SND_PCM_FORMAT_FLOAT = SND_PCM_FORMAT_FLOAT_LE,
00234 SND_PCM_FORMAT_FLOAT64 = SND_PCM_FORMAT_FLOAT64_LE,
00236 SND_PCM_FORMAT_IEC958_SUBFRAME = SND_PCM_FORMAT_IEC958_SUBFRAME_LE
00237 #elif __BYTE_ORDER == __BIG_ENDIAN
00238
00239 SND_PCM_FORMAT_S16 = SND_PCM_FORMAT_S16_BE,
00241 SND_PCM_FORMAT_U16 = SND_PCM_FORMAT_U16_BE,
00243 SND_PCM_FORMAT_S24 = SND_PCM_FORMAT_S24_BE,
00245 SND_PCM_FORMAT_U24 = SND_PCM_FORMAT_U24_BE,
00247 SND_PCM_FORMAT_S32 = SND_PCM_FORMAT_S32_BE,
00249 SND_PCM_FORMAT_U32 = SND_PCM_FORMAT_U32_BE,
00251 SND_PCM_FORMAT_FLOAT = SND_PCM_FORMAT_FLOAT_BE,
00253 SND_PCM_FORMAT_FLOAT64 = SND_PCM_FORMAT_FLOAT64_BE,
00255 SND_PCM_FORMAT_IEC958_SUBFRAME = SND_PCM_FORMAT_IEC958_SUBFRAME_BE
00256 #else
00257 #error "Unknown endian"
00258 #endif
00259 } snd_pcm_format_t;
00260
00262 typedef enum _snd_pcm_subformat {
00264 SND_PCM_SUBFORMAT_STD = 0,
00265 SND_PCM_SUBFORMAT_LAST = SND_PCM_SUBFORMAT_STD
00266 } snd_pcm_subformat_t;
00267
00269 typedef enum _snd_pcm_state {
00271 SND_PCM_STATE_OPEN = 0,
00273 SND_PCM_STATE_SETUP,
00275 SND_PCM_STATE_PREPARED,
00277 SND_PCM_STATE_RUNNING,
00279 SND_PCM_STATE_XRUN,
00281 SND_PCM_STATE_DRAINING,
00283 SND_PCM_STATE_PAUSED,
00285 SND_PCM_STATE_SUSPENDED,
00287 SND_PCM_STATE_DISCONNECTED,
00288 SND_PCM_STATE_LAST = SND_PCM_STATE_DISCONNECTED
00289 } snd_pcm_state_t;
00290
00292 typedef enum _snd_pcm_start {
00294 SND_PCM_START_DATA = 0,
00296 SND_PCM_START_EXPLICIT,
00297 SND_PCM_START_LAST = SND_PCM_START_EXPLICIT
00298 } snd_pcm_start_t;
00299
00301 typedef enum _snd_pcm_xrun {
00303 SND_PCM_XRUN_NONE = 0,
00305 SND_PCM_XRUN_STOP,
00306 SND_PCM_XRUN_LAST = SND_PCM_XRUN_STOP
00307 } snd_pcm_xrun_t;
00308
00310 typedef enum _snd_pcm_tstamp {
00312 SND_PCM_TSTAMP_NONE = 0,
00314 SND_PCM_TSTAMP_ENABLE,
00318 SND_PCM_TSTAMP_MMAP = SND_PCM_TSTAMP_ENABLE,
00319 SND_PCM_TSTAMP_LAST = SND_PCM_TSTAMP_ENABLE
00320 } snd_pcm_tstamp_t;
00321
00322 typedef enum _snd_pcm_tstamp_type {
00323 SND_PCM_TSTAMP_TYPE_GETTIMEOFDAY = 0,
00324 SND_PCM_TSTAMP_TYPE_MONOTONIC,
00325 SND_PCM_TSTAMP_TYPE_MONOTONIC_RAW,
00326 SND_PCM_TSTAMP_TYPE_LAST = SND_PCM_TSTAMP_TYPE_MONOTONIC_RAW,
00327 } snd_pcm_tstamp_type_t;
00328
00330 typedef unsigned long snd_pcm_uframes_t;
00332 typedef long snd_pcm_sframes_t;
00333
00335 #define SND_PCM_NONBLOCK 0x00000001
00336
00337 #define SND_PCM_ASYNC 0x00000002
00338
00339 #define SND_PCM_ABORT 0x00008000
00340
00341 #define SND_PCM_NO_AUTO_RESAMPLE 0x00010000
00342
00343 #define SND_PCM_NO_AUTO_CHANNELS 0x00020000
00344
00345 #define SND_PCM_NO_AUTO_FORMAT 0x00040000
00346
00347 #define SND_PCM_NO_SOFTVOL 0x00080000
00348
00350 typedef struct _snd_pcm snd_pcm_t;
00351
00353 enum _snd_pcm_type {
00355 SND_PCM_TYPE_HW = 0,
00357 SND_PCM_TYPE_HOOKS,
00360 SND_PCM_TYPE_MULTI,
00362 SND_PCM_TYPE_FILE,
00364 SND_PCM_TYPE_NULL,
00366 SND_PCM_TYPE_SHM,
00368 SND_PCM_TYPE_INET,
00370 SND_PCM_TYPE_COPY,
00372 SND_PCM_TYPE_LINEAR,
00374 SND_PCM_TYPE_ALAW,
00376 SND_PCM_TYPE_MULAW,
00378 SND_PCM_TYPE_ADPCM,
00380 SND_PCM_TYPE_RATE,
00382 SND_PCM_TYPE_ROUTE,
00384 SND_PCM_TYPE_PLUG,
00386 SND_PCM_TYPE_SHARE,
00388 SND_PCM_TYPE_METER,
00390 SND_PCM_TYPE_MIX,
00392 SND_PCM_TYPE_DROUTE,
00394 SND_PCM_TYPE_LBSERVER,
00396 SND_PCM_TYPE_LINEAR_FLOAT,
00398 SND_PCM_TYPE_LADSPA,
00400 SND_PCM_TYPE_DMIX,
00402 SND_PCM_TYPE_JACK,
00404 SND_PCM_TYPE_DSNOOP,
00406 SND_PCM_TYPE_DSHARE,
00408 SND_PCM_TYPE_IEC958,
00410 SND_PCM_TYPE_SOFTVOL,
00412 SND_PCM_TYPE_IOPLUG,
00414 SND_PCM_TYPE_EXTPLUG,
00416 SND_PCM_TYPE_MMAP_EMUL,
00417 SND_PCM_TYPE_LAST = SND_PCM_TYPE_MMAP_EMUL
00418 };
00419
00421 typedef enum _snd_pcm_type snd_pcm_type_t;
00422
00424 typedef struct _snd_pcm_channel_area {
00426 void *addr;
00428 unsigned int first;
00430 unsigned int step;
00431 } snd_pcm_channel_area_t;
00432
00434 typedef union _snd_pcm_sync_id {
00436 unsigned char id[16];
00438 unsigned short id16[8];
00440 unsigned int id32[4];
00441 } snd_pcm_sync_id_t;
00442
00444 typedef struct _snd_pcm_scope snd_pcm_scope_t;
00445
00446 int snd_pcm_open(snd_pcm_t **pcm, const char *name,
00447 snd_pcm_stream_t stream, int mode);
00448 int snd_pcm_open_lconf(snd_pcm_t **pcm, const char *name,
00449 snd_pcm_stream_t stream, int mode,
00450 snd_config_t *lconf);
00451 int snd_pcm_open_fallback(snd_pcm_t **pcm, snd_config_t *root,
00452 const char *name, const char *orig_name,
00453 snd_pcm_stream_t stream, int mode);
00454
00455 int snd_pcm_close(snd_pcm_t *pcm);
00456 const char *snd_pcm_name(snd_pcm_t *pcm);
00457 snd_pcm_type_t snd_pcm_type(snd_pcm_t *pcm);
00458 snd_pcm_stream_t snd_pcm_stream(snd_pcm_t *pcm);
00459 int snd_pcm_poll_descriptors_count(snd_pcm_t *pcm);
00460 int snd_pcm_poll_descriptors(snd_pcm_t *pcm, struct pollfd *pfds, unsigned int space);
00461 int snd_pcm_poll_descriptors_revents(snd_pcm_t *pcm, struct pollfd *pfds, unsigned int nfds, unsigned short *revents);
00462 int snd_pcm_nonblock(snd_pcm_t *pcm, int nonblock);
00463 static __inline__ int snd_pcm_abort(snd_pcm_t *pcm) { return snd_pcm_nonblock(pcm, 2); }
00464 int snd_async_add_pcm_handler(snd_async_handler_t **handler, snd_pcm_t *pcm,
00465 snd_async_callback_t callback, void *private_data);
00466 snd_pcm_t *snd_async_handler_get_pcm(snd_async_handler_t *handler);
00467 int snd_pcm_info(snd_pcm_t *pcm, snd_pcm_info_t *info);
00468 int snd_pcm_hw_params_current(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
00469 int snd_pcm_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
00470 int snd_pcm_hw_free(snd_pcm_t *pcm);
00471 int snd_pcm_sw_params_current(snd_pcm_t *pcm, snd_pcm_sw_params_t *params);
00472 int snd_pcm_sw_params(snd_pcm_t *pcm, snd_pcm_sw_params_t *params);
00473 int snd_pcm_prepare(snd_pcm_t *pcm);
00474 int snd_pcm_reset(snd_pcm_t *pcm);
00475 int snd_pcm_status(snd_pcm_t *pcm, snd_pcm_status_t *status);
00476 int snd_pcm_start(snd_pcm_t *pcm);
00477 int snd_pcm_drop(snd_pcm_t *pcm);
00478 int snd_pcm_drain(snd_pcm_t *pcm);
00479 int snd_pcm_pause(snd_pcm_t *pcm, int enable);
00480 snd_pcm_state_t snd_pcm_state(snd_pcm_t *pcm);
00481 int snd_pcm_hwsync(snd_pcm_t *pcm);
00482 int snd_pcm_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *delayp);
00483 int snd_pcm_resume(snd_pcm_t *pcm);
00484 int snd_pcm_htimestamp(snd_pcm_t *pcm, snd_pcm_uframes_t *avail, snd_htimestamp_t *tstamp);
00485 snd_pcm_sframes_t snd_pcm_avail(snd_pcm_t *pcm);
00486 snd_pcm_sframes_t snd_pcm_avail_update(snd_pcm_t *pcm);
00487 int snd_pcm_avail_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *availp, snd_pcm_sframes_t *delayp);
00488 snd_pcm_sframes_t snd_pcm_rewindable(snd_pcm_t *pcm);
00489 snd_pcm_sframes_t snd_pcm_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t frames);
00490 snd_pcm_sframes_t snd_pcm_forwardable(snd_pcm_t *pcm);
00491 snd_pcm_sframes_t snd_pcm_forward(snd_pcm_t *pcm, snd_pcm_uframes_t frames);
00492 snd_pcm_sframes_t snd_pcm_writei(snd_pcm_t *pcm, const void *buffer, snd_pcm_uframes_t size);
00493 snd_pcm_sframes_t snd_pcm_readi(snd_pcm_t *pcm, void *buffer, snd_pcm_uframes_t size);
00494 snd_pcm_sframes_t snd_pcm_writen(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size);
00495 snd_pcm_sframes_t snd_pcm_readn(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size);
00496 int snd_pcm_wait(snd_pcm_t *pcm, int timeout);
00497
00498 int snd_pcm_link(snd_pcm_t *pcm1, snd_pcm_t *pcm2);
00499 int snd_pcm_unlink(snd_pcm_t *pcm);
00500
00502 #define SND_CHMAP_API_VERSION ((1 << 16) | (0 << 8) | 1)
00503
00505 enum snd_pcm_chmap_type {
00506 SND_CHMAP_TYPE_NONE = 0,
00507 SND_CHMAP_TYPE_FIXED,
00508 SND_CHMAP_TYPE_VAR,
00509 SND_CHMAP_TYPE_PAIRED,
00510 SND_CHMAP_TYPE_LAST = SND_CHMAP_TYPE_PAIRED,
00511 };
00512
00514 enum snd_pcm_chmap_position {
00515 SND_CHMAP_UNKNOWN = 0,
00516 SND_CHMAP_NA,
00517 SND_CHMAP_MONO,
00518 SND_CHMAP_FL,
00519 SND_CHMAP_FR,
00520 SND_CHMAP_RL,
00521 SND_CHMAP_RR,
00522 SND_CHMAP_FC,
00523 SND_CHMAP_LFE,
00524 SND_CHMAP_SL,
00525 SND_CHMAP_SR,
00526 SND_CHMAP_RC,
00527 SND_CHMAP_FLC,
00528 SND_CHMAP_FRC,
00529 SND_CHMAP_RLC,
00530 SND_CHMAP_RRC,
00531 SND_CHMAP_FLW,
00532 SND_CHMAP_FRW,
00533 SND_CHMAP_FLH,
00534 SND_CHMAP_FCH,
00535 SND_CHMAP_FRH,
00536 SND_CHMAP_TC,
00537 SND_CHMAP_TFL,
00538 SND_CHMAP_TFR,
00539 SND_CHMAP_TFC,
00540 SND_CHMAP_TRL,
00541 SND_CHMAP_TRR,
00542 SND_CHMAP_TRC,
00543 SND_CHMAP_TFLC,
00544 SND_CHMAP_TFRC,
00545 SND_CHMAP_TSL,
00546 SND_CHMAP_TSR,
00547 SND_CHMAP_LLFE,
00548 SND_CHMAP_RLFE,
00549 SND_CHMAP_BC,
00550 SND_CHMAP_BLC,
00551 SND_CHMAP_BRC,
00552 SND_CHMAP_LAST = SND_CHMAP_BRC,
00553 };
00554
00556 #define SND_CHMAP_POSITION_MASK 0xffff
00557
00559 #define SND_CHMAP_PHASE_INVERSE (0x01 << 16)
00560
00561 #define SND_CHMAP_DRIVER_SPEC (0x02 << 16)
00562
00564 typedef struct snd_pcm_chmap {
00565 unsigned int channels;
00566 unsigned int pos[0];
00567 } snd_pcm_chmap_t;
00568
00570 typedef struct snd_pcm_chmap_query {
00571 enum snd_pcm_chmap_type type;
00572 snd_pcm_chmap_t map;
00573 } snd_pcm_chmap_query_t;
00574
00575
00576 snd_pcm_chmap_query_t **snd_pcm_query_chmaps(snd_pcm_t *pcm);
00577 snd_pcm_chmap_query_t **snd_pcm_query_chmaps_from_hw(int card, int dev,
00578 int subdev,
00579 snd_pcm_stream_t stream);
00580 void snd_pcm_free_chmaps(snd_pcm_chmap_query_t **maps);
00581 snd_pcm_chmap_t *snd_pcm_get_chmap(snd_pcm_t *pcm);
00582 int snd_pcm_set_chmap(snd_pcm_t *pcm, const snd_pcm_chmap_t *map);
00583
00584 const char *snd_pcm_chmap_type_name(enum snd_pcm_chmap_type val);
00585 const char *snd_pcm_chmap_name(enum snd_pcm_chmap_position val);
00586 const char *snd_pcm_chmap_long_name(enum snd_pcm_chmap_position val);
00587 int snd_pcm_chmap_print(const snd_pcm_chmap_t *map, size_t maxlen, char *buf);
00588 unsigned int snd_pcm_chmap_from_string(const char *str);
00589 snd_pcm_chmap_t *snd_pcm_chmap_parse_string(const char *str);
00590
00591
00592
00593
00594
00595
00596
00597
00598 int snd_pcm_recover(snd_pcm_t *pcm, int err, int silent);
00599 int snd_pcm_set_params(snd_pcm_t *pcm,
00600 snd_pcm_format_t format,
00601 snd_pcm_access_t access,
00602 unsigned int channels,
00603 unsigned int rate,
00604 int soft_resample,
00605 unsigned int latency);
00606 int snd_pcm_get_params(snd_pcm_t *pcm,
00607 snd_pcm_uframes_t *buffer_size,
00608 snd_pcm_uframes_t *period_size);
00609
00619 size_t snd_pcm_info_sizeof(void);
00624 #define snd_pcm_info_alloca(ptr) __snd_alloca(ptr, snd_pcm_info)
00625 int snd_pcm_info_malloc(snd_pcm_info_t **ptr);
00626 void snd_pcm_info_free(snd_pcm_info_t *obj);
00627 void snd_pcm_info_copy(snd_pcm_info_t *dst, const snd_pcm_info_t *src);
00628 unsigned int snd_pcm_info_get_device(const snd_pcm_info_t *obj);
00629 unsigned int snd_pcm_info_get_subdevice(const snd_pcm_info_t *obj);
00630 snd_pcm_stream_t snd_pcm_info_get_stream(const snd_pcm_info_t *obj);
00631 int snd_pcm_info_get_card(const snd_pcm_info_t *obj);
00632 const char *snd_pcm_info_get_id(const snd_pcm_info_t *obj);
00633 const char *snd_pcm_info_get_name(const snd_pcm_info_t *obj);
00634 const char *snd_pcm_info_get_subdevice_name(const snd_pcm_info_t *obj);
00635 snd_pcm_class_t snd_pcm_info_get_class(const snd_pcm_info_t *obj);
00636 snd_pcm_subclass_t snd_pcm_info_get_subclass(const snd_pcm_info_t *obj);
00637 unsigned int snd_pcm_info_get_subdevices_count(const snd_pcm_info_t *obj);
00638 unsigned int snd_pcm_info_get_subdevices_avail(const snd_pcm_info_t *obj);
00639 snd_pcm_sync_id_t snd_pcm_info_get_sync(const snd_pcm_info_t *obj);
00640 void snd_pcm_info_set_device(snd_pcm_info_t *obj, unsigned int val);
00641 void snd_pcm_info_set_subdevice(snd_pcm_info_t *obj, unsigned int val);
00642 void snd_pcm_info_set_stream(snd_pcm_info_t *obj, snd_pcm_stream_t val);
00643
00653 int snd_pcm_hw_params_any(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
00654
00655 int snd_pcm_hw_params_can_mmap_sample_resolution(const snd_pcm_hw_params_t *params);
00656 int snd_pcm_hw_params_is_double(const snd_pcm_hw_params_t *params);
00657 int snd_pcm_hw_params_is_batch(const snd_pcm_hw_params_t *params);
00658 int snd_pcm_hw_params_is_block_transfer(const snd_pcm_hw_params_t *params);
00659 int snd_pcm_hw_params_is_monotonic(const snd_pcm_hw_params_t *params);
00660 int snd_pcm_hw_params_can_overrange(const snd_pcm_hw_params_t *params);
00661 int snd_pcm_hw_params_can_pause(const snd_pcm_hw_params_t *params);
00662 int snd_pcm_hw_params_can_resume(const snd_pcm_hw_params_t *params);
00663 int snd_pcm_hw_params_is_half_duplex(const snd_pcm_hw_params_t *params);
00664 int snd_pcm_hw_params_is_joint_duplex(const snd_pcm_hw_params_t *params);
00665 int snd_pcm_hw_params_can_sync_start(const snd_pcm_hw_params_t *params);
00666 int snd_pcm_hw_params_can_disable_period_wakeup(const snd_pcm_hw_params_t *params);
00667 int snd_pcm_hw_params_supports_audio_wallclock_ts(const snd_pcm_hw_params_t *params);
00668 int snd_pcm_hw_params_get_rate_numden(const snd_pcm_hw_params_t *params,
00669 unsigned int *rate_num,
00670 unsigned int *rate_den);
00671 int snd_pcm_hw_params_get_sbits(const snd_pcm_hw_params_t *params);
00672 int snd_pcm_hw_params_get_fifo_size(const snd_pcm_hw_params_t *params);
00673
00674 #if 0
00675 typedef struct _snd_pcm_hw_strategy snd_pcm_hw_strategy_t;
00676
00677
00678 typedef struct _snd_pcm_hw_strategy_simple_choices_list {
00679 unsigned int value;
00680 unsigned int badness;
00681 } snd_pcm_hw_strategy_simple_choices_list_t;
00682
00683 int snd_pcm_hw_params_strategy(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
00684 const snd_pcm_hw_strategy_t *strategy,
00685 unsigned int badness_min,
00686 unsigned int badness_max);
00687
00688 void snd_pcm_hw_strategy_free(snd_pcm_hw_strategy_t *strategy);
00689 int snd_pcm_hw_strategy_simple(snd_pcm_hw_strategy_t **strategyp,
00690 unsigned int badness_min,
00691 unsigned int badness_max);
00692 int snd_pcm_hw_params_try_explain_failure(snd_pcm_t *pcm,
00693 snd_pcm_hw_params_t *fail,
00694 snd_pcm_hw_params_t *success,
00695 unsigned int depth,
00696 snd_output_t *out);
00697
00698 #endif
00699
00700 size_t snd_pcm_hw_params_sizeof(void);
00705 #define snd_pcm_hw_params_alloca(ptr) __snd_alloca(ptr, snd_pcm_hw_params)
00706 int snd_pcm_hw_params_malloc(snd_pcm_hw_params_t **ptr);
00707 void snd_pcm_hw_params_free(snd_pcm_hw_params_t *obj);
00708 void snd_pcm_hw_params_copy(snd_pcm_hw_params_t *dst, const snd_pcm_hw_params_t *src);
00709
00710 #if !defined(ALSA_LIBRARY_BUILD) && !defined(ALSA_PCM_OLD_HW_PARAMS_API)
00711
00712 int snd_pcm_hw_params_get_access(const snd_pcm_hw_params_t *params, snd_pcm_access_t *_access);
00713 int snd_pcm_hw_params_test_access(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t _access);
00714 int snd_pcm_hw_params_set_access(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t _access);
00715 int snd_pcm_hw_params_set_access_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t *_access);
00716 int snd_pcm_hw_params_set_access_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t *_access);
00717 int snd_pcm_hw_params_set_access_mask(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_mask_t *mask);
00718 int snd_pcm_hw_params_get_access_mask(snd_pcm_hw_params_t *params, snd_pcm_access_mask_t *mask);
00719
00720 int snd_pcm_hw_params_get_format(const snd_pcm_hw_params_t *params, snd_pcm_format_t *val);
00721 int snd_pcm_hw_params_test_format(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t val);
00722 int snd_pcm_hw_params_set_format(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t val);
00723 int snd_pcm_hw_params_set_format_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t *format);
00724 int snd_pcm_hw_params_set_format_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t *format);
00725 int snd_pcm_hw_params_set_format_mask(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_mask_t *mask);
00726 void snd_pcm_hw_params_get_format_mask(snd_pcm_hw_params_t *params, snd_pcm_format_mask_t *mask);
00727
00728 int snd_pcm_hw_params_get_subformat(const snd_pcm_hw_params_t *params, snd_pcm_subformat_t *subformat);
00729 int snd_pcm_hw_params_test_subformat(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t subformat);
00730 int snd_pcm_hw_params_set_subformat(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t subformat);
00731 int snd_pcm_hw_params_set_subformat_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t *subformat);
00732 int snd_pcm_hw_params_set_subformat_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t *subformat);
00733 int snd_pcm_hw_params_set_subformat_mask(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_mask_t *mask);
00734 void snd_pcm_hw_params_get_subformat_mask(snd_pcm_hw_params_t *params, snd_pcm_subformat_mask_t *mask);
00735
00736 int snd_pcm_hw_params_get_channels(const snd_pcm_hw_params_t *params, unsigned int *val);
00737 int snd_pcm_hw_params_get_channels_min(const snd_pcm_hw_params_t *params, unsigned int *val);
00738 int snd_pcm_hw_params_get_channels_max(const snd_pcm_hw_params_t *params, unsigned int *val);
00739 int snd_pcm_hw_params_test_channels(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
00740 int snd_pcm_hw_params_set_channels(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
00741 int snd_pcm_hw_params_set_channels_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
00742 int snd_pcm_hw_params_set_channels_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
00743 int snd_pcm_hw_params_set_channels_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *min, unsigned int *max);
00744 int snd_pcm_hw_params_set_channels_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
00745 int snd_pcm_hw_params_set_channels_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
00746 int snd_pcm_hw_params_set_channels_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
00747
00748 int snd_pcm_hw_params_get_rate(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00749 int snd_pcm_hw_params_get_rate_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00750 int snd_pcm_hw_params_get_rate_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00751 int snd_pcm_hw_params_test_rate(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
00752 int snd_pcm_hw_params_set_rate(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
00753 int snd_pcm_hw_params_set_rate_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00754 int snd_pcm_hw_params_set_rate_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00755 int snd_pcm_hw_params_set_rate_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *min, int *mindir, unsigned int *max, int *maxdir);
00756 int snd_pcm_hw_params_set_rate_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00757 int snd_pcm_hw_params_set_rate_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00758 int snd_pcm_hw_params_set_rate_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00759 int snd_pcm_hw_params_set_rate_resample(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
00760 int snd_pcm_hw_params_get_rate_resample(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
00761 int snd_pcm_hw_params_set_export_buffer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
00762 int snd_pcm_hw_params_get_export_buffer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
00763 int snd_pcm_hw_params_set_period_wakeup(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
00764 int snd_pcm_hw_params_get_period_wakeup(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
00765
00766 int snd_pcm_hw_params_get_period_time(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00767 int snd_pcm_hw_params_get_period_time_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00768 int snd_pcm_hw_params_get_period_time_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00769 int snd_pcm_hw_params_test_period_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
00770 int snd_pcm_hw_params_set_period_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
00771 int snd_pcm_hw_params_set_period_time_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00772 int snd_pcm_hw_params_set_period_time_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00773 int snd_pcm_hw_params_set_period_time_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *min, int *mindir, unsigned int *max, int *maxdir);
00774 int snd_pcm_hw_params_set_period_time_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00775 int snd_pcm_hw_params_set_period_time_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00776 int snd_pcm_hw_params_set_period_time_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00777
00778 int snd_pcm_hw_params_get_period_size(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *frames, int *dir);
00779 int snd_pcm_hw_params_get_period_size_min(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *frames, int *dir);
00780 int snd_pcm_hw_params_get_period_size_max(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *frames, int *dir);
00781 int snd_pcm_hw_params_test_period_size(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t val, int dir);
00782 int snd_pcm_hw_params_set_period_size(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t val, int dir);
00783 int snd_pcm_hw_params_set_period_size_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val, int *dir);
00784 int snd_pcm_hw_params_set_period_size_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val, int *dir);
00785 int snd_pcm_hw_params_set_period_size_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *min, int *mindir, snd_pcm_uframes_t *max, int *maxdir);
00786 int snd_pcm_hw_params_set_period_size_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val, int *dir);
00787 int snd_pcm_hw_params_set_period_size_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val, int *dir);
00788 int snd_pcm_hw_params_set_period_size_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val, int *dir);
00789 int snd_pcm_hw_params_set_period_size_integer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
00790
00791 int snd_pcm_hw_params_get_periods(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00792 int snd_pcm_hw_params_get_periods_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00793 int snd_pcm_hw_params_get_periods_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00794 int snd_pcm_hw_params_test_periods(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
00795 int snd_pcm_hw_params_set_periods(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
00796 int snd_pcm_hw_params_set_periods_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00797 int snd_pcm_hw_params_set_periods_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00798 int snd_pcm_hw_params_set_periods_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *min, int *mindir, unsigned int *max, int *maxdir);
00799 int snd_pcm_hw_params_set_periods_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00800 int snd_pcm_hw_params_set_periods_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00801 int snd_pcm_hw_params_set_periods_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00802 int snd_pcm_hw_params_set_periods_integer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
00803
00804 int snd_pcm_hw_params_get_buffer_time(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00805 int snd_pcm_hw_params_get_buffer_time_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00806 int snd_pcm_hw_params_get_buffer_time_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00807 int snd_pcm_hw_params_test_buffer_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
00808 int snd_pcm_hw_params_set_buffer_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
00809 int snd_pcm_hw_params_set_buffer_time_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00810 int snd_pcm_hw_params_set_buffer_time_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00811 int snd_pcm_hw_params_set_buffer_time_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *min, int *mindir, unsigned int *max, int *maxdir);
00812 int snd_pcm_hw_params_set_buffer_time_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00813 int snd_pcm_hw_params_set_buffer_time_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00814 int snd_pcm_hw_params_set_buffer_time_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00815
00816 int snd_pcm_hw_params_get_buffer_size(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
00817 int snd_pcm_hw_params_get_buffer_size_min(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
00818 int snd_pcm_hw_params_get_buffer_size_max(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
00819 int snd_pcm_hw_params_test_buffer_size(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t val);
00820 int snd_pcm_hw_params_set_buffer_size(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t val);
00821 int snd_pcm_hw_params_set_buffer_size_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
00822 int snd_pcm_hw_params_set_buffer_size_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
00823 int snd_pcm_hw_params_set_buffer_size_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *min, snd_pcm_uframes_t *max);
00824 int snd_pcm_hw_params_set_buffer_size_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
00825 int snd_pcm_hw_params_set_buffer_size_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
00826 int snd_pcm_hw_params_set_buffer_size_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
00827
00828 #endif
00829
00830 int snd_pcm_hw_params_get_min_align(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
00831
00841 size_t snd_pcm_sw_params_sizeof(void);
00846 #define snd_pcm_sw_params_alloca(ptr) __snd_alloca(ptr, snd_pcm_sw_params)
00847 int snd_pcm_sw_params_malloc(snd_pcm_sw_params_t **ptr);
00848 void snd_pcm_sw_params_free(snd_pcm_sw_params_t *obj);
00849 void snd_pcm_sw_params_copy(snd_pcm_sw_params_t *dst, const snd_pcm_sw_params_t *src);
00850 int snd_pcm_sw_params_get_boundary(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val);
00851
00852 #if !defined(ALSA_LIBRARY_BUILD) && !defined(ALSA_PCM_OLD_SW_PARAMS_API)
00853
00854 int snd_pcm_sw_params_set_tstamp_mode(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_tstamp_t val);
00855 int snd_pcm_sw_params_get_tstamp_mode(const snd_pcm_sw_params_t *params, snd_pcm_tstamp_t *val);
00856 int snd_pcm_sw_params_set_tstamp_type(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_tstamp_type_t val);
00857 int snd_pcm_sw_params_get_tstamp_type(const snd_pcm_sw_params_t *params, snd_pcm_tstamp_type_t *val);
00858 int snd_pcm_sw_params_set_avail_min(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
00859 int snd_pcm_sw_params_get_avail_min(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val);
00860 int snd_pcm_sw_params_set_period_event(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, int val);
00861 int snd_pcm_sw_params_get_period_event(const snd_pcm_sw_params_t *params, int *val);
00862 int snd_pcm_sw_params_set_start_threshold(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
00863 int snd_pcm_sw_params_get_start_threshold(const snd_pcm_sw_params_t *paramsm, snd_pcm_uframes_t *val);
00864 int snd_pcm_sw_params_set_stop_threshold(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
00865 int snd_pcm_sw_params_get_stop_threshold(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val);
00866 int snd_pcm_sw_params_set_silence_threshold(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
00867 int snd_pcm_sw_params_get_silence_threshold(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val);
00868 int snd_pcm_sw_params_set_silence_size(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
00869 int snd_pcm_sw_params_get_silence_size(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val);
00870
00871 #endif
00872
00875
00876 #ifndef ALSA_LIBRARY_BUILD
00877 #if defined(ALSA_PCM_OLD_HW_PARAMS_API) || defined(ALSA_PCM_OLD_SW_PARAMS_API)
00878 #include "pcm_old.h"
00879 #endif
00880 #endif
00881
00889 size_t snd_pcm_access_mask_sizeof(void);
00894 #define snd_pcm_access_mask_alloca(ptr) __snd_alloca(ptr, snd_pcm_access_mask)
00895 int snd_pcm_access_mask_malloc(snd_pcm_access_mask_t **ptr);
00896 void snd_pcm_access_mask_free(snd_pcm_access_mask_t *obj);
00897 void snd_pcm_access_mask_copy(snd_pcm_access_mask_t *dst, const snd_pcm_access_mask_t *src);
00898 void snd_pcm_access_mask_none(snd_pcm_access_mask_t *mask);
00899 void snd_pcm_access_mask_any(snd_pcm_access_mask_t *mask);
00900 int snd_pcm_access_mask_test(const snd_pcm_access_mask_t *mask, snd_pcm_access_t val);
00901 int snd_pcm_access_mask_empty(const snd_pcm_access_mask_t *mask);
00902 void snd_pcm_access_mask_set(snd_pcm_access_mask_t *mask, snd_pcm_access_t val);
00903 void snd_pcm_access_mask_reset(snd_pcm_access_mask_t *mask, snd_pcm_access_t val);
00904
00914 size_t snd_pcm_format_mask_sizeof(void);
00919 #define snd_pcm_format_mask_alloca(ptr) __snd_alloca(ptr, snd_pcm_format_mask)
00920 int snd_pcm_format_mask_malloc(snd_pcm_format_mask_t **ptr);
00921 void snd_pcm_format_mask_free(snd_pcm_format_mask_t *obj);
00922 void snd_pcm_format_mask_copy(snd_pcm_format_mask_t *dst, const snd_pcm_format_mask_t *src);
00923 void snd_pcm_format_mask_none(snd_pcm_format_mask_t *mask);
00924 void snd_pcm_format_mask_any(snd_pcm_format_mask_t *mask);
00925 int snd_pcm_format_mask_test(const snd_pcm_format_mask_t *mask, snd_pcm_format_t val);
00926 int snd_pcm_format_mask_empty(const snd_pcm_format_mask_t *mask);
00927 void snd_pcm_format_mask_set(snd_pcm_format_mask_t *mask, snd_pcm_format_t val);
00928 void snd_pcm_format_mask_reset(snd_pcm_format_mask_t *mask, snd_pcm_format_t val);
00929
00939 size_t snd_pcm_subformat_mask_sizeof(void);
00944 #define snd_pcm_subformat_mask_alloca(ptr) __snd_alloca(ptr, snd_pcm_subformat_mask)
00945 int snd_pcm_subformat_mask_malloc(snd_pcm_subformat_mask_t **ptr);
00946 void snd_pcm_subformat_mask_free(snd_pcm_subformat_mask_t *obj);
00947 void snd_pcm_subformat_mask_copy(snd_pcm_subformat_mask_t *dst, const snd_pcm_subformat_mask_t *src);
00948 void snd_pcm_subformat_mask_none(snd_pcm_subformat_mask_t *mask);
00949 void snd_pcm_subformat_mask_any(snd_pcm_subformat_mask_t *mask);
00950 int snd_pcm_subformat_mask_test(const snd_pcm_subformat_mask_t *mask, snd_pcm_subformat_t val);
00951 int snd_pcm_subformat_mask_empty(const snd_pcm_subformat_mask_t *mask);
00952 void snd_pcm_subformat_mask_set(snd_pcm_subformat_mask_t *mask, snd_pcm_subformat_t val);
00953 void snd_pcm_subformat_mask_reset(snd_pcm_subformat_mask_t *mask, snd_pcm_subformat_t val);
00954
00964 size_t snd_pcm_status_sizeof(void);
00969 #define snd_pcm_status_alloca(ptr) __snd_alloca(ptr, snd_pcm_status)
00970 int snd_pcm_status_malloc(snd_pcm_status_t **ptr);
00971 void snd_pcm_status_free(snd_pcm_status_t *obj);
00972 void snd_pcm_status_copy(snd_pcm_status_t *dst, const snd_pcm_status_t *src);
00973 snd_pcm_state_t snd_pcm_status_get_state(const snd_pcm_status_t *obj);
00974 void snd_pcm_status_get_trigger_tstamp(const snd_pcm_status_t *obj, snd_timestamp_t *ptr);
00975 void snd_pcm_status_get_trigger_htstamp(const snd_pcm_status_t *obj, snd_htimestamp_t *ptr);
00976 void snd_pcm_status_get_tstamp(const snd_pcm_status_t *obj, snd_timestamp_t *ptr);
00977 void snd_pcm_status_get_htstamp(const snd_pcm_status_t *obj, snd_htimestamp_t *ptr);
00978 void snd_pcm_status_get_audio_htstamp(const snd_pcm_status_t *obj, snd_htimestamp_t *ptr);
00979 snd_pcm_sframes_t snd_pcm_status_get_delay(const snd_pcm_status_t *obj);
00980 snd_pcm_uframes_t snd_pcm_status_get_avail(const snd_pcm_status_t *obj);
00981 snd_pcm_uframes_t snd_pcm_status_get_avail_max(const snd_pcm_status_t *obj);
00982 snd_pcm_uframes_t snd_pcm_status_get_overrange(const snd_pcm_status_t *obj);
00983
00993 const char *snd_pcm_type_name(snd_pcm_type_t type);
00994 const char *snd_pcm_stream_name(const snd_pcm_stream_t stream);
00995 const char *snd_pcm_access_name(const snd_pcm_access_t _access);
00996 const char *snd_pcm_format_name(const snd_pcm_format_t format);
00997 const char *snd_pcm_format_description(const snd_pcm_format_t format);
00998 const char *snd_pcm_subformat_name(const snd_pcm_subformat_t subformat);
00999 const char *snd_pcm_subformat_description(const snd_pcm_subformat_t subformat);
01000 snd_pcm_format_t snd_pcm_format_value(const char* name);
01001 const char *snd_pcm_tstamp_mode_name(const snd_pcm_tstamp_t mode);
01002 const char *snd_pcm_state_name(const snd_pcm_state_t state);
01003
01013 int snd_pcm_dump(snd_pcm_t *pcm, snd_output_t *out);
01014 int snd_pcm_dump_hw_setup(snd_pcm_t *pcm, snd_output_t *out);
01015 int snd_pcm_dump_sw_setup(snd_pcm_t *pcm, snd_output_t *out);
01016 int snd_pcm_dump_setup(snd_pcm_t *pcm, snd_output_t *out);
01017 int snd_pcm_hw_params_dump(snd_pcm_hw_params_t *params, snd_output_t *out);
01018 int snd_pcm_sw_params_dump(snd_pcm_sw_params_t *params, snd_output_t *out);
01019 int snd_pcm_status_dump(snd_pcm_status_t *status, snd_output_t *out);
01020
01030 int snd_pcm_mmap_begin(snd_pcm_t *pcm,
01031 const snd_pcm_channel_area_t **areas,
01032 snd_pcm_uframes_t *offset,
01033 snd_pcm_uframes_t *frames);
01034 snd_pcm_sframes_t snd_pcm_mmap_commit(snd_pcm_t *pcm,
01035 snd_pcm_uframes_t offset,
01036 snd_pcm_uframes_t frames);
01037 snd_pcm_sframes_t snd_pcm_mmap_writei(snd_pcm_t *pcm, const void *buffer, snd_pcm_uframes_t size);
01038 snd_pcm_sframes_t snd_pcm_mmap_readi(snd_pcm_t *pcm, void *buffer, snd_pcm_uframes_t size);
01039 snd_pcm_sframes_t snd_pcm_mmap_writen(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size);
01040 snd_pcm_sframes_t snd_pcm_mmap_readn(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size);
01041
01051 int snd_pcm_format_signed(snd_pcm_format_t format);
01052 int snd_pcm_format_unsigned(snd_pcm_format_t format);
01053 int snd_pcm_format_linear(snd_pcm_format_t format);
01054 int snd_pcm_format_float(snd_pcm_format_t format);
01055 int snd_pcm_format_little_endian(snd_pcm_format_t format);
01056 int snd_pcm_format_big_endian(snd_pcm_format_t format);
01057 int snd_pcm_format_cpu_endian(snd_pcm_format_t format);
01058 int snd_pcm_format_width(snd_pcm_format_t format);
01059 int snd_pcm_format_physical_width(snd_pcm_format_t format);
01060 snd_pcm_format_t snd_pcm_build_linear_format(int width, int pwidth, int unsignd, int big_endian);
01061 ssize_t snd_pcm_format_size(snd_pcm_format_t format, size_t samples);
01062 u_int8_t snd_pcm_format_silence(snd_pcm_format_t format);
01063 u_int16_t snd_pcm_format_silence_16(snd_pcm_format_t format);
01064 u_int32_t snd_pcm_format_silence_32(snd_pcm_format_t format);
01065 u_int64_t snd_pcm_format_silence_64(snd_pcm_format_t format);
01066 int snd_pcm_format_set_silence(snd_pcm_format_t format, void *buf, unsigned int samples);
01067
01068 snd_pcm_sframes_t snd_pcm_bytes_to_frames(snd_pcm_t *pcm, ssize_t bytes);
01069 ssize_t snd_pcm_frames_to_bytes(snd_pcm_t *pcm, snd_pcm_sframes_t frames);
01070 long snd_pcm_bytes_to_samples(snd_pcm_t *pcm, ssize_t bytes);
01071 ssize_t snd_pcm_samples_to_bytes(snd_pcm_t *pcm, long samples);
01072
01073 int snd_pcm_area_silence(const snd_pcm_channel_area_t *dst_channel, snd_pcm_uframes_t dst_offset,
01074 unsigned int samples, snd_pcm_format_t format);
01075 int snd_pcm_areas_silence(const snd_pcm_channel_area_t *dst_channels, snd_pcm_uframes_t dst_offset,
01076 unsigned int channels, snd_pcm_uframes_t frames, snd_pcm_format_t format);
01077 int snd_pcm_area_copy(const snd_pcm_channel_area_t *dst_channel, snd_pcm_uframes_t dst_offset,
01078 const snd_pcm_channel_area_t *src_channel, snd_pcm_uframes_t src_offset,
01079 unsigned int samples, snd_pcm_format_t format);
01080 int snd_pcm_areas_copy(const snd_pcm_channel_area_t *dst_channels, snd_pcm_uframes_t dst_offset,
01081 const snd_pcm_channel_area_t *src_channels, snd_pcm_uframes_t src_offset,
01082 unsigned int channels, snd_pcm_uframes_t frames, snd_pcm_format_t format);
01083
01094 typedef enum _snd_pcm_hook_type {
01095 SND_PCM_HOOK_TYPE_HW_PARAMS = 0,
01096 SND_PCM_HOOK_TYPE_HW_FREE,
01097 SND_PCM_HOOK_TYPE_CLOSE,
01098 SND_PCM_HOOK_TYPE_LAST = SND_PCM_HOOK_TYPE_CLOSE
01099 } snd_pcm_hook_type_t;
01100
01102 typedef struct _snd_pcm_hook snd_pcm_hook_t;
01104 typedef int (*snd_pcm_hook_func_t)(snd_pcm_hook_t *hook);
01105 snd_pcm_t *snd_pcm_hook_get_pcm(snd_pcm_hook_t *hook);
01106 void *snd_pcm_hook_get_private(snd_pcm_hook_t *hook);
01107 void snd_pcm_hook_set_private(snd_pcm_hook_t *hook, void *private_data);
01108 int snd_pcm_hook_add(snd_pcm_hook_t **hookp, snd_pcm_t *pcm,
01109 snd_pcm_hook_type_t type,
01110 snd_pcm_hook_func_t func, void *private_data);
01111 int snd_pcm_hook_remove(snd_pcm_hook_t *hook);
01112
01123 typedef struct _snd_pcm_scope_ops {
01127 int (*enable)(snd_pcm_scope_t *scope);
01131 void (*disable)(snd_pcm_scope_t *scope);
01135 void (*start)(snd_pcm_scope_t *scope);
01139 void (*stop)(snd_pcm_scope_t *scope);
01143 void (*update)(snd_pcm_scope_t *scope);
01147 void (*reset)(snd_pcm_scope_t *scope);
01151 void (*close)(snd_pcm_scope_t *scope);
01152 } snd_pcm_scope_ops_t;
01153
01154 snd_pcm_uframes_t snd_pcm_meter_get_bufsize(snd_pcm_t *pcm);
01155 unsigned int snd_pcm_meter_get_channels(snd_pcm_t *pcm);
01156 unsigned int snd_pcm_meter_get_rate(snd_pcm_t *pcm);
01157 snd_pcm_uframes_t snd_pcm_meter_get_now(snd_pcm_t *pcm);
01158 snd_pcm_uframes_t snd_pcm_meter_get_boundary(snd_pcm_t *pcm);
01159 int snd_pcm_meter_add_scope(snd_pcm_t *pcm, snd_pcm_scope_t *scope);
01160 snd_pcm_scope_t *snd_pcm_meter_search_scope(snd_pcm_t *pcm, const char *name);
01161 int snd_pcm_scope_malloc(snd_pcm_scope_t **ptr);
01162 void snd_pcm_scope_set_ops(snd_pcm_scope_t *scope,
01163 const snd_pcm_scope_ops_t *val);
01164 void snd_pcm_scope_set_name(snd_pcm_scope_t *scope, const char *val);
01165 const char *snd_pcm_scope_get_name(snd_pcm_scope_t *scope);
01166 void *snd_pcm_scope_get_callback_private(snd_pcm_scope_t *scope);
01167 void snd_pcm_scope_set_callback_private(snd_pcm_scope_t *scope, void *val);
01168 int snd_pcm_scope_s16_open(snd_pcm_t *pcm, const char *name,
01169 snd_pcm_scope_t **scopep);
01170 int16_t *snd_pcm_scope_s16_get_channel_buffer(snd_pcm_scope_t *scope,
01171 unsigned int channel);
01172
01183 typedef enum _snd_spcm_latency {
01186 SND_SPCM_LATENCY_STANDARD = 0,
01189 SND_SPCM_LATENCY_MEDIUM,
01192 SND_SPCM_LATENCY_REALTIME
01193 } snd_spcm_latency_t;
01194
01196 typedef enum _snd_spcm_xrun_type {
01198 SND_SPCM_XRUN_IGNORE = 0,
01200 SND_SPCM_XRUN_STOP
01201 } snd_spcm_xrun_type_t;
01202
01204 typedef enum _snd_spcm_duplex_type {
01206 SND_SPCM_DUPLEX_LIBERAL = 0,
01208 SND_SPCM_DUPLEX_PEDANTIC
01209 } snd_spcm_duplex_type_t;
01210
01211 int snd_spcm_init(snd_pcm_t *pcm,
01212 unsigned int rate,
01213 unsigned int channels,
01214 snd_pcm_format_t format,
01215 snd_pcm_subformat_t subformat,
01216 snd_spcm_latency_t latency,
01217 snd_pcm_access_t _access,
01218 snd_spcm_xrun_type_t xrun_type);
01219
01220 int snd_spcm_init_duplex(snd_pcm_t *playback_pcm,
01221 snd_pcm_t *capture_pcm,
01222 unsigned int rate,
01223 unsigned int channels,
01224 snd_pcm_format_t format,
01225 snd_pcm_subformat_t subformat,
01226 snd_spcm_latency_t latency,
01227 snd_pcm_access_t _access,
01228 snd_spcm_xrun_type_t xrun_type,
01229 snd_spcm_duplex_type_t duplex_type);
01230
01231 int snd_spcm_init_get_params(snd_pcm_t *pcm,
01232 unsigned int *rate,
01233 snd_pcm_uframes_t *buffer_size,
01234 snd_pcm_uframes_t *period_size);
01235
01245
01246 const char *snd_pcm_start_mode_name(snd_pcm_start_t mode) __attribute__((deprecated));
01247 const char *snd_pcm_xrun_mode_name(snd_pcm_xrun_t mode) __attribute__((deprecated));
01248 int snd_pcm_sw_params_set_start_mode(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_start_t val) __attribute__((deprecated));
01249 snd_pcm_start_t snd_pcm_sw_params_get_start_mode(const snd_pcm_sw_params_t *params) __attribute__((deprecated));
01250 int snd_pcm_sw_params_set_xrun_mode(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_xrun_t val) __attribute__((deprecated));
01251 snd_pcm_xrun_t snd_pcm_sw_params_get_xrun_mode(const snd_pcm_sw_params_t *params) __attribute__((deprecated));
01252 #if !defined(ALSA_LIBRARY_BUILD) && !defined(ALSA_PCM_OLD_SW_PARAMS_API)
01253 int snd_pcm_sw_params_set_xfer_align(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val) __attribute__((deprecated));
01254 int snd_pcm_sw_params_get_xfer_align(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val) __attribute__((deprecated));
01255 int snd_pcm_sw_params_set_sleep_min(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, unsigned int val) __attribute__((deprecated));
01256 int snd_pcm_sw_params_get_sleep_min(const snd_pcm_sw_params_t *params, unsigned int *val) __attribute__((deprecated));
01257 #endif
01258 #if !defined(ALSA_LIBRARY_BUILD) && !defined(ALSA_PCM_OLD_HW_PARAMS_API)
01259 int snd_pcm_hw_params_get_tick_time(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir) __attribute__((deprecated));
01260 int snd_pcm_hw_params_get_tick_time_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir) __attribute__((deprecated));
01261 int snd_pcm_hw_params_get_tick_time_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir) __attribute__((deprecated));
01262 int snd_pcm_hw_params_test_tick_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir) __attribute__((deprecated));
01263 int snd_pcm_hw_params_set_tick_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir) __attribute__((deprecated));
01264 int snd_pcm_hw_params_set_tick_time_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir) __attribute__((deprecated));
01265 int snd_pcm_hw_params_set_tick_time_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir) __attribute__((deprecated));
01266 int snd_pcm_hw_params_set_tick_time_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *min, int *mindir, unsigned int *max, int *maxdir) __attribute__((deprecated));
01267 int snd_pcm_hw_params_set_tick_time_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir) __attribute__((deprecated));
01268 int snd_pcm_hw_params_set_tick_time_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir) __attribute__((deprecated));
01269 int snd_pcm_hw_params_set_tick_time_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir) __attribute__((deprecated));
01270 #endif
01271
01274 #ifdef __cplusplus
01275 }
01276 #endif
01277
01278 #endif