ALSA project - the C library reference
/builddir/build/BUILD/alsa-lib-1.0.24/include/pcm.h
Go to the documentation of this file.
00001 
00012 /*
00013  *   This library is free software; you can redistribute it and/or modify
00014  *   it under the terms of the GNU Lesser General Public License as
00015  *   published by the Free Software Foundation; either version 2.1 of
00016  *   the License, or (at your option) any later version.
00017  *
00018  *   This program is distributed in the hope that it will be useful,
00019  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00020  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00021  *   GNU Lesser General Public License for more details.
00022  *
00023  *   You should have received a copy of the GNU Lesser General Public
00024  *   License along with this library; if not, write to the Free Software
00025  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
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;
00048 typedef struct _snd_pcm_hw_params snd_pcm_hw_params_t;
00050 typedef struct _snd_pcm_sw_params snd_pcm_sw_params_t;
00052  typedef struct _snd_pcm_status snd_pcm_status_t;
00054 typedef struct _snd_pcm_access_mask snd_pcm_access_mask_t;
00056 typedef struct _snd_pcm_format_mask snd_pcm_format_mask_t;
00058 typedef struct _snd_pcm_subformat_mask snd_pcm_subformat_mask_t;
00059 
00061 typedef enum _snd_pcm_class {
00064         SND_PCM_CLASS_GENERIC = 0,
00066         SND_PCM_CLASS_MULTI,
00068         SND_PCM_CLASS_MODEM,
00070         SND_PCM_CLASS_DIGITIZER,
00071         SND_PCM_CLASS_LAST = SND_PCM_CLASS_DIGITIZER
00072 } snd_pcm_class_t;
00073 
00075 typedef enum _snd_pcm_subclass {
00077         SND_PCM_SUBCLASS_GENERIC_MIX = 0,
00079         SND_PCM_SUBCLASS_MULTI_MIX,
00080         SND_PCM_SUBCLASS_LAST = SND_PCM_SUBCLASS_MULTI_MIX
00081 } snd_pcm_subclass_t;
00082 
00084 typedef enum _snd_pcm_stream {
00086         SND_PCM_STREAM_PLAYBACK = 0,
00088         SND_PCM_STREAM_CAPTURE,
00089         SND_PCM_STREAM_LAST = SND_PCM_STREAM_CAPTURE
00090 } snd_pcm_stream_t;
00091 
00093 typedef enum _snd_pcm_access {
00095         SND_PCM_ACCESS_MMAP_INTERLEAVED = 0,
00097         SND_PCM_ACCESS_MMAP_NONINTERLEAVED,
00099         SND_PCM_ACCESS_MMAP_COMPLEX,
00101         SND_PCM_ACCESS_RW_INTERLEAVED,
00103         SND_PCM_ACCESS_RW_NONINTERLEAVED,
00104         SND_PCM_ACCESS_LAST = SND_PCM_ACCESS_RW_NONINTERLEAVED
00105 } snd_pcm_access_t;
00106 
00108 typedef enum _snd_pcm_format {
00110         SND_PCM_FORMAT_UNKNOWN = -1,
00112         SND_PCM_FORMAT_S8 = 0,
00114         SND_PCM_FORMAT_U8,
00116         SND_PCM_FORMAT_S16_LE,
00118         SND_PCM_FORMAT_S16_BE,
00120         SND_PCM_FORMAT_U16_LE,
00122         SND_PCM_FORMAT_U16_BE,
00124         SND_PCM_FORMAT_S24_LE,
00126         SND_PCM_FORMAT_S24_BE,
00128         SND_PCM_FORMAT_U24_LE,
00130         SND_PCM_FORMAT_U24_BE,
00132         SND_PCM_FORMAT_S32_LE,
00134         SND_PCM_FORMAT_S32_BE,
00136         SND_PCM_FORMAT_U32_LE,
00138         SND_PCM_FORMAT_U32_BE,
00140         SND_PCM_FORMAT_FLOAT_LE,
00142         SND_PCM_FORMAT_FLOAT_BE,
00144         SND_PCM_FORMAT_FLOAT64_LE,
00146         SND_PCM_FORMAT_FLOAT64_BE,
00148         SND_PCM_FORMAT_IEC958_SUBFRAME_LE,
00150         SND_PCM_FORMAT_IEC958_SUBFRAME_BE,
00152         SND_PCM_FORMAT_MU_LAW,
00154         SND_PCM_FORMAT_A_LAW,
00156         SND_PCM_FORMAT_IMA_ADPCM,
00158         SND_PCM_FORMAT_MPEG,
00160         SND_PCM_FORMAT_GSM,
00162         SND_PCM_FORMAT_SPECIAL = 31,
00164         SND_PCM_FORMAT_S24_3LE = 32,
00166         SND_PCM_FORMAT_S24_3BE,
00168         SND_PCM_FORMAT_U24_3LE,
00170         SND_PCM_FORMAT_U24_3BE,
00172         SND_PCM_FORMAT_S20_3LE,
00174         SND_PCM_FORMAT_S20_3BE,
00176         SND_PCM_FORMAT_U20_3LE,
00178         SND_PCM_FORMAT_U20_3BE,
00180         SND_PCM_FORMAT_S18_3LE,
00182         SND_PCM_FORMAT_S18_3BE,
00184         SND_PCM_FORMAT_U18_3LE,
00186         SND_PCM_FORMAT_U18_3BE,
00187         SND_PCM_FORMAT_LAST = SND_PCM_FORMAT_U18_3BE,
00188 
00189 #if __BYTE_ORDER == __LITTLE_ENDIAN
00190 
00191         SND_PCM_FORMAT_S16 = SND_PCM_FORMAT_S16_LE,
00193         SND_PCM_FORMAT_U16 = SND_PCM_FORMAT_U16_LE,
00195         SND_PCM_FORMAT_S24 = SND_PCM_FORMAT_S24_LE,
00197         SND_PCM_FORMAT_U24 = SND_PCM_FORMAT_U24_LE,
00199         SND_PCM_FORMAT_S32 = SND_PCM_FORMAT_S32_LE,
00201         SND_PCM_FORMAT_U32 = SND_PCM_FORMAT_U32_LE,
00203         SND_PCM_FORMAT_FLOAT = SND_PCM_FORMAT_FLOAT_LE,
00205         SND_PCM_FORMAT_FLOAT64 = SND_PCM_FORMAT_FLOAT64_LE,
00207         SND_PCM_FORMAT_IEC958_SUBFRAME = SND_PCM_FORMAT_IEC958_SUBFRAME_LE
00208 #elif __BYTE_ORDER == __BIG_ENDIAN
00209 
00210         SND_PCM_FORMAT_S16 = SND_PCM_FORMAT_S16_BE,
00212         SND_PCM_FORMAT_U16 = SND_PCM_FORMAT_U16_BE,
00214         SND_PCM_FORMAT_S24 = SND_PCM_FORMAT_S24_BE,
00216         SND_PCM_FORMAT_U24 = SND_PCM_FORMAT_U24_BE,
00218         SND_PCM_FORMAT_S32 = SND_PCM_FORMAT_S32_BE,
00220         SND_PCM_FORMAT_U32 = SND_PCM_FORMAT_U32_BE,
00222         SND_PCM_FORMAT_FLOAT = SND_PCM_FORMAT_FLOAT_BE,
00224         SND_PCM_FORMAT_FLOAT64 = SND_PCM_FORMAT_FLOAT64_BE,
00226         SND_PCM_FORMAT_IEC958_SUBFRAME = SND_PCM_FORMAT_IEC958_SUBFRAME_BE
00227 #else
00228 #error "Unknown endian"
00229 #endif
00230 } snd_pcm_format_t;
00231 
00233 typedef enum _snd_pcm_subformat {
00235         SND_PCM_SUBFORMAT_STD = 0,
00236         SND_PCM_SUBFORMAT_LAST = SND_PCM_SUBFORMAT_STD
00237 } snd_pcm_subformat_t;
00238 
00240 typedef enum _snd_pcm_state {
00242         SND_PCM_STATE_OPEN = 0,
00244         SND_PCM_STATE_SETUP,
00246         SND_PCM_STATE_PREPARED,
00248         SND_PCM_STATE_RUNNING,
00250         SND_PCM_STATE_XRUN,
00252         SND_PCM_STATE_DRAINING,
00254         SND_PCM_STATE_PAUSED,
00256         SND_PCM_STATE_SUSPENDED,
00258         SND_PCM_STATE_DISCONNECTED,
00259         SND_PCM_STATE_LAST = SND_PCM_STATE_DISCONNECTED
00260 } snd_pcm_state_t;
00261 
00263 typedef enum _snd_pcm_start {
00265         SND_PCM_START_DATA = 0,
00267         SND_PCM_START_EXPLICIT,
00268         SND_PCM_START_LAST = SND_PCM_START_EXPLICIT
00269 } snd_pcm_start_t;
00270 
00272 typedef enum _snd_pcm_xrun {
00274         SND_PCM_XRUN_NONE = 0,
00276         SND_PCM_XRUN_STOP,
00277         SND_PCM_XRUN_LAST = SND_PCM_XRUN_STOP
00278 } snd_pcm_xrun_t;
00279 
00281 typedef enum _snd_pcm_tstamp {
00283         SND_PCM_TSTAMP_NONE = 0,
00285         SND_PCM_TSTAMP_ENABLE,
00289         SND_PCM_TSTAMP_MMAP = SND_PCM_TSTAMP_ENABLE,
00290         SND_PCM_TSTAMP_LAST = SND_PCM_TSTAMP_ENABLE
00291 } snd_pcm_tstamp_t;
00292 
00294 typedef unsigned long snd_pcm_uframes_t;
00296 typedef long snd_pcm_sframes_t;
00297 
00299 #define SND_PCM_NONBLOCK                0x00000001
00300 
00301 #define SND_PCM_ASYNC                   0x00000002
00302 
00303 #define SND_PCM_NO_AUTO_RESAMPLE        0x00010000
00304 
00305 #define SND_PCM_NO_AUTO_CHANNELS        0x00020000
00306 
00307 #define SND_PCM_NO_AUTO_FORMAT          0x00040000
00308 
00309 #define SND_PCM_NO_SOFTVOL              0x00080000
00310 
00312 typedef struct _snd_pcm snd_pcm_t;
00313 
00315 enum _snd_pcm_type {
00317         SND_PCM_TYPE_HW = 0,
00319         SND_PCM_TYPE_HOOKS,
00322         SND_PCM_TYPE_MULTI,
00324         SND_PCM_TYPE_FILE,
00326         SND_PCM_TYPE_NULL,
00328         SND_PCM_TYPE_SHM,
00330         SND_PCM_TYPE_INET,
00332         SND_PCM_TYPE_COPY,
00334         SND_PCM_TYPE_LINEAR,
00336         SND_PCM_TYPE_ALAW,
00338         SND_PCM_TYPE_MULAW,
00340         SND_PCM_TYPE_ADPCM,
00342         SND_PCM_TYPE_RATE,
00344         SND_PCM_TYPE_ROUTE,
00346         SND_PCM_TYPE_PLUG,
00348         SND_PCM_TYPE_SHARE,
00350         SND_PCM_TYPE_METER,
00352         SND_PCM_TYPE_MIX,
00354         SND_PCM_TYPE_DROUTE,
00356         SND_PCM_TYPE_LBSERVER,
00358         SND_PCM_TYPE_LINEAR_FLOAT,
00360         SND_PCM_TYPE_LADSPA,
00362         SND_PCM_TYPE_DMIX,
00364         SND_PCM_TYPE_JACK,
00366         SND_PCM_TYPE_DSNOOP,
00368         SND_PCM_TYPE_DSHARE,
00370         SND_PCM_TYPE_IEC958,
00372         SND_PCM_TYPE_SOFTVOL,
00374         SND_PCM_TYPE_IOPLUG,
00376         SND_PCM_TYPE_EXTPLUG,
00378         SND_PCM_TYPE_MMAP_EMUL,
00379         SND_PCM_TYPE_LAST = SND_PCM_TYPE_MMAP_EMUL
00380 };
00381 
00383 typedef enum _snd_pcm_type snd_pcm_type_t;
00384 
00386 typedef struct _snd_pcm_channel_area {
00388         void *addr;
00390         unsigned int first;
00392         unsigned int step;
00393 } snd_pcm_channel_area_t;
00394 
00396 typedef union _snd_pcm_sync_id {
00398         unsigned char id[16];
00400         unsigned short id16[8];
00402         unsigned int id32[4];
00403 } snd_pcm_sync_id_t;
00404 
00406 typedef struct _snd_pcm_scope snd_pcm_scope_t;
00407 
00408 int snd_pcm_open(snd_pcm_t **pcm, const char *name, 
00409                  snd_pcm_stream_t stream, int mode);
00410 int snd_pcm_open_lconf(snd_pcm_t **pcm, const char *name, 
00411                        snd_pcm_stream_t stream, int mode,
00412                        snd_config_t *lconf);
00413 
00414 int snd_pcm_close(snd_pcm_t *pcm);
00415 const char *snd_pcm_name(snd_pcm_t *pcm);
00416 snd_pcm_type_t snd_pcm_type(snd_pcm_t *pcm);
00417 snd_pcm_stream_t snd_pcm_stream(snd_pcm_t *pcm);
00418 int snd_pcm_poll_descriptors_count(snd_pcm_t *pcm);
00419 int snd_pcm_poll_descriptors(snd_pcm_t *pcm, struct pollfd *pfds, unsigned int space);
00420 int snd_pcm_poll_descriptors_revents(snd_pcm_t *pcm, struct pollfd *pfds, unsigned int nfds, unsigned short *revents);
00421 int snd_pcm_nonblock(snd_pcm_t *pcm, int nonblock);
00422 int snd_async_add_pcm_handler(snd_async_handler_t **handler, snd_pcm_t *pcm, 
00423                               snd_async_callback_t callback, void *private_data);
00424 snd_pcm_t *snd_async_handler_get_pcm(snd_async_handler_t *handler);
00425 int snd_pcm_info(snd_pcm_t *pcm, snd_pcm_info_t *info);
00426 int snd_pcm_hw_params_current(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
00427 int snd_pcm_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
00428 int snd_pcm_hw_free(snd_pcm_t *pcm);
00429 int snd_pcm_sw_params_current(snd_pcm_t *pcm, snd_pcm_sw_params_t *params);
00430 int snd_pcm_sw_params(snd_pcm_t *pcm, snd_pcm_sw_params_t *params);
00431 int snd_pcm_prepare(snd_pcm_t *pcm);
00432 int snd_pcm_reset(snd_pcm_t *pcm);
00433 int snd_pcm_status(snd_pcm_t *pcm, snd_pcm_status_t *status);
00434 int snd_pcm_start(snd_pcm_t *pcm);
00435 int snd_pcm_drop(snd_pcm_t *pcm);
00436 int snd_pcm_drain(snd_pcm_t *pcm);
00437 int snd_pcm_pause(snd_pcm_t *pcm, int enable);
00438 snd_pcm_state_t snd_pcm_state(snd_pcm_t *pcm);
00439 int snd_pcm_hwsync(snd_pcm_t *pcm);
00440 int snd_pcm_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *delayp);
00441 int snd_pcm_resume(snd_pcm_t *pcm);
00442 int snd_pcm_htimestamp(snd_pcm_t *pcm, snd_pcm_uframes_t *avail, snd_htimestamp_t *tstamp);
00443 snd_pcm_sframes_t snd_pcm_avail(snd_pcm_t *pcm);
00444 snd_pcm_sframes_t snd_pcm_avail_update(snd_pcm_t *pcm);
00445 int snd_pcm_avail_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *availp, snd_pcm_sframes_t *delayp);
00446 snd_pcm_sframes_t snd_pcm_rewindable(snd_pcm_t *pcm);
00447 snd_pcm_sframes_t snd_pcm_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t frames);
00448 snd_pcm_sframes_t snd_pcm_forwardable(snd_pcm_t *pcm);
00449 snd_pcm_sframes_t snd_pcm_forward(snd_pcm_t *pcm, snd_pcm_uframes_t frames);
00450 snd_pcm_sframes_t snd_pcm_writei(snd_pcm_t *pcm, const void *buffer, snd_pcm_uframes_t size);
00451 snd_pcm_sframes_t snd_pcm_readi(snd_pcm_t *pcm, void *buffer, snd_pcm_uframes_t size);
00452 snd_pcm_sframes_t snd_pcm_writen(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size);
00453 snd_pcm_sframes_t snd_pcm_readn(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size);
00454 int snd_pcm_wait(snd_pcm_t *pcm, int timeout);
00455 
00456 int snd_pcm_link(snd_pcm_t *pcm1, snd_pcm_t *pcm2);
00457 int snd_pcm_unlink(snd_pcm_t *pcm);
00458 
00459 //int snd_pcm_mixer_element(snd_pcm_t *pcm, snd_mixer_t *mixer, snd_mixer_elem_t **elem);
00460 
00461 /*
00462  * application helpers - these functions are implemented on top
00463  * of the basic API
00464  */
00465 
00466 int snd_pcm_recover(snd_pcm_t *pcm, int err, int silent);
00467 int snd_pcm_set_params(snd_pcm_t *pcm,
00468                        snd_pcm_format_t format,
00469                        snd_pcm_access_t access,
00470                        unsigned int channels,
00471                        unsigned int rate,
00472                        int soft_resample,
00473                        unsigned int latency);
00474 int snd_pcm_get_params(snd_pcm_t *pcm,
00475                        snd_pcm_uframes_t *buffer_size,
00476                        snd_pcm_uframes_t *period_size);
00477 
00487 size_t snd_pcm_info_sizeof(void);
00492 #define snd_pcm_info_alloca(ptr) __snd_alloca(ptr, snd_pcm_info)
00493 int snd_pcm_info_malloc(snd_pcm_info_t **ptr);
00494 void snd_pcm_info_free(snd_pcm_info_t *obj);
00495 void snd_pcm_info_copy(snd_pcm_info_t *dst, const snd_pcm_info_t *src);
00496 unsigned int snd_pcm_info_get_device(const snd_pcm_info_t *obj);
00497 unsigned int snd_pcm_info_get_subdevice(const snd_pcm_info_t *obj);
00498 snd_pcm_stream_t snd_pcm_info_get_stream(const snd_pcm_info_t *obj);
00499 int snd_pcm_info_get_card(const snd_pcm_info_t *obj);
00500 const char *snd_pcm_info_get_id(const snd_pcm_info_t *obj);
00501 const char *snd_pcm_info_get_name(const snd_pcm_info_t *obj);
00502 const char *snd_pcm_info_get_subdevice_name(const snd_pcm_info_t *obj);
00503 snd_pcm_class_t snd_pcm_info_get_class(const snd_pcm_info_t *obj);
00504 snd_pcm_subclass_t snd_pcm_info_get_subclass(const snd_pcm_info_t *obj);
00505 unsigned int snd_pcm_info_get_subdevices_count(const snd_pcm_info_t *obj);
00506 unsigned int snd_pcm_info_get_subdevices_avail(const snd_pcm_info_t *obj);
00507 snd_pcm_sync_id_t snd_pcm_info_get_sync(const snd_pcm_info_t *obj);
00508 void snd_pcm_info_set_device(snd_pcm_info_t *obj, unsigned int val);
00509 void snd_pcm_info_set_subdevice(snd_pcm_info_t *obj, unsigned int val);
00510 void snd_pcm_info_set_stream(snd_pcm_info_t *obj, snd_pcm_stream_t val);
00511 
00521 int snd_pcm_hw_params_any(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
00522 
00523 int snd_pcm_hw_params_can_mmap_sample_resolution(const snd_pcm_hw_params_t *params);
00524 int snd_pcm_hw_params_is_double(const snd_pcm_hw_params_t *params);
00525 int snd_pcm_hw_params_is_batch(const snd_pcm_hw_params_t *params);
00526 int snd_pcm_hw_params_is_block_transfer(const snd_pcm_hw_params_t *params);
00527 int snd_pcm_hw_params_is_monotonic(const snd_pcm_hw_params_t *params);
00528 int snd_pcm_hw_params_can_overrange(const snd_pcm_hw_params_t *params);
00529 int snd_pcm_hw_params_can_pause(const snd_pcm_hw_params_t *params);
00530 int snd_pcm_hw_params_can_resume(const snd_pcm_hw_params_t *params);
00531 int snd_pcm_hw_params_is_half_duplex(const snd_pcm_hw_params_t *params);
00532 int snd_pcm_hw_params_is_joint_duplex(const snd_pcm_hw_params_t *params);
00533 int snd_pcm_hw_params_can_sync_start(const snd_pcm_hw_params_t *params);
00534 int snd_pcm_hw_params_can_disable_period_wakeup(const snd_pcm_hw_params_t *params);
00535 int snd_pcm_hw_params_get_rate_numden(const snd_pcm_hw_params_t *params,
00536                                       unsigned int *rate_num,
00537                                       unsigned int *rate_den);
00538 int snd_pcm_hw_params_get_sbits(const snd_pcm_hw_params_t *params);
00539 int snd_pcm_hw_params_get_fifo_size(const snd_pcm_hw_params_t *params);
00540 
00541 #if 0
00542 typedef struct _snd_pcm_hw_strategy snd_pcm_hw_strategy_t;
00543 
00544 /* choices need to be sorted on ascending badness */
00545 typedef struct _snd_pcm_hw_strategy_simple_choices_list {
00546         unsigned int value;
00547         unsigned int badness;
00548 } snd_pcm_hw_strategy_simple_choices_list_t;
00549 
00550 int snd_pcm_hw_params_strategy(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
00551                                const snd_pcm_hw_strategy_t *strategy,
00552                                unsigned int badness_min,
00553                                unsigned int badness_max);
00554 
00555 void snd_pcm_hw_strategy_free(snd_pcm_hw_strategy_t *strategy);
00556 int snd_pcm_hw_strategy_simple(snd_pcm_hw_strategy_t **strategyp,
00557                                unsigned int badness_min,
00558                                unsigned int badness_max);
00559 int snd_pcm_hw_params_try_explain_failure(snd_pcm_t *pcm,
00560                                           snd_pcm_hw_params_t *fail,
00561                                           snd_pcm_hw_params_t *success,
00562                                           unsigned int depth,
00563                                           snd_output_t *out);
00564 
00565 #endif
00566 
00567 size_t snd_pcm_hw_params_sizeof(void);
00572 #define snd_pcm_hw_params_alloca(ptr) __snd_alloca(ptr, snd_pcm_hw_params)
00573 int snd_pcm_hw_params_malloc(snd_pcm_hw_params_t **ptr);
00574 void snd_pcm_hw_params_free(snd_pcm_hw_params_t *obj);
00575 void snd_pcm_hw_params_copy(snd_pcm_hw_params_t *dst, const snd_pcm_hw_params_t *src);
00576 
00577 #if !defined(ALSA_LIBRARY_BUILD) && !defined(ALSA_PCM_OLD_HW_PARAMS_API)
00578 
00579 int snd_pcm_hw_params_get_access(const snd_pcm_hw_params_t *params, snd_pcm_access_t *_access);
00580 int snd_pcm_hw_params_test_access(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t _access);
00581 int snd_pcm_hw_params_set_access(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t _access);
00582 int snd_pcm_hw_params_set_access_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t *_access);
00583 int snd_pcm_hw_params_set_access_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t *_access);
00584 int snd_pcm_hw_params_set_access_mask(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_mask_t *mask);
00585 int snd_pcm_hw_params_get_access_mask(snd_pcm_hw_params_t *params, snd_pcm_access_mask_t *mask);
00586 
00587 int snd_pcm_hw_params_get_format(const snd_pcm_hw_params_t *params, snd_pcm_format_t *val);
00588 int snd_pcm_hw_params_test_format(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t val);
00589 int snd_pcm_hw_params_set_format(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t val);
00590 int snd_pcm_hw_params_set_format_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t *format);
00591 int snd_pcm_hw_params_set_format_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t *format);
00592 int snd_pcm_hw_params_set_format_mask(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_mask_t *mask);
00593 void snd_pcm_hw_params_get_format_mask(snd_pcm_hw_params_t *params, snd_pcm_format_mask_t *mask);
00594 
00595 int snd_pcm_hw_params_get_subformat(const snd_pcm_hw_params_t *params, snd_pcm_subformat_t *subformat);
00596 int snd_pcm_hw_params_test_subformat(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t subformat);
00597 int snd_pcm_hw_params_set_subformat(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t subformat);
00598 int snd_pcm_hw_params_set_subformat_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t *subformat);
00599 int snd_pcm_hw_params_set_subformat_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t *subformat);
00600 int snd_pcm_hw_params_set_subformat_mask(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_mask_t *mask);
00601 void snd_pcm_hw_params_get_subformat_mask(snd_pcm_hw_params_t *params, snd_pcm_subformat_mask_t *mask);
00602 
00603 int snd_pcm_hw_params_get_channels(const snd_pcm_hw_params_t *params, unsigned int *val);
00604 int snd_pcm_hw_params_get_channels_min(const snd_pcm_hw_params_t *params, unsigned int *val);
00605 int snd_pcm_hw_params_get_channels_max(const snd_pcm_hw_params_t *params, unsigned int *val);
00606 int snd_pcm_hw_params_test_channels(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
00607 int snd_pcm_hw_params_set_channels(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
00608 int snd_pcm_hw_params_set_channels_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
00609 int snd_pcm_hw_params_set_channels_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
00610 int snd_pcm_hw_params_set_channels_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *min, unsigned int *max);
00611 int snd_pcm_hw_params_set_channels_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
00612 int snd_pcm_hw_params_set_channels_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
00613 int snd_pcm_hw_params_set_channels_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
00614 
00615 int snd_pcm_hw_params_get_rate(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00616 int snd_pcm_hw_params_get_rate_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00617 int snd_pcm_hw_params_get_rate_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00618 int snd_pcm_hw_params_test_rate(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
00619 int snd_pcm_hw_params_set_rate(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
00620 int snd_pcm_hw_params_set_rate_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00621 int snd_pcm_hw_params_set_rate_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00622 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);
00623 int snd_pcm_hw_params_set_rate_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00624 int snd_pcm_hw_params_set_rate_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00625 int snd_pcm_hw_params_set_rate_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00626 int snd_pcm_hw_params_set_rate_resample(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
00627 int snd_pcm_hw_params_get_rate_resample(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
00628 int snd_pcm_hw_params_set_export_buffer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
00629 int snd_pcm_hw_params_get_export_buffer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
00630 int snd_pcm_hw_params_set_period_wakeup(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
00631 int snd_pcm_hw_params_get_period_wakeup(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
00632 
00633 int snd_pcm_hw_params_get_period_time(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00634 int snd_pcm_hw_params_get_period_time_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00635 int snd_pcm_hw_params_get_period_time_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00636 int snd_pcm_hw_params_test_period_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
00637 int snd_pcm_hw_params_set_period_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
00638 int snd_pcm_hw_params_set_period_time_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00639 int snd_pcm_hw_params_set_period_time_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00640 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);
00641 int snd_pcm_hw_params_set_period_time_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00642 int snd_pcm_hw_params_set_period_time_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00643 int snd_pcm_hw_params_set_period_time_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00644 
00645 int snd_pcm_hw_params_get_period_size(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *frames, int *dir);
00646 int snd_pcm_hw_params_get_period_size_min(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *frames, int *dir);
00647 int snd_pcm_hw_params_get_period_size_max(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *frames, int *dir);
00648 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);
00649 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);
00650 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);
00651 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);
00652 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);
00653 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);
00654 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);
00655 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);
00656 int snd_pcm_hw_params_set_period_size_integer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
00657 
00658 int snd_pcm_hw_params_get_periods(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00659 int snd_pcm_hw_params_get_periods_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00660 int snd_pcm_hw_params_get_periods_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00661 int snd_pcm_hw_params_test_periods(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
00662 int snd_pcm_hw_params_set_periods(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
00663 int snd_pcm_hw_params_set_periods_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00664 int snd_pcm_hw_params_set_periods_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00665 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);
00666 int snd_pcm_hw_params_set_periods_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00667 int snd_pcm_hw_params_set_periods_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00668 int snd_pcm_hw_params_set_periods_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00669 int snd_pcm_hw_params_set_periods_integer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
00670 
00671 int snd_pcm_hw_params_get_buffer_time(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00672 int snd_pcm_hw_params_get_buffer_time_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00673 int snd_pcm_hw_params_get_buffer_time_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00674 int snd_pcm_hw_params_test_buffer_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
00675 int snd_pcm_hw_params_set_buffer_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
00676 int snd_pcm_hw_params_set_buffer_time_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00677 int snd_pcm_hw_params_set_buffer_time_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00678 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);
00679 int snd_pcm_hw_params_set_buffer_time_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00680 int snd_pcm_hw_params_set_buffer_time_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00681 int snd_pcm_hw_params_set_buffer_time_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00682 
00683 int snd_pcm_hw_params_get_buffer_size(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
00684 int snd_pcm_hw_params_get_buffer_size_min(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
00685 int snd_pcm_hw_params_get_buffer_size_max(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
00686 int snd_pcm_hw_params_test_buffer_size(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t val);
00687 int snd_pcm_hw_params_set_buffer_size(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t val);
00688 int snd_pcm_hw_params_set_buffer_size_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
00689 int snd_pcm_hw_params_set_buffer_size_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
00690 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);
00691 int snd_pcm_hw_params_set_buffer_size_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
00692 int snd_pcm_hw_params_set_buffer_size_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
00693 int snd_pcm_hw_params_set_buffer_size_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
00694 
00695 #endif /* !ALSA_LIBRARY_BUILD && !ALSA_PCM_OLD_HW_PARAMS_API */
00696 
00697 int snd_pcm_hw_params_get_min_align(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
00698 
00708 size_t snd_pcm_sw_params_sizeof(void);
00713 #define snd_pcm_sw_params_alloca(ptr) __snd_alloca(ptr, snd_pcm_sw_params)
00714 int snd_pcm_sw_params_malloc(snd_pcm_sw_params_t **ptr);
00715 void snd_pcm_sw_params_free(snd_pcm_sw_params_t *obj);
00716 void snd_pcm_sw_params_copy(snd_pcm_sw_params_t *dst, const snd_pcm_sw_params_t *src);
00717 int snd_pcm_sw_params_get_boundary(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val);
00718 
00719 #if !defined(ALSA_LIBRARY_BUILD) && !defined(ALSA_PCM_OLD_SW_PARAMS_API)
00720 
00721 int snd_pcm_sw_params_set_tstamp_mode(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_tstamp_t val);
00722 int snd_pcm_sw_params_get_tstamp_mode(const snd_pcm_sw_params_t *params, snd_pcm_tstamp_t *val);
00723 int snd_pcm_sw_params_set_avail_min(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
00724 int snd_pcm_sw_params_get_avail_min(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val);
00725 int snd_pcm_sw_params_set_period_event(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, int val);
00726 int snd_pcm_sw_params_get_period_event(const snd_pcm_sw_params_t *params, int *val);
00727 int snd_pcm_sw_params_set_start_threshold(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
00728 int snd_pcm_sw_params_get_start_threshold(const snd_pcm_sw_params_t *paramsm, snd_pcm_uframes_t *val);
00729 int snd_pcm_sw_params_set_stop_threshold(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
00730 int snd_pcm_sw_params_get_stop_threshold(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val);
00731 int snd_pcm_sw_params_set_silence_threshold(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
00732 int snd_pcm_sw_params_get_silence_threshold(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val);
00733 int snd_pcm_sw_params_set_silence_size(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
00734 int snd_pcm_sw_params_get_silence_size(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val);
00735 
00736 #endif /* !ALSA_LIBRARY_BUILD && !ALSA_PCM_OLD_SW_PARAMS_API */
00737 
00740 /* include old API */
00741 #ifndef ALSA_LIBRARY_BUILD
00742 #if defined(ALSA_PCM_OLD_HW_PARAMS_API) || defined(ALSA_PCM_OLD_SW_PARAMS_API)
00743 #include "pcm_old.h"
00744 #endif
00745 #endif
00746 
00754 size_t snd_pcm_access_mask_sizeof(void);
00759 #define snd_pcm_access_mask_alloca(ptr) __snd_alloca(ptr, snd_pcm_access_mask)
00760 int snd_pcm_access_mask_malloc(snd_pcm_access_mask_t **ptr);
00761 void snd_pcm_access_mask_free(snd_pcm_access_mask_t *obj);
00762 void snd_pcm_access_mask_copy(snd_pcm_access_mask_t *dst, const snd_pcm_access_mask_t *src);
00763 void snd_pcm_access_mask_none(snd_pcm_access_mask_t *mask);
00764 void snd_pcm_access_mask_any(snd_pcm_access_mask_t *mask);
00765 int snd_pcm_access_mask_test(const snd_pcm_access_mask_t *mask, snd_pcm_access_t val);
00766 int snd_pcm_access_mask_empty(const snd_pcm_access_mask_t *mask);
00767 void snd_pcm_access_mask_set(snd_pcm_access_mask_t *mask, snd_pcm_access_t val);
00768 void snd_pcm_access_mask_reset(snd_pcm_access_mask_t *mask, snd_pcm_access_t val);
00769 
00779 size_t snd_pcm_format_mask_sizeof(void);
00784 #define snd_pcm_format_mask_alloca(ptr) __snd_alloca(ptr, snd_pcm_format_mask)
00785 int snd_pcm_format_mask_malloc(snd_pcm_format_mask_t **ptr);
00786 void snd_pcm_format_mask_free(snd_pcm_format_mask_t *obj);
00787 void snd_pcm_format_mask_copy(snd_pcm_format_mask_t *dst, const snd_pcm_format_mask_t *src);
00788 void snd_pcm_format_mask_none(snd_pcm_format_mask_t *mask);
00789 void snd_pcm_format_mask_any(snd_pcm_format_mask_t *mask);
00790 int snd_pcm_format_mask_test(const snd_pcm_format_mask_t *mask, snd_pcm_format_t val);
00791 int snd_pcm_format_mask_empty(const snd_pcm_format_mask_t *mask);
00792 void snd_pcm_format_mask_set(snd_pcm_format_mask_t *mask, snd_pcm_format_t val);
00793 void snd_pcm_format_mask_reset(snd_pcm_format_mask_t *mask, snd_pcm_format_t val);
00794 
00804 size_t snd_pcm_subformat_mask_sizeof(void);
00809 #define snd_pcm_subformat_mask_alloca(ptr) __snd_alloca(ptr, snd_pcm_subformat_mask)
00810 int snd_pcm_subformat_mask_malloc(snd_pcm_subformat_mask_t **ptr);
00811 void snd_pcm_subformat_mask_free(snd_pcm_subformat_mask_t *obj);
00812 void snd_pcm_subformat_mask_copy(snd_pcm_subformat_mask_t *dst, const snd_pcm_subformat_mask_t *src);
00813 void snd_pcm_subformat_mask_none(snd_pcm_subformat_mask_t *mask);
00814 void snd_pcm_subformat_mask_any(snd_pcm_subformat_mask_t *mask);
00815 int snd_pcm_subformat_mask_test(const snd_pcm_subformat_mask_t *mask, snd_pcm_subformat_t val);
00816 int snd_pcm_subformat_mask_empty(const snd_pcm_subformat_mask_t *mask);
00817 void snd_pcm_subformat_mask_set(snd_pcm_subformat_mask_t *mask, snd_pcm_subformat_t val);
00818 void snd_pcm_subformat_mask_reset(snd_pcm_subformat_mask_t *mask, snd_pcm_subformat_t val);
00819 
00829 size_t snd_pcm_status_sizeof(void);
00834 #define snd_pcm_status_alloca(ptr) __snd_alloca(ptr, snd_pcm_status)
00835 int snd_pcm_status_malloc(snd_pcm_status_t **ptr);
00836 void snd_pcm_status_free(snd_pcm_status_t *obj);
00837 void snd_pcm_status_copy(snd_pcm_status_t *dst, const snd_pcm_status_t *src);
00838 snd_pcm_state_t snd_pcm_status_get_state(const snd_pcm_status_t *obj);
00839 void snd_pcm_status_get_trigger_tstamp(const snd_pcm_status_t *obj, snd_timestamp_t *ptr);
00840 void snd_pcm_status_get_trigger_htstamp(const snd_pcm_status_t *obj, snd_htimestamp_t *ptr);
00841 void snd_pcm_status_get_tstamp(const snd_pcm_status_t *obj, snd_timestamp_t *ptr);
00842 void snd_pcm_status_get_htstamp(const snd_pcm_status_t *obj, snd_htimestamp_t *ptr);
00843 snd_pcm_sframes_t snd_pcm_status_get_delay(const snd_pcm_status_t *obj);
00844 snd_pcm_uframes_t snd_pcm_status_get_avail(const snd_pcm_status_t *obj);
00845 snd_pcm_uframes_t snd_pcm_status_get_avail_max(const snd_pcm_status_t *obj);
00846 snd_pcm_uframes_t snd_pcm_status_get_overrange(const snd_pcm_status_t *obj);
00847 
00857 const char *snd_pcm_type_name(snd_pcm_type_t type);
00858 const char *snd_pcm_stream_name(const snd_pcm_stream_t stream);
00859 const char *snd_pcm_access_name(const snd_pcm_access_t _access);
00860 const char *snd_pcm_format_name(const snd_pcm_format_t format);
00861 const char *snd_pcm_format_description(const snd_pcm_format_t format);
00862 const char *snd_pcm_subformat_name(const snd_pcm_subformat_t subformat);
00863 const char *snd_pcm_subformat_description(const snd_pcm_subformat_t subformat);
00864 snd_pcm_format_t snd_pcm_format_value(const char* name);
00865 const char *snd_pcm_tstamp_mode_name(const snd_pcm_tstamp_t mode);
00866 const char *snd_pcm_state_name(const snd_pcm_state_t state);
00867 
00877 int snd_pcm_dump(snd_pcm_t *pcm, snd_output_t *out);
00878 int snd_pcm_dump_hw_setup(snd_pcm_t *pcm, snd_output_t *out);
00879 int snd_pcm_dump_sw_setup(snd_pcm_t *pcm, snd_output_t *out);
00880 int snd_pcm_dump_setup(snd_pcm_t *pcm, snd_output_t *out);
00881 int snd_pcm_hw_params_dump(snd_pcm_hw_params_t *params, snd_output_t *out);
00882 int snd_pcm_sw_params_dump(snd_pcm_sw_params_t *params, snd_output_t *out);
00883 int snd_pcm_status_dump(snd_pcm_status_t *status, snd_output_t *out);
00884 
00894 int snd_pcm_mmap_begin(snd_pcm_t *pcm,
00895                        const snd_pcm_channel_area_t **areas,
00896                        snd_pcm_uframes_t *offset,
00897                        snd_pcm_uframes_t *frames);
00898 snd_pcm_sframes_t snd_pcm_mmap_commit(snd_pcm_t *pcm,
00899                                       snd_pcm_uframes_t offset,
00900                                       snd_pcm_uframes_t frames);
00901 snd_pcm_sframes_t snd_pcm_mmap_writei(snd_pcm_t *pcm, const void *buffer, snd_pcm_uframes_t size);
00902 snd_pcm_sframes_t snd_pcm_mmap_readi(snd_pcm_t *pcm, void *buffer, snd_pcm_uframes_t size);
00903 snd_pcm_sframes_t snd_pcm_mmap_writen(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size);
00904 snd_pcm_sframes_t snd_pcm_mmap_readn(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size);                                                                
00905 
00915 int snd_pcm_format_signed(snd_pcm_format_t format);
00916 int snd_pcm_format_unsigned(snd_pcm_format_t format);
00917 int snd_pcm_format_linear(snd_pcm_format_t format);
00918 int snd_pcm_format_float(snd_pcm_format_t format);
00919 int snd_pcm_format_little_endian(snd_pcm_format_t format);
00920 int snd_pcm_format_big_endian(snd_pcm_format_t format);
00921 int snd_pcm_format_cpu_endian(snd_pcm_format_t format);
00922 int snd_pcm_format_width(snd_pcm_format_t format);                      /* in bits */
00923 int snd_pcm_format_physical_width(snd_pcm_format_t format);             /* in bits */
00924 snd_pcm_format_t snd_pcm_build_linear_format(int width, int pwidth, int unsignd, int big_endian);
00925 ssize_t snd_pcm_format_size(snd_pcm_format_t format, size_t samples);
00926 u_int8_t snd_pcm_format_silence(snd_pcm_format_t format);
00927 u_int16_t snd_pcm_format_silence_16(snd_pcm_format_t format);
00928 u_int32_t snd_pcm_format_silence_32(snd_pcm_format_t format);
00929 u_int64_t snd_pcm_format_silence_64(snd_pcm_format_t format);
00930 int snd_pcm_format_set_silence(snd_pcm_format_t format, void *buf, unsigned int samples);
00931 
00932 snd_pcm_sframes_t snd_pcm_bytes_to_frames(snd_pcm_t *pcm, ssize_t bytes);
00933 ssize_t snd_pcm_frames_to_bytes(snd_pcm_t *pcm, snd_pcm_sframes_t frames);
00934 long snd_pcm_bytes_to_samples(snd_pcm_t *pcm, ssize_t bytes);
00935 ssize_t snd_pcm_samples_to_bytes(snd_pcm_t *pcm, long samples);
00936 
00937 int snd_pcm_area_silence(const snd_pcm_channel_area_t *dst_channel, snd_pcm_uframes_t dst_offset,
00938                          unsigned int samples, snd_pcm_format_t format);
00939 int snd_pcm_areas_silence(const snd_pcm_channel_area_t *dst_channels, snd_pcm_uframes_t dst_offset,
00940                           unsigned int channels, snd_pcm_uframes_t frames, snd_pcm_format_t format);
00941 int snd_pcm_area_copy(const snd_pcm_channel_area_t *dst_channel, snd_pcm_uframes_t dst_offset,
00942                       const snd_pcm_channel_area_t *src_channel, snd_pcm_uframes_t src_offset,
00943                       unsigned int samples, snd_pcm_format_t format);
00944 int snd_pcm_areas_copy(const snd_pcm_channel_area_t *dst_channels, snd_pcm_uframes_t dst_offset,
00945                        const snd_pcm_channel_area_t *src_channels, snd_pcm_uframes_t src_offset,
00946                        unsigned int channels, snd_pcm_uframes_t frames, snd_pcm_format_t format);
00947 
00958 typedef enum _snd_pcm_hook_type {
00959         SND_PCM_HOOK_TYPE_HW_PARAMS = 0,
00960         SND_PCM_HOOK_TYPE_HW_FREE,
00961         SND_PCM_HOOK_TYPE_CLOSE,
00962         SND_PCM_HOOK_TYPE_LAST = SND_PCM_HOOK_TYPE_CLOSE
00963 } snd_pcm_hook_type_t;
00964 
00966 typedef struct _snd_pcm_hook snd_pcm_hook_t;
00968 typedef int (*snd_pcm_hook_func_t)(snd_pcm_hook_t *hook);
00969 snd_pcm_t *snd_pcm_hook_get_pcm(snd_pcm_hook_t *hook);
00970 void *snd_pcm_hook_get_private(snd_pcm_hook_t *hook);
00971 void snd_pcm_hook_set_private(snd_pcm_hook_t *hook, void *private_data);
00972 int snd_pcm_hook_add(snd_pcm_hook_t **hookp, snd_pcm_t *pcm,
00973                      snd_pcm_hook_type_t type,
00974                      snd_pcm_hook_func_t func, void *private_data);
00975 int snd_pcm_hook_remove(snd_pcm_hook_t *hook);
00976 
00987 typedef struct _snd_pcm_scope_ops {
00991         int (*enable)(snd_pcm_scope_t *scope);
00995         void (*disable)(snd_pcm_scope_t *scope);
00999         void (*start)(snd_pcm_scope_t *scope);
01003         void (*stop)(snd_pcm_scope_t *scope);
01007         void (*update)(snd_pcm_scope_t *scope);
01011         void (*reset)(snd_pcm_scope_t *scope);
01015         void (*close)(snd_pcm_scope_t *scope);
01016 } snd_pcm_scope_ops_t;
01017 
01018 snd_pcm_uframes_t snd_pcm_meter_get_bufsize(snd_pcm_t *pcm);
01019 unsigned int snd_pcm_meter_get_channels(snd_pcm_t *pcm);
01020 unsigned int snd_pcm_meter_get_rate(snd_pcm_t *pcm);
01021 snd_pcm_uframes_t snd_pcm_meter_get_now(snd_pcm_t *pcm);
01022 snd_pcm_uframes_t snd_pcm_meter_get_boundary(snd_pcm_t *pcm);
01023 int snd_pcm_meter_add_scope(snd_pcm_t *pcm, snd_pcm_scope_t *scope);
01024 snd_pcm_scope_t *snd_pcm_meter_search_scope(snd_pcm_t *pcm, const char *name);
01025 int snd_pcm_scope_malloc(snd_pcm_scope_t **ptr);
01026 void snd_pcm_scope_set_ops(snd_pcm_scope_t *scope,
01027                            const snd_pcm_scope_ops_t *val);
01028 void snd_pcm_scope_set_name(snd_pcm_scope_t *scope, const char *val);
01029 const char *snd_pcm_scope_get_name(snd_pcm_scope_t *scope);
01030 void *snd_pcm_scope_get_callback_private(snd_pcm_scope_t *scope);
01031 void snd_pcm_scope_set_callback_private(snd_pcm_scope_t *scope, void *val);
01032 int snd_pcm_scope_s16_open(snd_pcm_t *pcm, const char *name,
01033                            snd_pcm_scope_t **scopep);
01034 int16_t *snd_pcm_scope_s16_get_channel_buffer(snd_pcm_scope_t *scope,
01035                                               unsigned int channel);
01036 
01047 typedef enum _snd_spcm_latency {
01050         SND_SPCM_LATENCY_STANDARD = 0,
01053         SND_SPCM_LATENCY_MEDIUM,
01056         SND_SPCM_LATENCY_REALTIME
01057 } snd_spcm_latency_t;
01058 
01060 typedef enum _snd_spcm_xrun_type {
01062         SND_SPCM_XRUN_IGNORE = 0,
01064         SND_SPCM_XRUN_STOP
01065 } snd_spcm_xrun_type_t;
01066 
01068 typedef enum _snd_spcm_duplex_type {
01070         SND_SPCM_DUPLEX_LIBERAL = 0,
01072         SND_SPCM_DUPLEX_PEDANTIC
01073 } snd_spcm_duplex_type_t;
01074 
01075 int snd_spcm_init(snd_pcm_t *pcm,
01076                   unsigned int rate,
01077                   unsigned int channels,
01078                   snd_pcm_format_t format,
01079                   snd_pcm_subformat_t subformat,
01080                   snd_spcm_latency_t latency,
01081                   snd_pcm_access_t _access,
01082                   snd_spcm_xrun_type_t xrun_type);
01083 
01084 int snd_spcm_init_duplex(snd_pcm_t *playback_pcm,
01085                          snd_pcm_t *capture_pcm,
01086                          unsigned int rate,
01087                          unsigned int channels,
01088                          snd_pcm_format_t format,
01089                          snd_pcm_subformat_t subformat,
01090                          snd_spcm_latency_t latency,
01091                          snd_pcm_access_t _access,
01092                          snd_spcm_xrun_type_t xrun_type,
01093                          snd_spcm_duplex_type_t duplex_type);
01094 
01095 int snd_spcm_init_get_params(snd_pcm_t *pcm,
01096                              unsigned int *rate,
01097                              snd_pcm_uframes_t *buffer_size,
01098                              snd_pcm_uframes_t *period_size);
01099 
01109 /* Deprecated functions, for compatibility */
01110 const char *snd_pcm_start_mode_name(snd_pcm_start_t mode) __attribute__((deprecated));
01111 const char *snd_pcm_xrun_mode_name(snd_pcm_xrun_t mode) __attribute__((deprecated));
01112 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));
01113 snd_pcm_start_t snd_pcm_sw_params_get_start_mode(const snd_pcm_sw_params_t *params) __attribute__((deprecated));
01114 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));
01115 snd_pcm_xrun_t snd_pcm_sw_params_get_xrun_mode(const snd_pcm_sw_params_t *params) __attribute__((deprecated));
01116 #if !defined(ALSA_LIBRARY_BUILD) && !defined(ALSA_PCM_OLD_SW_PARAMS_API)
01117 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));
01118 int snd_pcm_sw_params_get_xfer_align(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val) __attribute__((deprecated));
01119 int snd_pcm_sw_params_set_sleep_min(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, unsigned int val) __attribute__((deprecated));
01120 int snd_pcm_sw_params_get_sleep_min(const snd_pcm_sw_params_t *params, unsigned int *val) __attribute__((deprecated));
01121 #endif /* !ALSA_LIBRARY_BUILD && !ALSA_PCM_OLD_SW_PARAMS_API */
01122 #if !defined(ALSA_LIBRARY_BUILD) && !defined(ALSA_PCM_OLD_HW_PARAMS_API)
01123 int snd_pcm_hw_params_get_tick_time(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir) __attribute__((deprecated));
01124 int snd_pcm_hw_params_get_tick_time_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir) __attribute__((deprecated));
01125 int snd_pcm_hw_params_get_tick_time_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir) __attribute__((deprecated));
01126 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));
01127 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));
01128 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));
01129 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));
01130 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));
01131 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));
01132 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));
01133 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));
01134 #endif /* !ALSA_LIBRARY_BUILD && !ALSA_PCM_OLD_HW_PARAMS_API */
01135 
01138 #ifdef __cplusplus
01139 }
01140 #endif
01141 
01142 #endif /* __ALSA_PCM_H */
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines

Generated for ALSA project - the C library reference by doxygen 1.7.4