annotate CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/include/alsa/pcm.h @ 69:33d812a61356

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