/home/alsa/tmp/cvs/alsa-lib/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;
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         SND_PCM_FORMAT_LAST = SND_PCM_FORMAT_U18_3BE,
00203 
00204 #if __BYTE_ORDER == __LITTLE_ENDIAN
00205 
00206         SND_PCM_FORMAT_S16 = SND_PCM_FORMAT_S16_LE,
00208         SND_PCM_FORMAT_U16 = SND_PCM_FORMAT_U16_LE,
00210         SND_PCM_FORMAT_S24 = SND_PCM_FORMAT_S24_LE,
00212         SND_PCM_FORMAT_U24 = SND_PCM_FORMAT_U24_LE,
00214         SND_PCM_FORMAT_S32 = SND_PCM_FORMAT_S32_LE,
00216         SND_PCM_FORMAT_U32 = SND_PCM_FORMAT_U32_LE,
00218         SND_PCM_FORMAT_FLOAT = SND_PCM_FORMAT_FLOAT_LE,
00220         SND_PCM_FORMAT_FLOAT64 = SND_PCM_FORMAT_FLOAT64_LE,
00222         SND_PCM_FORMAT_IEC958_SUBFRAME = SND_PCM_FORMAT_IEC958_SUBFRAME_LE
00223 #elif __BYTE_ORDER == __BIG_ENDIAN
00224 
00225         SND_PCM_FORMAT_S16 = SND_PCM_FORMAT_S16_BE,
00227         SND_PCM_FORMAT_U16 = SND_PCM_FORMAT_U16_BE,
00229         SND_PCM_FORMAT_S24 = SND_PCM_FORMAT_S24_BE,
00231         SND_PCM_FORMAT_U24 = SND_PCM_FORMAT_U24_BE,
00233         SND_PCM_FORMAT_S32 = SND_PCM_FORMAT_S32_BE,
00235         SND_PCM_FORMAT_U32 = SND_PCM_FORMAT_U32_BE,
00237         SND_PCM_FORMAT_FLOAT = SND_PCM_FORMAT_FLOAT_BE,
00239         SND_PCM_FORMAT_FLOAT64 = SND_PCM_FORMAT_FLOAT64_BE,
00241         SND_PCM_FORMAT_IEC958_SUBFRAME = SND_PCM_FORMAT_IEC958_SUBFRAME_BE
00242 #else
00243 #error "Unknown endian"
00244 #endif
00245 } snd_pcm_format_t;
00246 
00248 typedef enum _snd_pcm_subformat {
00250         SND_PCM_SUBFORMAT_STD = 0,
00251         SND_PCM_SUBFORMAT_LAST = SND_PCM_SUBFORMAT_STD
00252 } snd_pcm_subformat_t;
00253 
00255 typedef enum _snd_pcm_state {
00257         SND_PCM_STATE_OPEN = 0,
00259         SND_PCM_STATE_SETUP,
00261         SND_PCM_STATE_PREPARED,
00263         SND_PCM_STATE_RUNNING,
00265         SND_PCM_STATE_XRUN,
00267         SND_PCM_STATE_DRAINING,
00269         SND_PCM_STATE_PAUSED,
00271         SND_PCM_STATE_SUSPENDED,
00273         SND_PCM_STATE_DISCONNECTED,
00274         SND_PCM_STATE_LAST = SND_PCM_STATE_DISCONNECTED
00275 } snd_pcm_state_t;
00276 
00278 typedef enum _snd_pcm_start {
00280         SND_PCM_START_DATA = 0,
00282         SND_PCM_START_EXPLICIT,
00283         SND_PCM_START_LAST = SND_PCM_START_EXPLICIT
00284 } snd_pcm_start_t;
00285 
00287 typedef enum _snd_pcm_xrun {
00289         SND_PCM_XRUN_NONE = 0,
00291         SND_PCM_XRUN_STOP,
00292         SND_PCM_XRUN_LAST = SND_PCM_XRUN_STOP
00293 } snd_pcm_xrun_t;
00294 
00296 typedef enum _snd_pcm_tstamp {
00298         SND_PCM_TSTAMP_NONE = 0,
00300         SND_PCM_TSTAMP_ENABLE,
00304         SND_PCM_TSTAMP_MMAP = SND_PCM_TSTAMP_ENABLE,
00305         SND_PCM_TSTAMP_LAST = SND_PCM_TSTAMP_ENABLE
00306 } snd_pcm_tstamp_t;
00307 
00309 typedef unsigned long snd_pcm_uframes_t;
00311 typedef long snd_pcm_sframes_t;
00312 
00314 #define SND_PCM_NONBLOCK                0x00000001
00315 
00316 #define SND_PCM_ASYNC                   0x00000002
00317 
00318 #define SND_PCM_NO_AUTO_RESAMPLE        0x00010000
00319 
00320 #define SND_PCM_NO_AUTO_CHANNELS        0x00020000
00321 
00322 #define SND_PCM_NO_AUTO_FORMAT          0x00040000
00323 
00324 #define SND_PCM_NO_SOFTVOL              0x00080000
00325 
00327 typedef struct _snd_pcm snd_pcm_t;
00328 
00330 enum _snd_pcm_type {
00332         SND_PCM_TYPE_HW = 0,
00334         SND_PCM_TYPE_HOOKS,
00337         SND_PCM_TYPE_MULTI,
00339         SND_PCM_TYPE_FILE,
00341         SND_PCM_TYPE_NULL,
00343         SND_PCM_TYPE_SHM,
00345         SND_PCM_TYPE_INET,
00347         SND_PCM_TYPE_COPY,
00349         SND_PCM_TYPE_LINEAR,
00351         SND_PCM_TYPE_ALAW,
00353         SND_PCM_TYPE_MULAW,
00355         SND_PCM_TYPE_ADPCM,
00357         SND_PCM_TYPE_RATE,
00359         SND_PCM_TYPE_ROUTE,
00361         SND_PCM_TYPE_PLUG,
00363         SND_PCM_TYPE_SHARE,
00365         SND_PCM_TYPE_METER,
00367         SND_PCM_TYPE_MIX,
00369         SND_PCM_TYPE_DROUTE,
00371         SND_PCM_TYPE_LBSERVER,
00373         SND_PCM_TYPE_LINEAR_FLOAT,
00375         SND_PCM_TYPE_LADSPA,
00377         SND_PCM_TYPE_DMIX,
00379         SND_PCM_TYPE_JACK,
00381         SND_PCM_TYPE_DSNOOP,
00383         SND_PCM_TYPE_DSHARE,
00385         SND_PCM_TYPE_IEC958,
00387         SND_PCM_TYPE_SOFTVOL,
00389         SND_PCM_TYPE_IOPLUG,
00391         SND_PCM_TYPE_EXTPLUG,
00393         SND_PCM_TYPE_MMAP_EMUL,
00394         SND_PCM_TYPE_LAST = SND_PCM_TYPE_MMAP_EMUL
00395 };
00396 
00398 typedef enum _snd_pcm_type snd_pcm_type_t;
00399 
00401 typedef struct _snd_pcm_channel_area {
00403         void *addr;
00405         unsigned int first;
00407         unsigned int step;
00408 } snd_pcm_channel_area_t;
00409 
00411 typedef union _snd_pcm_sync_id {
00413         unsigned char id[16];
00415         unsigned short id16[8];
00417         unsigned int id32[4];
00418 } snd_pcm_sync_id_t;
00419 
00421 typedef struct _snd_pcm_scope snd_pcm_scope_t;
00422 
00423 int snd_pcm_open(snd_pcm_t **pcm, const char *name, 
00424                  snd_pcm_stream_t stream, int mode);
00425 int snd_pcm_open_lconf(snd_pcm_t **pcm, const char *name, 
00426                        snd_pcm_stream_t stream, int mode,
00427                        snd_config_t *lconf);
00428 int snd_pcm_open_fallback(snd_pcm_t **pcm, snd_config_t *root,
00429                           const char *name, const char *orig_name,
00430                           snd_pcm_stream_t stream, int mode);
00431 
00432 int snd_pcm_close(snd_pcm_t *pcm);
00433 const char *snd_pcm_name(snd_pcm_t *pcm);
00434 snd_pcm_type_t snd_pcm_type(snd_pcm_t *pcm);
00435 snd_pcm_stream_t snd_pcm_stream(snd_pcm_t *pcm);
00436 int snd_pcm_poll_descriptors_count(snd_pcm_t *pcm);
00437 int snd_pcm_poll_descriptors(snd_pcm_t *pcm, struct pollfd *pfds, unsigned int space);
00438 int snd_pcm_poll_descriptors_revents(snd_pcm_t *pcm, struct pollfd *pfds, unsigned int nfds, unsigned short *revents);
00439 int snd_pcm_nonblock(snd_pcm_t *pcm, int nonblock);
00440 int snd_async_add_pcm_handler(snd_async_handler_t **handler, snd_pcm_t *pcm, 
00441                               snd_async_callback_t callback, void *private_data);
00442 snd_pcm_t *snd_async_handler_get_pcm(snd_async_handler_t *handler);
00443 int snd_pcm_info(snd_pcm_t *pcm, snd_pcm_info_t *info);
00444 int snd_pcm_hw_params_current(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
00445 int snd_pcm_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
00446 int snd_pcm_hw_free(snd_pcm_t *pcm);
00447 int snd_pcm_sw_params_current(snd_pcm_t *pcm, snd_pcm_sw_params_t *params);
00448 int snd_pcm_sw_params(snd_pcm_t *pcm, snd_pcm_sw_params_t *params);
00449 int snd_pcm_prepare(snd_pcm_t *pcm);
00450 int snd_pcm_reset(snd_pcm_t *pcm);
00451 int snd_pcm_status(snd_pcm_t *pcm, snd_pcm_status_t *status);
00452 int snd_pcm_start(snd_pcm_t *pcm);
00453 int snd_pcm_drop(snd_pcm_t *pcm);
00454 int snd_pcm_drain(snd_pcm_t *pcm);
00455 int snd_pcm_pause(snd_pcm_t *pcm, int enable);
00456 snd_pcm_state_t snd_pcm_state(snd_pcm_t *pcm);
00457 int snd_pcm_hwsync(snd_pcm_t *pcm);
00458 int snd_pcm_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *delayp);
00459 int snd_pcm_resume(snd_pcm_t *pcm);
00460 int snd_pcm_htimestamp(snd_pcm_t *pcm, snd_pcm_uframes_t *avail, snd_htimestamp_t *tstamp);
00461 snd_pcm_sframes_t snd_pcm_avail(snd_pcm_t *pcm);
00462 snd_pcm_sframes_t snd_pcm_avail_update(snd_pcm_t *pcm);
00463 int snd_pcm_avail_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *availp, snd_pcm_sframes_t *delayp);
00464 snd_pcm_sframes_t snd_pcm_rewindable(snd_pcm_t *pcm);
00465 snd_pcm_sframes_t snd_pcm_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t frames);
00466 snd_pcm_sframes_t snd_pcm_forwardable(snd_pcm_t *pcm);
00467 snd_pcm_sframes_t snd_pcm_forward(snd_pcm_t *pcm, snd_pcm_uframes_t frames);
00468 snd_pcm_sframes_t snd_pcm_writei(snd_pcm_t *pcm, const void *buffer, snd_pcm_uframes_t size);
00469 snd_pcm_sframes_t snd_pcm_readi(snd_pcm_t *pcm, void *buffer, snd_pcm_uframes_t size);
00470 snd_pcm_sframes_t snd_pcm_writen(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size);
00471 snd_pcm_sframes_t snd_pcm_readn(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size);
00472 int snd_pcm_wait(snd_pcm_t *pcm, int timeout);
00473 
00474 int snd_pcm_link(snd_pcm_t *pcm1, snd_pcm_t *pcm2);
00475 int snd_pcm_unlink(snd_pcm_t *pcm);
00476 
00477 //int snd_pcm_mixer_element(snd_pcm_t *pcm, snd_mixer_t *mixer, snd_mixer_elem_t **elem);
00478 
00479 /*
00480  * application helpers - these functions are implemented on top
00481  * of the basic API
00482  */
00483 
00484 int snd_pcm_recover(snd_pcm_t *pcm, int err, int silent);
00485 int snd_pcm_set_params(snd_pcm_t *pcm,
00486                        snd_pcm_format_t format,
00487                        snd_pcm_access_t access,
00488                        unsigned int channels,
00489                        unsigned int rate,
00490                        int soft_resample,
00491                        unsigned int latency);
00492 int snd_pcm_get_params(snd_pcm_t *pcm,
00493                        snd_pcm_uframes_t *buffer_size,
00494                        snd_pcm_uframes_t *period_size);
00495 
00505 size_t snd_pcm_info_sizeof(void);
00510 #define snd_pcm_info_alloca(ptr) __snd_alloca(ptr, snd_pcm_info)
00511 int snd_pcm_info_malloc(snd_pcm_info_t **ptr);
00512 void snd_pcm_info_free(snd_pcm_info_t *obj);
00513 void snd_pcm_info_copy(snd_pcm_info_t *dst, const snd_pcm_info_t *src);
00514 unsigned int snd_pcm_info_get_device(const snd_pcm_info_t *obj);
00515 unsigned int snd_pcm_info_get_subdevice(const snd_pcm_info_t *obj);
00516 snd_pcm_stream_t snd_pcm_info_get_stream(const snd_pcm_info_t *obj);
00517 int snd_pcm_info_get_card(const snd_pcm_info_t *obj);
00518 const char *snd_pcm_info_get_id(const snd_pcm_info_t *obj);
00519 const char *snd_pcm_info_get_name(const snd_pcm_info_t *obj);
00520 const char *snd_pcm_info_get_subdevice_name(const snd_pcm_info_t *obj);
00521 snd_pcm_class_t snd_pcm_info_get_class(const snd_pcm_info_t *obj);
00522 snd_pcm_subclass_t snd_pcm_info_get_subclass(const snd_pcm_info_t *obj);
00523 unsigned int snd_pcm_info_get_subdevices_count(const snd_pcm_info_t *obj);
00524 unsigned int snd_pcm_info_get_subdevices_avail(const snd_pcm_info_t *obj);
00525 snd_pcm_sync_id_t snd_pcm_info_get_sync(const snd_pcm_info_t *obj);
00526 void snd_pcm_info_set_device(snd_pcm_info_t *obj, unsigned int val);
00527 void snd_pcm_info_set_subdevice(snd_pcm_info_t *obj, unsigned int val);
00528 void snd_pcm_info_set_stream(snd_pcm_info_t *obj, snd_pcm_stream_t val);
00529 
00539 int snd_pcm_hw_params_any(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
00540 
00541 int snd_pcm_hw_params_can_mmap_sample_resolution(const snd_pcm_hw_params_t *params);
00542 int snd_pcm_hw_params_is_double(const snd_pcm_hw_params_t *params);
00543 int snd_pcm_hw_params_is_batch(const snd_pcm_hw_params_t *params);
00544 int snd_pcm_hw_params_is_block_transfer(const snd_pcm_hw_params_t *params);
00545 int snd_pcm_hw_params_is_monotonic(const snd_pcm_hw_params_t *params);
00546 int snd_pcm_hw_params_can_overrange(const snd_pcm_hw_params_t *params);
00547 int snd_pcm_hw_params_can_pause(const snd_pcm_hw_params_t *params);
00548 int snd_pcm_hw_params_can_resume(const snd_pcm_hw_params_t *params);
00549 int snd_pcm_hw_params_is_half_duplex(const snd_pcm_hw_params_t *params);
00550 int snd_pcm_hw_params_is_joint_duplex(const snd_pcm_hw_params_t *params);
00551 int snd_pcm_hw_params_can_sync_start(const snd_pcm_hw_params_t *params);
00552 int snd_pcm_hw_params_can_disable_period_wakeup(const snd_pcm_hw_params_t *params);
00553 int snd_pcm_hw_params_get_rate_numden(const snd_pcm_hw_params_t *params,
00554                                       unsigned int *rate_num,
00555                                       unsigned int *rate_den);
00556 int snd_pcm_hw_params_get_sbits(const snd_pcm_hw_params_t *params);
00557 int snd_pcm_hw_params_get_fifo_size(const snd_pcm_hw_params_t *params);
00558 
00559 #if 0
00560 typedef struct _snd_pcm_hw_strategy snd_pcm_hw_strategy_t;
00561 
00562 /* choices need to be sorted on ascending badness */
00563 typedef struct _snd_pcm_hw_strategy_simple_choices_list {
00564         unsigned int value;
00565         unsigned int badness;
00566 } snd_pcm_hw_strategy_simple_choices_list_t;
00567 
00568 int snd_pcm_hw_params_strategy(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
00569                                const snd_pcm_hw_strategy_t *strategy,
00570                                unsigned int badness_min,
00571                                unsigned int badness_max);
00572 
00573 void snd_pcm_hw_strategy_free(snd_pcm_hw_strategy_t *strategy);
00574 int snd_pcm_hw_strategy_simple(snd_pcm_hw_strategy_t **strategyp,
00575                                unsigned int badness_min,
00576                                unsigned int badness_max);
00577 int snd_pcm_hw_params_try_explain_failure(snd_pcm_t *pcm,
00578                                           snd_pcm_hw_params_t *fail,
00579                                           snd_pcm_hw_params_t *success,
00580                                           unsigned int depth,
00581                                           snd_output_t *out);
00582 
00583 #endif
00584 
00585 size_t snd_pcm_hw_params_sizeof(void);
00590 #define snd_pcm_hw_params_alloca(ptr) __snd_alloca(ptr, snd_pcm_hw_params)
00591 int snd_pcm_hw_params_malloc(snd_pcm_hw_params_t **ptr);
00592 void snd_pcm_hw_params_free(snd_pcm_hw_params_t *obj);
00593 void snd_pcm_hw_params_copy(snd_pcm_hw_params_t *dst, const snd_pcm_hw_params_t *src);
00594 
00595 #if !defined(ALSA_LIBRARY_BUILD) && !defined(ALSA_PCM_OLD_HW_PARAMS_API)
00596 
00597 int snd_pcm_hw_params_get_access(const snd_pcm_hw_params_t *params, snd_pcm_access_t *_access);
00598 int snd_pcm_hw_params_test_access(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t _access);
00599 int snd_pcm_hw_params_set_access(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t _access);
00600 int snd_pcm_hw_params_set_access_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t *_access);
00601 int snd_pcm_hw_params_set_access_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t *_access);
00602 int snd_pcm_hw_params_set_access_mask(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_mask_t *mask);
00603 int snd_pcm_hw_params_get_access_mask(snd_pcm_hw_params_t *params, snd_pcm_access_mask_t *mask);
00604 
00605 int snd_pcm_hw_params_get_format(const snd_pcm_hw_params_t *params, snd_pcm_format_t *val);
00606 int snd_pcm_hw_params_test_format(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t val);
00607 int snd_pcm_hw_params_set_format(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t val);
00608 int snd_pcm_hw_params_set_format_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t *format);
00609 int snd_pcm_hw_params_set_format_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t *format);
00610 int snd_pcm_hw_params_set_format_mask(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_mask_t *mask);
00611 void snd_pcm_hw_params_get_format_mask(snd_pcm_hw_params_t *params, snd_pcm_format_mask_t *mask);
00612 
00613 int snd_pcm_hw_params_get_subformat(const snd_pcm_hw_params_t *params, snd_pcm_subformat_t *subformat);
00614 int snd_pcm_hw_params_test_subformat(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t subformat);
00615 int snd_pcm_hw_params_set_subformat(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t subformat);
00616 int snd_pcm_hw_params_set_subformat_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t *subformat);
00617 int snd_pcm_hw_params_set_subformat_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t *subformat);
00618 int snd_pcm_hw_params_set_subformat_mask(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_mask_t *mask);
00619 void snd_pcm_hw_params_get_subformat_mask(snd_pcm_hw_params_t *params, snd_pcm_subformat_mask_t *mask);
00620 
00621 int snd_pcm_hw_params_get_channels(const snd_pcm_hw_params_t *params, unsigned int *val);
00622 int snd_pcm_hw_params_get_channels_min(const snd_pcm_hw_params_t *params, unsigned int *val);
00623 int snd_pcm_hw_params_get_channels_max(const snd_pcm_hw_params_t *params, unsigned int *val);
00624 int snd_pcm_hw_params_test_channels(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
00625 int snd_pcm_hw_params_set_channels(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
00626 int snd_pcm_hw_params_set_channels_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
00627 int snd_pcm_hw_params_set_channels_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
00628 int snd_pcm_hw_params_set_channels_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *min, unsigned int *max);
00629 int snd_pcm_hw_params_set_channels_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
00630 int snd_pcm_hw_params_set_channels_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
00631 int snd_pcm_hw_params_set_channels_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
00632 
00633 int snd_pcm_hw_params_get_rate(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00634 int snd_pcm_hw_params_get_rate_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00635 int snd_pcm_hw_params_get_rate_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00636 int snd_pcm_hw_params_test_rate(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
00637 int snd_pcm_hw_params_set_rate(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
00638 int snd_pcm_hw_params_set_rate_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00639 int snd_pcm_hw_params_set_rate_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00640 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);
00641 int snd_pcm_hw_params_set_rate_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00642 int snd_pcm_hw_params_set_rate_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00643 int snd_pcm_hw_params_set_rate_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00644 int snd_pcm_hw_params_set_rate_resample(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
00645 int snd_pcm_hw_params_get_rate_resample(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
00646 int snd_pcm_hw_params_set_export_buffer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
00647 int snd_pcm_hw_params_get_export_buffer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
00648 int snd_pcm_hw_params_set_period_wakeup(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
00649 int snd_pcm_hw_params_get_period_wakeup(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
00650 
00651 int snd_pcm_hw_params_get_period_time(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00652 int snd_pcm_hw_params_get_period_time_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00653 int snd_pcm_hw_params_get_period_time_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00654 int snd_pcm_hw_params_test_period_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
00655 int snd_pcm_hw_params_set_period_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
00656 int snd_pcm_hw_params_set_period_time_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00657 int snd_pcm_hw_params_set_period_time_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00658 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);
00659 int snd_pcm_hw_params_set_period_time_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00660 int snd_pcm_hw_params_set_period_time_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00661 int snd_pcm_hw_params_set_period_time_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00662 
00663 int snd_pcm_hw_params_get_period_size(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *frames, int *dir);
00664 int snd_pcm_hw_params_get_period_size_min(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *frames, int *dir);
00665 int snd_pcm_hw_params_get_period_size_max(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *frames, int *dir);
00666 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);
00667 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);
00668 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);
00669 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);
00670 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);
00671 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);
00672 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);
00673 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);
00674 int snd_pcm_hw_params_set_period_size_integer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
00675 
00676 int snd_pcm_hw_params_get_periods(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00677 int snd_pcm_hw_params_get_periods_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00678 int snd_pcm_hw_params_get_periods_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00679 int snd_pcm_hw_params_test_periods(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
00680 int snd_pcm_hw_params_set_periods(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
00681 int snd_pcm_hw_params_set_periods_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00682 int snd_pcm_hw_params_set_periods_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00683 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);
00684 int snd_pcm_hw_params_set_periods_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00685 int snd_pcm_hw_params_set_periods_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00686 int snd_pcm_hw_params_set_periods_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00687 int snd_pcm_hw_params_set_periods_integer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
00688 
00689 int snd_pcm_hw_params_get_buffer_time(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00690 int snd_pcm_hw_params_get_buffer_time_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00691 int snd_pcm_hw_params_get_buffer_time_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00692 int snd_pcm_hw_params_test_buffer_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
00693 int snd_pcm_hw_params_set_buffer_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
00694 int snd_pcm_hw_params_set_buffer_time_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00695 int snd_pcm_hw_params_set_buffer_time_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00696 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);
00697 int snd_pcm_hw_params_set_buffer_time_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00698 int snd_pcm_hw_params_set_buffer_time_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00699 int snd_pcm_hw_params_set_buffer_time_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00700 
00701 int snd_pcm_hw_params_get_buffer_size(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
00702 int snd_pcm_hw_params_get_buffer_size_min(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
00703 int snd_pcm_hw_params_get_buffer_size_max(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
00704 int snd_pcm_hw_params_test_buffer_size(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t val);
00705 int snd_pcm_hw_params_set_buffer_size(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t val);
00706 int snd_pcm_hw_params_set_buffer_size_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
00707 int snd_pcm_hw_params_set_buffer_size_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
00708 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);
00709 int snd_pcm_hw_params_set_buffer_size_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
00710 int snd_pcm_hw_params_set_buffer_size_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
00711 int snd_pcm_hw_params_set_buffer_size_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
00712 
00713 #endif /* !ALSA_LIBRARY_BUILD && !ALSA_PCM_OLD_HW_PARAMS_API */
00714 
00715 int snd_pcm_hw_params_get_min_align(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
00716 
00726 size_t snd_pcm_sw_params_sizeof(void);
00731 #define snd_pcm_sw_params_alloca(ptr) __snd_alloca(ptr, snd_pcm_sw_params)
00732 int snd_pcm_sw_params_malloc(snd_pcm_sw_params_t **ptr);
00733 void snd_pcm_sw_params_free(snd_pcm_sw_params_t *obj);
00734 void snd_pcm_sw_params_copy(snd_pcm_sw_params_t *dst, const snd_pcm_sw_params_t *src);
00735 int snd_pcm_sw_params_get_boundary(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val);
00736 
00737 #if !defined(ALSA_LIBRARY_BUILD) && !defined(ALSA_PCM_OLD_SW_PARAMS_API)
00738 
00739 int snd_pcm_sw_params_set_tstamp_mode(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_tstamp_t val);
00740 int snd_pcm_sw_params_get_tstamp_mode(const snd_pcm_sw_params_t *params, snd_pcm_tstamp_t *val);
00741 int snd_pcm_sw_params_set_avail_min(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
00742 int snd_pcm_sw_params_get_avail_min(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val);
00743 int snd_pcm_sw_params_set_period_event(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, int val);
00744 int snd_pcm_sw_params_get_period_event(const snd_pcm_sw_params_t *params, int *val);
00745 int snd_pcm_sw_params_set_start_threshold(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
00746 int snd_pcm_sw_params_get_start_threshold(const snd_pcm_sw_params_t *paramsm, snd_pcm_uframes_t *val);
00747 int snd_pcm_sw_params_set_stop_threshold(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
00748 int snd_pcm_sw_params_get_stop_threshold(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val);
00749 int snd_pcm_sw_params_set_silence_threshold(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
00750 int snd_pcm_sw_params_get_silence_threshold(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val);
00751 int snd_pcm_sw_params_set_silence_size(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
00752 int snd_pcm_sw_params_get_silence_size(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val);
00753 
00754 #endif /* !ALSA_LIBRARY_BUILD && !ALSA_PCM_OLD_SW_PARAMS_API */
00755 
00758 /* include old API */
00759 #ifndef ALSA_LIBRARY_BUILD
00760 #if defined(ALSA_PCM_OLD_HW_PARAMS_API) || defined(ALSA_PCM_OLD_SW_PARAMS_API)
00761 #include "pcm_old.h"
00762 #endif
00763 #endif
00764 
00772 size_t snd_pcm_access_mask_sizeof(void);
00777 #define snd_pcm_access_mask_alloca(ptr) __snd_alloca(ptr, snd_pcm_access_mask)
00778 int snd_pcm_access_mask_malloc(snd_pcm_access_mask_t **ptr);
00779 void snd_pcm_access_mask_free(snd_pcm_access_mask_t *obj);
00780 void snd_pcm_access_mask_copy(snd_pcm_access_mask_t *dst, const snd_pcm_access_mask_t *src);
00781 void snd_pcm_access_mask_none(snd_pcm_access_mask_t *mask);
00782 void snd_pcm_access_mask_any(snd_pcm_access_mask_t *mask);
00783 int snd_pcm_access_mask_test(const snd_pcm_access_mask_t *mask, snd_pcm_access_t val);
00784 int snd_pcm_access_mask_empty(const snd_pcm_access_mask_t *mask);
00785 void snd_pcm_access_mask_set(snd_pcm_access_mask_t *mask, snd_pcm_access_t val);
00786 void snd_pcm_access_mask_reset(snd_pcm_access_mask_t *mask, snd_pcm_access_t val);
00787 
00797 size_t snd_pcm_format_mask_sizeof(void);
00802 #define snd_pcm_format_mask_alloca(ptr) __snd_alloca(ptr, snd_pcm_format_mask)
00803 int snd_pcm_format_mask_malloc(snd_pcm_format_mask_t **ptr);
00804 void snd_pcm_format_mask_free(snd_pcm_format_mask_t *obj);
00805 void snd_pcm_format_mask_copy(snd_pcm_format_mask_t *dst, const snd_pcm_format_mask_t *src);
00806 void snd_pcm_format_mask_none(snd_pcm_format_mask_t *mask);
00807 void snd_pcm_format_mask_any(snd_pcm_format_mask_t *mask);
00808 int snd_pcm_format_mask_test(const snd_pcm_format_mask_t *mask, snd_pcm_format_t val);
00809 int snd_pcm_format_mask_empty(const snd_pcm_format_mask_t *mask);
00810 void snd_pcm_format_mask_set(snd_pcm_format_mask_t *mask, snd_pcm_format_t val);
00811 void snd_pcm_format_mask_reset(snd_pcm_format_mask_t *mask, snd_pcm_format_t val);
00812 
00822 size_t snd_pcm_subformat_mask_sizeof(void);
00827 #define snd_pcm_subformat_mask_alloca(ptr) __snd_alloca(ptr, snd_pcm_subformat_mask)
00828 int snd_pcm_subformat_mask_malloc(snd_pcm_subformat_mask_t **ptr);
00829 void snd_pcm_subformat_mask_free(snd_pcm_subformat_mask_t *obj);
00830 void snd_pcm_subformat_mask_copy(snd_pcm_subformat_mask_t *dst, const snd_pcm_subformat_mask_t *src);
00831 void snd_pcm_subformat_mask_none(snd_pcm_subformat_mask_t *mask);
00832 void snd_pcm_subformat_mask_any(snd_pcm_subformat_mask_t *mask);
00833 int snd_pcm_subformat_mask_test(const snd_pcm_subformat_mask_t *mask, snd_pcm_subformat_t val);
00834 int snd_pcm_subformat_mask_empty(const snd_pcm_subformat_mask_t *mask);
00835 void snd_pcm_subformat_mask_set(snd_pcm_subformat_mask_t *mask, snd_pcm_subformat_t val);
00836 void snd_pcm_subformat_mask_reset(snd_pcm_subformat_mask_t *mask, snd_pcm_subformat_t val);
00837 
00847 size_t snd_pcm_status_sizeof(void);
00852 #define snd_pcm_status_alloca(ptr) __snd_alloca(ptr, snd_pcm_status)
00853 int snd_pcm_status_malloc(snd_pcm_status_t **ptr);
00854 void snd_pcm_status_free(snd_pcm_status_t *obj);
00855 void snd_pcm_status_copy(snd_pcm_status_t *dst, const snd_pcm_status_t *src);
00856 snd_pcm_state_t snd_pcm_status_get_state(const snd_pcm_status_t *obj);
00857 void snd_pcm_status_get_trigger_tstamp(const snd_pcm_status_t *obj, snd_timestamp_t *ptr);
00858 void snd_pcm_status_get_trigger_htstamp(const snd_pcm_status_t *obj, snd_htimestamp_t *ptr);
00859 void snd_pcm_status_get_tstamp(const snd_pcm_status_t *obj, snd_timestamp_t *ptr);
00860 void snd_pcm_status_get_htstamp(const snd_pcm_status_t *obj, snd_htimestamp_t *ptr);
00861 snd_pcm_sframes_t snd_pcm_status_get_delay(const snd_pcm_status_t *obj);
00862 snd_pcm_uframes_t snd_pcm_status_get_avail(const snd_pcm_status_t *obj);
00863 snd_pcm_uframes_t snd_pcm_status_get_avail_max(const snd_pcm_status_t *obj);
00864 snd_pcm_uframes_t snd_pcm_status_get_overrange(const snd_pcm_status_t *obj);
00865 
00875 const char *snd_pcm_type_name(snd_pcm_type_t type);
00876 const char *snd_pcm_stream_name(const snd_pcm_stream_t stream);
00877 const char *snd_pcm_access_name(const snd_pcm_access_t _access);
00878 const char *snd_pcm_format_name(const snd_pcm_format_t format);
00879 const char *snd_pcm_format_description(const snd_pcm_format_t format);
00880 const char *snd_pcm_subformat_name(const snd_pcm_subformat_t subformat);
00881 const char *snd_pcm_subformat_description(const snd_pcm_subformat_t subformat);
00882 snd_pcm_format_t snd_pcm_format_value(const char* name);
00883 const char *snd_pcm_tstamp_mode_name(const snd_pcm_tstamp_t mode);
00884 const char *snd_pcm_state_name(const snd_pcm_state_t state);
00885 
00895 int snd_pcm_dump(snd_pcm_t *pcm, snd_output_t *out);
00896 int snd_pcm_dump_hw_setup(snd_pcm_t *pcm, snd_output_t *out);
00897 int snd_pcm_dump_sw_setup(snd_pcm_t *pcm, snd_output_t *out);
00898 int snd_pcm_dump_setup(snd_pcm_t *pcm, snd_output_t *out);
00899 int snd_pcm_hw_params_dump(snd_pcm_hw_params_t *params, snd_output_t *out);
00900 int snd_pcm_sw_params_dump(snd_pcm_sw_params_t *params, snd_output_t *out);
00901 int snd_pcm_status_dump(snd_pcm_status_t *status, snd_output_t *out);
00902 
00912 int snd_pcm_mmap_begin(snd_pcm_t *pcm,
00913                        const snd_pcm_channel_area_t **areas,
00914                        snd_pcm_uframes_t *offset,
00915                        snd_pcm_uframes_t *frames);
00916 snd_pcm_sframes_t snd_pcm_mmap_commit(snd_pcm_t *pcm,
00917                                       snd_pcm_uframes_t offset,
00918                                       snd_pcm_uframes_t frames);
00919 snd_pcm_sframes_t snd_pcm_mmap_writei(snd_pcm_t *pcm, const void *buffer, snd_pcm_uframes_t size);
00920 snd_pcm_sframes_t snd_pcm_mmap_readi(snd_pcm_t *pcm, void *buffer, snd_pcm_uframes_t size);
00921 snd_pcm_sframes_t snd_pcm_mmap_writen(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size);
00922 snd_pcm_sframes_t snd_pcm_mmap_readn(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size);                                                                
00923 
00933 int snd_pcm_format_signed(snd_pcm_format_t format);
00934 int snd_pcm_format_unsigned(snd_pcm_format_t format);
00935 int snd_pcm_format_linear(snd_pcm_format_t format);
00936 int snd_pcm_format_float(snd_pcm_format_t format);
00937 int snd_pcm_format_little_endian(snd_pcm_format_t format);
00938 int snd_pcm_format_big_endian(snd_pcm_format_t format);
00939 int snd_pcm_format_cpu_endian(snd_pcm_format_t format);
00940 int snd_pcm_format_width(snd_pcm_format_t format);                      /* in bits */
00941 int snd_pcm_format_physical_width(snd_pcm_format_t format);             /* in bits */
00942 snd_pcm_format_t snd_pcm_build_linear_format(int width, int pwidth, int unsignd, int big_endian);
00943 ssize_t snd_pcm_format_size(snd_pcm_format_t format, size_t samples);
00944 u_int8_t snd_pcm_format_silence(snd_pcm_format_t format);
00945 u_int16_t snd_pcm_format_silence_16(snd_pcm_format_t format);
00946 u_int32_t snd_pcm_format_silence_32(snd_pcm_format_t format);
00947 u_int64_t snd_pcm_format_silence_64(snd_pcm_format_t format);
00948 int snd_pcm_format_set_silence(snd_pcm_format_t format, void *buf, unsigned int samples);
00949 
00950 snd_pcm_sframes_t snd_pcm_bytes_to_frames(snd_pcm_t *pcm, ssize_t bytes);
00951 ssize_t snd_pcm_frames_to_bytes(snd_pcm_t *pcm, snd_pcm_sframes_t frames);
00952 long snd_pcm_bytes_to_samples(snd_pcm_t *pcm, ssize_t bytes);
00953 ssize_t snd_pcm_samples_to_bytes(snd_pcm_t *pcm, long samples);
00954 
00955 int snd_pcm_area_silence(const snd_pcm_channel_area_t *dst_channel, snd_pcm_uframes_t dst_offset,
00956                          unsigned int samples, snd_pcm_format_t format);
00957 int snd_pcm_areas_silence(const snd_pcm_channel_area_t *dst_channels, snd_pcm_uframes_t dst_offset,
00958                           unsigned int channels, snd_pcm_uframes_t frames, snd_pcm_format_t format);
00959 int snd_pcm_area_copy(const snd_pcm_channel_area_t *dst_channel, snd_pcm_uframes_t dst_offset,
00960                       const snd_pcm_channel_area_t *src_channel, snd_pcm_uframes_t src_offset,
00961                       unsigned int samples, snd_pcm_format_t format);
00962 int snd_pcm_areas_copy(const snd_pcm_channel_area_t *dst_channels, snd_pcm_uframes_t dst_offset,
00963                        const snd_pcm_channel_area_t *src_channels, snd_pcm_uframes_t src_offset,
00964                        unsigned int channels, snd_pcm_uframes_t frames, snd_pcm_format_t format);
00965 
00976 typedef enum _snd_pcm_hook_type {
00977         SND_PCM_HOOK_TYPE_HW_PARAMS = 0,
00978         SND_PCM_HOOK_TYPE_HW_FREE,
00979         SND_PCM_HOOK_TYPE_CLOSE,
00980         SND_PCM_HOOK_TYPE_LAST = SND_PCM_HOOK_TYPE_CLOSE
00981 } snd_pcm_hook_type_t;
00982 
00984 typedef struct _snd_pcm_hook snd_pcm_hook_t;
00986 typedef int (*snd_pcm_hook_func_t)(snd_pcm_hook_t *hook);
00987 snd_pcm_t *snd_pcm_hook_get_pcm(snd_pcm_hook_t *hook);
00988 void *snd_pcm_hook_get_private(snd_pcm_hook_t *hook);
00989 void snd_pcm_hook_set_private(snd_pcm_hook_t *hook, void *private_data);
00990 int snd_pcm_hook_add(snd_pcm_hook_t **hookp, snd_pcm_t *pcm,
00991                      snd_pcm_hook_type_t type,
00992                      snd_pcm_hook_func_t func, void *private_data);
00993 int snd_pcm_hook_remove(snd_pcm_hook_t *hook);
00994 
01005 typedef struct _snd_pcm_scope_ops {
01009         int (*enable)(snd_pcm_scope_t *scope);
01013         void (*disable)(snd_pcm_scope_t *scope);
01017         void (*start)(snd_pcm_scope_t *scope);
01021         void (*stop)(snd_pcm_scope_t *scope);
01025         void (*update)(snd_pcm_scope_t *scope);
01029         void (*reset)(snd_pcm_scope_t *scope);
01033         void (*close)(snd_pcm_scope_t *scope);
01034 } snd_pcm_scope_ops_t;
01035 
01036 snd_pcm_uframes_t snd_pcm_meter_get_bufsize(snd_pcm_t *pcm);
01037 unsigned int snd_pcm_meter_get_channels(snd_pcm_t *pcm);
01038 unsigned int snd_pcm_meter_get_rate(snd_pcm_t *pcm);
01039 snd_pcm_uframes_t snd_pcm_meter_get_now(snd_pcm_t *pcm);
01040 snd_pcm_uframes_t snd_pcm_meter_get_boundary(snd_pcm_t *pcm);
01041 int snd_pcm_meter_add_scope(snd_pcm_t *pcm, snd_pcm_scope_t *scope);
01042 snd_pcm_scope_t *snd_pcm_meter_search_scope(snd_pcm_t *pcm, const char *name);
01043 int snd_pcm_scope_malloc(snd_pcm_scope_t **ptr);
01044 void snd_pcm_scope_set_ops(snd_pcm_scope_t *scope,
01045                            const snd_pcm_scope_ops_t *val);
01046 void snd_pcm_scope_set_name(snd_pcm_scope_t *scope, const char *val);
01047 const char *snd_pcm_scope_get_name(snd_pcm_scope_t *scope);
01048 void *snd_pcm_scope_get_callback_private(snd_pcm_scope_t *scope);
01049 void snd_pcm_scope_set_callback_private(snd_pcm_scope_t *scope, void *val);
01050 int snd_pcm_scope_s16_open(snd_pcm_t *pcm, const char *name,
01051                            snd_pcm_scope_t **scopep);
01052 int16_t *snd_pcm_scope_s16_get_channel_buffer(snd_pcm_scope_t *scope,
01053                                               unsigned int channel);
01054 
01065 typedef enum _snd_spcm_latency {
01068         SND_SPCM_LATENCY_STANDARD = 0,
01071         SND_SPCM_LATENCY_MEDIUM,
01074         SND_SPCM_LATENCY_REALTIME
01075 } snd_spcm_latency_t;
01076 
01078 typedef enum _snd_spcm_xrun_type {
01080         SND_SPCM_XRUN_IGNORE = 0,
01082         SND_SPCM_XRUN_STOP
01083 } snd_spcm_xrun_type_t;
01084 
01086 typedef enum _snd_spcm_duplex_type {
01088         SND_SPCM_DUPLEX_LIBERAL = 0,
01090         SND_SPCM_DUPLEX_PEDANTIC
01091 } snd_spcm_duplex_type_t;
01092 
01093 int snd_spcm_init(snd_pcm_t *pcm,
01094                   unsigned int rate,
01095                   unsigned int channels,
01096                   snd_pcm_format_t format,
01097                   snd_pcm_subformat_t subformat,
01098                   snd_spcm_latency_t latency,
01099                   snd_pcm_access_t _access,
01100                   snd_spcm_xrun_type_t xrun_type);
01101 
01102 int snd_spcm_init_duplex(snd_pcm_t *playback_pcm,
01103                          snd_pcm_t *capture_pcm,
01104                          unsigned int rate,
01105                          unsigned int channels,
01106                          snd_pcm_format_t format,
01107                          snd_pcm_subformat_t subformat,
01108                          snd_spcm_latency_t latency,
01109                          snd_pcm_access_t _access,
01110                          snd_spcm_xrun_type_t xrun_type,
01111                          snd_spcm_duplex_type_t duplex_type);
01112 
01113 int snd_spcm_init_get_params(snd_pcm_t *pcm,
01114                              unsigned int *rate,
01115                              snd_pcm_uframes_t *buffer_size,
01116                              snd_pcm_uframes_t *period_size);
01117 
01127 /* Deprecated functions, for compatibility */
01128 const char *snd_pcm_start_mode_name(snd_pcm_start_t mode) __attribute__((deprecated));
01129 const char *snd_pcm_xrun_mode_name(snd_pcm_xrun_t mode) __attribute__((deprecated));
01130 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));
01131 snd_pcm_start_t snd_pcm_sw_params_get_start_mode(const snd_pcm_sw_params_t *params) __attribute__((deprecated));
01132 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));
01133 snd_pcm_xrun_t snd_pcm_sw_params_get_xrun_mode(const snd_pcm_sw_params_t *params) __attribute__((deprecated));
01134 #if !defined(ALSA_LIBRARY_BUILD) && !defined(ALSA_PCM_OLD_SW_PARAMS_API)
01135 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));
01136 int snd_pcm_sw_params_get_xfer_align(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val) __attribute__((deprecated));
01137 int snd_pcm_sw_params_set_sleep_min(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, unsigned int val) __attribute__((deprecated));
01138 int snd_pcm_sw_params_get_sleep_min(const snd_pcm_sw_params_t *params, unsigned int *val) __attribute__((deprecated));
01139 #endif /* !ALSA_LIBRARY_BUILD && !ALSA_PCM_OLD_SW_PARAMS_API */
01140 #if !defined(ALSA_LIBRARY_BUILD) && !defined(ALSA_PCM_OLD_HW_PARAMS_API)
01141 int snd_pcm_hw_params_get_tick_time(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir) __attribute__((deprecated));
01142 int snd_pcm_hw_params_get_tick_time_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir) __attribute__((deprecated));
01143 int snd_pcm_hw_params_get_tick_time_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir) __attribute__((deprecated));
01144 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));
01145 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));
01146 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));
01147 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));
01148 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));
01149 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));
01150 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));
01151 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));
01152 #endif /* !ALSA_LIBRARY_BUILD && !ALSA_PCM_OLD_HW_PARAMS_API */
01153 
01156 #ifdef __cplusplus
01157 }
01158 #endif
01159 
01160 #endif /* __ALSA_PCM_H */

Generated on Wed Jan 25 10:30:30 2012 for ALSA project - the C library reference by  doxygen 1.5.0