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 SND_PCM_FORMAT_LAST = SND_PCM_FORMAT_DSD_U16_LE,
00215
00216 #if __BYTE_ORDER == __LITTLE_ENDIAN
00217
00218 SND_PCM_FORMAT_S16 = SND_PCM_FORMAT_S16_LE,
00220 SND_PCM_FORMAT_U16 = SND_PCM_FORMAT_U16_LE,
00222 SND_PCM_FORMAT_S24 = SND_PCM_FORMAT_S24_LE,
00224 SND_PCM_FORMAT_U24 = SND_PCM_FORMAT_U24_LE,
00226 SND_PCM_FORMAT_S32 = SND_PCM_FORMAT_S32_LE,
00228 SND_PCM_FORMAT_U32 = SND_PCM_FORMAT_U32_LE,
00230 SND_PCM_FORMAT_FLOAT = SND_PCM_FORMAT_FLOAT_LE,
00232 SND_PCM_FORMAT_FLOAT64 = SND_PCM_FORMAT_FLOAT64_LE,
00234 SND_PCM_FORMAT_IEC958_SUBFRAME = SND_PCM_FORMAT_IEC958_SUBFRAME_LE
00235 #elif __BYTE_ORDER == __BIG_ENDIAN
00236
00237 SND_PCM_FORMAT_S16 = SND_PCM_FORMAT_S16_BE,
00239 SND_PCM_FORMAT_U16 = SND_PCM_FORMAT_U16_BE,
00241 SND_PCM_FORMAT_S24 = SND_PCM_FORMAT_S24_BE,
00243 SND_PCM_FORMAT_U24 = SND_PCM_FORMAT_U24_BE,
00245 SND_PCM_FORMAT_S32 = SND_PCM_FORMAT_S32_BE,
00247 SND_PCM_FORMAT_U32 = SND_PCM_FORMAT_U32_BE,
00249 SND_PCM_FORMAT_FLOAT = SND_PCM_FORMAT_FLOAT_BE,
00251 SND_PCM_FORMAT_FLOAT64 = SND_PCM_FORMAT_FLOAT64_BE,
00253 SND_PCM_FORMAT_IEC958_SUBFRAME = SND_PCM_FORMAT_IEC958_SUBFRAME_BE
00254 #else
00255 #error "Unknown endian"
00256 #endif
00257 } snd_pcm_format_t;
00258
00260 typedef enum _snd_pcm_subformat {
00262 SND_PCM_SUBFORMAT_STD = 0,
00263 SND_PCM_SUBFORMAT_LAST = SND_PCM_SUBFORMAT_STD
00264 } snd_pcm_subformat_t;
00265
00267 typedef enum _snd_pcm_state {
00269 SND_PCM_STATE_OPEN = 0,
00271 SND_PCM_STATE_SETUP,
00273 SND_PCM_STATE_PREPARED,
00275 SND_PCM_STATE_RUNNING,
00277 SND_PCM_STATE_XRUN,
00279 SND_PCM_STATE_DRAINING,
00281 SND_PCM_STATE_PAUSED,
00283 SND_PCM_STATE_SUSPENDED,
00285 SND_PCM_STATE_DISCONNECTED,
00286 SND_PCM_STATE_LAST = SND_PCM_STATE_DISCONNECTED
00287 } snd_pcm_state_t;
00288
00290 typedef enum _snd_pcm_start {
00292 SND_PCM_START_DATA = 0,
00294 SND_PCM_START_EXPLICIT,
00295 SND_PCM_START_LAST = SND_PCM_START_EXPLICIT
00296 } snd_pcm_start_t;
00297
00299 typedef enum _snd_pcm_xrun {
00301 SND_PCM_XRUN_NONE = 0,
00303 SND_PCM_XRUN_STOP,
00304 SND_PCM_XRUN_LAST = SND_PCM_XRUN_STOP
00305 } snd_pcm_xrun_t;
00306
00308 typedef enum _snd_pcm_tstamp {
00310 SND_PCM_TSTAMP_NONE = 0,
00312 SND_PCM_TSTAMP_ENABLE,
00316 SND_PCM_TSTAMP_MMAP = SND_PCM_TSTAMP_ENABLE,
00317 SND_PCM_TSTAMP_LAST = SND_PCM_TSTAMP_ENABLE
00318 } snd_pcm_tstamp_t;
00319
00321 typedef unsigned long snd_pcm_uframes_t;
00323 typedef long snd_pcm_sframes_t;
00324
00326 #define SND_PCM_NONBLOCK 0x00000001
00327
00328 #define SND_PCM_ASYNC 0x00000002
00329
00330 #define SND_PCM_ABORT 0x00008000
00331
00332 #define SND_PCM_NO_AUTO_RESAMPLE 0x00010000
00333
00334 #define SND_PCM_NO_AUTO_CHANNELS 0x00020000
00335
00336 #define SND_PCM_NO_AUTO_FORMAT 0x00040000
00337
00338 #define SND_PCM_NO_SOFTVOL 0x00080000
00339
00341 typedef struct _snd_pcm snd_pcm_t;
00342
00344 enum _snd_pcm_type {
00346 SND_PCM_TYPE_HW = 0,
00348 SND_PCM_TYPE_HOOKS,
00351 SND_PCM_TYPE_MULTI,
00353 SND_PCM_TYPE_FILE,
00355 SND_PCM_TYPE_NULL,
00357 SND_PCM_TYPE_SHM,
00359 SND_PCM_TYPE_INET,
00361 SND_PCM_TYPE_COPY,
00363 SND_PCM_TYPE_LINEAR,
00365 SND_PCM_TYPE_ALAW,
00367 SND_PCM_TYPE_MULAW,
00369 SND_PCM_TYPE_ADPCM,
00371 SND_PCM_TYPE_RATE,
00373 SND_PCM_TYPE_ROUTE,
00375 SND_PCM_TYPE_PLUG,
00377 SND_PCM_TYPE_SHARE,
00379 SND_PCM_TYPE_METER,
00381 SND_PCM_TYPE_MIX,
00383 SND_PCM_TYPE_DROUTE,
00385 SND_PCM_TYPE_LBSERVER,
00387 SND_PCM_TYPE_LINEAR_FLOAT,
00389 SND_PCM_TYPE_LADSPA,
00391 SND_PCM_TYPE_DMIX,
00393 SND_PCM_TYPE_JACK,
00395 SND_PCM_TYPE_DSNOOP,
00397 SND_PCM_TYPE_DSHARE,
00399 SND_PCM_TYPE_IEC958,
00401 SND_PCM_TYPE_SOFTVOL,
00403 SND_PCM_TYPE_IOPLUG,
00405 SND_PCM_TYPE_EXTPLUG,
00407 SND_PCM_TYPE_MMAP_EMUL,
00408 SND_PCM_TYPE_LAST = SND_PCM_TYPE_MMAP_EMUL
00409 };
00410
00412 typedef enum _snd_pcm_type snd_pcm_type_t;
00413
00415 typedef struct _snd_pcm_channel_area {
00417 void *addr;
00419 unsigned int first;
00421 unsigned int step;
00422 } snd_pcm_channel_area_t;
00423
00425 typedef union _snd_pcm_sync_id {
00427 unsigned char id[16];
00429 unsigned short id16[8];
00431 unsigned int id32[4];
00432 } snd_pcm_sync_id_t;
00433
00435 typedef struct _snd_pcm_scope snd_pcm_scope_t;
00436
00437 int snd_pcm_open(snd_pcm_t **pcm, const char *name,
00438 snd_pcm_stream_t stream, int mode);
00439 int snd_pcm_open_lconf(snd_pcm_t **pcm, const char *name,
00440 snd_pcm_stream_t stream, int mode,
00441 snd_config_t *lconf);
00442 int snd_pcm_open_fallback(snd_pcm_t **pcm, snd_config_t *root,
00443 const char *name, const char *orig_name,
00444 snd_pcm_stream_t stream, int mode);
00445
00446 int snd_pcm_close(snd_pcm_t *pcm);
00447 const char *snd_pcm_name(snd_pcm_t *pcm);
00448 snd_pcm_type_t snd_pcm_type(snd_pcm_t *pcm);
00449 snd_pcm_stream_t snd_pcm_stream(snd_pcm_t *pcm);
00450 int snd_pcm_poll_descriptors_count(snd_pcm_t *pcm);
00451 int snd_pcm_poll_descriptors(snd_pcm_t *pcm, struct pollfd *pfds, unsigned int space);
00452 int snd_pcm_poll_descriptors_revents(snd_pcm_t *pcm, struct pollfd *pfds, unsigned int nfds, unsigned short *revents);
00453 int snd_pcm_nonblock(snd_pcm_t *pcm, int nonblock);
00454 static __inline__ int snd_pcm_abort(snd_pcm_t *pcm) { return snd_pcm_nonblock(pcm, 2); }
00455 int snd_async_add_pcm_handler(snd_async_handler_t **handler, snd_pcm_t *pcm,
00456 snd_async_callback_t callback, void *private_data);
00457 snd_pcm_t *snd_async_handler_get_pcm(snd_async_handler_t *handler);
00458 int snd_pcm_info(snd_pcm_t *pcm, snd_pcm_info_t *info);
00459 int snd_pcm_hw_params_current(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
00460 int snd_pcm_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
00461 int snd_pcm_hw_free(snd_pcm_t *pcm);
00462 int snd_pcm_sw_params_current(snd_pcm_t *pcm, snd_pcm_sw_params_t *params);
00463 int snd_pcm_sw_params(snd_pcm_t *pcm, snd_pcm_sw_params_t *params);
00464 int snd_pcm_prepare(snd_pcm_t *pcm);
00465 int snd_pcm_reset(snd_pcm_t *pcm);
00466 int snd_pcm_status(snd_pcm_t *pcm, snd_pcm_status_t *status);
00467 int snd_pcm_start(snd_pcm_t *pcm);
00468 int snd_pcm_drop(snd_pcm_t *pcm);
00469 int snd_pcm_drain(snd_pcm_t *pcm);
00470 int snd_pcm_pause(snd_pcm_t *pcm, int enable);
00471 snd_pcm_state_t snd_pcm_state(snd_pcm_t *pcm);
00472 int snd_pcm_hwsync(snd_pcm_t *pcm);
00473 int snd_pcm_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *delayp);
00474 int snd_pcm_resume(snd_pcm_t *pcm);
00475 int snd_pcm_htimestamp(snd_pcm_t *pcm, snd_pcm_uframes_t *avail, snd_htimestamp_t *tstamp);
00476 snd_pcm_sframes_t snd_pcm_avail(snd_pcm_t *pcm);
00477 snd_pcm_sframes_t snd_pcm_avail_update(snd_pcm_t *pcm);
00478 int snd_pcm_avail_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *availp, snd_pcm_sframes_t *delayp);
00479 snd_pcm_sframes_t snd_pcm_rewindable(snd_pcm_t *pcm);
00480 snd_pcm_sframes_t snd_pcm_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t frames);
00481 snd_pcm_sframes_t snd_pcm_forwardable(snd_pcm_t *pcm);
00482 snd_pcm_sframes_t snd_pcm_forward(snd_pcm_t *pcm, snd_pcm_uframes_t frames);
00483 snd_pcm_sframes_t snd_pcm_writei(snd_pcm_t *pcm, const void *buffer, snd_pcm_uframes_t size);
00484 snd_pcm_sframes_t snd_pcm_readi(snd_pcm_t *pcm, void *buffer, snd_pcm_uframes_t size);
00485 snd_pcm_sframes_t snd_pcm_writen(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size);
00486 snd_pcm_sframes_t snd_pcm_readn(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size);
00487 int snd_pcm_wait(snd_pcm_t *pcm, int timeout);
00488
00489 int snd_pcm_link(snd_pcm_t *pcm1, snd_pcm_t *pcm2);
00490 int snd_pcm_unlink(snd_pcm_t *pcm);
00491
00493 #define SND_CHMAP_API_VERSION ((1 << 16) | (0 << 8) | 1)
00494
00496 enum snd_pcm_chmap_type {
00497 SND_CHMAP_TYPE_NONE = 0,
00498 SND_CHMAP_TYPE_FIXED,
00499 SND_CHMAP_TYPE_VAR,
00500 SND_CHMAP_TYPE_PAIRED,
00501 SND_CHMAP_TYPE_LAST = SND_CHMAP_TYPE_PAIRED,
00502 };
00503
00505 enum snd_pcm_chmap_position {
00506 SND_CHMAP_UNKNOWN = 0,
00507 SND_CHMAP_NA,
00508 SND_CHMAP_MONO,
00509 SND_CHMAP_FL,
00510 SND_CHMAP_FR,
00511 SND_CHMAP_RL,
00512 SND_CHMAP_RR,
00513 SND_CHMAP_FC,
00514 SND_CHMAP_LFE,
00515 SND_CHMAP_SL,
00516 SND_CHMAP_SR,
00517 SND_CHMAP_RC,
00518 SND_CHMAP_FLC,
00519 SND_CHMAP_FRC,
00520 SND_CHMAP_RLC,
00521 SND_CHMAP_RRC,
00522 SND_CHMAP_FLW,
00523 SND_CHMAP_FRW,
00524 SND_CHMAP_FLH,
00525 SND_CHMAP_FCH,
00526 SND_CHMAP_FRH,
00527 SND_CHMAP_TC,
00528 SND_CHMAP_TFL,
00529 SND_CHMAP_TFR,
00530 SND_CHMAP_TFC,
00531 SND_CHMAP_TRL,
00532 SND_CHMAP_TRR,
00533 SND_CHMAP_TRC,
00534 SND_CHMAP_TFLC,
00535 SND_CHMAP_TFRC,
00536 SND_CHMAP_TSL,
00537 SND_CHMAP_TSR,
00538 SND_CHMAP_LLFE,
00539 SND_CHMAP_RLFE,
00540 SND_CHMAP_BC,
00541 SND_CHMAP_BLC,
00542 SND_CHMAP_BRC,
00543 SND_CHMAP_LAST = SND_CHMAP_BRC,
00544 };
00545
00547 #define SND_CHMAP_POSITION_MASK 0xffff
00548
00550 #define SND_CHMAP_PHASE_INVERSE (0x01 << 16)
00551
00552 #define SND_CHMAP_DRIVER_SPEC (0x02 << 16)
00553
00555 typedef struct snd_pcm_chmap {
00556 unsigned int channels;
00557 unsigned int pos[0];
00558 } snd_pcm_chmap_t;
00559
00561 typedef struct snd_pcm_chmap_query {
00562 enum snd_pcm_chmap_type type;
00563 snd_pcm_chmap_t map;
00564 } snd_pcm_chmap_query_t;
00565
00566
00567 snd_pcm_chmap_query_t **snd_pcm_query_chmaps(snd_pcm_t *pcm);
00568 snd_pcm_chmap_query_t **snd_pcm_query_chmaps_from_hw(int card, int dev,
00569 int subdev,
00570 snd_pcm_stream_t stream);
00571 void snd_pcm_free_chmaps(snd_pcm_chmap_query_t **maps);
00572 snd_pcm_chmap_t *snd_pcm_get_chmap(snd_pcm_t *pcm);
00573 int snd_pcm_set_chmap(snd_pcm_t *pcm, const snd_pcm_chmap_t *map);
00574
00575 const char *snd_pcm_chmap_type_name(enum snd_pcm_chmap_type val);
00576 const char *snd_pcm_chmap_name(enum snd_pcm_chmap_position val);
00577 const char *snd_pcm_chmap_long_name(enum snd_pcm_chmap_position val);
00578 int snd_pcm_chmap_print(const snd_pcm_chmap_t *map, size_t maxlen, char *buf);
00579 unsigned int snd_pcm_chmap_from_string(const char *str);
00580 snd_pcm_chmap_t *snd_pcm_chmap_parse_string(const char *str);
00581
00582
00583
00584
00585
00586
00587
00588
00589 int snd_pcm_recover(snd_pcm_t *pcm, int err, int silent);
00590 int snd_pcm_set_params(snd_pcm_t *pcm,
00591 snd_pcm_format_t format,
00592 snd_pcm_access_t access,
00593 unsigned int channels,
00594 unsigned int rate,
00595 int soft_resample,
00596 unsigned int latency);
00597 int snd_pcm_get_params(snd_pcm_t *pcm,
00598 snd_pcm_uframes_t *buffer_size,
00599 snd_pcm_uframes_t *period_size);
00600
00610 size_t snd_pcm_info_sizeof(void);
00615 #define snd_pcm_info_alloca(ptr) __snd_alloca(ptr, snd_pcm_info)
00616 int snd_pcm_info_malloc(snd_pcm_info_t **ptr);
00617 void snd_pcm_info_free(snd_pcm_info_t *obj);
00618 void snd_pcm_info_copy(snd_pcm_info_t *dst, const snd_pcm_info_t *src);
00619 unsigned int snd_pcm_info_get_device(const snd_pcm_info_t *obj);
00620 unsigned int snd_pcm_info_get_subdevice(const snd_pcm_info_t *obj);
00621 snd_pcm_stream_t snd_pcm_info_get_stream(const snd_pcm_info_t *obj);
00622 int snd_pcm_info_get_card(const snd_pcm_info_t *obj);
00623 const char *snd_pcm_info_get_id(const snd_pcm_info_t *obj);
00624 const char *snd_pcm_info_get_name(const snd_pcm_info_t *obj);
00625 const char *snd_pcm_info_get_subdevice_name(const snd_pcm_info_t *obj);
00626 snd_pcm_class_t snd_pcm_info_get_class(const snd_pcm_info_t *obj);
00627 snd_pcm_subclass_t snd_pcm_info_get_subclass(const snd_pcm_info_t *obj);
00628 unsigned int snd_pcm_info_get_subdevices_count(const snd_pcm_info_t *obj);
00629 unsigned int snd_pcm_info_get_subdevices_avail(const snd_pcm_info_t *obj);
00630 snd_pcm_sync_id_t snd_pcm_info_get_sync(const snd_pcm_info_t *obj);
00631 void snd_pcm_info_set_device(snd_pcm_info_t *obj, unsigned int val);
00632 void snd_pcm_info_set_subdevice(snd_pcm_info_t *obj, unsigned int val);
00633 void snd_pcm_info_set_stream(snd_pcm_info_t *obj, snd_pcm_stream_t val);
00634
00644 int snd_pcm_hw_params_any(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
00645
00646 int snd_pcm_hw_params_can_mmap_sample_resolution(const snd_pcm_hw_params_t *params);
00647 int snd_pcm_hw_params_is_double(const snd_pcm_hw_params_t *params);
00648 int snd_pcm_hw_params_is_batch(const snd_pcm_hw_params_t *params);
00649 int snd_pcm_hw_params_is_block_transfer(const snd_pcm_hw_params_t *params);
00650 int snd_pcm_hw_params_is_monotonic(const snd_pcm_hw_params_t *params);
00651 int snd_pcm_hw_params_can_overrange(const snd_pcm_hw_params_t *params);
00652 int snd_pcm_hw_params_can_pause(const snd_pcm_hw_params_t *params);
00653 int snd_pcm_hw_params_can_resume(const snd_pcm_hw_params_t *params);
00654 int snd_pcm_hw_params_is_half_duplex(const snd_pcm_hw_params_t *params);
00655 int snd_pcm_hw_params_is_joint_duplex(const snd_pcm_hw_params_t *params);
00656 int snd_pcm_hw_params_can_sync_start(const snd_pcm_hw_params_t *params);
00657 int snd_pcm_hw_params_can_disable_period_wakeup(const snd_pcm_hw_params_t *params);
00658 int snd_pcm_hw_params_supports_audio_wallclock_ts(const snd_pcm_hw_params_t *params);
00659 int snd_pcm_hw_params_get_rate_numden(const snd_pcm_hw_params_t *params,
00660 unsigned int *rate_num,
00661 unsigned int *rate_den);
00662 int snd_pcm_hw_params_get_sbits(const snd_pcm_hw_params_t *params);
00663 int snd_pcm_hw_params_get_fifo_size(const snd_pcm_hw_params_t *params);
00664
00665 #if 0
00666 typedef struct _snd_pcm_hw_strategy snd_pcm_hw_strategy_t;
00667
00668
00669 typedef struct _snd_pcm_hw_strategy_simple_choices_list {
00670 unsigned int value;
00671 unsigned int badness;
00672 } snd_pcm_hw_strategy_simple_choices_list_t;
00673
00674 int snd_pcm_hw_params_strategy(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
00675 const snd_pcm_hw_strategy_t *strategy,
00676 unsigned int badness_min,
00677 unsigned int badness_max);
00678
00679 void snd_pcm_hw_strategy_free(snd_pcm_hw_strategy_t *strategy);
00680 int snd_pcm_hw_strategy_simple(snd_pcm_hw_strategy_t **strategyp,
00681 unsigned int badness_min,
00682 unsigned int badness_max);
00683 int snd_pcm_hw_params_try_explain_failure(snd_pcm_t *pcm,
00684 snd_pcm_hw_params_t *fail,
00685 snd_pcm_hw_params_t *success,
00686 unsigned int depth,
00687 snd_output_t *out);
00688
00689 #endif
00690
00691 size_t snd_pcm_hw_params_sizeof(void);
00696 #define snd_pcm_hw_params_alloca(ptr) __snd_alloca(ptr, snd_pcm_hw_params)
00697 int snd_pcm_hw_params_malloc(snd_pcm_hw_params_t **ptr);
00698 void snd_pcm_hw_params_free(snd_pcm_hw_params_t *obj);
00699 void snd_pcm_hw_params_copy(snd_pcm_hw_params_t *dst, const snd_pcm_hw_params_t *src);
00700
00701 #if !defined(ALSA_LIBRARY_BUILD) && !defined(ALSA_PCM_OLD_HW_PARAMS_API)
00702
00703 int snd_pcm_hw_params_get_access(const snd_pcm_hw_params_t *params, snd_pcm_access_t *_access);
00704 int snd_pcm_hw_params_test_access(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t _access);
00705 int snd_pcm_hw_params_set_access(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t _access);
00706 int snd_pcm_hw_params_set_access_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t *_access);
00707 int snd_pcm_hw_params_set_access_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t *_access);
00708 int snd_pcm_hw_params_set_access_mask(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_mask_t *mask);
00709 int snd_pcm_hw_params_get_access_mask(snd_pcm_hw_params_t *params, snd_pcm_access_mask_t *mask);
00710
00711 int snd_pcm_hw_params_get_format(const snd_pcm_hw_params_t *params, snd_pcm_format_t *val);
00712 int snd_pcm_hw_params_test_format(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t val);
00713 int snd_pcm_hw_params_set_format(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t val);
00714 int snd_pcm_hw_params_set_format_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t *format);
00715 int snd_pcm_hw_params_set_format_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t *format);
00716 int snd_pcm_hw_params_set_format_mask(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_mask_t *mask);
00717 void snd_pcm_hw_params_get_format_mask(snd_pcm_hw_params_t *params, snd_pcm_format_mask_t *mask);
00718
00719 int snd_pcm_hw_params_get_subformat(const snd_pcm_hw_params_t *params, snd_pcm_subformat_t *subformat);
00720 int snd_pcm_hw_params_test_subformat(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t subformat);
00721 int snd_pcm_hw_params_set_subformat(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t subformat);
00722 int snd_pcm_hw_params_set_subformat_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t *subformat);
00723 int snd_pcm_hw_params_set_subformat_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t *subformat);
00724 int snd_pcm_hw_params_set_subformat_mask(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_mask_t *mask);
00725 void snd_pcm_hw_params_get_subformat_mask(snd_pcm_hw_params_t *params, snd_pcm_subformat_mask_t *mask);
00726
00727 int snd_pcm_hw_params_get_channels(const snd_pcm_hw_params_t *params, unsigned int *val);
00728 int snd_pcm_hw_params_get_channels_min(const snd_pcm_hw_params_t *params, unsigned int *val);
00729 int snd_pcm_hw_params_get_channels_max(const snd_pcm_hw_params_t *params, unsigned int *val);
00730 int snd_pcm_hw_params_test_channels(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
00731 int snd_pcm_hw_params_set_channels(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
00732 int snd_pcm_hw_params_set_channels_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
00733 int snd_pcm_hw_params_set_channels_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
00734 int snd_pcm_hw_params_set_channels_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *min, unsigned int *max);
00735 int snd_pcm_hw_params_set_channels_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
00736 int snd_pcm_hw_params_set_channels_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
00737 int snd_pcm_hw_params_set_channels_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
00738
00739 int snd_pcm_hw_params_get_rate(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00740 int snd_pcm_hw_params_get_rate_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00741 int snd_pcm_hw_params_get_rate_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00742 int snd_pcm_hw_params_test_rate(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
00743 int snd_pcm_hw_params_set_rate(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
00744 int snd_pcm_hw_params_set_rate_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00745 int snd_pcm_hw_params_set_rate_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00746 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);
00747 int snd_pcm_hw_params_set_rate_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00748 int snd_pcm_hw_params_set_rate_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00749 int snd_pcm_hw_params_set_rate_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00750 int snd_pcm_hw_params_set_rate_resample(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
00751 int snd_pcm_hw_params_get_rate_resample(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
00752 int snd_pcm_hw_params_set_export_buffer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
00753 int snd_pcm_hw_params_get_export_buffer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
00754 int snd_pcm_hw_params_set_period_wakeup(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
00755 int snd_pcm_hw_params_get_period_wakeup(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
00756
00757 int snd_pcm_hw_params_get_period_time(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00758 int snd_pcm_hw_params_get_period_time_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00759 int snd_pcm_hw_params_get_period_time_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00760 int snd_pcm_hw_params_test_period_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
00761 int snd_pcm_hw_params_set_period_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
00762 int snd_pcm_hw_params_set_period_time_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00763 int snd_pcm_hw_params_set_period_time_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00764 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);
00765 int snd_pcm_hw_params_set_period_time_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00766 int snd_pcm_hw_params_set_period_time_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00767 int snd_pcm_hw_params_set_period_time_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00768
00769 int snd_pcm_hw_params_get_period_size(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *frames, int *dir);
00770 int snd_pcm_hw_params_get_period_size_min(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *frames, int *dir);
00771 int snd_pcm_hw_params_get_period_size_max(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *frames, int *dir);
00772 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);
00773 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);
00774 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);
00775 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);
00776 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);
00777 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);
00778 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);
00779 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);
00780 int snd_pcm_hw_params_set_period_size_integer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
00781
00782 int snd_pcm_hw_params_get_periods(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00783 int snd_pcm_hw_params_get_periods_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00784 int snd_pcm_hw_params_get_periods_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00785 int snd_pcm_hw_params_test_periods(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
00786 int snd_pcm_hw_params_set_periods(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
00787 int snd_pcm_hw_params_set_periods_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00788 int snd_pcm_hw_params_set_periods_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00789 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);
00790 int snd_pcm_hw_params_set_periods_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00791 int snd_pcm_hw_params_set_periods_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00792 int snd_pcm_hw_params_set_periods_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00793 int snd_pcm_hw_params_set_periods_integer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
00794
00795 int snd_pcm_hw_params_get_buffer_time(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00796 int snd_pcm_hw_params_get_buffer_time_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00797 int snd_pcm_hw_params_get_buffer_time_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00798 int snd_pcm_hw_params_test_buffer_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
00799 int snd_pcm_hw_params_set_buffer_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
00800 int snd_pcm_hw_params_set_buffer_time_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00801 int snd_pcm_hw_params_set_buffer_time_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00802 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);
00803 int snd_pcm_hw_params_set_buffer_time_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00804 int snd_pcm_hw_params_set_buffer_time_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00805 int snd_pcm_hw_params_set_buffer_time_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00806
00807 int snd_pcm_hw_params_get_buffer_size(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
00808 int snd_pcm_hw_params_get_buffer_size_min(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
00809 int snd_pcm_hw_params_get_buffer_size_max(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
00810 int snd_pcm_hw_params_test_buffer_size(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t val);
00811 int snd_pcm_hw_params_set_buffer_size(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t val);
00812 int snd_pcm_hw_params_set_buffer_size_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
00813 int snd_pcm_hw_params_set_buffer_size_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
00814 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);
00815 int snd_pcm_hw_params_set_buffer_size_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
00816 int snd_pcm_hw_params_set_buffer_size_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
00817 int snd_pcm_hw_params_set_buffer_size_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
00818
00819 #endif
00820
00821 int snd_pcm_hw_params_get_min_align(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
00822
00832 size_t snd_pcm_sw_params_sizeof(void);
00837 #define snd_pcm_sw_params_alloca(ptr) __snd_alloca(ptr, snd_pcm_sw_params)
00838 int snd_pcm_sw_params_malloc(snd_pcm_sw_params_t **ptr);
00839 void snd_pcm_sw_params_free(snd_pcm_sw_params_t *obj);
00840 void snd_pcm_sw_params_copy(snd_pcm_sw_params_t *dst, const snd_pcm_sw_params_t *src);
00841 int snd_pcm_sw_params_get_boundary(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val);
00842
00843 #if !defined(ALSA_LIBRARY_BUILD) && !defined(ALSA_PCM_OLD_SW_PARAMS_API)
00844
00845 int snd_pcm_sw_params_set_tstamp_mode(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_tstamp_t val);
00846 int snd_pcm_sw_params_get_tstamp_mode(const snd_pcm_sw_params_t *params, snd_pcm_tstamp_t *val);
00847 int snd_pcm_sw_params_set_avail_min(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
00848 int snd_pcm_sw_params_get_avail_min(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val);
00849 int snd_pcm_sw_params_set_period_event(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, int val);
00850 int snd_pcm_sw_params_get_period_event(const snd_pcm_sw_params_t *params, int *val);
00851 int snd_pcm_sw_params_set_start_threshold(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
00852 int snd_pcm_sw_params_get_start_threshold(const snd_pcm_sw_params_t *paramsm, snd_pcm_uframes_t *val);
00853 int snd_pcm_sw_params_set_stop_threshold(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
00854 int snd_pcm_sw_params_get_stop_threshold(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val);
00855 int snd_pcm_sw_params_set_silence_threshold(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
00856 int snd_pcm_sw_params_get_silence_threshold(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val);
00857 int snd_pcm_sw_params_set_silence_size(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
00858 int snd_pcm_sw_params_get_silence_size(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val);
00859
00860 #endif
00861
00864
00865 #ifndef ALSA_LIBRARY_BUILD
00866 #if defined(ALSA_PCM_OLD_HW_PARAMS_API) || defined(ALSA_PCM_OLD_SW_PARAMS_API)
00867 #include "pcm_old.h"
00868 #endif
00869 #endif
00870
00878 size_t snd_pcm_access_mask_sizeof(void);
00883 #define snd_pcm_access_mask_alloca(ptr) __snd_alloca(ptr, snd_pcm_access_mask)
00884 int snd_pcm_access_mask_malloc(snd_pcm_access_mask_t **ptr);
00885 void snd_pcm_access_mask_free(snd_pcm_access_mask_t *obj);
00886 void snd_pcm_access_mask_copy(snd_pcm_access_mask_t *dst, const snd_pcm_access_mask_t *src);
00887 void snd_pcm_access_mask_none(snd_pcm_access_mask_t *mask);
00888 void snd_pcm_access_mask_any(snd_pcm_access_mask_t *mask);
00889 int snd_pcm_access_mask_test(const snd_pcm_access_mask_t *mask, snd_pcm_access_t val);
00890 int snd_pcm_access_mask_empty(const snd_pcm_access_mask_t *mask);
00891 void snd_pcm_access_mask_set(snd_pcm_access_mask_t *mask, snd_pcm_access_t val);
00892 void snd_pcm_access_mask_reset(snd_pcm_access_mask_t *mask, snd_pcm_access_t val);
00893
00903 size_t snd_pcm_format_mask_sizeof(void);
00908 #define snd_pcm_format_mask_alloca(ptr) __snd_alloca(ptr, snd_pcm_format_mask)
00909 int snd_pcm_format_mask_malloc(snd_pcm_format_mask_t **ptr);
00910 void snd_pcm_format_mask_free(snd_pcm_format_mask_t *obj);
00911 void snd_pcm_format_mask_copy(snd_pcm_format_mask_t *dst, const snd_pcm_format_mask_t *src);
00912 void snd_pcm_format_mask_none(snd_pcm_format_mask_t *mask);
00913 void snd_pcm_format_mask_any(snd_pcm_format_mask_t *mask);
00914 int snd_pcm_format_mask_test(const snd_pcm_format_mask_t *mask, snd_pcm_format_t val);
00915 int snd_pcm_format_mask_empty(const snd_pcm_format_mask_t *mask);
00916 void snd_pcm_format_mask_set(snd_pcm_format_mask_t *mask, snd_pcm_format_t val);
00917 void snd_pcm_format_mask_reset(snd_pcm_format_mask_t *mask, snd_pcm_format_t val);
00918
00928 size_t snd_pcm_subformat_mask_sizeof(void);
00933 #define snd_pcm_subformat_mask_alloca(ptr) __snd_alloca(ptr, snd_pcm_subformat_mask)
00934 int snd_pcm_subformat_mask_malloc(snd_pcm_subformat_mask_t **ptr);
00935 void snd_pcm_subformat_mask_free(snd_pcm_subformat_mask_t *obj);
00936 void snd_pcm_subformat_mask_copy(snd_pcm_subformat_mask_t *dst, const snd_pcm_subformat_mask_t *src);
00937 void snd_pcm_subformat_mask_none(snd_pcm_subformat_mask_t *mask);
00938 void snd_pcm_subformat_mask_any(snd_pcm_subformat_mask_t *mask);
00939 int snd_pcm_subformat_mask_test(const snd_pcm_subformat_mask_t *mask, snd_pcm_subformat_t val);
00940 int snd_pcm_subformat_mask_empty(const snd_pcm_subformat_mask_t *mask);
00941 void snd_pcm_subformat_mask_set(snd_pcm_subformat_mask_t *mask, snd_pcm_subformat_t val);
00942 void snd_pcm_subformat_mask_reset(snd_pcm_subformat_mask_t *mask, snd_pcm_subformat_t val);
00943
00953 size_t snd_pcm_status_sizeof(void);
00958 #define snd_pcm_status_alloca(ptr) __snd_alloca(ptr, snd_pcm_status)
00959 int snd_pcm_status_malloc(snd_pcm_status_t **ptr);
00960 void snd_pcm_status_free(snd_pcm_status_t *obj);
00961 void snd_pcm_status_copy(snd_pcm_status_t *dst, const snd_pcm_status_t *src);
00962 snd_pcm_state_t snd_pcm_status_get_state(const snd_pcm_status_t *obj);
00963 void snd_pcm_status_get_trigger_tstamp(const snd_pcm_status_t *obj, snd_timestamp_t *ptr);
00964 void snd_pcm_status_get_trigger_htstamp(const snd_pcm_status_t *obj, snd_htimestamp_t *ptr);
00965 void snd_pcm_status_get_tstamp(const snd_pcm_status_t *obj, snd_timestamp_t *ptr);
00966 void snd_pcm_status_get_htstamp(const snd_pcm_status_t *obj, snd_htimestamp_t *ptr);
00967 void snd_pcm_status_get_audio_htstamp(const snd_pcm_status_t *obj, snd_htimestamp_t *ptr);
00968 snd_pcm_sframes_t snd_pcm_status_get_delay(const snd_pcm_status_t *obj);
00969 snd_pcm_uframes_t snd_pcm_status_get_avail(const snd_pcm_status_t *obj);
00970 snd_pcm_uframes_t snd_pcm_status_get_avail_max(const snd_pcm_status_t *obj);
00971 snd_pcm_uframes_t snd_pcm_status_get_overrange(const snd_pcm_status_t *obj);
00972
00982 const char *snd_pcm_type_name(snd_pcm_type_t type);
00983 const char *snd_pcm_stream_name(const snd_pcm_stream_t stream);
00984 const char *snd_pcm_access_name(const snd_pcm_access_t _access);
00985 const char *snd_pcm_format_name(const snd_pcm_format_t format);
00986 const char *snd_pcm_format_description(const snd_pcm_format_t format);
00987 const char *snd_pcm_subformat_name(const snd_pcm_subformat_t subformat);
00988 const char *snd_pcm_subformat_description(const snd_pcm_subformat_t subformat);
00989 snd_pcm_format_t snd_pcm_format_value(const char* name);
00990 const char *snd_pcm_tstamp_mode_name(const snd_pcm_tstamp_t mode);
00991 const char *snd_pcm_state_name(const snd_pcm_state_t state);
00992
01002 int snd_pcm_dump(snd_pcm_t *pcm, snd_output_t *out);
01003 int snd_pcm_dump_hw_setup(snd_pcm_t *pcm, snd_output_t *out);
01004 int snd_pcm_dump_sw_setup(snd_pcm_t *pcm, snd_output_t *out);
01005 int snd_pcm_dump_setup(snd_pcm_t *pcm, snd_output_t *out);
01006 int snd_pcm_hw_params_dump(snd_pcm_hw_params_t *params, snd_output_t *out);
01007 int snd_pcm_sw_params_dump(snd_pcm_sw_params_t *params, snd_output_t *out);
01008 int snd_pcm_status_dump(snd_pcm_status_t *status, snd_output_t *out);
01009
01019 int snd_pcm_mmap_begin(snd_pcm_t *pcm,
01020 const snd_pcm_channel_area_t **areas,
01021 snd_pcm_uframes_t *offset,
01022 snd_pcm_uframes_t *frames);
01023 snd_pcm_sframes_t snd_pcm_mmap_commit(snd_pcm_t *pcm,
01024 snd_pcm_uframes_t offset,
01025 snd_pcm_uframes_t frames);
01026 snd_pcm_sframes_t snd_pcm_mmap_writei(snd_pcm_t *pcm, const void *buffer, snd_pcm_uframes_t size);
01027 snd_pcm_sframes_t snd_pcm_mmap_readi(snd_pcm_t *pcm, void *buffer, snd_pcm_uframes_t size);
01028 snd_pcm_sframes_t snd_pcm_mmap_writen(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size);
01029 snd_pcm_sframes_t snd_pcm_mmap_readn(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size);
01030
01040 int snd_pcm_format_signed(snd_pcm_format_t format);
01041 int snd_pcm_format_unsigned(snd_pcm_format_t format);
01042 int snd_pcm_format_linear(snd_pcm_format_t format);
01043 int snd_pcm_format_float(snd_pcm_format_t format);
01044 int snd_pcm_format_little_endian(snd_pcm_format_t format);
01045 int snd_pcm_format_big_endian(snd_pcm_format_t format);
01046 int snd_pcm_format_cpu_endian(snd_pcm_format_t format);
01047 int snd_pcm_format_width(snd_pcm_format_t format);
01048 int snd_pcm_format_physical_width(snd_pcm_format_t format);
01049 snd_pcm_format_t snd_pcm_build_linear_format(int width, int pwidth, int unsignd, int big_endian);
01050 ssize_t snd_pcm_format_size(snd_pcm_format_t format, size_t samples);
01051 u_int8_t snd_pcm_format_silence(snd_pcm_format_t format);
01052 u_int16_t snd_pcm_format_silence_16(snd_pcm_format_t format);
01053 u_int32_t snd_pcm_format_silence_32(snd_pcm_format_t format);
01054 u_int64_t snd_pcm_format_silence_64(snd_pcm_format_t format);
01055 int snd_pcm_format_set_silence(snd_pcm_format_t format, void *buf, unsigned int samples);
01056
01057 snd_pcm_sframes_t snd_pcm_bytes_to_frames(snd_pcm_t *pcm, ssize_t bytes);
01058 ssize_t snd_pcm_frames_to_bytes(snd_pcm_t *pcm, snd_pcm_sframes_t frames);
01059 long snd_pcm_bytes_to_samples(snd_pcm_t *pcm, ssize_t bytes);
01060 ssize_t snd_pcm_samples_to_bytes(snd_pcm_t *pcm, long samples);
01061
01062 int snd_pcm_area_silence(const snd_pcm_channel_area_t *dst_channel, snd_pcm_uframes_t dst_offset,
01063 unsigned int samples, snd_pcm_format_t format);
01064 int snd_pcm_areas_silence(const snd_pcm_channel_area_t *dst_channels, snd_pcm_uframes_t dst_offset,
01065 unsigned int channels, snd_pcm_uframes_t frames, snd_pcm_format_t format);
01066 int snd_pcm_area_copy(const snd_pcm_channel_area_t *dst_channel, snd_pcm_uframes_t dst_offset,
01067 const snd_pcm_channel_area_t *src_channel, snd_pcm_uframes_t src_offset,
01068 unsigned int samples, snd_pcm_format_t format);
01069 int snd_pcm_areas_copy(const snd_pcm_channel_area_t *dst_channels, snd_pcm_uframes_t dst_offset,
01070 const snd_pcm_channel_area_t *src_channels, snd_pcm_uframes_t src_offset,
01071 unsigned int channels, snd_pcm_uframes_t frames, snd_pcm_format_t format);
01072
01083 typedef enum _snd_pcm_hook_type {
01084 SND_PCM_HOOK_TYPE_HW_PARAMS = 0,
01085 SND_PCM_HOOK_TYPE_HW_FREE,
01086 SND_PCM_HOOK_TYPE_CLOSE,
01087 SND_PCM_HOOK_TYPE_LAST = SND_PCM_HOOK_TYPE_CLOSE
01088 } snd_pcm_hook_type_t;
01089
01091 typedef struct _snd_pcm_hook snd_pcm_hook_t;
01093 typedef int (*snd_pcm_hook_func_t)(snd_pcm_hook_t *hook);
01094 snd_pcm_t *snd_pcm_hook_get_pcm(snd_pcm_hook_t *hook);
01095 void *snd_pcm_hook_get_private(snd_pcm_hook_t *hook);
01096 void snd_pcm_hook_set_private(snd_pcm_hook_t *hook, void *private_data);
01097 int snd_pcm_hook_add(snd_pcm_hook_t **hookp, snd_pcm_t *pcm,
01098 snd_pcm_hook_type_t type,
01099 snd_pcm_hook_func_t func, void *private_data);
01100 int snd_pcm_hook_remove(snd_pcm_hook_t *hook);
01101
01112 typedef struct _snd_pcm_scope_ops {
01116 int (*enable)(snd_pcm_scope_t *scope);
01120 void (*disable)(snd_pcm_scope_t *scope);
01124 void (*start)(snd_pcm_scope_t *scope);
01128 void (*stop)(snd_pcm_scope_t *scope);
01132 void (*update)(snd_pcm_scope_t *scope);
01136 void (*reset)(snd_pcm_scope_t *scope);
01140 void (*close)(snd_pcm_scope_t *scope);
01141 } snd_pcm_scope_ops_t;
01142
01143 snd_pcm_uframes_t snd_pcm_meter_get_bufsize(snd_pcm_t *pcm);
01144 unsigned int snd_pcm_meter_get_channels(snd_pcm_t *pcm);
01145 unsigned int snd_pcm_meter_get_rate(snd_pcm_t *pcm);
01146 snd_pcm_uframes_t snd_pcm_meter_get_now(snd_pcm_t *pcm);
01147 snd_pcm_uframes_t snd_pcm_meter_get_boundary(snd_pcm_t *pcm);
01148 int snd_pcm_meter_add_scope(snd_pcm_t *pcm, snd_pcm_scope_t *scope);
01149 snd_pcm_scope_t *snd_pcm_meter_search_scope(snd_pcm_t *pcm, const char *name);
01150 int snd_pcm_scope_malloc(snd_pcm_scope_t **ptr);
01151 void snd_pcm_scope_set_ops(snd_pcm_scope_t *scope,
01152 const snd_pcm_scope_ops_t *val);
01153 void snd_pcm_scope_set_name(snd_pcm_scope_t *scope, const char *val);
01154 const char *snd_pcm_scope_get_name(snd_pcm_scope_t *scope);
01155 void *snd_pcm_scope_get_callback_private(snd_pcm_scope_t *scope);
01156 void snd_pcm_scope_set_callback_private(snd_pcm_scope_t *scope, void *val);
01157 int snd_pcm_scope_s16_open(snd_pcm_t *pcm, const char *name,
01158 snd_pcm_scope_t **scopep);
01159 int16_t *snd_pcm_scope_s16_get_channel_buffer(snd_pcm_scope_t *scope,
01160 unsigned int channel);
01161
01172 typedef enum _snd_spcm_latency {
01175 SND_SPCM_LATENCY_STANDARD = 0,
01178 SND_SPCM_LATENCY_MEDIUM,
01181 SND_SPCM_LATENCY_REALTIME
01182 } snd_spcm_latency_t;
01183
01185 typedef enum _snd_spcm_xrun_type {
01187 SND_SPCM_XRUN_IGNORE = 0,
01189 SND_SPCM_XRUN_STOP
01190 } snd_spcm_xrun_type_t;
01191
01193 typedef enum _snd_spcm_duplex_type {
01195 SND_SPCM_DUPLEX_LIBERAL = 0,
01197 SND_SPCM_DUPLEX_PEDANTIC
01198 } snd_spcm_duplex_type_t;
01199
01200 int snd_spcm_init(snd_pcm_t *pcm,
01201 unsigned int rate,
01202 unsigned int channels,
01203 snd_pcm_format_t format,
01204 snd_pcm_subformat_t subformat,
01205 snd_spcm_latency_t latency,
01206 snd_pcm_access_t _access,
01207 snd_spcm_xrun_type_t xrun_type);
01208
01209 int snd_spcm_init_duplex(snd_pcm_t *playback_pcm,
01210 snd_pcm_t *capture_pcm,
01211 unsigned int rate,
01212 unsigned int channels,
01213 snd_pcm_format_t format,
01214 snd_pcm_subformat_t subformat,
01215 snd_spcm_latency_t latency,
01216 snd_pcm_access_t _access,
01217 snd_spcm_xrun_type_t xrun_type,
01218 snd_spcm_duplex_type_t duplex_type);
01219
01220 int snd_spcm_init_get_params(snd_pcm_t *pcm,
01221 unsigned int *rate,
01222 snd_pcm_uframes_t *buffer_size,
01223 snd_pcm_uframes_t *period_size);
01224
01234
01235 const char *snd_pcm_start_mode_name(snd_pcm_start_t mode) __attribute__((deprecated));
01236 const char *snd_pcm_xrun_mode_name(snd_pcm_xrun_t mode) __attribute__((deprecated));
01237 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));
01238 snd_pcm_start_t snd_pcm_sw_params_get_start_mode(const snd_pcm_sw_params_t *params) __attribute__((deprecated));
01239 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));
01240 snd_pcm_xrun_t snd_pcm_sw_params_get_xrun_mode(const snd_pcm_sw_params_t *params) __attribute__((deprecated));
01241 #if !defined(ALSA_LIBRARY_BUILD) && !defined(ALSA_PCM_OLD_SW_PARAMS_API)
01242 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));
01243 int snd_pcm_sw_params_get_xfer_align(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val) __attribute__((deprecated));
01244 int snd_pcm_sw_params_set_sleep_min(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, unsigned int val) __attribute__((deprecated));
01245 int snd_pcm_sw_params_get_sleep_min(const snd_pcm_sw_params_t *params, unsigned int *val) __attribute__((deprecated));
01246 #endif
01247 #if !defined(ALSA_LIBRARY_BUILD) && !defined(ALSA_PCM_OLD_HW_PARAMS_API)
01248 int snd_pcm_hw_params_get_tick_time(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir) __attribute__((deprecated));
01249 int snd_pcm_hw_params_get_tick_time_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir) __attribute__((deprecated));
01250 int snd_pcm_hw_params_get_tick_time_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir) __attribute__((deprecated));
01251 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));
01252 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));
01253 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));
01254 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));
01255 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));
01256 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));
01257 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));
01258 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));
01259 #endif
01260
01263 #ifdef __cplusplus
01264 }
01265 #endif
01266
01267 #endif