1/** 2 * \file include/pcm.h 3 * \brief Application interface library for the ALSA driver 4 * \author Jaroslav Kysela <perex@perex.cz> 5 * \author Abramo Bagnara <abramo@alsa-project.org> 6 * \author Takashi Iwai <tiwai@suse.de> 7 * \date 1998-2001 8 * 9 * Application interface library for the ALSA driver. 10 * See the \ref pcm page for more details. 11 */ 12/* 13 * This library is free software; you can redistribute it and/or modify 14 * it under the terms of the GNU Lesser General Public License as 15 * published by the Free Software Foundation; either version 2.1 of 16 * the License, or (at your option) any later version. 17 * 18 * This program is distributed in the hope that it will be useful, 19 * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 * GNU Lesser General Public License for more details. 22 * 23 * You should have received a copy of the GNU Lesser General Public 24 * License along with this library; if not, write to the Free Software 25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 26 * 27 */ 28 29#ifndef __ALSA_PCM_H 30#define __ALSA_PCM_H 31 32#ifdef __cplusplus 33extern "C" { 34#endif 35 36/** 37 * \defgroup PCM PCM Interface 38 * See the \ref pcm page for more details. 39 * \{ 40 */ 41 42/** dlsym version for interface entry callback */ 43#define SND_PCM_DLSYM_VERSION _dlsym_pcm_001 44 45/** PCM generic info container */ 46typedef struct _snd_pcm_info snd_pcm_info_t; 47 48/** PCM hardware configuration space container 49 * 50 * snd_pcm_hw_params_t is an opaque structure which contains a set of possible 51 * PCM hardware configurations. For example, a given instance might include a 52 * range of buffer sizes, a range of period sizes, and a set of several sample 53 * formats. Some subset of all possible combinations these sets may be valid, 54 * but not necessarily any combination will be valid. 55 * 56 * When a parameter is set or restricted using a snd_pcm_hw_params_set* 57 * function, all of the other ranges will be updated to exclude as many 58 * impossible configurations as possible. Attempting to set a parameter 59 * outside of its acceptable range will result in the function failing 60 * and an error code being returned. 61 */ 62typedef struct _snd_pcm_hw_params snd_pcm_hw_params_t; 63 64/** PCM software configuration container */ 65typedef struct _snd_pcm_sw_params snd_pcm_sw_params_t; 66/** PCM status container */ 67 typedef struct _snd_pcm_status snd_pcm_status_t; 68/** PCM access types mask */ 69typedef struct _snd_pcm_access_mask snd_pcm_access_mask_t; 70/** PCM formats mask */ 71typedef struct _snd_pcm_format_mask snd_pcm_format_mask_t; 72/** PCM subformats mask */ 73typedef struct _snd_pcm_subformat_mask snd_pcm_subformat_mask_t; 74 75/** PCM class */ 76typedef enum _snd_pcm_class { 77 /** standard device */ 78 79 SND_PCM_CLASS_GENERIC = 0, 80 /** multichannel device */ 81 SND_PCM_CLASS_MULTI, 82 /** software modem device */ 83 SND_PCM_CLASS_MODEM, 84 /** digitizer device */ 85 SND_PCM_CLASS_DIGITIZER, 86 SND_PCM_CLASS_LAST = SND_PCM_CLASS_DIGITIZER 87} snd_pcm_class_t; 88 89/** PCM subclass */ 90typedef enum _snd_pcm_subclass { 91 /** subdevices are mixed together */ 92 SND_PCM_SUBCLASS_GENERIC_MIX = 0, 93 /** multichannel subdevices are mixed together */ 94 SND_PCM_SUBCLASS_MULTI_MIX, 95 SND_PCM_SUBCLASS_LAST = SND_PCM_SUBCLASS_MULTI_MIX 96} snd_pcm_subclass_t; 97 98/** PCM stream (direction) */ 99typedef enum _snd_pcm_stream { 100 /** Playback stream */ 101 SND_PCM_STREAM_PLAYBACK = 0, 102 /** Capture stream */ 103 SND_PCM_STREAM_CAPTURE, 104 SND_PCM_STREAM_LAST = SND_PCM_STREAM_CAPTURE 105} snd_pcm_stream_t; 106 107/** PCM access type */ 108typedef enum _snd_pcm_access { 109 /** mmap access with simple interleaved channels */ 110 SND_PCM_ACCESS_MMAP_INTERLEAVED = 0, 111 /** mmap access with simple non interleaved channels */ 112 SND_PCM_ACCESS_MMAP_NONINTERLEAVED, 113 /** mmap access with complex placement */ 114 SND_PCM_ACCESS_MMAP_COMPLEX, 115 /** snd_pcm_readi/snd_pcm_writei access */ 116 SND_PCM_ACCESS_RW_INTERLEAVED, 117 /** snd_pcm_readn/snd_pcm_writen access */ 118 SND_PCM_ACCESS_RW_NONINTERLEAVED, 119 SND_PCM_ACCESS_LAST = SND_PCM_ACCESS_RW_NONINTERLEAVED 120} snd_pcm_access_t; 121 122/** PCM sample format */ 123typedef enum _snd_pcm_format { 124 /** Unknown */ 125 SND_PCM_FORMAT_UNKNOWN = -1, 126 /** Signed 8 bit */ 127 SND_PCM_FORMAT_S8 = 0, 128 /** Unsigned 8 bit */ 129 SND_PCM_FORMAT_U8, 130 /** Signed 16 bit Little Endian */ 131 SND_PCM_FORMAT_S16_LE, 132 /** Signed 16 bit Big Endian */ 133 SND_PCM_FORMAT_S16_BE, 134 /** Unsigned 16 bit Little Endian */ 135 SND_PCM_FORMAT_U16_LE, 136 /** Unsigned 16 bit Big Endian */ 137 SND_PCM_FORMAT_U16_BE, 138 /** Signed 24 bit Little Endian using low three bytes in 32-bit word */ 139 SND_PCM_FORMAT_S24_LE, 140 /** Signed 24 bit Big Endian using low three bytes in 32-bit word */ 141 SND_PCM_FORMAT_S24_BE, 142 /** Unsigned 24 bit Little Endian using low three bytes in 32-bit word */ 143 SND_PCM_FORMAT_U24_LE, 144 /** Unsigned 24 bit Big Endian using low three bytes in 32-bit word */ 145 SND_PCM_FORMAT_U24_BE, 146 /** Signed 32 bit Little Endian */ 147 SND_PCM_FORMAT_S32_LE, 148 /** Signed 32 bit Big Endian */ 149 SND_PCM_FORMAT_S32_BE, 150 /** Unsigned 32 bit Little Endian */ 151 SND_PCM_FORMAT_U32_LE, 152 /** Unsigned 32 bit Big Endian */ 153 SND_PCM_FORMAT_U32_BE, 154 /** Float 32 bit Little Endian, Range -1.0 to 1.0 */ 155 SND_PCM_FORMAT_FLOAT_LE, 156 /** Float 32 bit Big Endian, Range -1.0 to 1.0 */ 157 SND_PCM_FORMAT_FLOAT_BE, 158 /** Float 64 bit Little Endian, Range -1.0 to 1.0 */ 159 SND_PCM_FORMAT_FLOAT64_LE, 160 /** Float 64 bit Big Endian, Range -1.0 to 1.0 */ 161 SND_PCM_FORMAT_FLOAT64_BE, 162 /** IEC-958 Little Endian */ 163 SND_PCM_FORMAT_IEC958_SUBFRAME_LE, 164 /** IEC-958 Big Endian */ 165 SND_PCM_FORMAT_IEC958_SUBFRAME_BE, 166 /** Mu-Law */ 167 SND_PCM_FORMAT_MU_LAW, 168 /** A-Law */ 169 SND_PCM_FORMAT_A_LAW, 170 /** Ima-ADPCM */ 171 SND_PCM_FORMAT_IMA_ADPCM, 172 /** MPEG */ 173 SND_PCM_FORMAT_MPEG, 174 /** GSM */ 175 SND_PCM_FORMAT_GSM, 176 /** Special */ 177 SND_PCM_FORMAT_SPECIAL = 31, 178 /** Signed 24bit Little Endian in 3bytes format */ 179 SND_PCM_FORMAT_S24_3LE = 32, 180 /** Signed 24bit Big Endian in 3bytes format */ 181 SND_PCM_FORMAT_S24_3BE, 182 /** Unsigned 24bit Little Endian in 3bytes format */ 183 SND_PCM_FORMAT_U24_3LE, 184 /** Unsigned 24bit Big Endian in 3bytes format */ 185 SND_PCM_FORMAT_U24_3BE, 186 /** Signed 20bit Little Endian in 3bytes format */ 187 SND_PCM_FORMAT_S20_3LE, 188 /** Signed 20bit Big Endian in 3bytes format */ 189 SND_PCM_FORMAT_S20_3BE, 190 /** Unsigned 20bit Little Endian in 3bytes format */ 191 SND_PCM_FORMAT_U20_3LE, 192 /** Unsigned 20bit Big Endian in 3bytes format */ 193 SND_PCM_FORMAT_U20_3BE, 194 /** Signed 18bit Little Endian in 3bytes format */ 195 SND_PCM_FORMAT_S18_3LE, 196 /** Signed 18bit Big Endian in 3bytes format */ 197 SND_PCM_FORMAT_S18_3BE, 198 /** Unsigned 18bit Little Endian in 3bytes format */ 199 SND_PCM_FORMAT_U18_3LE, 200 /** Unsigned 18bit Big Endian in 3bytes format */ 201 SND_PCM_FORMAT_U18_3BE, 202 SND_PCM_FORMAT_LAST = SND_PCM_FORMAT_U18_3BE, 203 204#if __BYTE_ORDER == __LITTLE_ENDIAN 205 /** Signed 16 bit CPU endian */ 206 SND_PCM_FORMAT_S16 = SND_PCM_FORMAT_S16_LE, 207 /** Unsigned 16 bit CPU endian */ 208 SND_PCM_FORMAT_U16 = SND_PCM_FORMAT_U16_LE, 209 /** Signed 24 bit CPU endian */ 210 SND_PCM_FORMAT_S24 = SND_PCM_FORMAT_S24_LE, 211 /** Unsigned 24 bit CPU endian */ 212 SND_PCM_FORMAT_U24 = SND_PCM_FORMAT_U24_LE, 213 /** Signed 32 bit CPU endian */ 214 SND_PCM_FORMAT_S32 = SND_PCM_FORMAT_S32_LE, 215 /** Unsigned 32 bit CPU endian */ 216 SND_PCM_FORMAT_U32 = SND_PCM_FORMAT_U32_LE, 217 /** Float 32 bit CPU endian */ 218 SND_PCM_FORMAT_FLOAT = SND_PCM_FORMAT_FLOAT_LE, 219 /** Float 64 bit CPU endian */ 220 SND_PCM_FORMAT_FLOAT64 = SND_PCM_FORMAT_FLOAT64_LE, 221 /** IEC-958 CPU Endian */ 222 SND_PCM_FORMAT_IEC958_SUBFRAME = SND_PCM_FORMAT_IEC958_SUBFRAME_LE 223#elif __BYTE_ORDER == __BIG_ENDIAN 224 /** Signed 16 bit CPU endian */ 225 SND_PCM_FORMAT_S16 = SND_PCM_FORMAT_S16_BE, 226 /** Unsigned 16 bit CPU endian */ 227 SND_PCM_FORMAT_U16 = SND_PCM_FORMAT_U16_BE, 228 /** Signed 24 bit CPU endian */ 229 SND_PCM_FORMAT_S24 = SND_PCM_FORMAT_S24_BE, 230 /** Unsigned 24 bit CPU endian */ 231 SND_PCM_FORMAT_U24 = SND_PCM_FORMAT_U24_BE, 232 /** Signed 32 bit CPU endian */ 233 SND_PCM_FORMAT_S32 = SND_PCM_FORMAT_S32_BE, 234 /** Unsigned 32 bit CPU endian */ 235 SND_PCM_FORMAT_U32 = SND_PCM_FORMAT_U32_BE, 236 /** Float 32 bit CPU endian */ 237 SND_PCM_FORMAT_FLOAT = SND_PCM_FORMAT_FLOAT_BE, 238 /** Float 64 bit CPU endian */ 239 SND_PCM_FORMAT_FLOAT64 = SND_PCM_FORMAT_FLOAT64_BE, 240 /** IEC-958 CPU Endian */ 241 SND_PCM_FORMAT_IEC958_SUBFRAME = SND_PCM_FORMAT_IEC958_SUBFRAME_BE 242#else 243#error "Unknown endian" 244#endif 245} snd_pcm_format_t; 246 247/** PCM sample subformat */ 248typedef enum _snd_pcm_subformat { 249 /** Standard */ 250 SND_PCM_SUBFORMAT_STD = 0, 251 SND_PCM_SUBFORMAT_LAST = SND_PCM_SUBFORMAT_STD 252} snd_pcm_subformat_t; 253 254/** PCM state */ 255typedef enum _snd_pcm_state { 256 /** Open */ 257 SND_PCM_STATE_OPEN = 0, 258 /** Setup installed */ 259 SND_PCM_STATE_SETUP, 260 /** Ready to start */ 261 SND_PCM_STATE_PREPARED, 262 /** Running */ 263 SND_PCM_STATE_RUNNING, 264 /** Stopped: underrun (playback) or overrun (capture) detected */ 265 SND_PCM_STATE_XRUN, 266 /** Draining: running (playback) or stopped (capture) */ 267 SND_PCM_STATE_DRAINING, 268 /** Paused */ 269 SND_PCM_STATE_PAUSED, 270 /** Hardware is suspended */ 271 SND_PCM_STATE_SUSPENDED, 272 /** Hardware is disconnected */ 273 SND_PCM_STATE_DISCONNECTED, 274 SND_PCM_STATE_LAST = SND_PCM_STATE_DISCONNECTED 275} snd_pcm_state_t; 276 277/** PCM start mode */ 278typedef enum _snd_pcm_start { 279 /** Automatic start on data read/write */ 280 SND_PCM_START_DATA = 0, 281 /** Explicit start */ 282 SND_PCM_START_EXPLICIT, 283 SND_PCM_START_LAST = SND_PCM_START_EXPLICIT 284} snd_pcm_start_t; 285 286/** PCM xrun mode */ 287typedef enum _snd_pcm_xrun { 288 /** Xrun detection disabled */ 289 SND_PCM_XRUN_NONE = 0, 290 /** Stop on xrun detection */ 291 SND_PCM_XRUN_STOP, 292 SND_PCM_XRUN_LAST = SND_PCM_XRUN_STOP 293} snd_pcm_xrun_t; 294 295/** PCM timestamp mode */ 296typedef enum _snd_pcm_tstamp { 297 /** No timestamp */ 298 SND_PCM_TSTAMP_NONE = 0, 299 /** Update timestamp at every hardware position update */ 300 SND_PCM_TSTAMP_ENABLE, 301 /** Equivalent with #SND_PCM_TSTAMP_ENABLE, 302 * just for compatibility with older versions 303 */ 304 SND_PCM_TSTAMP_MMAP = SND_PCM_TSTAMP_ENABLE, 305 SND_PCM_TSTAMP_LAST = SND_PCM_TSTAMP_ENABLE 306} snd_pcm_tstamp_t; 307 308/** Unsigned frames quantity */ 309typedef unsigned long snd_pcm_uframes_t; 310/** Signed frames quantity */ 311typedef long snd_pcm_sframes_t; 312 313/** Non blocking mode (flag for open mode) \hideinitializer */ 314#define SND_PCM_NONBLOCK 0x00000001 315/** Async notification (flag for open mode) \hideinitializer */ 316#define SND_PCM_ASYNC 0x00000002 317/** Disable automatic (but not forced!) rate resamplinig */ 318#define SND_PCM_NO_AUTO_RESAMPLE 0x00010000 319/** Disable automatic (but not forced!) channel conversion */ 320#define SND_PCM_NO_AUTO_CHANNELS 0x00020000 321/** Disable automatic (but not forced!) format conversion */ 322#define SND_PCM_NO_AUTO_FORMAT 0x00040000 323/** Disable soft volume control */ 324#define SND_PCM_NO_SOFTVOL 0x00080000 325 326/** PCM handle */ 327typedef struct _snd_pcm snd_pcm_t; 328 329/** PCM type */ 330enum _snd_pcm_type { 331 /** Kernel level PCM */ 332 SND_PCM_TYPE_HW = 0, 333 /** Hooked PCM */ 334 SND_PCM_TYPE_HOOKS, 335 /** One or more linked PCM with exclusive access to selected 336 channels */ 337 SND_PCM_TYPE_MULTI, 338 /** File writing plugin */ 339 SND_PCM_TYPE_FILE, 340 /** Null endpoint PCM */ 341 SND_PCM_TYPE_NULL, 342 /** Shared memory client PCM */ 343 SND_PCM_TYPE_SHM, 344 /** INET client PCM (not yet implemented) */ 345 SND_PCM_TYPE_INET, 346 /** Copying plugin */ 347 SND_PCM_TYPE_COPY, 348 /** Linear format conversion PCM */ 349 SND_PCM_TYPE_LINEAR, 350 /** A-Law format conversion PCM */ 351 SND_PCM_TYPE_ALAW, 352 /** Mu-Law format conversion PCM */ 353 SND_PCM_TYPE_MULAW, 354 /** IMA-ADPCM format conversion PCM */ 355 SND_PCM_TYPE_ADPCM, 356 /** Rate conversion PCM */ 357 SND_PCM_TYPE_RATE, 358 /** Attenuated static route PCM */ 359 SND_PCM_TYPE_ROUTE, 360 /** Format adjusted PCM */ 361 SND_PCM_TYPE_PLUG, 362 /** Sharing PCM */ 363 SND_PCM_TYPE_SHARE, 364 /** Meter plugin */ 365 SND_PCM_TYPE_METER, 366 /** Mixing PCM */ 367 SND_PCM_TYPE_MIX, 368 /** Attenuated dynamic route PCM (not yet implemented) */ 369 SND_PCM_TYPE_DROUTE, 370 /** Loopback server plugin (not yet implemented) */ 371 SND_PCM_TYPE_LBSERVER, 372 /** Linear Integer <-> Linear Float format conversion PCM */ 373 SND_PCM_TYPE_LINEAR_FLOAT, 374 /** LADSPA integration plugin */ 375 SND_PCM_TYPE_LADSPA, 376 /** Direct Mixing plugin */ 377 SND_PCM_TYPE_DMIX, 378 /** Jack Audio Connection Kit plugin */ 379 SND_PCM_TYPE_JACK, 380 /** Direct Snooping plugin */ 381 SND_PCM_TYPE_DSNOOP, 382 /** Direct Sharing plugin */ 383 SND_PCM_TYPE_DSHARE, 384 /** IEC958 subframe plugin */ 385 SND_PCM_TYPE_IEC958, 386 /** Soft volume plugin */ 387 SND_PCM_TYPE_SOFTVOL, 388 /** External I/O plugin */ 389 SND_PCM_TYPE_IOPLUG, 390 /** External filter plugin */ 391 SND_PCM_TYPE_EXTPLUG, 392 /** Mmap-emulation plugin */ 393 SND_PCM_TYPE_MMAP_EMUL, 394 SND_PCM_TYPE_LAST = SND_PCM_TYPE_MMAP_EMUL 395}; 396 397/** PCM type */ 398typedef enum _snd_pcm_type snd_pcm_type_t; 399 400/** PCM area specification */ 401typedef struct _snd_pcm_channel_area { 402 /** base address of channel samples */ 403 void *addr; 404 /** offset to first sample in bits */ 405 unsigned int first; 406 /** samples distance in bits */ 407 unsigned int step; 408} snd_pcm_channel_area_t; 409 410/** PCM synchronization ID */ 411typedef union _snd_pcm_sync_id { 412 /** 8-bit ID */ 413 unsigned char id[16]; 414 /** 16-bit ID */ 415 unsigned short id16[8]; 416 /** 32-bit ID */ 417 unsigned int id32[4]; 418} snd_pcm_sync_id_t; 419 420/** #SND_PCM_TYPE_METER scope handle */ 421typedef struct _snd_pcm_scope snd_pcm_scope_t; 422 423int snd_pcm_open(snd_pcm_t **pcm, const char *name, 424 snd_pcm_stream_t stream, int mode); 425int snd_pcm_open_lconf(snd_pcm_t **pcm, const char *name, 426 snd_pcm_stream_t stream, int mode, 427 snd_config_t *lconf); 428int snd_pcm_open_fallback(snd_pcm_t **pcm, snd_config_t *root, 429 const char *name, const char *orig_name, 430 snd_pcm_stream_t stream, int mode); 431 432int snd_pcm_close(snd_pcm_t *pcm); 433const char *snd_pcm_name(snd_pcm_t *pcm); 434snd_pcm_type_t snd_pcm_type(snd_pcm_t *pcm); 435snd_pcm_stream_t snd_pcm_stream(snd_pcm_t *pcm); 436int snd_pcm_poll_descriptors_count(snd_pcm_t *pcm); 437int snd_pcm_poll_descriptors(snd_pcm_t *pcm, struct pollfd *pfds, unsigned int space); 438int snd_pcm_poll_descriptors_revents(snd_pcm_t *pcm, struct pollfd *pfds, unsigned int nfds, unsigned short *revents); 439int snd_pcm_nonblock(snd_pcm_t *pcm, int nonblock); 440int snd_async_add_pcm_handler(snd_async_handler_t **handler, snd_pcm_t *pcm, 441 snd_async_callback_t callback, void *private_data); 442snd_pcm_t *snd_async_handler_get_pcm(snd_async_handler_t *handler); 443int snd_pcm_info(snd_pcm_t *pcm, snd_pcm_info_t *info); 444int snd_pcm_hw_params_current(snd_pcm_t *pcm, snd_pcm_hw_params_t *params); 445int snd_pcm_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t *params); 446int snd_pcm_hw_free(snd_pcm_t *pcm); 447int snd_pcm_sw_params_current(snd_pcm_t *pcm, snd_pcm_sw_params_t *params); 448int snd_pcm_sw_params(snd_pcm_t *pcm, snd_pcm_sw_params_t *params); 449int snd_pcm_prepare(snd_pcm_t *pcm); 450int snd_pcm_reset(snd_pcm_t *pcm); 451int snd_pcm_status(snd_pcm_t *pcm, snd_pcm_status_t *status); 452int snd_pcm_start(snd_pcm_t *pcm); 453int snd_pcm_drop(snd_pcm_t *pcm); 454int snd_pcm_drain(snd_pcm_t *pcm); 455int snd_pcm_pause(snd_pcm_t *pcm, int enable); 456snd_pcm_state_t snd_pcm_state(snd_pcm_t *pcm); 457int snd_pcm_hwsync(snd_pcm_t *pcm); 458int snd_pcm_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *delayp); 459int snd_pcm_resume(snd_pcm_t *pcm); 460int snd_pcm_htimestamp(snd_pcm_t *pcm, snd_pcm_uframes_t *avail, snd_htimestamp_t *tstamp); 461snd_pcm_sframes_t snd_pcm_avail(snd_pcm_t *pcm); 462snd_pcm_sframes_t snd_pcm_avail_update(snd_pcm_t *pcm); 463int snd_pcm_avail_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *availp, snd_pcm_sframes_t *delayp); 464snd_pcm_sframes_t snd_pcm_rewindable(snd_pcm_t *pcm); 465snd_pcm_sframes_t snd_pcm_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t frames); 466snd_pcm_sframes_t snd_pcm_forwardable(snd_pcm_t *pcm); 467snd_pcm_sframes_t snd_pcm_forward(snd_pcm_t *pcm, snd_pcm_uframes_t frames); 468snd_pcm_sframes_t snd_pcm_writei(snd_pcm_t *pcm, const void *buffer, snd_pcm_uframes_t size); 469snd_pcm_sframes_t snd_pcm_readi(snd_pcm_t *pcm, void *buffer, snd_pcm_uframes_t size); 470snd_pcm_sframes_t snd_pcm_writen(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size); 471snd_pcm_sframes_t snd_pcm_readn(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size); 472int snd_pcm_wait(snd_pcm_t *pcm, int timeout); 473 474int snd_pcm_link(snd_pcm_t *pcm1, snd_pcm_t *pcm2); 475int snd_pcm_unlink(snd_pcm_t *pcm); 476 477//int snd_pcm_mixer_element(snd_pcm_t *pcm, snd_mixer_t *mixer, snd_mixer_elem_t **elem); 478 479/* 480 * application helpers - these functions are implemented on top 481 * of the basic API 482 */ 483 484int snd_pcm_recover(snd_pcm_t *pcm, int err, int silent); 485int snd_pcm_set_params(snd_pcm_t *pcm, 486 snd_pcm_format_t format, 487 snd_pcm_access_t access, 488 unsigned int channels, 489 unsigned int rate, 490 int soft_resample, 491 unsigned int latency); 492int snd_pcm_get_params(snd_pcm_t *pcm, 493 snd_pcm_uframes_t *buffer_size, 494 snd_pcm_uframes_t *period_size); 495 496/** \} */ 497 498/** 499 * \defgroup PCM_Info Stream Information 500 * \ingroup PCM 501 * See the \ref pcm page for more details. 502 * \{ 503 */ 504 505size_t snd_pcm_info_sizeof(void); 506/** \hideinitializer 507 * \brief allocate an invalid #snd_pcm_info_t using standard alloca 508 * \param ptr returned pointer 509 */ 510#define snd_pcm_info_alloca(ptr) __snd_alloca(ptr, snd_pcm_info) 511int snd_pcm_info_malloc(snd_pcm_info_t **ptr); 512void snd_pcm_info_free(snd_pcm_info_t *obj); 513void snd_pcm_info_copy(snd_pcm_info_t *dst, const snd_pcm_info_t *src); 514unsigned int snd_pcm_info_get_device(const snd_pcm_info_t *obj); 515unsigned int snd_pcm_info_get_subdevice(const snd_pcm_info_t *obj); 516snd_pcm_stream_t snd_pcm_info_get_stream(const snd_pcm_info_t *obj); 517int snd_pcm_info_get_card(const snd_pcm_info_t *obj); 518const char *snd_pcm_info_get_id(const snd_pcm_info_t *obj); 519const char *snd_pcm_info_get_name(const snd_pcm_info_t *obj); 520const char *snd_pcm_info_get_subdevice_name(const snd_pcm_info_t *obj); 521snd_pcm_class_t snd_pcm_info_get_class(const snd_pcm_info_t *obj); 522snd_pcm_subclass_t snd_pcm_info_get_subclass(const snd_pcm_info_t *obj); 523unsigned int snd_pcm_info_get_subdevices_count(const snd_pcm_info_t *obj); 524unsigned int snd_pcm_info_get_subdevices_avail(const snd_pcm_info_t *obj); 525snd_pcm_sync_id_t snd_pcm_info_get_sync(const snd_pcm_info_t *obj); 526void snd_pcm_info_set_device(snd_pcm_info_t *obj, unsigned int val); 527void snd_pcm_info_set_subdevice(snd_pcm_info_t *obj, unsigned int val); 528void snd_pcm_info_set_stream(snd_pcm_info_t *obj, snd_pcm_stream_t val); 529 530/** \} */ 531 532/** 533 * \defgroup PCM_HW_Params Hardware Parameters 534 * \ingroup PCM 535 * See the \ref pcm page for more details. 536 * \{ 537 */ 538 539int snd_pcm_hw_params_any(snd_pcm_t *pcm, snd_pcm_hw_params_t *params); 540 541int snd_pcm_hw_params_can_mmap_sample_resolution(const snd_pcm_hw_params_t *params); 542int snd_pcm_hw_params_is_double(const snd_pcm_hw_params_t *params); 543int snd_pcm_hw_params_is_batch(const snd_pcm_hw_params_t *params); 544int snd_pcm_hw_params_is_block_transfer(const snd_pcm_hw_params_t *params); 545int snd_pcm_hw_params_is_monotonic(const snd_pcm_hw_params_t *params); 546int snd_pcm_hw_params_can_overrange(const snd_pcm_hw_params_t *params); 547int snd_pcm_hw_params_can_pause(const snd_pcm_hw_params_t *params); 548int snd_pcm_hw_params_can_resume(const snd_pcm_hw_params_t *params); 549int snd_pcm_hw_params_is_half_duplex(const snd_pcm_hw_params_t *params); 550int snd_pcm_hw_params_is_joint_duplex(const snd_pcm_hw_params_t *params); 551int snd_pcm_hw_params_can_sync_start(const snd_pcm_hw_params_t *params); 552int snd_pcm_hw_params_can_disable_period_wakeup(const snd_pcm_hw_params_t *params); 553int snd_pcm_hw_params_get_rate_numden(const snd_pcm_hw_params_t *params, 554 unsigned int *rate_num, 555 unsigned int *rate_den); 556int snd_pcm_hw_params_get_sbits(const snd_pcm_hw_params_t *params); 557int snd_pcm_hw_params_get_fifo_size(const snd_pcm_hw_params_t *params); 558 559#if 0 560typedef struct _snd_pcm_hw_strategy snd_pcm_hw_strategy_t; 561 562/* choices need to be sorted on ascending badness */ 563typedef struct _snd_pcm_hw_strategy_simple_choices_list { 564 unsigned int value; 565 unsigned int badness; 566} snd_pcm_hw_strategy_simple_choices_list_t; 567 568int snd_pcm_hw_params_strategy(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, 569 const snd_pcm_hw_strategy_t *strategy, 570 unsigned int badness_min, 571 unsigned int badness_max); 572 573void snd_pcm_hw_strategy_free(snd_pcm_hw_strategy_t *strategy); 574int snd_pcm_hw_strategy_simple(snd_pcm_hw_strategy_t **strategyp, 575 unsigned int badness_min, 576 unsigned int badness_max); 577int snd_pcm_hw_params_try_explain_failure(snd_pcm_t *pcm, 578 snd_pcm_hw_params_t *fail, 579 snd_pcm_hw_params_t *success, 580 unsigned int depth, 581 snd_output_t *out); 582 583#endif 584 585size_t snd_pcm_hw_params_sizeof(void); 586/** \hideinitializer 587 * \brief allocate an invalid #snd_pcm_hw_params_t using standard alloca 588 * \param ptr returned pointer 589 */ 590#define snd_pcm_hw_params_alloca(ptr) __snd_alloca(ptr, snd_pcm_hw_params) 591int snd_pcm_hw_params_malloc(snd_pcm_hw_params_t **ptr); 592void snd_pcm_hw_params_free(snd_pcm_hw_params_t *obj); 593void snd_pcm_hw_params_copy(snd_pcm_hw_params_t *dst, const snd_pcm_hw_params_t *src); 594 595#if !defined(ALSA_LIBRARY_BUILD) && !defined(ALSA_PCM_OLD_HW_PARAMS_API) 596 597int snd_pcm_hw_params_get_access(const snd_pcm_hw_params_t *params, snd_pcm_access_t *_access); 598int snd_pcm_hw_params_test_access(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t _access); 599int snd_pcm_hw_params_set_access(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t _access); 600int snd_pcm_hw_params_set_access_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t *_access); 601int snd_pcm_hw_params_set_access_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t *_access); 602int snd_pcm_hw_params_set_access_mask(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_mask_t *mask); 603int snd_pcm_hw_params_get_access_mask(snd_pcm_hw_params_t *params, snd_pcm_access_mask_t *mask); 604 605int snd_pcm_hw_params_get_format(const snd_pcm_hw_params_t *params, snd_pcm_format_t *val); 606int snd_pcm_hw_params_test_format(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t val); 607int snd_pcm_hw_params_set_format(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t val); 608int snd_pcm_hw_params_set_format_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t *format); 609int snd_pcm_hw_params_set_format_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t *format); 610int snd_pcm_hw_params_set_format_mask(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_mask_t *mask); 611void snd_pcm_hw_params_get_format_mask(snd_pcm_hw_params_t *params, snd_pcm_format_mask_t *mask); 612 613int snd_pcm_hw_params_get_subformat(const snd_pcm_hw_params_t *params, snd_pcm_subformat_t *subformat); 614int snd_pcm_hw_params_test_subformat(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t subformat); 615int snd_pcm_hw_params_set_subformat(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t subformat); 616int snd_pcm_hw_params_set_subformat_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t *subformat); 617int snd_pcm_hw_params_set_subformat_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t *subformat); 618int snd_pcm_hw_params_set_subformat_mask(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_mask_t *mask); 619void snd_pcm_hw_params_get_subformat_mask(snd_pcm_hw_params_t *params, snd_pcm_subformat_mask_t *mask); 620 621int snd_pcm_hw_params_get_channels(const snd_pcm_hw_params_t *params, unsigned int *val); 622int snd_pcm_hw_params_get_channels_min(const snd_pcm_hw_params_t *params, unsigned int *val); 623int snd_pcm_hw_params_get_channels_max(const snd_pcm_hw_params_t *params, unsigned int *val); 624int snd_pcm_hw_params_test_channels(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val); 625int snd_pcm_hw_params_set_channels(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val); 626int snd_pcm_hw_params_set_channels_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val); 627int snd_pcm_hw_params_set_channels_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val); 628int snd_pcm_hw_params_set_channels_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *min, unsigned int *max); 629int snd_pcm_hw_params_set_channels_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val); 630int snd_pcm_hw_params_set_channels_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val); 631int snd_pcm_hw_params_set_channels_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val); 632 633int snd_pcm_hw_params_get_rate(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir); 634int snd_pcm_hw_params_get_rate_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir); 635int snd_pcm_hw_params_get_rate_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir); 636int snd_pcm_hw_params_test_rate(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir); 637int snd_pcm_hw_params_set_rate(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir); 638int snd_pcm_hw_params_set_rate_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); 639int snd_pcm_hw_params_set_rate_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); 640int 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); 641int snd_pcm_hw_params_set_rate_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); 642int snd_pcm_hw_params_set_rate_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); 643int snd_pcm_hw_params_set_rate_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); 644int snd_pcm_hw_params_set_rate_resample(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val); 645int snd_pcm_hw_params_get_rate_resample(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val); 646int snd_pcm_hw_params_set_export_buffer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val); 647int snd_pcm_hw_params_get_export_buffer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val); 648int snd_pcm_hw_params_set_period_wakeup(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val); 649int snd_pcm_hw_params_get_period_wakeup(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val); 650 651int snd_pcm_hw_params_get_period_time(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir); 652int snd_pcm_hw_params_get_period_time_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir); 653int snd_pcm_hw_params_get_period_time_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir); 654int snd_pcm_hw_params_test_period_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir); 655int snd_pcm_hw_params_set_period_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir); 656int snd_pcm_hw_params_set_period_time_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); 657int snd_pcm_hw_params_set_period_time_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); 658int 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); 659int snd_pcm_hw_params_set_period_time_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); 660int snd_pcm_hw_params_set_period_time_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); 661int snd_pcm_hw_params_set_period_time_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); 662 663int snd_pcm_hw_params_get_period_size(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *frames, int *dir); 664int snd_pcm_hw_params_get_period_size_min(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *frames, int *dir); 665int snd_pcm_hw_params_get_period_size_max(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *frames, int *dir); 666int snd_pcm_hw_params_test_period_size(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t val, int dir); 667int snd_pcm_hw_params_set_period_size(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t val, int dir); 668int 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); 669int 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); 670int 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); 671int 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); 672int 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); 673int 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); 674int snd_pcm_hw_params_set_period_size_integer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params); 675 676int snd_pcm_hw_params_get_periods(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir); 677int snd_pcm_hw_params_get_periods_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir); 678int snd_pcm_hw_params_get_periods_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir); 679int snd_pcm_hw_params_test_periods(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir); 680int snd_pcm_hw_params_set_periods(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir); 681int snd_pcm_hw_params_set_periods_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); 682int snd_pcm_hw_params_set_periods_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); 683int 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); 684int snd_pcm_hw_params_set_periods_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); 685int snd_pcm_hw_params_set_periods_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); 686int snd_pcm_hw_params_set_periods_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); 687int snd_pcm_hw_params_set_periods_integer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params); 688 689int snd_pcm_hw_params_get_buffer_time(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir); 690int snd_pcm_hw_params_get_buffer_time_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir); 691int snd_pcm_hw_params_get_buffer_time_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir); 692int snd_pcm_hw_params_test_buffer_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir); 693int snd_pcm_hw_params_set_buffer_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir); 694int snd_pcm_hw_params_set_buffer_time_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); 695int snd_pcm_hw_params_set_buffer_time_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); 696int 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); 697int snd_pcm_hw_params_set_buffer_time_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); 698int snd_pcm_hw_params_set_buffer_time_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); 699int snd_pcm_hw_params_set_buffer_time_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); 700 701int snd_pcm_hw_params_get_buffer_size(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val); 702int snd_pcm_hw_params_get_buffer_size_min(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val); 703int snd_pcm_hw_params_get_buffer_size_max(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val); 704int snd_pcm_hw_params_test_buffer_size(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t val); 705int snd_pcm_hw_params_set_buffer_size(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t val); 706int snd_pcm_hw_params_set_buffer_size_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val); 707int snd_pcm_hw_params_set_buffer_size_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val); 708int 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); 709int snd_pcm_hw_params_set_buffer_size_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val); 710int snd_pcm_hw_params_set_buffer_size_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val); 711int snd_pcm_hw_params_set_buffer_size_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val); 712 713#endif /* !ALSA_LIBRARY_BUILD && !ALSA_PCM_OLD_HW_PARAMS_API */ 714 715int snd_pcm_hw_params_get_min_align(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val); 716 717/** \} */ 718 719/** 720 * \defgroup PCM_SW_Params Software Parameters 721 * \ingroup PCM 722 * See the \ref pcm page for more details. 723 * \{ 724 */ 725 726size_t snd_pcm_sw_params_sizeof(void); 727/** \hideinitializer 728 * \brief allocate an invalid #snd_pcm_sw_params_t using standard alloca 729 * \param ptr returned pointer 730 */ 731#define snd_pcm_sw_params_alloca(ptr) __snd_alloca(ptr, snd_pcm_sw_params) 732int snd_pcm_sw_params_malloc(snd_pcm_sw_params_t **ptr); 733void snd_pcm_sw_params_free(snd_pcm_sw_params_t *obj); 734void snd_pcm_sw_params_copy(snd_pcm_sw_params_t *dst, const snd_pcm_sw_params_t *src); 735int snd_pcm_sw_params_get_boundary(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val); 736 737#if !defined(ALSA_LIBRARY_BUILD) && !defined(ALSA_PCM_OLD_SW_PARAMS_API) 738 739int snd_pcm_sw_params_set_tstamp_mode(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_tstamp_t val); 740int snd_pcm_sw_params_get_tstamp_mode(const snd_pcm_sw_params_t *params, snd_pcm_tstamp_t *val); 741int snd_pcm_sw_params_set_avail_min(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val); 742int snd_pcm_sw_params_get_avail_min(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val); 743int snd_pcm_sw_params_set_period_event(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, int val); 744int snd_pcm_sw_params_get_period_event(const snd_pcm_sw_params_t *params, int *val); 745int snd_pcm_sw_params_set_start_threshold(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val); 746int snd_pcm_sw_params_get_start_threshold(const snd_pcm_sw_params_t *paramsm, snd_pcm_uframes_t *val); 747int snd_pcm_sw_params_set_stop_threshold(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val); 748int snd_pcm_sw_params_get_stop_threshold(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val); 749int snd_pcm_sw_params_set_silence_threshold(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val); 750int snd_pcm_sw_params_get_silence_threshold(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val); 751int snd_pcm_sw_params_set_silence_size(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val); 752int snd_pcm_sw_params_get_silence_size(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val); 753 754#endif /* !ALSA_LIBRARY_BUILD && !ALSA_PCM_OLD_SW_PARAMS_API */ 755 756/** \} */ 757 758/* include old API */ 759#ifndef ALSA_LIBRARY_BUILD 760#if defined(ALSA_PCM_OLD_HW_PARAMS_API) || defined(ALSA_PCM_OLD_SW_PARAMS_API) 761#include "pcm_old.h" 762#endif 763#endif 764 765/** 766 * \defgroup PCM_Access Access Mask Functions 767 * \ingroup PCM 768 * See the \ref pcm page for more details. 769 * \{ 770 */ 771 772size_t snd_pcm_access_mask_sizeof(void); 773/** \hideinitializer 774 * \brief allocate an empty #snd_pcm_access_mask_t using standard alloca 775 * \param ptr returned pointer 776 */ 777#define snd_pcm_access_mask_alloca(ptr) __snd_alloca(ptr, snd_pcm_access_mask) 778int snd_pcm_access_mask_malloc(snd_pcm_access_mask_t **ptr); 779void snd_pcm_access_mask_free(snd_pcm_access_mask_t *obj); 780void snd_pcm_access_mask_copy(snd_pcm_access_mask_t *dst, const snd_pcm_access_mask_t *src); 781void snd_pcm_access_mask_none(snd_pcm_access_mask_t *mask); 782void snd_pcm_access_mask_any(snd_pcm_access_mask_t *mask); 783int snd_pcm_access_mask_test(const snd_pcm_access_mask_t *mask, snd_pcm_access_t val); 784int snd_pcm_access_mask_empty(const snd_pcm_access_mask_t *mask); 785void snd_pcm_access_mask_set(snd_pcm_access_mask_t *mask, snd_pcm_access_t val); 786void snd_pcm_access_mask_reset(snd_pcm_access_mask_t *mask, snd_pcm_access_t val); 787 788/** \} */ 789 790/** 791 * \defgroup PCM_Format Format Mask Functions 792 * \ingroup PCM 793 * See the \ref pcm page for more details. 794 * \{ 795 */ 796 797size_t snd_pcm_format_mask_sizeof(void); 798/** \hideinitializer 799 * \brief allocate an empty #snd_pcm_format_mask_t using standard alloca 800 * \param ptr returned pointer 801 */ 802#define snd_pcm_format_mask_alloca(ptr) __snd_alloca(ptr, snd_pcm_format_mask) 803int snd_pcm_format_mask_malloc(snd_pcm_format_mask_t **ptr); 804void snd_pcm_format_mask_free(snd_pcm_format_mask_t *obj); 805void snd_pcm_format_mask_copy(snd_pcm_format_mask_t *dst, const snd_pcm_format_mask_t *src); 806void snd_pcm_format_mask_none(snd_pcm_format_mask_t *mask); 807void snd_pcm_format_mask_any(snd_pcm_format_mask_t *mask); 808int snd_pcm_format_mask_test(const snd_pcm_format_mask_t *mask, snd_pcm_format_t val); 809int snd_pcm_format_mask_empty(const snd_pcm_format_mask_t *mask); 810void snd_pcm_format_mask_set(snd_pcm_format_mask_t *mask, snd_pcm_format_t val); 811void snd_pcm_format_mask_reset(snd_pcm_format_mask_t *mask, snd_pcm_format_t val); 812 813/** \} */ 814 815/** 816 * \defgroup PCM_SubFormat Subformat Mask Functions 817 * \ingroup PCM 818 * See the \ref pcm page for more details. 819 * \{ 820 */ 821 822size_t snd_pcm_subformat_mask_sizeof(void); 823/** \hideinitializer 824 * \brief allocate an empty #snd_pcm_subformat_mask_t using standard alloca 825 * \param ptr returned pointer 826 */ 827#define snd_pcm_subformat_mask_alloca(ptr) __snd_alloca(ptr, snd_pcm_subformat_mask) 828int snd_pcm_subformat_mask_malloc(snd_pcm_subformat_mask_t **ptr); 829void snd_pcm_subformat_mask_free(snd_pcm_subformat_mask_t *obj); 830void snd_pcm_subformat_mask_copy(snd_pcm_subformat_mask_t *dst, const snd_pcm_subformat_mask_t *src); 831void snd_pcm_subformat_mask_none(snd_pcm_subformat_mask_t *mask); 832void snd_pcm_subformat_mask_any(snd_pcm_subformat_mask_t *mask); 833int snd_pcm_subformat_mask_test(const snd_pcm_subformat_mask_t *mask, snd_pcm_subformat_t val); 834int snd_pcm_subformat_mask_empty(const snd_pcm_subformat_mask_t *mask); 835void snd_pcm_subformat_mask_set(snd_pcm_subformat_mask_t *mask, snd_pcm_subformat_t val); 836void snd_pcm_subformat_mask_reset(snd_pcm_subformat_mask_t *mask, snd_pcm_subformat_t val); 837 838/** \} */ 839 840/** 841 * \defgroup PCM_Status Status Functions 842 * \ingroup PCM 843 * See the \ref pcm page for more details. 844 * \{ 845 */ 846 847size_t snd_pcm_status_sizeof(void); 848/** \hideinitializer 849 * \brief allocate an invalid #snd_pcm_status_t using standard alloca 850 * \param ptr returned pointer 851 */ 852#define snd_pcm_status_alloca(ptr) __snd_alloca(ptr, snd_pcm_status) 853int snd_pcm_status_malloc(snd_pcm_status_t **ptr); 854void snd_pcm_status_free(snd_pcm_status_t *obj); 855void snd_pcm_status_copy(snd_pcm_status_t *dst, const snd_pcm_status_t *src); 856snd_pcm_state_t snd_pcm_status_get_state(const snd_pcm_status_t *obj); 857void snd_pcm_status_get_trigger_tstamp(const snd_pcm_status_t *obj, snd_timestamp_t *ptr); 858void snd_pcm_status_get_trigger_htstamp(const snd_pcm_status_t *obj, snd_htimestamp_t *ptr); 859void snd_pcm_status_get_tstamp(const snd_pcm_status_t *obj, snd_timestamp_t *ptr); 860void snd_pcm_status_get_htstamp(const snd_pcm_status_t *obj, snd_htimestamp_t *ptr); 861snd_pcm_sframes_t snd_pcm_status_get_delay(const snd_pcm_status_t *obj); 862snd_pcm_uframes_t snd_pcm_status_get_avail(const snd_pcm_status_t *obj); 863snd_pcm_uframes_t snd_pcm_status_get_avail_max(const snd_pcm_status_t *obj); 864snd_pcm_uframes_t snd_pcm_status_get_overrange(const snd_pcm_status_t *obj); 865 866/** \} */ 867 868/** 869 * \defgroup PCM_Description Description Functions 870 * \ingroup PCM 871 * See the \ref pcm page for more details. 872 * \{ 873 */ 874 875const char *snd_pcm_type_name(snd_pcm_type_t type); 876const char *snd_pcm_stream_name(const snd_pcm_stream_t stream); 877const char *snd_pcm_access_name(const snd_pcm_access_t _access); 878const char *snd_pcm_format_name(const snd_pcm_format_t format); 879const char *snd_pcm_format_description(const snd_pcm_format_t format); 880const char *snd_pcm_subformat_name(const snd_pcm_subformat_t subformat); 881const char *snd_pcm_subformat_description(const snd_pcm_subformat_t subformat); 882snd_pcm_format_t snd_pcm_format_value(const char* name); 883const char *snd_pcm_tstamp_mode_name(const snd_pcm_tstamp_t mode); 884const char *snd_pcm_state_name(const snd_pcm_state_t state); 885 886/** \} */ 887 888/** 889 * \defgroup PCM_Dump Debug Functions 890 * \ingroup PCM 891 * See the \ref pcm page for more details. 892 * \{ 893 */ 894 895int snd_pcm_dump(snd_pcm_t *pcm, snd_output_t *out); 896int snd_pcm_dump_hw_setup(snd_pcm_t *pcm, snd_output_t *out); 897int snd_pcm_dump_sw_setup(snd_pcm_t *pcm, snd_output_t *out); 898int snd_pcm_dump_setup(snd_pcm_t *pcm, snd_output_t *out); 899int snd_pcm_hw_params_dump(snd_pcm_hw_params_t *params, snd_output_t *out); 900int snd_pcm_sw_params_dump(snd_pcm_sw_params_t *params, snd_output_t *out); 901int snd_pcm_status_dump(snd_pcm_status_t *status, snd_output_t *out); 902 903/** \} */ 904 905/** 906 * \defgroup PCM_Direct Direct Access (MMAP) Functions 907 * \ingroup PCM 908 * See the \ref pcm page for more details. 909 * \{ 910 */ 911 912int snd_pcm_mmap_begin(snd_pcm_t *pcm, 913 const snd_pcm_channel_area_t **areas, 914 snd_pcm_uframes_t *offset, 915 snd_pcm_uframes_t *frames); 916snd_pcm_sframes_t snd_pcm_mmap_commit(snd_pcm_t *pcm, 917 snd_pcm_uframes_t offset, 918 snd_pcm_uframes_t frames); 919snd_pcm_sframes_t snd_pcm_mmap_writei(snd_pcm_t *pcm, const void *buffer, snd_pcm_uframes_t size); 920snd_pcm_sframes_t snd_pcm_mmap_readi(snd_pcm_t *pcm, void *buffer, snd_pcm_uframes_t size); 921snd_pcm_sframes_t snd_pcm_mmap_writen(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size); 922snd_pcm_sframes_t snd_pcm_mmap_readn(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size); 923 924/** \} */ 925 926/** 927 * \defgroup PCM_Helpers Helper Functions 928 * \ingroup PCM 929 * See the \ref pcm page for more details. 930 * \{ 931 */ 932 933int snd_pcm_format_signed(snd_pcm_format_t format); 934int snd_pcm_format_unsigned(snd_pcm_format_t format); 935int snd_pcm_format_linear(snd_pcm_format_t format); 936int snd_pcm_format_float(snd_pcm_format_t format); 937int snd_pcm_format_little_endian(snd_pcm_format_t format); 938int snd_pcm_format_big_endian(snd_pcm_format_t format); 939int snd_pcm_format_cpu_endian(snd_pcm_format_t format); 940int snd_pcm_format_width(snd_pcm_format_t format); /* in bits */ 941int snd_pcm_format_physical_width(snd_pcm_format_t format); /* in bits */ 942snd_pcm_format_t snd_pcm_build_linear_format(int width, int pwidth, int unsignd, int big_endian); 943ssize_t snd_pcm_format_size(snd_pcm_format_t format, size_t samples); 944u_int8_t snd_pcm_format_silence(snd_pcm_format_t format); 945u_int16_t snd_pcm_format_silence_16(snd_pcm_format_t format); 946u_int32_t snd_pcm_format_silence_32(snd_pcm_format_t format); 947u_int64_t snd_pcm_format_silence_64(snd_pcm_format_t format); 948int snd_pcm_format_set_silence(snd_pcm_format_t format, void *buf, unsigned int samples); 949 950snd_pcm_sframes_t snd_pcm_bytes_to_frames(snd_pcm_t *pcm, ssize_t bytes); 951ssize_t snd_pcm_frames_to_bytes(snd_pcm_t *pcm, snd_pcm_sframes_t frames); 952long snd_pcm_bytes_to_samples(snd_pcm_t *pcm, ssize_t bytes); 953ssize_t snd_pcm_samples_to_bytes(snd_pcm_t *pcm, long samples); 954 955int snd_pcm_area_silence(const snd_pcm_channel_area_t *dst_channel, snd_pcm_uframes_t dst_offset, 956 unsigned int samples, snd_pcm_format_t format); 957int snd_pcm_areas_silence(const snd_pcm_channel_area_t *dst_channels, snd_pcm_uframes_t dst_offset, 958 unsigned int channels, snd_pcm_uframes_t frames, snd_pcm_format_t format); 959int snd_pcm_area_copy(const snd_pcm_channel_area_t *dst_channel, snd_pcm_uframes_t dst_offset, 960 const snd_pcm_channel_area_t *src_channel, snd_pcm_uframes_t src_offset, 961 unsigned int samples, snd_pcm_format_t format); 962int snd_pcm_areas_copy(const snd_pcm_channel_area_t *dst_channels, snd_pcm_uframes_t dst_offset, 963 const snd_pcm_channel_area_t *src_channels, snd_pcm_uframes_t src_offset, 964 unsigned int channels, snd_pcm_uframes_t frames, snd_pcm_format_t format); 965 966/** \} */ 967 968/** 969 * \defgroup PCM_Hook Hook Extension 970 * \ingroup PCM 971 * See the \ref pcm page for more details. 972 * \{ 973 */ 974 975/** type of pcm hook */ 976typedef enum _snd_pcm_hook_type { 977 SND_PCM_HOOK_TYPE_HW_PARAMS = 0, 978 SND_PCM_HOOK_TYPE_HW_FREE, 979 SND_PCM_HOOK_TYPE_CLOSE, 980 SND_PCM_HOOK_TYPE_LAST = SND_PCM_HOOK_TYPE_CLOSE 981} snd_pcm_hook_type_t; 982 983/** PCM hook container */ 984typedef struct _snd_pcm_hook snd_pcm_hook_t; 985/** PCM hook callback function */ 986typedef int (*snd_pcm_hook_func_t)(snd_pcm_hook_t *hook); 987snd_pcm_t *snd_pcm_hook_get_pcm(snd_pcm_hook_t *hook); 988void *snd_pcm_hook_get_private(snd_pcm_hook_t *hook); 989void snd_pcm_hook_set_private(snd_pcm_hook_t *hook, void *private_data); 990int snd_pcm_hook_add(snd_pcm_hook_t **hookp, snd_pcm_t *pcm, 991 snd_pcm_hook_type_t type, 992 snd_pcm_hook_func_t func, void *private_data); 993int snd_pcm_hook_remove(snd_pcm_hook_t *hook); 994 995/** \} */ 996 997/** 998 * \defgroup PCM_Scope Scope Plugin Extension 999 * \ingroup PCM 1000 * See the \ref pcm page for more details. 1001 * \{ 1002 */ 1003 1004/** #SND_PCM_TYPE_METER scope functions */ 1005typedef struct _snd_pcm_scope_ops { 1006 /** \brief Enable and prepare it using current params 1007 * \param scope scope handle 1008 */ 1009 int (*enable)(snd_pcm_scope_t *scope); 1010 /** \brief Disable 1011 * \param scope scope handle 1012 */ 1013 void (*disable)(snd_pcm_scope_t *scope); 1014 /** \brief PCM has been started 1015 * \param scope scope handle 1016 */ 1017 void (*start)(snd_pcm_scope_t *scope); 1018 /** \brief PCM has been stopped 1019 * \param scope scope handle 1020 */ 1021 void (*stop)(snd_pcm_scope_t *scope); 1022 /** \brief New frames are present 1023 * \param scope scope handle 1024 */ 1025 void (*update)(snd_pcm_scope_t *scope); 1026 /** \brief Reset status 1027 * \param scope scope handle 1028 */ 1029 void (*reset)(snd_pcm_scope_t *scope); 1030 /** \brief PCM is closing 1031 * \param scope scope handle 1032 */ 1033 void (*close)(snd_pcm_scope_t *scope); 1034} snd_pcm_scope_ops_t; 1035 1036snd_pcm_uframes_t snd_pcm_meter_get_bufsize(snd_pcm_t *pcm); 1037unsigned int snd_pcm_meter_get_channels(snd_pcm_t *pcm); 1038unsigned int snd_pcm_meter_get_rate(snd_pcm_t *pcm); 1039snd_pcm_uframes_t snd_pcm_meter_get_now(snd_pcm_t *pcm); 1040snd_pcm_uframes_t snd_pcm_meter_get_boundary(snd_pcm_t *pcm); 1041int snd_pcm_meter_add_scope(snd_pcm_t *pcm, snd_pcm_scope_t *scope); 1042snd_pcm_scope_t *snd_pcm_meter_search_scope(snd_pcm_t *pcm, const char *name); 1043int snd_pcm_scope_malloc(snd_pcm_scope_t **ptr); 1044void snd_pcm_scope_set_ops(snd_pcm_scope_t *scope, 1045 const snd_pcm_scope_ops_t *val); 1046void snd_pcm_scope_set_name(snd_pcm_scope_t *scope, const char *val); 1047const char *snd_pcm_scope_get_name(snd_pcm_scope_t *scope); 1048void *snd_pcm_scope_get_callback_private(snd_pcm_scope_t *scope); 1049void snd_pcm_scope_set_callback_private(snd_pcm_scope_t *scope, void *val); 1050int snd_pcm_scope_s16_open(snd_pcm_t *pcm, const char *name, 1051 snd_pcm_scope_t **scopep); 1052int16_t *snd_pcm_scope_s16_get_channel_buffer(snd_pcm_scope_t *scope, 1053 unsigned int channel); 1054 1055/** \} */ 1056 1057/** 1058 * \defgroup PCM_Simple Simple setup functions 1059 * \ingroup PCM 1060 * See the \ref pcm page for more details. 1061 * \{ 1062 */ 1063 1064/** Simple PCM latency type */ 1065typedef enum _snd_spcm_latency { 1066 /** standard latency - for standard playback or capture 1067 (estimated latency in one direction 350ms) */ 1068 SND_SPCM_LATENCY_STANDARD = 0, 1069 /** medium latency - software phones etc. 1070 (estimated latency in one direction maximally 25ms */ 1071 SND_SPCM_LATENCY_MEDIUM, 1072 /** realtime latency - realtime applications (effect processors etc.) 1073 (estimated latency in one direction 5ms and better) */ 1074 SND_SPCM_LATENCY_REALTIME 1075} snd_spcm_latency_t; 1076 1077/** Simple PCM xrun type */ 1078typedef enum _snd_spcm_xrun_type { 1079 /** driver / library will ignore all xruns, the stream runs forever */ 1080 SND_SPCM_XRUN_IGNORE = 0, 1081 /** driver / library stops the stream when an xrun occurs */ 1082 SND_SPCM_XRUN_STOP 1083} snd_spcm_xrun_type_t; 1084 1085/** Simple PCM duplex type */ 1086typedef enum _snd_spcm_duplex_type { 1087 /** liberal duplex - the buffer and period sizes might not match */ 1088 SND_SPCM_DUPLEX_LIBERAL = 0, 1089 /** pedantic duplex - the buffer and period sizes MUST match */ 1090 SND_SPCM_DUPLEX_PEDANTIC 1091} snd_spcm_duplex_type_t; 1092 1093int snd_spcm_init(snd_pcm_t *pcm, 1094 unsigned int rate, 1095 unsigned int channels, 1096 snd_pcm_format_t format, 1097 snd_pcm_subformat_t subformat, 1098 snd_spcm_latency_t latency, 1099 snd_pcm_access_t _access, 1100 snd_spcm_xrun_type_t xrun_type); 1101 1102int snd_spcm_init_duplex(snd_pcm_t *playback_pcm, 1103 snd_pcm_t *capture_pcm, 1104 unsigned int rate, 1105 unsigned int channels, 1106 snd_pcm_format_t format, 1107 snd_pcm_subformat_t subformat, 1108 snd_spcm_latency_t latency, 1109 snd_pcm_access_t _access, 1110 snd_spcm_xrun_type_t xrun_type, 1111 snd_spcm_duplex_type_t duplex_type); 1112 1113int snd_spcm_init_get_params(snd_pcm_t *pcm, 1114 unsigned int *rate, 1115 snd_pcm_uframes_t *buffer_size, 1116 snd_pcm_uframes_t *period_size); 1117 1118/** \} */ 1119 1120/** 1121 * \defgroup PCM_Deprecated Deprecated Functions 1122 * \ingroup PCM 1123 * See the \ref pcm page for more details. 1124 * \{ 1125 */ 1126 1127/* Deprecated functions, for compatibility */ 1128const char *snd_pcm_start_mode_name(snd_pcm_start_t mode) __attribute__((deprecated)); 1129const char *snd_pcm_xrun_mode_name(snd_pcm_xrun_t mode) __attribute__((deprecated)); 1130int snd_pcm_sw_params_set_start_mode(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_start_t val) __attribute__((deprecated)); 1131snd_pcm_start_t snd_pcm_sw_params_get_start_mode(const snd_pcm_sw_params_t *params) __attribute__((deprecated)); 1132int snd_pcm_sw_params_set_xrun_mode(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_xrun_t val) __attribute__((deprecated)); 1133snd_pcm_xrun_t snd_pcm_sw_params_get_xrun_mode(const snd_pcm_sw_params_t *params) __attribute__((deprecated)); 1134#if !defined(ALSA_LIBRARY_BUILD) && !defined(ALSA_PCM_OLD_SW_PARAMS_API) 1135int snd_pcm_sw_params_set_xfer_align(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val) __attribute__((deprecated)); 1136int snd_pcm_sw_params_get_xfer_align(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val) __attribute__((deprecated)); 1137int snd_pcm_sw_params_set_sleep_min(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, unsigned int val) __attribute__((deprecated)); 1138int snd_pcm_sw_params_get_sleep_min(const snd_pcm_sw_params_t *params, unsigned int *val) __attribute__((deprecated)); 1139#endif /* !ALSA_LIBRARY_BUILD && !ALSA_PCM_OLD_SW_PARAMS_API */ 1140#if !defined(ALSA_LIBRARY_BUILD) && !defined(ALSA_PCM_OLD_HW_PARAMS_API) 1141int snd_pcm_hw_params_get_tick_time(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir) __attribute__((deprecated)); 1142int snd_pcm_hw_params_get_tick_time_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir) __attribute__((deprecated)); 1143int snd_pcm_hw_params_get_tick_time_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir) __attribute__((deprecated)); 1144int snd_pcm_hw_params_test_tick_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir) __attribute__((deprecated)); 1145int snd_pcm_hw_params_set_tick_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir) __attribute__((deprecated)); 1146int 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)); 1147int 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)); 1148int 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)); 1149int 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)); 1150int 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)); 1151int 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)); 1152#endif /* !ALSA_LIBRARY_BUILD && !ALSA_PCM_OLD_HW_PARAMS_API */ 1153 1154/** \} */ 1155 1156#ifdef __cplusplus 1157} 1158#endif 1159 1160#endif /* __ALSA_PCM_H */ 1161