ALSA project - the C library reference
/usr/src/RPM/BUILD/libalsa-1.0.27/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_ABORT                   0x00008000
00319 
00320 #define SND_PCM_NO_AUTO_RESAMPLE        0x00010000
00321 
00322 #define SND_PCM_NO_AUTO_CHANNELS        0x00020000
00323 
00324 #define SND_PCM_NO_AUTO_FORMAT          0x00040000
00325 
00326 #define SND_PCM_NO_SOFTVOL              0x00080000
00327 
00329 typedef struct _snd_pcm snd_pcm_t;
00330 
00332 enum _snd_pcm_type {
00334         SND_PCM_TYPE_HW = 0,
00336         SND_PCM_TYPE_HOOKS,
00339         SND_PCM_TYPE_MULTI,
00341         SND_PCM_TYPE_FILE,
00343         SND_PCM_TYPE_NULL,
00345         SND_PCM_TYPE_SHM,
00347         SND_PCM_TYPE_INET,
00349         SND_PCM_TYPE_COPY,
00351         SND_PCM_TYPE_LINEAR,
00353         SND_PCM_TYPE_ALAW,
00355         SND_PCM_TYPE_MULAW,
00357         SND_PCM_TYPE_ADPCM,
00359         SND_PCM_TYPE_RATE,
00361         SND_PCM_TYPE_ROUTE,
00363         SND_PCM_TYPE_PLUG,
00365         SND_PCM_TYPE_SHARE,
00367         SND_PCM_TYPE_METER,
00369         SND_PCM_TYPE_MIX,
00371         SND_PCM_TYPE_DROUTE,
00373         SND_PCM_TYPE_LBSERVER,
00375         SND_PCM_TYPE_LINEAR_FLOAT,
00377         SND_PCM_TYPE_LADSPA,
00379         SND_PCM_TYPE_DMIX,
00381         SND_PCM_TYPE_JACK,
00383         SND_PCM_TYPE_DSNOOP,
00385         SND_PCM_TYPE_DSHARE,
00387         SND_PCM_TYPE_IEC958,
00389         SND_PCM_TYPE_SOFTVOL,
00391         SND_PCM_TYPE_IOPLUG,
00393         SND_PCM_TYPE_EXTPLUG,
00395         SND_PCM_TYPE_MMAP_EMUL,
00396         SND_PCM_TYPE_LAST = SND_PCM_TYPE_MMAP_EMUL
00397 };
00398 
00400 typedef enum _snd_pcm_type snd_pcm_type_t;
00401 
00403 typedef struct _snd_pcm_channel_area {
00405         void *addr;
00407         unsigned int first;
00409         unsigned int step;
00410 } snd_pcm_channel_area_t;
00411 
00413 typedef union _snd_pcm_sync_id {
00415         unsigned char id[16];
00417         unsigned short id16[8];
00419         unsigned int id32[4];
00420 } snd_pcm_sync_id_t;
00421 
00423 typedef struct _snd_pcm_scope snd_pcm_scope_t;
00424 
00425 int snd_pcm_open(snd_pcm_t **pcm, const char *name, 
00426                  snd_pcm_stream_t stream, int mode);
00427 int snd_pcm_open_lconf(snd_pcm_t **pcm, const char *name, 
00428                        snd_pcm_stream_t stream, int mode,
00429                        snd_config_t *lconf);
00430 int snd_pcm_open_fallback(snd_pcm_t **pcm, snd_config_t *root,
00431                           const char *name, const char *orig_name,
00432                           snd_pcm_stream_t stream, int mode);
00433 
00434 int snd_pcm_close(snd_pcm_t *pcm);
00435 const char *snd_pcm_name(snd_pcm_t *pcm);
00436 snd_pcm_type_t snd_pcm_type(snd_pcm_t *pcm);
00437 snd_pcm_stream_t snd_pcm_stream(snd_pcm_t *pcm);
00438 int snd_pcm_poll_descriptors_count(snd_pcm_t *pcm);
00439 int snd_pcm_poll_descriptors(snd_pcm_t *pcm, struct pollfd *pfds, unsigned int space);
00440 int snd_pcm_poll_descriptors_revents(snd_pcm_t *pcm, struct pollfd *pfds, unsigned int nfds, unsigned short *revents);
00441 int snd_pcm_nonblock(snd_pcm_t *pcm, int nonblock);
00442 static __inline__ int snd_pcm_abort(snd_pcm_t *pcm) { return snd_pcm_nonblock(pcm, 2); }
00443 int snd_async_add_pcm_handler(snd_async_handler_t **handler, snd_pcm_t *pcm, 
00444                               snd_async_callback_t callback, void *private_data);
00445 snd_pcm_t *snd_async_handler_get_pcm(snd_async_handler_t *handler);
00446 int snd_pcm_info(snd_pcm_t *pcm, snd_pcm_info_t *info);
00447 int snd_pcm_hw_params_current(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
00448 int snd_pcm_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
00449 int snd_pcm_hw_free(snd_pcm_t *pcm);
00450 int snd_pcm_sw_params_current(snd_pcm_t *pcm, snd_pcm_sw_params_t *params);
00451 int snd_pcm_sw_params(snd_pcm_t *pcm, snd_pcm_sw_params_t *params);
00452 int snd_pcm_prepare(snd_pcm_t *pcm);
00453 int snd_pcm_reset(snd_pcm_t *pcm);
00454 int snd_pcm_status(snd_pcm_t *pcm, snd_pcm_status_t *status);
00455 int snd_pcm_start(snd_pcm_t *pcm);
00456 int snd_pcm_drop(snd_pcm_t *pcm);
00457 int snd_pcm_drain(snd_pcm_t *pcm);
00458 int snd_pcm_pause(snd_pcm_t *pcm, int enable);
00459 snd_pcm_state_t snd_pcm_state(snd_pcm_t *pcm);
00460 int snd_pcm_hwsync(snd_pcm_t *pcm);
00461 int snd_pcm_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *delayp);
00462 int snd_pcm_resume(snd_pcm_t *pcm);
00463 int snd_pcm_htimestamp(snd_pcm_t *pcm, snd_pcm_uframes_t *avail, snd_htimestamp_t *tstamp);
00464 snd_pcm_sframes_t snd_pcm_avail(snd_pcm_t *pcm);
00465 snd_pcm_sframes_t snd_pcm_avail_update(snd_pcm_t *pcm);
00466 int snd_pcm_avail_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *availp, snd_pcm_sframes_t *delayp);
00467 snd_pcm_sframes_t snd_pcm_rewindable(snd_pcm_t *pcm);
00468 snd_pcm_sframes_t snd_pcm_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t frames);
00469 snd_pcm_sframes_t snd_pcm_forwardable(snd_pcm_t *pcm);
00470 snd_pcm_sframes_t snd_pcm_forward(snd_pcm_t *pcm, snd_pcm_uframes_t frames);
00471 snd_pcm_sframes_t snd_pcm_writei(snd_pcm_t *pcm, const void *buffer, snd_pcm_uframes_t size);
00472 snd_pcm_sframes_t snd_pcm_readi(snd_pcm_t *pcm, void *buffer, snd_pcm_uframes_t size);
00473 snd_pcm_sframes_t snd_pcm_writen(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size);
00474 snd_pcm_sframes_t snd_pcm_readn(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size);
00475 int snd_pcm_wait(snd_pcm_t *pcm, int timeout);
00476 
00477 int snd_pcm_link(snd_pcm_t *pcm1, snd_pcm_t *pcm2);
00478 int snd_pcm_unlink(snd_pcm_t *pcm);
00479 
00481 #define SND_CHMAP_API_VERSION   ((1 << 16) | (0 << 8) | 1)
00482 
00484 enum snd_pcm_chmap_type {
00485         SND_CHMAP_TYPE_NONE = 0,
00486         SND_CHMAP_TYPE_FIXED,   
00487         SND_CHMAP_TYPE_VAR,     
00488         SND_CHMAP_TYPE_PAIRED,  
00489         SND_CHMAP_TYPE_LAST = SND_CHMAP_TYPE_PAIRED, 
00490 };
00491 
00493 enum snd_pcm_chmap_position {
00494         SND_CHMAP_UNKNOWN = 0,  
00495         SND_CHMAP_NA,           
00496         SND_CHMAP_MONO,         
00497         SND_CHMAP_FL,           
00498         SND_CHMAP_FR,           
00499         SND_CHMAP_RL,           
00500         SND_CHMAP_RR,           
00501         SND_CHMAP_FC,           
00502         SND_CHMAP_LFE,          
00503         SND_CHMAP_SL,           
00504         SND_CHMAP_SR,           
00505         SND_CHMAP_RC,           
00506         SND_CHMAP_FLC,          
00507         SND_CHMAP_FRC,          
00508         SND_CHMAP_RLC,          
00509         SND_CHMAP_RRC,          
00510         SND_CHMAP_FLW,          
00511         SND_CHMAP_FRW,          
00512         SND_CHMAP_FLH,          
00513         SND_CHMAP_FCH,          
00514         SND_CHMAP_FRH,          
00515         SND_CHMAP_TC,           
00516         SND_CHMAP_TFL,          
00517         SND_CHMAP_TFR,          
00518         SND_CHMAP_TFC,          
00519         SND_CHMAP_TRL,          
00520         SND_CHMAP_TRR,          
00521         SND_CHMAP_TRC,          
00522         SND_CHMAP_TFLC,         
00523         SND_CHMAP_TFRC,         
00524         SND_CHMAP_TSL,          
00525         SND_CHMAP_TSR,          
00526         SND_CHMAP_LLFE,         
00527         SND_CHMAP_RLFE,         
00528         SND_CHMAP_BC,           
00529         SND_CHMAP_BLC,          
00530         SND_CHMAP_BRC,          
00531         SND_CHMAP_LAST = SND_CHMAP_BRC,
00532 };
00533 
00535 #define SND_CHMAP_POSITION_MASK         0xffff
00536 
00538 #define SND_CHMAP_PHASE_INVERSE         (0x01 << 16)
00539 
00540 #define SND_CHMAP_DRIVER_SPEC           (0x02 << 16)
00541 
00543 typedef struct snd_pcm_chmap {
00544         unsigned int channels;  
00545         unsigned int pos[0];    
00546 } snd_pcm_chmap_t;
00547 
00549 typedef struct snd_pcm_chmap_query {
00550         enum snd_pcm_chmap_type type;   
00551         snd_pcm_chmap_t map;            
00552 } snd_pcm_chmap_query_t;
00553 
00554 
00555 snd_pcm_chmap_query_t **snd_pcm_query_chmaps(snd_pcm_t *pcm);
00556 snd_pcm_chmap_query_t **snd_pcm_query_chmaps_from_hw(int card, int dev,
00557                                                      int subdev,
00558                                                      snd_pcm_stream_t stream);
00559 void snd_pcm_free_chmaps(snd_pcm_chmap_query_t **maps);
00560 snd_pcm_chmap_t *snd_pcm_get_chmap(snd_pcm_t *pcm);
00561 int snd_pcm_set_chmap(snd_pcm_t *pcm, const snd_pcm_chmap_t *map);
00562 
00563 const char *snd_pcm_chmap_type_name(enum snd_pcm_chmap_type val);
00564 const char *snd_pcm_chmap_name(enum snd_pcm_chmap_position val);
00565 const char *snd_pcm_chmap_long_name(enum snd_pcm_chmap_position val);
00566 int snd_pcm_chmap_print(const snd_pcm_chmap_t *map, size_t maxlen, char *buf);
00567 unsigned int snd_pcm_chmap_from_string(const char *str);
00568 snd_pcm_chmap_t *snd_pcm_chmap_parse_string(const char *str);
00569 
00570 //int snd_pcm_mixer_element(snd_pcm_t *pcm, snd_mixer_t *mixer, snd_mixer_elem_t **elem);
00571 
00572 /*
00573  * application helpers - these functions are implemented on top
00574  * of the basic API
00575  */
00576 
00577 int snd_pcm_recover(snd_pcm_t *pcm, int err, int silent);
00578 int snd_pcm_set_params(snd_pcm_t *pcm,
00579                        snd_pcm_format_t format,
00580                        snd_pcm_access_t access,
00581                        unsigned int channels,
00582                        unsigned int rate,
00583                        int soft_resample,
00584                        unsigned int latency);
00585 int snd_pcm_get_params(snd_pcm_t *pcm,
00586                        snd_pcm_uframes_t *buffer_size,
00587                        snd_pcm_uframes_t *period_size);
00588 
00598 size_t snd_pcm_info_sizeof(void);
00603 #define snd_pcm_info_alloca(ptr) __snd_alloca(ptr, snd_pcm_info)
00604 int snd_pcm_info_malloc(snd_pcm_info_t **ptr);
00605 void snd_pcm_info_free(snd_pcm_info_t *obj);
00606 void snd_pcm_info_copy(snd_pcm_info_t *dst, const snd_pcm_info_t *src);
00607 unsigned int snd_pcm_info_get_device(const snd_pcm_info_t *obj);
00608 unsigned int snd_pcm_info_get_subdevice(const snd_pcm_info_t *obj);
00609 snd_pcm_stream_t snd_pcm_info_get_stream(const snd_pcm_info_t *obj);
00610 int snd_pcm_info_get_card(const snd_pcm_info_t *obj);
00611 const char *snd_pcm_info_get_id(const snd_pcm_info_t *obj);
00612 const char *snd_pcm_info_get_name(const snd_pcm_info_t *obj);
00613 const char *snd_pcm_info_get_subdevice_name(const snd_pcm_info_t *obj);
00614 snd_pcm_class_t snd_pcm_info_get_class(const snd_pcm_info_t *obj);
00615 snd_pcm_subclass_t snd_pcm_info_get_subclass(const snd_pcm_info_t *obj);
00616 unsigned int snd_pcm_info_get_subdevices_count(const snd_pcm_info_t *obj);
00617 unsigned int snd_pcm_info_get_subdevices_avail(const snd_pcm_info_t *obj);
00618 snd_pcm_sync_id_t snd_pcm_info_get_sync(const snd_pcm_info_t *obj);
00619 void snd_pcm_info_set_device(snd_pcm_info_t *obj, unsigned int val);
00620 void snd_pcm_info_set_subdevice(snd_pcm_info_t *obj, unsigned int val);
00621 void snd_pcm_info_set_stream(snd_pcm_info_t *obj, snd_pcm_stream_t val);
00622 
00632 int snd_pcm_hw_params_any(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
00633 
00634 int snd_pcm_hw_params_can_mmap_sample_resolution(const snd_pcm_hw_params_t *params);
00635 int snd_pcm_hw_params_is_double(const snd_pcm_hw_params_t *params);
00636 int snd_pcm_hw_params_is_batch(const snd_pcm_hw_params_t *params);
00637 int snd_pcm_hw_params_is_block_transfer(const snd_pcm_hw_params_t *params);
00638 int snd_pcm_hw_params_is_monotonic(const snd_pcm_hw_params_t *params);
00639 int snd_pcm_hw_params_can_overrange(const snd_pcm_hw_params_t *params);
00640 int snd_pcm_hw_params_can_pause(const snd_pcm_hw_params_t *params);
00641 int snd_pcm_hw_params_can_resume(const snd_pcm_hw_params_t *params);
00642 int snd_pcm_hw_params_is_half_duplex(const snd_pcm_hw_params_t *params);
00643 int snd_pcm_hw_params_is_joint_duplex(const snd_pcm_hw_params_t *params);
00644 int snd_pcm_hw_params_can_sync_start(const snd_pcm_hw_params_t *params);
00645 int snd_pcm_hw_params_can_disable_period_wakeup(const snd_pcm_hw_params_t *params);
00646 int snd_pcm_hw_params_supports_audio_wallclock_ts(const snd_pcm_hw_params_t *params);
00647 int snd_pcm_hw_params_get_rate_numden(const snd_pcm_hw_params_t *params,
00648                                       unsigned int *rate_num,
00649                                       unsigned int *rate_den);
00650 int snd_pcm_hw_params_get_sbits(const snd_pcm_hw_params_t *params);
00651 int snd_pcm_hw_params_get_fifo_size(const snd_pcm_hw_params_t *params);
00652 
00653 #if 0
00654 typedef struct _snd_pcm_hw_strategy snd_pcm_hw_strategy_t;
00655 
00656 /* choices need to be sorted on ascending badness */
00657 typedef struct _snd_pcm_hw_strategy_simple_choices_list {
00658         unsigned int value;
00659         unsigned int badness;
00660 } snd_pcm_hw_strategy_simple_choices_list_t;
00661 
00662 int snd_pcm_hw_params_strategy(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
00663                                const snd_pcm_hw_strategy_t *strategy,
00664                                unsigned int badness_min,
00665                                unsigned int badness_max);
00666 
00667 void snd_pcm_hw_strategy_free(snd_pcm_hw_strategy_t *strategy);
00668 int snd_pcm_hw_strategy_simple(snd_pcm_hw_strategy_t **strategyp,
00669                                unsigned int badness_min,
00670                                unsigned int badness_max);
00671 int snd_pcm_hw_params_try_explain_failure(snd_pcm_t *pcm,
00672                                           snd_pcm_hw_params_t *fail,
00673                                           snd_pcm_hw_params_t *success,
00674                                           unsigned int depth,
00675                                           snd_output_t *out);
00676 
00677 #endif
00678 
00679 size_t snd_pcm_hw_params_sizeof(void);
00684 #define snd_pcm_hw_params_alloca(ptr) __snd_alloca(ptr, snd_pcm_hw_params)
00685 int snd_pcm_hw_params_malloc(snd_pcm_hw_params_t **ptr);
00686 void snd_pcm_hw_params_free(snd_pcm_hw_params_t *obj);
00687 void snd_pcm_hw_params_copy(snd_pcm_hw_params_t *dst, const snd_pcm_hw_params_t *src);
00688 
00689 #if !defined(ALSA_LIBRARY_BUILD) && !defined(ALSA_PCM_OLD_HW_PARAMS_API)
00690 
00691 int snd_pcm_hw_params_get_access(const snd_pcm_hw_params_t *params, snd_pcm_access_t *_access);
00692 int snd_pcm_hw_params_test_access(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t _access);
00693 int snd_pcm_hw_params_set_access(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t _access);
00694 int snd_pcm_hw_params_set_access_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t *_access);
00695 int snd_pcm_hw_params_set_access_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t *_access);
00696 int snd_pcm_hw_params_set_access_mask(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_mask_t *mask);
00697 int snd_pcm_hw_params_get_access_mask(snd_pcm_hw_params_t *params, snd_pcm_access_mask_t *mask);
00698 
00699 int snd_pcm_hw_params_get_format(const snd_pcm_hw_params_t *params, snd_pcm_format_t *val);
00700 int snd_pcm_hw_params_test_format(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t val);
00701 int snd_pcm_hw_params_set_format(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t val);
00702 int snd_pcm_hw_params_set_format_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t *format);
00703 int snd_pcm_hw_params_set_format_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t *format);
00704 int snd_pcm_hw_params_set_format_mask(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_mask_t *mask);
00705 void snd_pcm_hw_params_get_format_mask(snd_pcm_hw_params_t *params, snd_pcm_format_mask_t *mask);
00706 
00707 int snd_pcm_hw_params_get_subformat(const snd_pcm_hw_params_t *params, snd_pcm_subformat_t *subformat);
00708 int snd_pcm_hw_params_test_subformat(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t subformat);
00709 int snd_pcm_hw_params_set_subformat(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t subformat);
00710 int snd_pcm_hw_params_set_subformat_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t *subformat);
00711 int snd_pcm_hw_params_set_subformat_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t *subformat);
00712 int snd_pcm_hw_params_set_subformat_mask(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_mask_t *mask);
00713 void snd_pcm_hw_params_get_subformat_mask(snd_pcm_hw_params_t *params, snd_pcm_subformat_mask_t *mask);
00714 
00715 int snd_pcm_hw_params_get_channels(const snd_pcm_hw_params_t *params, unsigned int *val);
00716 int snd_pcm_hw_params_get_channels_min(const snd_pcm_hw_params_t *params, unsigned int *val);
00717 int snd_pcm_hw_params_get_channels_max(const snd_pcm_hw_params_t *params, unsigned int *val);
00718 int snd_pcm_hw_params_test_channels(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
00719 int snd_pcm_hw_params_set_channels(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
00720 int snd_pcm_hw_params_set_channels_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
00721 int snd_pcm_hw_params_set_channels_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
00722 int snd_pcm_hw_params_set_channels_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *min, unsigned int *max);
00723 int snd_pcm_hw_params_set_channels_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
00724 int snd_pcm_hw_params_set_channels_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
00725 int snd_pcm_hw_params_set_channels_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
00726 
00727 int snd_pcm_hw_params_get_rate(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00728 int snd_pcm_hw_params_get_rate_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00729 int snd_pcm_hw_params_get_rate_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00730 int snd_pcm_hw_params_test_rate(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
00731 int snd_pcm_hw_params_set_rate(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
00732 int snd_pcm_hw_params_set_rate_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00733 int snd_pcm_hw_params_set_rate_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00734 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);
00735 int snd_pcm_hw_params_set_rate_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00736 int snd_pcm_hw_params_set_rate_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00737 int snd_pcm_hw_params_set_rate_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00738 int snd_pcm_hw_params_set_rate_resample(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
00739 int snd_pcm_hw_params_get_rate_resample(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
00740 int snd_pcm_hw_params_set_export_buffer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
00741 int snd_pcm_hw_params_get_export_buffer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
00742 int snd_pcm_hw_params_set_period_wakeup(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
00743 int snd_pcm_hw_params_get_period_wakeup(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
00744 
00745 int snd_pcm_hw_params_get_period_time(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00746 int snd_pcm_hw_params_get_period_time_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00747 int snd_pcm_hw_params_get_period_time_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00748 int snd_pcm_hw_params_test_period_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
00749 int snd_pcm_hw_params_set_period_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
00750 int snd_pcm_hw_params_set_period_time_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00751 int snd_pcm_hw_params_set_period_time_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00752 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);
00753 int snd_pcm_hw_params_set_period_time_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00754 int snd_pcm_hw_params_set_period_time_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00755 int snd_pcm_hw_params_set_period_time_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00756 
00757 int snd_pcm_hw_params_get_period_size(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *frames, int *dir);
00758 int snd_pcm_hw_params_get_period_size_min(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *frames, int *dir);
00759 int snd_pcm_hw_params_get_period_size_max(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *frames, int *dir);
00760 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);
00761 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);
00762 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);
00763 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);
00764 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);
00765 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);
00766 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);
00767 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);
00768 int snd_pcm_hw_params_set_period_size_integer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
00769 
00770 int snd_pcm_hw_params_get_periods(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00771 int snd_pcm_hw_params_get_periods_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00772 int snd_pcm_hw_params_get_periods_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00773 int snd_pcm_hw_params_test_periods(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
00774 int snd_pcm_hw_params_set_periods(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
00775 int snd_pcm_hw_params_set_periods_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00776 int snd_pcm_hw_params_set_periods_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00777 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);
00778 int snd_pcm_hw_params_set_periods_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00779 int snd_pcm_hw_params_set_periods_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00780 int snd_pcm_hw_params_set_periods_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00781 int snd_pcm_hw_params_set_periods_integer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
00782 
00783 int snd_pcm_hw_params_get_buffer_time(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00784 int snd_pcm_hw_params_get_buffer_time_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00785 int snd_pcm_hw_params_get_buffer_time_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00786 int snd_pcm_hw_params_test_buffer_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
00787 int snd_pcm_hw_params_set_buffer_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
00788 int snd_pcm_hw_params_set_buffer_time_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00789 int snd_pcm_hw_params_set_buffer_time_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00790 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);
00791 int snd_pcm_hw_params_set_buffer_time_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00792 int snd_pcm_hw_params_set_buffer_time_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00793 int snd_pcm_hw_params_set_buffer_time_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
00794 
00795 int snd_pcm_hw_params_get_buffer_size(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
00796 int snd_pcm_hw_params_get_buffer_size_min(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
00797 int snd_pcm_hw_params_get_buffer_size_max(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
00798 int snd_pcm_hw_params_test_buffer_size(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t val);
00799 int snd_pcm_hw_params_set_buffer_size(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t val);
00800 int snd_pcm_hw_params_set_buffer_size_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
00801 int snd_pcm_hw_params_set_buffer_size_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
00802 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);
00803 int snd_pcm_hw_params_set_buffer_size_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
00804 int snd_pcm_hw_params_set_buffer_size_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
00805 int snd_pcm_hw_params_set_buffer_size_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
00806 
00807 #endif /* !ALSA_LIBRARY_BUILD && !ALSA_PCM_OLD_HW_PARAMS_API */
00808 
00809 int snd_pcm_hw_params_get_min_align(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
00810 
00820 size_t snd_pcm_sw_params_sizeof(void);
00825 #define snd_pcm_sw_params_alloca(ptr) __snd_alloca(ptr, snd_pcm_sw_params)
00826 int snd_pcm_sw_params_malloc(snd_pcm_sw_params_t **ptr);
00827 void snd_pcm_sw_params_free(snd_pcm_sw_params_t *obj);
00828 void snd_pcm_sw_params_copy(snd_pcm_sw_params_t *dst, const snd_pcm_sw_params_t *src);
00829 int snd_pcm_sw_params_get_boundary(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val);
00830 
00831 #if !defined(ALSA_LIBRARY_BUILD) && !defined(ALSA_PCM_OLD_SW_PARAMS_API)
00832 
00833 int snd_pcm_sw_params_set_tstamp_mode(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_tstamp_t val);
00834 int snd_pcm_sw_params_get_tstamp_mode(const snd_pcm_sw_params_t *params, snd_pcm_tstamp_t *val);
00835 int snd_pcm_sw_params_set_avail_min(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
00836 int snd_pcm_sw_params_get_avail_min(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val);
00837 int snd_pcm_sw_params_set_period_event(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, int val);
00838 int snd_pcm_sw_params_get_period_event(const snd_pcm_sw_params_t *params, int *val);
00839 int snd_pcm_sw_params_set_start_threshold(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
00840 int snd_pcm_sw_params_get_start_threshold(const snd_pcm_sw_params_t *paramsm, snd_pcm_uframes_t *val);
00841 int snd_pcm_sw_params_set_stop_threshold(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
00842 int snd_pcm_sw_params_get_stop_threshold(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val);
00843 int snd_pcm_sw_params_set_silence_threshold(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
00844 int snd_pcm_sw_params_get_silence_threshold(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val);
00845 int snd_pcm_sw_params_set_silence_size(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
00846 int snd_pcm_sw_params_get_silence_size(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val);
00847 
00848 #endif /* !ALSA_LIBRARY_BUILD && !ALSA_PCM_OLD_SW_PARAMS_API */
00849 
00852 /* include old API */
00853 #ifndef ALSA_LIBRARY_BUILD
00854 #if defined(ALSA_PCM_OLD_HW_PARAMS_API) || defined(ALSA_PCM_OLD_SW_PARAMS_API)
00855 #include "pcm_old.h"
00856 #endif
00857 #endif
00858 
00866 size_t snd_pcm_access_mask_sizeof(void);
00871 #define snd_pcm_access_mask_alloca(ptr) __snd_alloca(ptr, snd_pcm_access_mask)
00872 int snd_pcm_access_mask_malloc(snd_pcm_access_mask_t **ptr);
00873 void snd_pcm_access_mask_free(snd_pcm_access_mask_t *obj);
00874 void snd_pcm_access_mask_copy(snd_pcm_access_mask_t *dst, const snd_pcm_access_mask_t *src);
00875 void snd_pcm_access_mask_none(snd_pcm_access_mask_t *mask);
00876 void snd_pcm_access_mask_any(snd_pcm_access_mask_t *mask);
00877 int snd_pcm_access_mask_test(const snd_pcm_access_mask_t *mask, snd_pcm_access_t val);
00878 int snd_pcm_access_mask_empty(const snd_pcm_access_mask_t *mask);
00879 void snd_pcm_access_mask_set(snd_pcm_access_mask_t *mask, snd_pcm_access_t val);
00880 void snd_pcm_access_mask_reset(snd_pcm_access_mask_t *mask, snd_pcm_access_t val);
00881 
00891 size_t snd_pcm_format_mask_sizeof(void);
00896 #define snd_pcm_format_mask_alloca(ptr) __snd_alloca(ptr, snd_pcm_format_mask)
00897 int snd_pcm_format_mask_malloc(snd_pcm_format_mask_t **ptr);
00898 void snd_pcm_format_mask_free(snd_pcm_format_mask_t *obj);
00899 void snd_pcm_format_mask_copy(snd_pcm_format_mask_t *dst, const snd_pcm_format_mask_t *src);
00900 void snd_pcm_format_mask_none(snd_pcm_format_mask_t *mask);
00901 void snd_pcm_format_mask_any(snd_pcm_format_mask_t *mask);
00902 int snd_pcm_format_mask_test(const snd_pcm_format_mask_t *mask, snd_pcm_format_t val);
00903 int snd_pcm_format_mask_empty(const snd_pcm_format_mask_t *mask);
00904 void snd_pcm_format_mask_set(snd_pcm_format_mask_t *mask, snd_pcm_format_t val);
00905 void snd_pcm_format_mask_reset(snd_pcm_format_mask_t *mask, snd_pcm_format_t val);
00906 
00916 size_t snd_pcm_subformat_mask_sizeof(void);
00921 #define snd_pcm_subformat_mask_alloca(ptr) __snd_alloca(ptr, snd_pcm_subformat_mask)
00922 int snd_pcm_subformat_mask_malloc(snd_pcm_subformat_mask_t **ptr);
00923 void snd_pcm_subformat_mask_free(snd_pcm_subformat_mask_t *obj);
00924 void snd_pcm_subformat_mask_copy(snd_pcm_subformat_mask_t *dst, const snd_pcm_subformat_mask_t *src);
00925 void snd_pcm_subformat_mask_none(snd_pcm_subformat_mask_t *mask);
00926 void snd_pcm_subformat_mask_any(snd_pcm_subformat_mask_t *mask);
00927 int snd_pcm_subformat_mask_test(const snd_pcm_subformat_mask_t *mask, snd_pcm_subformat_t val);
00928 int snd_pcm_subformat_mask_empty(const snd_pcm_subformat_mask_t *mask);
00929 void snd_pcm_subformat_mask_set(snd_pcm_subformat_mask_t *mask, snd_pcm_subformat_t val);
00930 void snd_pcm_subformat_mask_reset(snd_pcm_subformat_mask_t *mask, snd_pcm_subformat_t val);
00931 
00941 size_t snd_pcm_status_sizeof(void);
00946 #define snd_pcm_status_alloca(ptr) __snd_alloca(ptr, snd_pcm_status)
00947 int snd_pcm_status_malloc(snd_pcm_status_t **ptr);
00948 void snd_pcm_status_free(snd_pcm_status_t *obj);
00949 void snd_pcm_status_copy(snd_pcm_status_t *dst, const snd_pcm_status_t *src);
00950 snd_pcm_state_t snd_pcm_status_get_state(const snd_pcm_status_t *obj);
00951 void snd_pcm_status_get_trigger_tstamp(const snd_pcm_status_t *obj, snd_timestamp_t *ptr);
00952 void snd_pcm_status_get_trigger_htstamp(const snd_pcm_status_t *obj, snd_htimestamp_t *ptr);
00953 void snd_pcm_status_get_tstamp(const snd_pcm_status_t *obj, snd_timestamp_t *ptr);
00954 void snd_pcm_status_get_htstamp(const snd_pcm_status_t *obj, snd_htimestamp_t *ptr);
00955 void snd_pcm_status_get_audio_htstamp(const snd_pcm_status_t *obj, snd_htimestamp_t *ptr);
00956 snd_pcm_sframes_t snd_pcm_status_get_delay(const snd_pcm_status_t *obj);
00957 snd_pcm_uframes_t snd_pcm_status_get_avail(const snd_pcm_status_t *obj);
00958 snd_pcm_uframes_t snd_pcm_status_get_avail_max(const snd_pcm_status_t *obj);
00959 snd_pcm_uframes_t snd_pcm_status_get_overrange(const snd_pcm_status_t *obj);
00960 
00970 const char *snd_pcm_type_name(snd_pcm_type_t type);
00971 const char *snd_pcm_stream_name(const snd_pcm_stream_t stream);
00972 const char *snd_pcm_access_name(const snd_pcm_access_t _access);
00973 const char *snd_pcm_format_name(const snd_pcm_format_t format);
00974 const char *snd_pcm_format_description(const snd_pcm_format_t format);
00975 const char *snd_pcm_subformat_name(const snd_pcm_subformat_t subformat);
00976 const char *snd_pcm_subformat_description(const snd_pcm_subformat_t subformat);
00977 snd_pcm_format_t snd_pcm_format_value(const char* name);
00978 const char *snd_pcm_tstamp_mode_name(const snd_pcm_tstamp_t mode);
00979 const char *snd_pcm_state_name(const snd_pcm_state_t state);
00980 
00990 int snd_pcm_dump(snd_pcm_t *pcm, snd_output_t *out);
00991 int snd_pcm_dump_hw_setup(snd_pcm_t *pcm, snd_output_t *out);
00992 int snd_pcm_dump_sw_setup(snd_pcm_t *pcm, snd_output_t *out);
00993 int snd_pcm_dump_setup(snd_pcm_t *pcm, snd_output_t *out);
00994 int snd_pcm_hw_params_dump(snd_pcm_hw_params_t *params, snd_output_t *out);
00995 int snd_pcm_sw_params_dump(snd_pcm_sw_params_t *params, snd_output_t *out);
00996 int snd_pcm_status_dump(snd_pcm_status_t *status, snd_output_t *out);
00997 
01007 int snd_pcm_mmap_begin(snd_pcm_t *pcm,
01008                        const snd_pcm_channel_area_t **areas,
01009                        snd_pcm_uframes_t *offset,
01010                        snd_pcm_uframes_t *frames);
01011 snd_pcm_sframes_t snd_pcm_mmap_commit(snd_pcm_t *pcm,
01012                                       snd_pcm_uframes_t offset,
01013                                       snd_pcm_uframes_t frames);
01014 snd_pcm_sframes_t snd_pcm_mmap_writei(snd_pcm_t *pcm, const void *buffer, snd_pcm_uframes_t size);
01015 snd_pcm_sframes_t snd_pcm_mmap_readi(snd_pcm_t *pcm, void *buffer, snd_pcm_uframes_t size);
01016 snd_pcm_sframes_t snd_pcm_mmap_writen(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size);
01017 snd_pcm_sframes_t snd_pcm_mmap_readn(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size);                                                                
01018 
01028 int snd_pcm_format_signed(snd_pcm_format_t format);
01029 int snd_pcm_format_unsigned(snd_pcm_format_t format);
01030 int snd_pcm_format_linear(snd_pcm_format_t format);
01031 int snd_pcm_format_float(snd_pcm_format_t format);
01032 int snd_pcm_format_little_endian(snd_pcm_format_t format);
01033 int snd_pcm_format_big_endian(snd_pcm_format_t format);
01034 int snd_pcm_format_cpu_endian(snd_pcm_format_t format);
01035 int snd_pcm_format_width(snd_pcm_format_t format);                      /* in bits */
01036 int snd_pcm_format_physical_width(snd_pcm_format_t format);             /* in bits */
01037 snd_pcm_format_t snd_pcm_build_linear_format(int width, int pwidth, int unsignd, int big_endian);
01038 ssize_t snd_pcm_format_size(snd_pcm_format_t format, size_t samples);
01039 u_int8_t snd_pcm_format_silence(snd_pcm_format_t format);
01040 u_int16_t snd_pcm_format_silence_16(snd_pcm_format_t format);
01041 u_int32_t snd_pcm_format_silence_32(snd_pcm_format_t format);
01042 u_int64_t snd_pcm_format_silence_64(snd_pcm_format_t format);
01043 int snd_pcm_format_set_silence(snd_pcm_format_t format, void *buf, unsigned int samples);
01044 
01045 snd_pcm_sframes_t snd_pcm_bytes_to_frames(snd_pcm_t *pcm, ssize_t bytes);
01046 ssize_t snd_pcm_frames_to_bytes(snd_pcm_t *pcm, snd_pcm_sframes_t frames);
01047 long snd_pcm_bytes_to_samples(snd_pcm_t *pcm, ssize_t bytes);
01048 ssize_t snd_pcm_samples_to_bytes(snd_pcm_t *pcm, long samples);
01049 
01050 int snd_pcm_area_silence(const snd_pcm_channel_area_t *dst_channel, snd_pcm_uframes_t dst_offset,
01051                          unsigned int samples, snd_pcm_format_t format);
01052 int snd_pcm_areas_silence(const snd_pcm_channel_area_t *dst_channels, snd_pcm_uframes_t dst_offset,
01053                           unsigned int channels, snd_pcm_uframes_t frames, snd_pcm_format_t format);
01054 int snd_pcm_area_copy(const snd_pcm_channel_area_t *dst_channel, snd_pcm_uframes_t dst_offset,
01055                       const snd_pcm_channel_area_t *src_channel, snd_pcm_uframes_t src_offset,
01056                       unsigned int samples, snd_pcm_format_t format);
01057 int snd_pcm_areas_copy(const snd_pcm_channel_area_t *dst_channels, snd_pcm_uframes_t dst_offset,
01058                        const snd_pcm_channel_area_t *src_channels, snd_pcm_uframes_t src_offset,
01059                        unsigned int channels, snd_pcm_uframes_t frames, snd_pcm_format_t format);
01060 
01071 typedef enum _snd_pcm_hook_type {
01072         SND_PCM_HOOK_TYPE_HW_PARAMS = 0,
01073         SND_PCM_HOOK_TYPE_HW_FREE,
01074         SND_PCM_HOOK_TYPE_CLOSE,
01075         SND_PCM_HOOK_TYPE_LAST = SND_PCM_HOOK_TYPE_CLOSE
01076 } snd_pcm_hook_type_t;
01077 
01079 typedef struct _snd_pcm_hook snd_pcm_hook_t;
01081 typedef int (*snd_pcm_hook_func_t)(snd_pcm_hook_t *hook);
01082 snd_pcm_t *snd_pcm_hook_get_pcm(snd_pcm_hook_t *hook);
01083 void *snd_pcm_hook_get_private(snd_pcm_hook_t *hook);
01084 void snd_pcm_hook_set_private(snd_pcm_hook_t *hook, void *private_data);
01085 int snd_pcm_hook_add(snd_pcm_hook_t **hookp, snd_pcm_t *pcm,
01086                      snd_pcm_hook_type_t type,
01087                      snd_pcm_hook_func_t func, void *private_data);
01088 int snd_pcm_hook_remove(snd_pcm_hook_t *hook);
01089 
01100 typedef struct _snd_pcm_scope_ops {
01104         int (*enable)(snd_pcm_scope_t *scope);
01108         void (*disable)(snd_pcm_scope_t *scope);
01112         void (*start)(snd_pcm_scope_t *scope);
01116         void (*stop)(snd_pcm_scope_t *scope);
01120         void (*update)(snd_pcm_scope_t *scope);
01124         void (*reset)(snd_pcm_scope_t *scope);
01128         void (*close)(snd_pcm_scope_t *scope);
01129 } snd_pcm_scope_ops_t;
01130 
01131 snd_pcm_uframes_t snd_pcm_meter_get_bufsize(snd_pcm_t *pcm);
01132 unsigned int snd_pcm_meter_get_channels(snd_pcm_t *pcm);
01133 unsigned int snd_pcm_meter_get_rate(snd_pcm_t *pcm);
01134 snd_pcm_uframes_t snd_pcm_meter_get_now(snd_pcm_t *pcm);
01135 snd_pcm_uframes_t snd_pcm_meter_get_boundary(snd_pcm_t *pcm);
01136 int snd_pcm_meter_add_scope(snd_pcm_t *pcm, snd_pcm_scope_t *scope);
01137 snd_pcm_scope_t *snd_pcm_meter_search_scope(snd_pcm_t *pcm, const char *name);
01138 int snd_pcm_scope_malloc(snd_pcm_scope_t **ptr);
01139 void snd_pcm_scope_set_ops(snd_pcm_scope_t *scope,
01140                            const snd_pcm_scope_ops_t *val);
01141 void snd_pcm_scope_set_name(snd_pcm_scope_t *scope, const char *val);
01142 const char *snd_pcm_scope_get_name(snd_pcm_scope_t *scope);
01143 void *snd_pcm_scope_get_callback_private(snd_pcm_scope_t *scope);
01144 void snd_pcm_scope_set_callback_private(snd_pcm_scope_t *scope, void *val);
01145 int snd_pcm_scope_s16_open(snd_pcm_t *pcm, const char *name,
01146                            snd_pcm_scope_t **scopep);
01147 int16_t *snd_pcm_scope_s16_get_channel_buffer(snd_pcm_scope_t *scope,
01148                                               unsigned int channel);
01149 
01160 typedef enum _snd_spcm_latency {
01163         SND_SPCM_LATENCY_STANDARD = 0,
01166         SND_SPCM_LATENCY_MEDIUM,
01169         SND_SPCM_LATENCY_REALTIME
01170 } snd_spcm_latency_t;
01171 
01173 typedef enum _snd_spcm_xrun_type {
01175         SND_SPCM_XRUN_IGNORE = 0,
01177         SND_SPCM_XRUN_STOP
01178 } snd_spcm_xrun_type_t;
01179 
01181 typedef enum _snd_spcm_duplex_type {
01183         SND_SPCM_DUPLEX_LIBERAL = 0,
01185         SND_SPCM_DUPLEX_PEDANTIC
01186 } snd_spcm_duplex_type_t;
01187 
01188 int snd_spcm_init(snd_pcm_t *pcm,
01189                   unsigned int rate,
01190                   unsigned int channels,
01191                   snd_pcm_format_t format,
01192                   snd_pcm_subformat_t subformat,
01193                   snd_spcm_latency_t latency,
01194                   snd_pcm_access_t _access,
01195                   snd_spcm_xrun_type_t xrun_type);
01196 
01197 int snd_spcm_init_duplex(snd_pcm_t *playback_pcm,
01198                          snd_pcm_t *capture_pcm,
01199                          unsigned int rate,
01200                          unsigned int channels,
01201                          snd_pcm_format_t format,
01202                          snd_pcm_subformat_t subformat,
01203                          snd_spcm_latency_t latency,
01204                          snd_pcm_access_t _access,
01205                          snd_spcm_xrun_type_t xrun_type,
01206                          snd_spcm_duplex_type_t duplex_type);
01207 
01208 int snd_spcm_init_get_params(snd_pcm_t *pcm,
01209                              unsigned int *rate,
01210                              snd_pcm_uframes_t *buffer_size,
01211                              snd_pcm_uframes_t *period_size);
01212 
01222 /* Deprecated functions, for compatibility */
01223 const char *snd_pcm_start_mode_name(snd_pcm_start_t mode) __attribute__((deprecated));
01224 const char *snd_pcm_xrun_mode_name(snd_pcm_xrun_t mode) __attribute__((deprecated));
01225 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));
01226 snd_pcm_start_t snd_pcm_sw_params_get_start_mode(const snd_pcm_sw_params_t *params) __attribute__((deprecated));
01227 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));
01228 snd_pcm_xrun_t snd_pcm_sw_params_get_xrun_mode(const snd_pcm_sw_params_t *params) __attribute__((deprecated));
01229 #if !defined(ALSA_LIBRARY_BUILD) && !defined(ALSA_PCM_OLD_SW_PARAMS_API)
01230 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));
01231 int snd_pcm_sw_params_get_xfer_align(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val) __attribute__((deprecated));
01232 int snd_pcm_sw_params_set_sleep_min(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, unsigned int val) __attribute__((deprecated));
01233 int snd_pcm_sw_params_get_sleep_min(const snd_pcm_sw_params_t *params, unsigned int *val) __attribute__((deprecated));
01234 #endif /* !ALSA_LIBRARY_BUILD && !ALSA_PCM_OLD_SW_PARAMS_API */
01235 #if !defined(ALSA_LIBRARY_BUILD) && !defined(ALSA_PCM_OLD_HW_PARAMS_API)
01236 int snd_pcm_hw_params_get_tick_time(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir) __attribute__((deprecated));
01237 int snd_pcm_hw_params_get_tick_time_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir) __attribute__((deprecated));
01238 int snd_pcm_hw_params_get_tick_time_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir) __attribute__((deprecated));
01239 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));
01240 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));
01241 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));
01242 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));
01243 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));
01244 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));
01245 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));
01246 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));
01247 #endif /* !ALSA_LIBRARY_BUILD && !ALSA_PCM_OLD_HW_PARAMS_API */
01248 
01251 #ifdef __cplusplus
01252 }
01253 #endif
01254 
01255 #endif /* __ALSA_PCM_H */
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines