Blame include/pcm.h

Packit 4a16fb
/**
Packit 4a16fb
 * \file include/pcm.h
Packit 4a16fb
 * \brief Application interface library for the ALSA driver
Packit 4a16fb
 * \author Jaroslav Kysela <perex@perex.cz>
Packit 4a16fb
 * \author Abramo Bagnara <abramo@alsa-project.org>
Packit 4a16fb
 * \author Takashi Iwai <tiwai@suse.de>
Packit 4a16fb
 * \date 1998-2001
Packit 4a16fb
 *
Packit 4a16fb
 * Application interface library for the ALSA driver.
Packit 4a16fb
 * See the \ref pcm page for more details.
Packit 4a16fb
 */
Packit 4a16fb
/*
Packit 4a16fb
 *   This library is free software; you can redistribute it and/or modify
Packit 4a16fb
 *   it under the terms of the GNU Lesser General Public License as
Packit 4a16fb
 *   published by the Free Software Foundation; either version 2.1 of
Packit 4a16fb
 *   the License, or (at your option) any later version.
Packit 4a16fb
 *
Packit 4a16fb
 *   This program is distributed in the hope that it will be useful,
Packit 4a16fb
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 4a16fb
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit 4a16fb
 *   GNU Lesser General Public License for more details.
Packit 4a16fb
 *
Packit 4a16fb
 *   You should have received a copy of the GNU Lesser General Public
Packit 4a16fb
 *   License along with this library; if not, write to the Free Software
Packit 4a16fb
 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
Packit 4a16fb
 *
Packit 4a16fb
 */
Packit 4a16fb
Packit 4a16fb
#ifndef __ALSA_PCM_H
Packit 4a16fb
#define __ALSA_PCM_H
Packit 4a16fb
Packit 4a16fb
#ifdef __cplusplus
Packit 4a16fb
extern "C" {
Packit 4a16fb
#endif
Packit 4a16fb
Packit 4a16fb
#include <stdint.h>
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 *  \defgroup PCM PCM Interface
Packit 4a16fb
 *  See the \ref pcm page for more details.
Packit 4a16fb
 *  \{
Packit 4a16fb
 */
Packit 4a16fb
Packit 4a16fb
/** dlsym version for interface entry callback */
Packit 4a16fb
#define SND_PCM_DLSYM_VERSION		_dlsym_pcm_001
Packit 4a16fb
Packit 4a16fb
/** PCM generic info container */
Packit 4a16fb
typedef struct _snd_pcm_info snd_pcm_info_t;
Packit 4a16fb
Packit 4a16fb
/** PCM hardware configuration space container
Packit 4a16fb
 *
Packit 4a16fb
 *  snd_pcm_hw_params_t is an opaque structure which contains a set of possible
Packit 4a16fb
 *  PCM hardware configurations. For example, a given instance might include a
Packit 4a16fb
 *  range of buffer sizes, a range of period sizes, and a set of several sample
Packit 4a16fb
 *  formats. Some subset of all possible combinations these sets may be valid,
Packit 4a16fb
 *  but not necessarily any combination will be valid.
Packit 4a16fb
 *
Packit 4a16fb
 *  When a parameter is set or restricted using a snd_pcm_hw_params_set*
Packit 4a16fb
 *  function, all of the other ranges will be updated to exclude as many
Packit 4a16fb
 *  impossible configurations as possible. Attempting to set a parameter
Packit 4a16fb
 *  outside of its acceptable range will result in the function failing
Packit 4a16fb
 *  and an error code being returned.
Packit 4a16fb
 */
Packit 4a16fb
typedef struct _snd_pcm_hw_params snd_pcm_hw_params_t;
Packit 4a16fb
Packit 4a16fb
/** PCM software configuration container */
Packit 4a16fb
typedef struct _snd_pcm_sw_params snd_pcm_sw_params_t;
Packit 4a16fb
/** PCM status container */
Packit 4a16fb
 typedef struct _snd_pcm_status snd_pcm_status_t;
Packit 4a16fb
/** PCM access types mask */
Packit 4a16fb
typedef struct _snd_pcm_access_mask snd_pcm_access_mask_t;
Packit 4a16fb
/** PCM formats mask */
Packit 4a16fb
typedef struct _snd_pcm_format_mask snd_pcm_format_mask_t;
Packit 4a16fb
/** PCM subformats mask */
Packit 4a16fb
typedef struct _snd_pcm_subformat_mask snd_pcm_subformat_mask_t;
Packit 4a16fb
Packit 4a16fb
/** PCM class */
Packit 4a16fb
typedef enum _snd_pcm_class {
Packit 4a16fb
	/** standard device */
Packit 4a16fb
Packit 4a16fb
	SND_PCM_CLASS_GENERIC = 0,
Packit 4a16fb
	/** multichannel device */
Packit 4a16fb
	SND_PCM_CLASS_MULTI,
Packit 4a16fb
	/** software modem device */
Packit 4a16fb
	SND_PCM_CLASS_MODEM,
Packit 4a16fb
	/** digitizer device */
Packit 4a16fb
	SND_PCM_CLASS_DIGITIZER,
Packit 4a16fb
	SND_PCM_CLASS_LAST = SND_PCM_CLASS_DIGITIZER
Packit 4a16fb
} snd_pcm_class_t;
Packit 4a16fb
Packit 4a16fb
/** PCM subclass */
Packit 4a16fb
typedef enum _snd_pcm_subclass {
Packit 4a16fb
	/** subdevices are mixed together */
Packit 4a16fb
	SND_PCM_SUBCLASS_GENERIC_MIX = 0,
Packit 4a16fb
	/** multichannel subdevices are mixed together */
Packit 4a16fb
	SND_PCM_SUBCLASS_MULTI_MIX,
Packit 4a16fb
	SND_PCM_SUBCLASS_LAST = SND_PCM_SUBCLASS_MULTI_MIX
Packit 4a16fb
} snd_pcm_subclass_t;
Packit 4a16fb
Packit 4a16fb
/** PCM stream (direction) */
Packit 4a16fb
typedef enum _snd_pcm_stream {
Packit 4a16fb
	/** Playback stream */
Packit 4a16fb
	SND_PCM_STREAM_PLAYBACK = 0,
Packit 4a16fb
	/** Capture stream */
Packit 4a16fb
	SND_PCM_STREAM_CAPTURE,
Packit 4a16fb
	SND_PCM_STREAM_LAST = SND_PCM_STREAM_CAPTURE
Packit 4a16fb
} snd_pcm_stream_t;
Packit 4a16fb
Packit 4a16fb
/** PCM access type */
Packit 4a16fb
typedef enum _snd_pcm_access {
Packit 4a16fb
	/** mmap access with simple interleaved channels */
Packit 4a16fb
	SND_PCM_ACCESS_MMAP_INTERLEAVED = 0,
Packit 4a16fb
	/** mmap access with simple non interleaved channels */
Packit 4a16fb
	SND_PCM_ACCESS_MMAP_NONINTERLEAVED,
Packit 4a16fb
	/** mmap access with complex placement */
Packit 4a16fb
	SND_PCM_ACCESS_MMAP_COMPLEX,
Packit 4a16fb
	/** snd_pcm_readi/snd_pcm_writei access */
Packit 4a16fb
	SND_PCM_ACCESS_RW_INTERLEAVED,
Packit 4a16fb
	/** snd_pcm_readn/snd_pcm_writen access */
Packit 4a16fb
	SND_PCM_ACCESS_RW_NONINTERLEAVED,
Packit 4a16fb
	SND_PCM_ACCESS_LAST = SND_PCM_ACCESS_RW_NONINTERLEAVED
Packit 4a16fb
} snd_pcm_access_t;
Packit 4a16fb
Packit 4a16fb
/** PCM sample format */
Packit 4a16fb
typedef enum _snd_pcm_format {
Packit 4a16fb
	/** Unknown */
Packit 4a16fb
	SND_PCM_FORMAT_UNKNOWN = -1,
Packit 4a16fb
	/** Signed 8 bit */
Packit 4a16fb
	SND_PCM_FORMAT_S8 = 0,
Packit 4a16fb
	/** Unsigned 8 bit */
Packit 4a16fb
	SND_PCM_FORMAT_U8,
Packit 4a16fb
	/** Signed 16 bit Little Endian */
Packit 4a16fb
	SND_PCM_FORMAT_S16_LE,
Packit 4a16fb
	/** Signed 16 bit Big Endian */
Packit 4a16fb
	SND_PCM_FORMAT_S16_BE,
Packit 4a16fb
	/** Unsigned 16 bit Little Endian */
Packit 4a16fb
	SND_PCM_FORMAT_U16_LE,
Packit 4a16fb
	/** Unsigned 16 bit Big Endian */
Packit 4a16fb
	SND_PCM_FORMAT_U16_BE,
Packit 4a16fb
	/** Signed 24 bit Little Endian using low three bytes in 32-bit word */
Packit 4a16fb
	SND_PCM_FORMAT_S24_LE,
Packit 4a16fb
	/** Signed 24 bit Big Endian using low three bytes in 32-bit word */
Packit 4a16fb
	SND_PCM_FORMAT_S24_BE,
Packit 4a16fb
	/** Unsigned 24 bit Little Endian using low three bytes in 32-bit word */
Packit 4a16fb
	SND_PCM_FORMAT_U24_LE,
Packit 4a16fb
	/** Unsigned 24 bit Big Endian using low three bytes in 32-bit word */
Packit 4a16fb
	SND_PCM_FORMAT_U24_BE,
Packit 4a16fb
	/** Signed 32 bit Little Endian */
Packit 4a16fb
	SND_PCM_FORMAT_S32_LE,
Packit 4a16fb
	/** Signed 32 bit Big Endian */
Packit 4a16fb
	SND_PCM_FORMAT_S32_BE,
Packit 4a16fb
	/** Unsigned 32 bit Little Endian */
Packit 4a16fb
	SND_PCM_FORMAT_U32_LE,
Packit 4a16fb
	/** Unsigned 32 bit Big Endian */
Packit 4a16fb
	SND_PCM_FORMAT_U32_BE,
Packit 4a16fb
	/** Float 32 bit Little Endian, Range -1.0 to 1.0 */
Packit 4a16fb
	SND_PCM_FORMAT_FLOAT_LE,
Packit 4a16fb
	/** Float 32 bit Big Endian, Range -1.0 to 1.0 */
Packit 4a16fb
	SND_PCM_FORMAT_FLOAT_BE,
Packit 4a16fb
	/** Float 64 bit Little Endian, Range -1.0 to 1.0 */
Packit 4a16fb
	SND_PCM_FORMAT_FLOAT64_LE,
Packit 4a16fb
	/** Float 64 bit Big Endian, Range -1.0 to 1.0 */
Packit 4a16fb
	SND_PCM_FORMAT_FLOAT64_BE,
Packit 4a16fb
	/** IEC-958 Little Endian */
Packit 4a16fb
	SND_PCM_FORMAT_IEC958_SUBFRAME_LE,
Packit 4a16fb
	/** IEC-958 Big Endian */
Packit 4a16fb
	SND_PCM_FORMAT_IEC958_SUBFRAME_BE,
Packit 4a16fb
	/** Mu-Law */
Packit 4a16fb
	SND_PCM_FORMAT_MU_LAW,
Packit 4a16fb
	/** A-Law */
Packit 4a16fb
	SND_PCM_FORMAT_A_LAW,
Packit 4a16fb
	/** Ima-ADPCM */
Packit 4a16fb
	SND_PCM_FORMAT_IMA_ADPCM,
Packit 4a16fb
	/** MPEG */
Packit 4a16fb
	SND_PCM_FORMAT_MPEG,
Packit 4a16fb
	/** GSM */
Packit 4a16fb
	SND_PCM_FORMAT_GSM,
Packit 4a16fb
	/** Signed 20bit Little Endian in 4bytes format, LSB justified */
Packit 4a16fb
	SND_PCM_FORMAT_S20_LE,
Packit 4a16fb
	/** Signed 20bit Big Endian in 4bytes format, LSB justified */
Packit 4a16fb
	SND_PCM_FORMAT_S20_BE,
Packit 4a16fb
	/** Unsigned 20bit Little Endian in 4bytes format, LSB justified */
Packit 4a16fb
	SND_PCM_FORMAT_U20_LE,
Packit 4a16fb
	/** Unsigned 20bit Big Endian in 4bytes format, LSB justified */
Packit 4a16fb
	SND_PCM_FORMAT_U20_BE,
Packit 4a16fb
	/** Special */
Packit 4a16fb
	SND_PCM_FORMAT_SPECIAL = 31,
Packit 4a16fb
	/** Signed 24bit Little Endian in 3bytes format */
Packit 4a16fb
	SND_PCM_FORMAT_S24_3LE = 32,
Packit 4a16fb
	/** Signed 24bit Big Endian in 3bytes format */
Packit 4a16fb
	SND_PCM_FORMAT_S24_3BE,
Packit 4a16fb
	/** Unsigned 24bit Little Endian in 3bytes format */
Packit 4a16fb
	SND_PCM_FORMAT_U24_3LE,
Packit 4a16fb
	/** Unsigned 24bit Big Endian in 3bytes format */
Packit 4a16fb
	SND_PCM_FORMAT_U24_3BE,
Packit 4a16fb
	/** Signed 20bit Little Endian in 3bytes format */
Packit 4a16fb
	SND_PCM_FORMAT_S20_3LE,
Packit 4a16fb
	/** Signed 20bit Big Endian in 3bytes format */
Packit 4a16fb
	SND_PCM_FORMAT_S20_3BE,
Packit 4a16fb
	/** Unsigned 20bit Little Endian in 3bytes format */
Packit 4a16fb
	SND_PCM_FORMAT_U20_3LE,
Packit 4a16fb
	/** Unsigned 20bit Big Endian in 3bytes format */
Packit 4a16fb
	SND_PCM_FORMAT_U20_3BE,
Packit 4a16fb
	/** Signed 18bit Little Endian in 3bytes format */
Packit 4a16fb
	SND_PCM_FORMAT_S18_3LE,
Packit 4a16fb
	/** Signed 18bit Big Endian in 3bytes format */
Packit 4a16fb
	SND_PCM_FORMAT_S18_3BE,
Packit 4a16fb
	/** Unsigned 18bit Little Endian in 3bytes format */
Packit 4a16fb
	SND_PCM_FORMAT_U18_3LE,
Packit 4a16fb
	/** Unsigned 18bit Big Endian in 3bytes format */
Packit 4a16fb
	SND_PCM_FORMAT_U18_3BE,
Packit 4a16fb
	/* G.723 (ADPCM) 24 kbit/s, 8 samples in 3 bytes */
Packit 4a16fb
	SND_PCM_FORMAT_G723_24,
Packit 4a16fb
	/* G.723 (ADPCM) 24 kbit/s, 1 sample in 1 byte */
Packit 4a16fb
	SND_PCM_FORMAT_G723_24_1B,
Packit 4a16fb
	/* G.723 (ADPCM) 40 kbit/s, 8 samples in 3 bytes */
Packit 4a16fb
	SND_PCM_FORMAT_G723_40,
Packit 4a16fb
	/* G.723 (ADPCM) 40 kbit/s, 1 sample in 1 byte */
Packit 4a16fb
	SND_PCM_FORMAT_G723_40_1B,
Packit 4a16fb
	/* Direct Stream Digital (DSD) in 1-byte samples (x8) */
Packit 4a16fb
	SND_PCM_FORMAT_DSD_U8,
Packit 4a16fb
	/* Direct Stream Digital (DSD) in 2-byte samples (x16) */
Packit 4a16fb
	SND_PCM_FORMAT_DSD_U16_LE,
Packit 4a16fb
	/* Direct Stream Digital (DSD) in 4-byte samples (x32) */
Packit 4a16fb
	SND_PCM_FORMAT_DSD_U32_LE,
Packit 4a16fb
	/* Direct Stream Digital (DSD) in 2-byte samples (x16) */
Packit 4a16fb
	SND_PCM_FORMAT_DSD_U16_BE,
Packit 4a16fb
	/* Direct Stream Digital (DSD) in 4-byte samples (x32) */
Packit 4a16fb
	SND_PCM_FORMAT_DSD_U32_BE,
Packit 4a16fb
	SND_PCM_FORMAT_LAST = SND_PCM_FORMAT_DSD_U32_BE,
Packit 4a16fb
Packit 4a16fb
#if __BYTE_ORDER == __LITTLE_ENDIAN
Packit 4a16fb
	/** Signed 16 bit CPU endian */
Packit 4a16fb
	SND_PCM_FORMAT_S16 = SND_PCM_FORMAT_S16_LE,
Packit 4a16fb
	/** Unsigned 16 bit CPU endian */
Packit 4a16fb
	SND_PCM_FORMAT_U16 = SND_PCM_FORMAT_U16_LE,
Packit 4a16fb
	/** Signed 24 bit CPU endian */
Packit 4a16fb
	SND_PCM_FORMAT_S24 = SND_PCM_FORMAT_S24_LE,
Packit 4a16fb
	/** Unsigned 24 bit CPU endian */
Packit 4a16fb
	SND_PCM_FORMAT_U24 = SND_PCM_FORMAT_U24_LE,
Packit 4a16fb
	/** Signed 32 bit CPU endian */
Packit 4a16fb
	SND_PCM_FORMAT_S32 = SND_PCM_FORMAT_S32_LE,
Packit 4a16fb
	/** Unsigned 32 bit CPU endian */
Packit 4a16fb
	SND_PCM_FORMAT_U32 = SND_PCM_FORMAT_U32_LE,
Packit 4a16fb
	/** Float 32 bit CPU endian */
Packit 4a16fb
	SND_PCM_FORMAT_FLOAT = SND_PCM_FORMAT_FLOAT_LE,
Packit 4a16fb
	/** Float 64 bit CPU endian */
Packit 4a16fb
	SND_PCM_FORMAT_FLOAT64 = SND_PCM_FORMAT_FLOAT64_LE,
Packit 4a16fb
	/** IEC-958 CPU Endian */
Packit 4a16fb
	SND_PCM_FORMAT_IEC958_SUBFRAME = SND_PCM_FORMAT_IEC958_SUBFRAME_LE,
Packit 4a16fb
	/** Signed 20bit in 4bytes format, LSB justified, CPU Endian */
Packit 4a16fb
	SND_PCM_FORMAT_S20 = SND_PCM_FORMAT_S20_LE,
Packit 4a16fb
	/** Unsigned 20bit in 4bytes format, LSB justified, CPU Endian */
Packit 4a16fb
	SND_PCM_FORMAT_U20 = SND_PCM_FORMAT_U20_LE,
Packit 4a16fb
#elif __BYTE_ORDER == __BIG_ENDIAN
Packit 4a16fb
	/** Signed 16 bit CPU endian */
Packit 4a16fb
	SND_PCM_FORMAT_S16 = SND_PCM_FORMAT_S16_BE,
Packit 4a16fb
	/** Unsigned 16 bit CPU endian */
Packit 4a16fb
	SND_PCM_FORMAT_U16 = SND_PCM_FORMAT_U16_BE,
Packit 4a16fb
	/** Signed 24 bit CPU endian */
Packit 4a16fb
	SND_PCM_FORMAT_S24 = SND_PCM_FORMAT_S24_BE,
Packit 4a16fb
	/** Unsigned 24 bit CPU endian */
Packit 4a16fb
	SND_PCM_FORMAT_U24 = SND_PCM_FORMAT_U24_BE,
Packit 4a16fb
	/** Signed 32 bit CPU endian */
Packit 4a16fb
	SND_PCM_FORMAT_S32 = SND_PCM_FORMAT_S32_BE,
Packit 4a16fb
	/** Unsigned 32 bit CPU endian */
Packit 4a16fb
	SND_PCM_FORMAT_U32 = SND_PCM_FORMAT_U32_BE,
Packit 4a16fb
	/** Float 32 bit CPU endian */
Packit 4a16fb
	SND_PCM_FORMAT_FLOAT = SND_PCM_FORMAT_FLOAT_BE,
Packit 4a16fb
	/** Float 64 bit CPU endian */
Packit 4a16fb
	SND_PCM_FORMAT_FLOAT64 = SND_PCM_FORMAT_FLOAT64_BE,
Packit 4a16fb
	/** IEC-958 CPU Endian */
Packit 4a16fb
	SND_PCM_FORMAT_IEC958_SUBFRAME = SND_PCM_FORMAT_IEC958_SUBFRAME_BE,
Packit 4a16fb
	/** Signed 20bit in 4bytes format, LSB justified, CPU Endian */
Packit 4a16fb
	SND_PCM_FORMAT_S20 = SND_PCM_FORMAT_S20_BE,
Packit 4a16fb
	/** Unsigned 20bit in 4bytes format, LSB justified, CPU Endian */
Packit 4a16fb
	SND_PCM_FORMAT_U20 = SND_PCM_FORMAT_U20_BE,
Packit 4a16fb
#else
Packit 4a16fb
#error "Unknown endian"
Packit 4a16fb
#endif
Packit 4a16fb
} snd_pcm_format_t;
Packit 4a16fb
Packit 4a16fb
/** PCM sample subformat */
Packit 4a16fb
typedef enum _snd_pcm_subformat {
Packit 4a16fb
	/** Standard */
Packit 4a16fb
	SND_PCM_SUBFORMAT_STD = 0,
Packit 4a16fb
	SND_PCM_SUBFORMAT_LAST = SND_PCM_SUBFORMAT_STD
Packit 4a16fb
} snd_pcm_subformat_t;
Packit 4a16fb
Packit 4a16fb
/** PCM state */
Packit 4a16fb
typedef enum _snd_pcm_state {
Packit 4a16fb
	/** Open */
Packit 4a16fb
	SND_PCM_STATE_OPEN = 0,
Packit 4a16fb
	/** Setup installed */ 
Packit 4a16fb
	SND_PCM_STATE_SETUP,
Packit 4a16fb
	/** Ready to start */
Packit 4a16fb
	SND_PCM_STATE_PREPARED,
Packit 4a16fb
	/** Running */
Packit 4a16fb
	SND_PCM_STATE_RUNNING,
Packit 4a16fb
	/** Stopped: underrun (playback) or overrun (capture) detected */
Packit 4a16fb
	SND_PCM_STATE_XRUN,
Packit 4a16fb
	/** Draining: running (playback) or stopped (capture) */
Packit 4a16fb
	SND_PCM_STATE_DRAINING,
Packit 4a16fb
	/** Paused */
Packit 4a16fb
	SND_PCM_STATE_PAUSED,
Packit 4a16fb
	/** Hardware is suspended */
Packit 4a16fb
	SND_PCM_STATE_SUSPENDED,
Packit 4a16fb
	/** Hardware is disconnected */
Packit 4a16fb
	SND_PCM_STATE_DISCONNECTED,
Packit 4a16fb
	SND_PCM_STATE_LAST = SND_PCM_STATE_DISCONNECTED,
Packit 4a16fb
	/** Private - used internally in the library - do not use*/
Packit 4a16fb
	SND_PCM_STATE_PRIVATE1 = 1024
Packit 4a16fb
} snd_pcm_state_t;
Packit 4a16fb
Packit 4a16fb
/** PCM start mode */
Packit 4a16fb
typedef enum _snd_pcm_start {
Packit 4a16fb
	/** Automatic start on data read/write */
Packit 4a16fb
	SND_PCM_START_DATA = 0,
Packit 4a16fb
	/** Explicit start */
Packit 4a16fb
	SND_PCM_START_EXPLICIT,
Packit 4a16fb
	SND_PCM_START_LAST = SND_PCM_START_EXPLICIT
Packit 4a16fb
} snd_pcm_start_t;
Packit 4a16fb
Packit 4a16fb
/** PCM xrun mode */
Packit 4a16fb
typedef enum _snd_pcm_xrun {
Packit 4a16fb
	/** Xrun detection disabled */
Packit 4a16fb
	SND_PCM_XRUN_NONE = 0,
Packit 4a16fb
	/** Stop on xrun detection */
Packit 4a16fb
	SND_PCM_XRUN_STOP,
Packit 4a16fb
	SND_PCM_XRUN_LAST = SND_PCM_XRUN_STOP
Packit 4a16fb
} snd_pcm_xrun_t;
Packit 4a16fb
Packit 4a16fb
/** PCM timestamp mode */
Packit 4a16fb
typedef enum _snd_pcm_tstamp {
Packit 4a16fb
	/** No timestamp */
Packit 4a16fb
	SND_PCM_TSTAMP_NONE = 0,
Packit 4a16fb
	/** Update timestamp at every hardware position update */
Packit 4a16fb
	SND_PCM_TSTAMP_ENABLE,
Packit 4a16fb
	/** Equivalent with #SND_PCM_TSTAMP_ENABLE,
Packit 4a16fb
	 * just for compatibility with older versions
Packit 4a16fb
	 */
Packit 4a16fb
	SND_PCM_TSTAMP_MMAP = SND_PCM_TSTAMP_ENABLE,
Packit 4a16fb
	SND_PCM_TSTAMP_LAST = SND_PCM_TSTAMP_ENABLE
Packit 4a16fb
} snd_pcm_tstamp_t;
Packit 4a16fb
Packit 4a16fb
typedef enum _snd_pcm_tstamp_type {
Packit 4a16fb
	SND_PCM_TSTAMP_TYPE_GETTIMEOFDAY = 0,	/**< gettimeofday equivalent */
Packit 4a16fb
	SND_PCM_TSTAMP_TYPE_MONOTONIC,	/**< posix_clock_monotonic equivalent */
Packit 4a16fb
	SND_PCM_TSTAMP_TYPE_MONOTONIC_RAW,	/**< monotonic_raw (no NTP) */
Packit 4a16fb
	SND_PCM_TSTAMP_TYPE_LAST = SND_PCM_TSTAMP_TYPE_MONOTONIC_RAW,
Packit 4a16fb
} snd_pcm_tstamp_type_t;
Packit 4a16fb
Packit 4a16fb
typedef struct _snd_pcm_audio_tstamp_config {
Packit 4a16fb
	/* 5 of max 16 bits used */
Packit 4a16fb
	unsigned int type_requested:4;
Packit 4a16fb
	unsigned int report_delay:1; /* add total delay to A/D or D/A */
Packit 4a16fb
} snd_pcm_audio_tstamp_config_t;
Packit 4a16fb
Packit 4a16fb
typedef struct _snd_pcm_audio_tstamp_report {
Packit 4a16fb
	/* 6 of max 16 bits used for bit-fields */
Packit 4a16fb
Packit 4a16fb
	/* for backwards compatibility */
Packit 4a16fb
	unsigned int valid:1;
Packit 4a16fb
Packit 4a16fb
	/* actual type if hardware could not support requested timestamp */
Packit 4a16fb
	unsigned int actual_type:4;
Packit 4a16fb
Packit 4a16fb
	/* accuracy represented in ns units */
Packit 4a16fb
	unsigned int accuracy_report:1; /* 0 if accuracy unknown, 1 if accuracy field is valid */
Packit 4a16fb
	unsigned int accuracy; /* up to 4.29s, will be packed in separate field  */
Packit 4a16fb
} snd_pcm_audio_tstamp_report_t;
Packit 4a16fb
Packit 4a16fb
/** Unsigned frames quantity */
Packit 4a16fb
typedef unsigned long snd_pcm_uframes_t;
Packit 4a16fb
/** Signed frames quantity */
Packit 4a16fb
typedef long snd_pcm_sframes_t;
Packit 4a16fb
Packit 4a16fb
/** Non blocking mode (flag for open mode) \hideinitializer */
Packit 4a16fb
#define SND_PCM_NONBLOCK		0x00000001
Packit 4a16fb
/** Async notification (flag for open mode) \hideinitializer */
Packit 4a16fb
#define SND_PCM_ASYNC			0x00000002
Packit 4a16fb
/** In an abort state (internal, not allowed for open) */
Packit 4a16fb
#define SND_PCM_ABORT			0x00008000
Packit 4a16fb
/** Disable automatic (but not forced!) rate resamplinig */
Packit 4a16fb
#define SND_PCM_NO_AUTO_RESAMPLE	0x00010000
Packit 4a16fb
/** Disable automatic (but not forced!) channel conversion */
Packit 4a16fb
#define SND_PCM_NO_AUTO_CHANNELS	0x00020000
Packit 4a16fb
/** Disable automatic (but not forced!) format conversion */
Packit 4a16fb
#define SND_PCM_NO_AUTO_FORMAT		0x00040000
Packit 4a16fb
/** Disable soft volume control */
Packit 4a16fb
#define SND_PCM_NO_SOFTVOL		0x00080000
Packit 4a16fb
Packit 4a16fb
/** PCM handle */
Packit 4a16fb
typedef struct _snd_pcm snd_pcm_t;
Packit 4a16fb
Packit 4a16fb
/** PCM type */
Packit 4a16fb
enum _snd_pcm_type {
Packit 4a16fb
	/** Kernel level PCM */
Packit 4a16fb
	SND_PCM_TYPE_HW = 0,
Packit 4a16fb
	/** Hooked PCM */
Packit 4a16fb
	SND_PCM_TYPE_HOOKS,
Packit 4a16fb
	/** One or more linked PCM with exclusive access to selected
Packit 4a16fb
	    channels */
Packit 4a16fb
	SND_PCM_TYPE_MULTI,
Packit 4a16fb
	/** File writing plugin */
Packit 4a16fb
	SND_PCM_TYPE_FILE,
Packit 4a16fb
	/** Null endpoint PCM */
Packit 4a16fb
	SND_PCM_TYPE_NULL,
Packit 4a16fb
	/** Shared memory client PCM */
Packit 4a16fb
	SND_PCM_TYPE_SHM,
Packit 4a16fb
	/** INET client PCM (not yet implemented) */
Packit 4a16fb
	SND_PCM_TYPE_INET,
Packit 4a16fb
	/** Copying plugin */
Packit 4a16fb
	SND_PCM_TYPE_COPY,
Packit 4a16fb
	/** Linear format conversion PCM */
Packit 4a16fb
	SND_PCM_TYPE_LINEAR,
Packit 4a16fb
	/** A-Law format conversion PCM */
Packit 4a16fb
	SND_PCM_TYPE_ALAW,
Packit 4a16fb
	/** Mu-Law format conversion PCM */
Packit 4a16fb
	SND_PCM_TYPE_MULAW,
Packit 4a16fb
	/** IMA-ADPCM format conversion PCM */
Packit 4a16fb
	SND_PCM_TYPE_ADPCM,
Packit 4a16fb
	/** Rate conversion PCM */
Packit 4a16fb
	SND_PCM_TYPE_RATE,
Packit 4a16fb
	/** Attenuated static route PCM */
Packit 4a16fb
	SND_PCM_TYPE_ROUTE,
Packit 4a16fb
	/** Format adjusted PCM */
Packit 4a16fb
	SND_PCM_TYPE_PLUG,
Packit 4a16fb
	/** Sharing PCM */
Packit 4a16fb
	SND_PCM_TYPE_SHARE,
Packit 4a16fb
	/** Meter plugin */
Packit 4a16fb
	SND_PCM_TYPE_METER,
Packit 4a16fb
	/** Mixing PCM */
Packit 4a16fb
	SND_PCM_TYPE_MIX,
Packit 4a16fb
	/** Attenuated dynamic route PCM (not yet implemented) */
Packit 4a16fb
	SND_PCM_TYPE_DROUTE,
Packit 4a16fb
	/** Loopback server plugin (not yet implemented) */
Packit 4a16fb
	SND_PCM_TYPE_LBSERVER,
Packit 4a16fb
	/** Linear Integer <-> Linear Float format conversion PCM */
Packit 4a16fb
	SND_PCM_TYPE_LINEAR_FLOAT,
Packit 4a16fb
	/** LADSPA integration plugin */
Packit 4a16fb
	SND_PCM_TYPE_LADSPA,
Packit 4a16fb
	/** Direct Mixing plugin */
Packit 4a16fb
	SND_PCM_TYPE_DMIX,
Packit 4a16fb
	/** Jack Audio Connection Kit plugin */
Packit 4a16fb
	SND_PCM_TYPE_JACK,
Packit 4a16fb
	/** Direct Snooping plugin */
Packit 4a16fb
	SND_PCM_TYPE_DSNOOP,
Packit 4a16fb
	/** Direct Sharing plugin */
Packit 4a16fb
	SND_PCM_TYPE_DSHARE,
Packit 4a16fb
	/** IEC958 subframe plugin */
Packit 4a16fb
	SND_PCM_TYPE_IEC958,
Packit 4a16fb
	/** Soft volume plugin */
Packit 4a16fb
	SND_PCM_TYPE_SOFTVOL,
Packit 4a16fb
	/** External I/O plugin */
Packit 4a16fb
	SND_PCM_TYPE_IOPLUG,
Packit 4a16fb
	/** External filter plugin */
Packit 4a16fb
	SND_PCM_TYPE_EXTPLUG,
Packit 4a16fb
	/** Mmap-emulation plugin */
Packit 4a16fb
	SND_PCM_TYPE_MMAP_EMUL,
Packit 4a16fb
	SND_PCM_TYPE_LAST = SND_PCM_TYPE_MMAP_EMUL
Packit 4a16fb
};
Packit 4a16fb
Packit 4a16fb
/** PCM type */
Packit 4a16fb
typedef enum _snd_pcm_type snd_pcm_type_t;
Packit 4a16fb
Packit 4a16fb
/** PCM area specification */
Packit 4a16fb
typedef struct _snd_pcm_channel_area {
Packit 4a16fb
	/** base address of channel samples */
Packit 4a16fb
	void *addr;
Packit 4a16fb
	/** offset to first sample in bits */
Packit 4a16fb
	unsigned int first;
Packit 4a16fb
	/** samples distance in bits */
Packit 4a16fb
	unsigned int step;
Packit 4a16fb
} snd_pcm_channel_area_t;
Packit 4a16fb
Packit 4a16fb
/** PCM synchronization ID */
Packit 4a16fb
typedef union _snd_pcm_sync_id {
Packit 4a16fb
	/** 8-bit ID */
Packit 4a16fb
	unsigned char id[16];
Packit 4a16fb
	/** 16-bit ID */
Packit 4a16fb
	unsigned short id16[8];
Packit 4a16fb
	/** 32-bit ID */
Packit 4a16fb
	unsigned int id32[4];
Packit 4a16fb
} snd_pcm_sync_id_t;
Packit 4a16fb
Packit 4a16fb
/** #SND_PCM_TYPE_METER scope handle */
Packit 4a16fb
typedef struct _snd_pcm_scope snd_pcm_scope_t;
Packit 4a16fb
Packit 4a16fb
int snd_pcm_open(snd_pcm_t **pcm, const char *name, 
Packit 4a16fb
		 snd_pcm_stream_t stream, int mode);
Packit 4a16fb
int snd_pcm_open_lconf(snd_pcm_t **pcm, const char *name, 
Packit 4a16fb
		       snd_pcm_stream_t stream, int mode,
Packit 4a16fb
		       snd_config_t *lconf);
Packit 4a16fb
int snd_pcm_open_fallback(snd_pcm_t **pcm, snd_config_t *root,
Packit 4a16fb
			  const char *name, const char *orig_name,
Packit 4a16fb
			  snd_pcm_stream_t stream, int mode);
Packit 4a16fb
Packit 4a16fb
int snd_pcm_close(snd_pcm_t *pcm);
Packit 4a16fb
const char *snd_pcm_name(snd_pcm_t *pcm);
Packit 4a16fb
snd_pcm_type_t snd_pcm_type(snd_pcm_t *pcm);
Packit 4a16fb
snd_pcm_stream_t snd_pcm_stream(snd_pcm_t *pcm);
Packit 4a16fb
int snd_pcm_poll_descriptors_count(snd_pcm_t *pcm);
Packit 4a16fb
int snd_pcm_poll_descriptors(snd_pcm_t *pcm, struct pollfd *pfds, unsigned int space);
Packit 4a16fb
int snd_pcm_poll_descriptors_revents(snd_pcm_t *pcm, struct pollfd *pfds, unsigned int nfds, unsigned short *revents);
Packit 4a16fb
int snd_pcm_nonblock(snd_pcm_t *pcm, int nonblock);
Packit 4a16fb
static __inline__ int snd_pcm_abort(snd_pcm_t *pcm) { return snd_pcm_nonblock(pcm, 2); }
Packit 4a16fb
int snd_async_add_pcm_handler(snd_async_handler_t **handler, snd_pcm_t *pcm, 
Packit 4a16fb
			      snd_async_callback_t callback, void *private_data);
Packit 4a16fb
snd_pcm_t *snd_async_handler_get_pcm(snd_async_handler_t *handler);
Packit 4a16fb
int snd_pcm_info(snd_pcm_t *pcm, snd_pcm_info_t *info);
Packit 4a16fb
int snd_pcm_hw_params_current(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
Packit 4a16fb
int snd_pcm_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
Packit 4a16fb
int snd_pcm_hw_free(snd_pcm_t *pcm);
Packit 4a16fb
int snd_pcm_sw_params_current(snd_pcm_t *pcm, snd_pcm_sw_params_t *params);
Packit 4a16fb
int snd_pcm_sw_params(snd_pcm_t *pcm, snd_pcm_sw_params_t *params);
Packit 4a16fb
int snd_pcm_prepare(snd_pcm_t *pcm);
Packit 4a16fb
int snd_pcm_reset(snd_pcm_t *pcm);
Packit 4a16fb
int snd_pcm_status(snd_pcm_t *pcm, snd_pcm_status_t *status);
Packit 4a16fb
int snd_pcm_start(snd_pcm_t *pcm);
Packit 4a16fb
int snd_pcm_drop(snd_pcm_t *pcm);
Packit 4a16fb
int snd_pcm_drain(snd_pcm_t *pcm);
Packit 4a16fb
int snd_pcm_pause(snd_pcm_t *pcm, int enable);
Packit 4a16fb
snd_pcm_state_t snd_pcm_state(snd_pcm_t *pcm);
Packit 4a16fb
int snd_pcm_hwsync(snd_pcm_t *pcm);
Packit 4a16fb
int snd_pcm_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *delayp);
Packit 4a16fb
int snd_pcm_resume(snd_pcm_t *pcm);
Packit 4a16fb
int snd_pcm_htimestamp(snd_pcm_t *pcm, snd_pcm_uframes_t *avail, snd_htimestamp_t *tstamp);
Packit 4a16fb
snd_pcm_sframes_t snd_pcm_avail(snd_pcm_t *pcm);
Packit 4a16fb
snd_pcm_sframes_t snd_pcm_avail_update(snd_pcm_t *pcm);
Packit 4a16fb
int snd_pcm_avail_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *availp, snd_pcm_sframes_t *delayp);
Packit 4a16fb
snd_pcm_sframes_t snd_pcm_rewindable(snd_pcm_t *pcm);
Packit 4a16fb
snd_pcm_sframes_t snd_pcm_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t frames);
Packit 4a16fb
snd_pcm_sframes_t snd_pcm_forwardable(snd_pcm_t *pcm);
Packit 4a16fb
snd_pcm_sframes_t snd_pcm_forward(snd_pcm_t *pcm, snd_pcm_uframes_t frames);
Packit 4a16fb
snd_pcm_sframes_t snd_pcm_writei(snd_pcm_t *pcm, const void *buffer, snd_pcm_uframes_t size);
Packit 4a16fb
snd_pcm_sframes_t snd_pcm_readi(snd_pcm_t *pcm, void *buffer, snd_pcm_uframes_t size);
Packit 4a16fb
snd_pcm_sframes_t snd_pcm_writen(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size);
Packit 4a16fb
snd_pcm_sframes_t snd_pcm_readn(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size);
Packit 4a16fb
int snd_pcm_wait(snd_pcm_t *pcm, int timeout);
Packit 4a16fb
Packit 4a16fb
int snd_pcm_link(snd_pcm_t *pcm1, snd_pcm_t *pcm2);
Packit 4a16fb
int snd_pcm_unlink(snd_pcm_t *pcm);
Packit 4a16fb
Packit 4a16fb
/** channel mapping API version number */
Packit 4a16fb
#define SND_CHMAP_API_VERSION	((1 << 16) | (0 << 8) | 1)
Packit 4a16fb
Packit 4a16fb
/** channel map list type */
Packit 4a16fb
enum snd_pcm_chmap_type {
Packit 4a16fb
	SND_CHMAP_TYPE_NONE = 0,/**< unspecified channel position */
Packit 4a16fb
	SND_CHMAP_TYPE_FIXED,	/**< fixed channel position */
Packit 4a16fb
	SND_CHMAP_TYPE_VAR,	/**< freely swappable channel position */
Packit 4a16fb
	SND_CHMAP_TYPE_PAIRED,	/**< pair-wise swappable channel position */
Packit 4a16fb
	SND_CHMAP_TYPE_LAST = SND_CHMAP_TYPE_PAIRED, /**< last entry */
Packit 4a16fb
};
Packit 4a16fb
Packit 4a16fb
/** channel positions */
Packit 4a16fb
enum snd_pcm_chmap_position {
Packit 4a16fb
	SND_CHMAP_UNKNOWN = 0,	/**< unspecified */
Packit 4a16fb
	SND_CHMAP_NA,		/**< N/A, silent */
Packit 4a16fb
	SND_CHMAP_MONO,		/**< mono stream */
Packit 4a16fb
	SND_CHMAP_FL,		/**< front left */
Packit 4a16fb
	SND_CHMAP_FR,		/**< front right */
Packit 4a16fb
	SND_CHMAP_RL,		/**< rear left */
Packit 4a16fb
	SND_CHMAP_RR,		/**< rear right */
Packit 4a16fb
	SND_CHMAP_FC,		/**< front center */
Packit 4a16fb
	SND_CHMAP_LFE,		/**< LFE */
Packit 4a16fb
	SND_CHMAP_SL,		/**< side left */
Packit 4a16fb
	SND_CHMAP_SR,		/**< side right */
Packit 4a16fb
	SND_CHMAP_RC,		/**< rear center */
Packit 4a16fb
	SND_CHMAP_FLC,		/**< front left center */
Packit 4a16fb
	SND_CHMAP_FRC,		/**< front right center */
Packit 4a16fb
	SND_CHMAP_RLC,		/**< rear left center */
Packit 4a16fb
	SND_CHMAP_RRC,		/**< rear right center */
Packit 4a16fb
	SND_CHMAP_FLW,		/**< front left wide */
Packit 4a16fb
	SND_CHMAP_FRW,		/**< front right wide */
Packit 4a16fb
	SND_CHMAP_FLH,		/**< front left high */
Packit 4a16fb
	SND_CHMAP_FCH,		/**< front center high */
Packit 4a16fb
	SND_CHMAP_FRH,		/**< front right high */
Packit 4a16fb
	SND_CHMAP_TC,		/**< top center */
Packit 4a16fb
	SND_CHMAP_TFL,		/**< top front left */
Packit 4a16fb
	SND_CHMAP_TFR,		/**< top front right */
Packit 4a16fb
	SND_CHMAP_TFC,		/**< top front center */
Packit 4a16fb
	SND_CHMAP_TRL,		/**< top rear left */
Packit 4a16fb
	SND_CHMAP_TRR,		/**< top rear right */
Packit 4a16fb
	SND_CHMAP_TRC,		/**< top rear center */
Packit 4a16fb
	SND_CHMAP_TFLC,		/**< top front left center */
Packit 4a16fb
	SND_CHMAP_TFRC,		/**< top front right center */
Packit 4a16fb
	SND_CHMAP_TSL,		/**< top side left */
Packit 4a16fb
	SND_CHMAP_TSR,		/**< top side right */
Packit 4a16fb
	SND_CHMAP_LLFE,		/**< left LFE */
Packit 4a16fb
	SND_CHMAP_RLFE,		/**< right LFE */
Packit 4a16fb
	SND_CHMAP_BC,		/**< bottom center */
Packit 4a16fb
	SND_CHMAP_BLC,		/**< bottom left center */
Packit 4a16fb
	SND_CHMAP_BRC,		/**< bottom right center */
Packit 4a16fb
	SND_CHMAP_LAST = SND_CHMAP_BRC,
Packit 4a16fb
};
Packit 4a16fb
Packit 4a16fb
/** bitmask for channel position */
Packit 4a16fb
#define SND_CHMAP_POSITION_MASK		0xffff
Packit 4a16fb
Packit 4a16fb
/** bit flag indicating the channel is phase inverted */
Packit 4a16fb
#define SND_CHMAP_PHASE_INVERSE		(0x01 << 16)
Packit 4a16fb
/** bit flag indicating the non-standard channel value */
Packit 4a16fb
#define SND_CHMAP_DRIVER_SPEC		(0x02 << 16)
Packit 4a16fb
Packit 4a16fb
/** the channel map header */
Packit 4a16fb
typedef struct snd_pcm_chmap {
Packit 4a16fb
	unsigned int channels;	/**< number of channels */
Packit 4a16fb
	unsigned int pos[0];	/**< channel position array */
Packit 4a16fb
} snd_pcm_chmap_t;
Packit 4a16fb
Packit 4a16fb
/** the header of array items returned from snd_pcm_query_chmaps() */
Packit 4a16fb
typedef struct snd_pcm_chmap_query {
Packit 4a16fb
	enum snd_pcm_chmap_type type;	/**< channel map type */
Packit 4a16fb
	snd_pcm_chmap_t map;		/**< available channel map */
Packit 4a16fb
} snd_pcm_chmap_query_t;
Packit 4a16fb
Packit 4a16fb
Packit 4a16fb
snd_pcm_chmap_query_t **snd_pcm_query_chmaps(snd_pcm_t *pcm);
Packit 4a16fb
snd_pcm_chmap_query_t **snd_pcm_query_chmaps_from_hw(int card, int dev,
Packit 4a16fb
						     int subdev,
Packit 4a16fb
						     snd_pcm_stream_t stream);
Packit 4a16fb
void snd_pcm_free_chmaps(snd_pcm_chmap_query_t **maps);
Packit 4a16fb
snd_pcm_chmap_t *snd_pcm_get_chmap(snd_pcm_t *pcm);
Packit 4a16fb
int snd_pcm_set_chmap(snd_pcm_t *pcm, const snd_pcm_chmap_t *map);
Packit 4a16fb
Packit 4a16fb
const char *snd_pcm_chmap_type_name(enum snd_pcm_chmap_type val);
Packit 4a16fb
const char *snd_pcm_chmap_name(enum snd_pcm_chmap_position val);
Packit 4a16fb
const char *snd_pcm_chmap_long_name(enum snd_pcm_chmap_position val);
Packit 4a16fb
int snd_pcm_chmap_print(const snd_pcm_chmap_t *map, size_t maxlen, char *buf);
Packit 4a16fb
unsigned int snd_pcm_chmap_from_string(const char *str);
Packit 4a16fb
snd_pcm_chmap_t *snd_pcm_chmap_parse_string(const char *str);
Packit 4a16fb
Packit 4a16fb
//int snd_pcm_mixer_element(snd_pcm_t *pcm, snd_mixer_t *mixer, snd_mixer_elem_t **elem);
Packit 4a16fb
Packit 4a16fb
/*
Packit 4a16fb
 * application helpers - these functions are implemented on top
Packit 4a16fb
 * of the basic API
Packit 4a16fb
 */
Packit 4a16fb
Packit 4a16fb
int snd_pcm_recover(snd_pcm_t *pcm, int err, int silent);
Packit 4a16fb
int snd_pcm_set_params(snd_pcm_t *pcm,
Packit 4a16fb
                       snd_pcm_format_t format,
Packit 4a16fb
                       snd_pcm_access_t access,
Packit 4a16fb
                       unsigned int channels,
Packit 4a16fb
                       unsigned int rate,
Packit 4a16fb
                       int soft_resample,
Packit 4a16fb
                       unsigned int latency);
Packit 4a16fb
int snd_pcm_get_params(snd_pcm_t *pcm,
Packit 4a16fb
                       snd_pcm_uframes_t *buffer_size,
Packit 4a16fb
                       snd_pcm_uframes_t *period_size);
Packit 4a16fb
Packit 4a16fb
/** \} */
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \defgroup PCM_Info Stream Information
Packit 4a16fb
 * \ingroup PCM
Packit 4a16fb
 * See the \ref pcm page for more details.
Packit 4a16fb
 * \{
Packit 4a16fb
 */
Packit 4a16fb
Packit 4a16fb
size_t snd_pcm_info_sizeof(void);
Packit 4a16fb
/** \hideinitializer
Packit 4a16fb
 * \brief allocate an invalid #snd_pcm_info_t using standard alloca
Packit 4a16fb
 * \param ptr returned pointer
Packit 4a16fb
 */
Packit 4a16fb
#define snd_pcm_info_alloca(ptr) __snd_alloca(ptr, snd_pcm_info)
Packit 4a16fb
int snd_pcm_info_malloc(snd_pcm_info_t **ptr);
Packit 4a16fb
void snd_pcm_info_free(snd_pcm_info_t *obj);
Packit 4a16fb
void snd_pcm_info_copy(snd_pcm_info_t *dst, const snd_pcm_info_t *src);
Packit 4a16fb
unsigned int snd_pcm_info_get_device(const snd_pcm_info_t *obj);
Packit 4a16fb
unsigned int snd_pcm_info_get_subdevice(const snd_pcm_info_t *obj);
Packit 4a16fb
snd_pcm_stream_t snd_pcm_info_get_stream(const snd_pcm_info_t *obj);
Packit 4a16fb
int snd_pcm_info_get_card(const snd_pcm_info_t *obj);
Packit 4a16fb
const char *snd_pcm_info_get_id(const snd_pcm_info_t *obj);
Packit 4a16fb
const char *snd_pcm_info_get_name(const snd_pcm_info_t *obj);
Packit 4a16fb
const char *snd_pcm_info_get_subdevice_name(const snd_pcm_info_t *obj);
Packit 4a16fb
snd_pcm_class_t snd_pcm_info_get_class(const snd_pcm_info_t *obj);
Packit 4a16fb
snd_pcm_subclass_t snd_pcm_info_get_subclass(const snd_pcm_info_t *obj);
Packit 4a16fb
unsigned int snd_pcm_info_get_subdevices_count(const snd_pcm_info_t *obj);
Packit 4a16fb
unsigned int snd_pcm_info_get_subdevices_avail(const snd_pcm_info_t *obj);
Packit 4a16fb
snd_pcm_sync_id_t snd_pcm_info_get_sync(const snd_pcm_info_t *obj);
Packit 4a16fb
void snd_pcm_info_set_device(snd_pcm_info_t *obj, unsigned int val);
Packit 4a16fb
void snd_pcm_info_set_subdevice(snd_pcm_info_t *obj, unsigned int val);
Packit 4a16fb
void snd_pcm_info_set_stream(snd_pcm_info_t *obj, snd_pcm_stream_t val);
Packit 4a16fb
Packit 4a16fb
/** \} */
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \defgroup PCM_HW_Params Hardware Parameters
Packit 4a16fb
 * \ingroup PCM
Packit 4a16fb
 * See the \ref pcm page for more details.
Packit 4a16fb
 * \{
Packit 4a16fb
 */
Packit 4a16fb
Packit 4a16fb
int snd_pcm_hw_params_any(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
Packit 4a16fb
Packit 4a16fb
int snd_pcm_hw_params_can_mmap_sample_resolution(const snd_pcm_hw_params_t *params);
Packit 4a16fb
int snd_pcm_hw_params_is_double(const snd_pcm_hw_params_t *params);
Packit 4a16fb
int snd_pcm_hw_params_is_batch(const snd_pcm_hw_params_t *params);
Packit 4a16fb
int snd_pcm_hw_params_is_block_transfer(const snd_pcm_hw_params_t *params);
Packit 4a16fb
int snd_pcm_hw_params_is_monotonic(const snd_pcm_hw_params_t *params);
Packit 4a16fb
int snd_pcm_hw_params_can_overrange(const snd_pcm_hw_params_t *params);
Packit 4a16fb
int snd_pcm_hw_params_can_pause(const snd_pcm_hw_params_t *params);
Packit 4a16fb
int snd_pcm_hw_params_can_resume(const snd_pcm_hw_params_t *params);
Packit 4a16fb
int snd_pcm_hw_params_is_half_duplex(const snd_pcm_hw_params_t *params);
Packit 4a16fb
int snd_pcm_hw_params_is_joint_duplex(const snd_pcm_hw_params_t *params);
Packit 4a16fb
int snd_pcm_hw_params_can_sync_start(const snd_pcm_hw_params_t *params);
Packit 4a16fb
int snd_pcm_hw_params_can_disable_period_wakeup(const snd_pcm_hw_params_t *params);
Packit 4a16fb
int snd_pcm_hw_params_supports_audio_wallclock_ts(const snd_pcm_hw_params_t *params); /* deprecated, use audio_ts_type */
Packit 4a16fb
int snd_pcm_hw_params_supports_audio_ts_type(const snd_pcm_hw_params_t *params, int type);
Packit 4a16fb
int snd_pcm_hw_params_get_rate_numden(const snd_pcm_hw_params_t *params,
Packit 4a16fb
				      unsigned int *rate_num,
Packit 4a16fb
				      unsigned int *rate_den);
Packit 4a16fb
int snd_pcm_hw_params_get_sbits(const snd_pcm_hw_params_t *params);
Packit 4a16fb
int snd_pcm_hw_params_get_fifo_size(const snd_pcm_hw_params_t *params);
Packit 4a16fb
Packit 4a16fb
#if 0
Packit 4a16fb
typedef struct _snd_pcm_hw_strategy snd_pcm_hw_strategy_t;
Packit 4a16fb
Packit 4a16fb
/* choices need to be sorted on ascending badness */
Packit 4a16fb
typedef struct _snd_pcm_hw_strategy_simple_choices_list {
Packit 4a16fb
	unsigned int value;
Packit 4a16fb
	unsigned int badness;
Packit 4a16fb
} snd_pcm_hw_strategy_simple_choices_list_t;
Packit 4a16fb
Packit 4a16fb
int snd_pcm_hw_params_strategy(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
Packit 4a16fb
			       const snd_pcm_hw_strategy_t *strategy,
Packit 4a16fb
			       unsigned int badness_min,
Packit 4a16fb
			       unsigned int badness_max);
Packit 4a16fb
Packit 4a16fb
void snd_pcm_hw_strategy_free(snd_pcm_hw_strategy_t *strategy);
Packit 4a16fb
int snd_pcm_hw_strategy_simple(snd_pcm_hw_strategy_t **strategyp,
Packit 4a16fb
			       unsigned int badness_min,
Packit 4a16fb
			       unsigned int badness_max);
Packit 4a16fb
int snd_pcm_hw_params_try_explain_failure(snd_pcm_t *pcm,
Packit 4a16fb
					  snd_pcm_hw_params_t *fail,
Packit 4a16fb
					  snd_pcm_hw_params_t *success,
Packit 4a16fb
					  unsigned int depth,
Packit 4a16fb
					  snd_output_t *out);
Packit 4a16fb
Packit 4a16fb
#endif
Packit 4a16fb
Packit 4a16fb
size_t snd_pcm_hw_params_sizeof(void);
Packit 4a16fb
/** \hideinitializer
Packit 4a16fb
 * \brief allocate an invalid #snd_pcm_hw_params_t using standard alloca
Packit 4a16fb
 * \param ptr returned pointer
Packit 4a16fb
 */
Packit 4a16fb
#define snd_pcm_hw_params_alloca(ptr) __snd_alloca(ptr, snd_pcm_hw_params)
Packit 4a16fb
int snd_pcm_hw_params_malloc(snd_pcm_hw_params_t **ptr);
Packit 4a16fb
void snd_pcm_hw_params_free(snd_pcm_hw_params_t *obj);
Packit 4a16fb
void snd_pcm_hw_params_copy(snd_pcm_hw_params_t *dst, const snd_pcm_hw_params_t *src);
Packit 4a16fb
Packit 4a16fb
#if !defined(ALSA_LIBRARY_BUILD) && !defined(ALSA_PCM_OLD_HW_PARAMS_API)
Packit 4a16fb
Packit 4a16fb
int snd_pcm_hw_params_get_access(const snd_pcm_hw_params_t *params, snd_pcm_access_t *_access);
Packit 4a16fb
int snd_pcm_hw_params_test_access(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t _access);
Packit 4a16fb
int snd_pcm_hw_params_set_access(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t _access);
Packit 4a16fb
int snd_pcm_hw_params_set_access_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t *_access);
Packit 4a16fb
int snd_pcm_hw_params_set_access_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t *_access);
Packit 4a16fb
int snd_pcm_hw_params_set_access_mask(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_mask_t *mask);
Packit 4a16fb
int snd_pcm_hw_params_get_access_mask(snd_pcm_hw_params_t *params, snd_pcm_access_mask_t *mask);
Packit 4a16fb
Packit 4a16fb
int snd_pcm_hw_params_get_format(const snd_pcm_hw_params_t *params, snd_pcm_format_t *val);
Packit 4a16fb
int snd_pcm_hw_params_test_format(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t val);
Packit 4a16fb
int snd_pcm_hw_params_set_format(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t val);
Packit 4a16fb
int snd_pcm_hw_params_set_format_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t *format);
Packit 4a16fb
int snd_pcm_hw_params_set_format_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t *format);
Packit 4a16fb
int snd_pcm_hw_params_set_format_mask(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_mask_t *mask);
Packit 4a16fb
void snd_pcm_hw_params_get_format_mask(snd_pcm_hw_params_t *params, snd_pcm_format_mask_t *mask);
Packit 4a16fb
Packit 4a16fb
int snd_pcm_hw_params_get_subformat(const snd_pcm_hw_params_t *params, snd_pcm_subformat_t *subformat);
Packit 4a16fb
int snd_pcm_hw_params_test_subformat(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t subformat);
Packit 4a16fb
int snd_pcm_hw_params_set_subformat(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t subformat);
Packit 4a16fb
int snd_pcm_hw_params_set_subformat_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t *subformat);
Packit 4a16fb
int snd_pcm_hw_params_set_subformat_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t *subformat);
Packit 4a16fb
int snd_pcm_hw_params_set_subformat_mask(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_mask_t *mask);
Packit 4a16fb
void snd_pcm_hw_params_get_subformat_mask(snd_pcm_hw_params_t *params, snd_pcm_subformat_mask_t *mask);
Packit 4a16fb
Packit 4a16fb
int snd_pcm_hw_params_get_channels(const snd_pcm_hw_params_t *params, unsigned int *val);
Packit 4a16fb
int snd_pcm_hw_params_get_channels_min(const snd_pcm_hw_params_t *params, unsigned int *val);
Packit 4a16fb
int snd_pcm_hw_params_get_channels_max(const snd_pcm_hw_params_t *params, unsigned int *val);
Packit 4a16fb
int snd_pcm_hw_params_test_channels(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
Packit 4a16fb
int snd_pcm_hw_params_set_channels(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
Packit 4a16fb
int snd_pcm_hw_params_set_channels_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
Packit 4a16fb
int snd_pcm_hw_params_set_channels_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
Packit 4a16fb
int snd_pcm_hw_params_set_channels_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *min, unsigned int *max);
Packit 4a16fb
int snd_pcm_hw_params_set_channels_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
Packit 4a16fb
int snd_pcm_hw_params_set_channels_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
Packit 4a16fb
int snd_pcm_hw_params_set_channels_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
Packit 4a16fb
Packit 4a16fb
int snd_pcm_hw_params_get_rate(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
Packit 4a16fb
int snd_pcm_hw_params_get_rate_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
Packit 4a16fb
int snd_pcm_hw_params_get_rate_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
Packit 4a16fb
int snd_pcm_hw_params_test_rate(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
Packit 4a16fb
int snd_pcm_hw_params_set_rate(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
Packit 4a16fb
int snd_pcm_hw_params_set_rate_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
Packit 4a16fb
int snd_pcm_hw_params_set_rate_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
Packit 4a16fb
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);
Packit 4a16fb
int snd_pcm_hw_params_set_rate_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
Packit 4a16fb
int snd_pcm_hw_params_set_rate_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
Packit 4a16fb
int snd_pcm_hw_params_set_rate_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
Packit 4a16fb
int snd_pcm_hw_params_set_rate_resample(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
Packit 4a16fb
int snd_pcm_hw_params_get_rate_resample(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
Packit 4a16fb
int snd_pcm_hw_params_set_export_buffer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
Packit 4a16fb
int snd_pcm_hw_params_get_export_buffer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
Packit 4a16fb
int snd_pcm_hw_params_set_period_wakeup(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
Packit 4a16fb
int snd_pcm_hw_params_get_period_wakeup(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
Packit 4a16fb
Packit 4a16fb
int snd_pcm_hw_params_get_period_time(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
Packit 4a16fb
int snd_pcm_hw_params_get_period_time_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
Packit 4a16fb
int snd_pcm_hw_params_get_period_time_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
Packit 4a16fb
int snd_pcm_hw_params_test_period_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
Packit 4a16fb
int snd_pcm_hw_params_set_period_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
Packit 4a16fb
int snd_pcm_hw_params_set_period_time_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
Packit 4a16fb
int snd_pcm_hw_params_set_period_time_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
Packit 4a16fb
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);
Packit 4a16fb
int snd_pcm_hw_params_set_period_time_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
Packit 4a16fb
int snd_pcm_hw_params_set_period_time_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
Packit 4a16fb
int snd_pcm_hw_params_set_period_time_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
Packit 4a16fb
Packit 4a16fb
int snd_pcm_hw_params_get_period_size(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *frames, int *dir);
Packit 4a16fb
int snd_pcm_hw_params_get_period_size_min(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *frames, int *dir);
Packit 4a16fb
int snd_pcm_hw_params_get_period_size_max(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *frames, int *dir);
Packit 4a16fb
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);
Packit 4a16fb
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);
Packit 4a16fb
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);
Packit 4a16fb
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);
Packit 4a16fb
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);
Packit 4a16fb
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);
Packit 4a16fb
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);
Packit 4a16fb
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);
Packit 4a16fb
int snd_pcm_hw_params_set_period_size_integer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
Packit 4a16fb
Packit 4a16fb
int snd_pcm_hw_params_get_periods(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
Packit 4a16fb
int snd_pcm_hw_params_get_periods_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
Packit 4a16fb
int snd_pcm_hw_params_get_periods_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
Packit 4a16fb
int snd_pcm_hw_params_test_periods(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
Packit 4a16fb
int snd_pcm_hw_params_set_periods(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
Packit 4a16fb
int snd_pcm_hw_params_set_periods_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
Packit 4a16fb
int snd_pcm_hw_params_set_periods_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
Packit 4a16fb
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);
Packit 4a16fb
int snd_pcm_hw_params_set_periods_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
Packit 4a16fb
int snd_pcm_hw_params_set_periods_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
Packit 4a16fb
int snd_pcm_hw_params_set_periods_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
Packit 4a16fb
int snd_pcm_hw_params_set_periods_integer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
Packit 4a16fb
Packit 4a16fb
int snd_pcm_hw_params_get_buffer_time(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
Packit 4a16fb
int snd_pcm_hw_params_get_buffer_time_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
Packit 4a16fb
int snd_pcm_hw_params_get_buffer_time_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
Packit 4a16fb
int snd_pcm_hw_params_test_buffer_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
Packit 4a16fb
int snd_pcm_hw_params_set_buffer_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir);
Packit 4a16fb
int snd_pcm_hw_params_set_buffer_time_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
Packit 4a16fb
int snd_pcm_hw_params_set_buffer_time_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
Packit 4a16fb
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);
Packit 4a16fb
int snd_pcm_hw_params_set_buffer_time_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
Packit 4a16fb
int snd_pcm_hw_params_set_buffer_time_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
Packit 4a16fb
int snd_pcm_hw_params_set_buffer_time_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
Packit 4a16fb
Packit 4a16fb
int snd_pcm_hw_params_get_buffer_size(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
Packit 4a16fb
int snd_pcm_hw_params_get_buffer_size_min(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
Packit 4a16fb
int snd_pcm_hw_params_get_buffer_size_max(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
Packit 4a16fb
int snd_pcm_hw_params_test_buffer_size(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t val);
Packit 4a16fb
int snd_pcm_hw_params_set_buffer_size(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t val);
Packit 4a16fb
int snd_pcm_hw_params_set_buffer_size_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
Packit 4a16fb
int snd_pcm_hw_params_set_buffer_size_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
Packit 4a16fb
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);
Packit 4a16fb
int snd_pcm_hw_params_set_buffer_size_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
Packit 4a16fb
int snd_pcm_hw_params_set_buffer_size_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
Packit 4a16fb
int snd_pcm_hw_params_set_buffer_size_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
Packit 4a16fb
Packit 4a16fb
#endif /* !ALSA_LIBRARY_BUILD && !ALSA_PCM_OLD_HW_PARAMS_API */
Packit 4a16fb
Packit 4a16fb
int snd_pcm_hw_params_get_min_align(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
Packit 4a16fb
Packit 4a16fb
/** \} */
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \defgroup PCM_SW_Params Software Parameters
Packit 4a16fb
 * \ingroup PCM
Packit 4a16fb
 * See the \ref pcm page for more details.
Packit 4a16fb
 * \{
Packit 4a16fb
 */
Packit 4a16fb
Packit 4a16fb
size_t snd_pcm_sw_params_sizeof(void);
Packit 4a16fb
/** \hideinitializer
Packit 4a16fb
 * \brief allocate an invalid #snd_pcm_sw_params_t using standard alloca
Packit 4a16fb
 * \param ptr returned pointer
Packit 4a16fb
 */
Packit 4a16fb
#define snd_pcm_sw_params_alloca(ptr) __snd_alloca(ptr, snd_pcm_sw_params)
Packit 4a16fb
int snd_pcm_sw_params_malloc(snd_pcm_sw_params_t **ptr);
Packit 4a16fb
void snd_pcm_sw_params_free(snd_pcm_sw_params_t *obj);
Packit 4a16fb
void snd_pcm_sw_params_copy(snd_pcm_sw_params_t *dst, const snd_pcm_sw_params_t *src);
Packit 4a16fb
int snd_pcm_sw_params_get_boundary(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val);
Packit 4a16fb
Packit 4a16fb
#if !defined(ALSA_LIBRARY_BUILD) && !defined(ALSA_PCM_OLD_SW_PARAMS_API)
Packit 4a16fb
Packit 4a16fb
int snd_pcm_sw_params_set_tstamp_mode(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_tstamp_t val);
Packit 4a16fb
int snd_pcm_sw_params_get_tstamp_mode(const snd_pcm_sw_params_t *params, snd_pcm_tstamp_t *val);
Packit 4a16fb
int snd_pcm_sw_params_set_tstamp_type(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_tstamp_type_t val);
Packit 4a16fb
int snd_pcm_sw_params_get_tstamp_type(const snd_pcm_sw_params_t *params, snd_pcm_tstamp_type_t *val);
Packit 4a16fb
int snd_pcm_sw_params_set_avail_min(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
Packit 4a16fb
int snd_pcm_sw_params_get_avail_min(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val);
Packit 4a16fb
int snd_pcm_sw_params_set_period_event(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, int val);
Packit 4a16fb
int snd_pcm_sw_params_get_period_event(const snd_pcm_sw_params_t *params, int *val);
Packit 4a16fb
int snd_pcm_sw_params_set_start_threshold(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
Packit 4a16fb
int snd_pcm_sw_params_get_start_threshold(const snd_pcm_sw_params_t *paramsm, snd_pcm_uframes_t *val);
Packit 4a16fb
int snd_pcm_sw_params_set_stop_threshold(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
Packit 4a16fb
int snd_pcm_sw_params_get_stop_threshold(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val);
Packit 4a16fb
int snd_pcm_sw_params_set_silence_threshold(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
Packit 4a16fb
int snd_pcm_sw_params_get_silence_threshold(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val);
Packit 4a16fb
int snd_pcm_sw_params_set_silence_size(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
Packit 4a16fb
int snd_pcm_sw_params_get_silence_size(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val);
Packit 4a16fb
Packit 4a16fb
#endif /* !ALSA_LIBRARY_BUILD && !ALSA_PCM_OLD_SW_PARAMS_API */
Packit 4a16fb
Packit 4a16fb
/** \} */
Packit 4a16fb
Packit 4a16fb
/* include old API */
Packit 4a16fb
#ifndef ALSA_LIBRARY_BUILD
Packit 4a16fb
#if defined(ALSA_PCM_OLD_HW_PARAMS_API) || defined(ALSA_PCM_OLD_SW_PARAMS_API)
Packit 4a16fb
#include "pcm_old.h"
Packit 4a16fb
#endif
Packit 4a16fb
#endif
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \defgroup PCM_Access Access Mask Functions
Packit 4a16fb
 * \ingroup PCM
Packit 4a16fb
 * See the \ref pcm page for more details.
Packit 4a16fb
 * \{
Packit 4a16fb
 */
Packit 4a16fb
Packit 4a16fb
size_t snd_pcm_access_mask_sizeof(void);
Packit 4a16fb
/** \hideinitializer
Packit 4a16fb
 * \brief allocate an empty #snd_pcm_access_mask_t using standard alloca
Packit 4a16fb
 * \param ptr returned pointer
Packit 4a16fb
 */
Packit 4a16fb
#define snd_pcm_access_mask_alloca(ptr) __snd_alloca(ptr, snd_pcm_access_mask)
Packit 4a16fb
int snd_pcm_access_mask_malloc(snd_pcm_access_mask_t **ptr);
Packit 4a16fb
void snd_pcm_access_mask_free(snd_pcm_access_mask_t *obj);
Packit 4a16fb
void snd_pcm_access_mask_copy(snd_pcm_access_mask_t *dst, const snd_pcm_access_mask_t *src);
Packit 4a16fb
void snd_pcm_access_mask_none(snd_pcm_access_mask_t *mask);
Packit 4a16fb
void snd_pcm_access_mask_any(snd_pcm_access_mask_t *mask);
Packit 4a16fb
int snd_pcm_access_mask_test(const snd_pcm_access_mask_t *mask, snd_pcm_access_t val);
Packit 4a16fb
int snd_pcm_access_mask_empty(const snd_pcm_access_mask_t *mask);
Packit 4a16fb
void snd_pcm_access_mask_set(snd_pcm_access_mask_t *mask, snd_pcm_access_t val);
Packit 4a16fb
void snd_pcm_access_mask_reset(snd_pcm_access_mask_t *mask, snd_pcm_access_t val);
Packit 4a16fb
Packit 4a16fb
/** \} */
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \defgroup PCM_Format Format Mask Functions
Packit 4a16fb
 * \ingroup PCM
Packit 4a16fb
 * See the \ref pcm page for more details.
Packit 4a16fb
 * \{
Packit 4a16fb
 */
Packit 4a16fb
Packit 4a16fb
size_t snd_pcm_format_mask_sizeof(void);
Packit 4a16fb
/** \hideinitializer
Packit 4a16fb
 * \brief allocate an empty #snd_pcm_format_mask_t using standard alloca
Packit 4a16fb
 * \param ptr returned pointer
Packit 4a16fb
 */
Packit 4a16fb
#define snd_pcm_format_mask_alloca(ptr) __snd_alloca(ptr, snd_pcm_format_mask)
Packit 4a16fb
int snd_pcm_format_mask_malloc(snd_pcm_format_mask_t **ptr);
Packit 4a16fb
void snd_pcm_format_mask_free(snd_pcm_format_mask_t *obj);
Packit 4a16fb
void snd_pcm_format_mask_copy(snd_pcm_format_mask_t *dst, const snd_pcm_format_mask_t *src);
Packit 4a16fb
void snd_pcm_format_mask_none(snd_pcm_format_mask_t *mask);
Packit 4a16fb
void snd_pcm_format_mask_any(snd_pcm_format_mask_t *mask);
Packit 4a16fb
int snd_pcm_format_mask_test(const snd_pcm_format_mask_t *mask, snd_pcm_format_t val);
Packit 4a16fb
int snd_pcm_format_mask_empty(const snd_pcm_format_mask_t *mask);
Packit 4a16fb
void snd_pcm_format_mask_set(snd_pcm_format_mask_t *mask, snd_pcm_format_t val);
Packit 4a16fb
void snd_pcm_format_mask_reset(snd_pcm_format_mask_t *mask, snd_pcm_format_t val);
Packit 4a16fb
Packit 4a16fb
/** \} */
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \defgroup PCM_SubFormat Subformat Mask Functions
Packit 4a16fb
 * \ingroup PCM
Packit 4a16fb
 * See the \ref pcm page for more details.
Packit 4a16fb
 * \{
Packit 4a16fb
 */
Packit 4a16fb
Packit 4a16fb
size_t snd_pcm_subformat_mask_sizeof(void);
Packit 4a16fb
/** \hideinitializer
Packit 4a16fb
 * \brief allocate an empty #snd_pcm_subformat_mask_t using standard alloca
Packit 4a16fb
 * \param ptr returned pointer
Packit 4a16fb
 */
Packit 4a16fb
#define snd_pcm_subformat_mask_alloca(ptr) __snd_alloca(ptr, snd_pcm_subformat_mask)
Packit 4a16fb
int snd_pcm_subformat_mask_malloc(snd_pcm_subformat_mask_t **ptr);
Packit 4a16fb
void snd_pcm_subformat_mask_free(snd_pcm_subformat_mask_t *obj);
Packit 4a16fb
void snd_pcm_subformat_mask_copy(snd_pcm_subformat_mask_t *dst, const snd_pcm_subformat_mask_t *src);
Packit 4a16fb
void snd_pcm_subformat_mask_none(snd_pcm_subformat_mask_t *mask);
Packit 4a16fb
void snd_pcm_subformat_mask_any(snd_pcm_subformat_mask_t *mask);
Packit 4a16fb
int snd_pcm_subformat_mask_test(const snd_pcm_subformat_mask_t *mask, snd_pcm_subformat_t val);
Packit 4a16fb
int snd_pcm_subformat_mask_empty(const snd_pcm_subformat_mask_t *mask);
Packit 4a16fb
void snd_pcm_subformat_mask_set(snd_pcm_subformat_mask_t *mask, snd_pcm_subformat_t val);
Packit 4a16fb
void snd_pcm_subformat_mask_reset(snd_pcm_subformat_mask_t *mask, snd_pcm_subformat_t val);
Packit 4a16fb
Packit 4a16fb
/** \} */
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \defgroup PCM_Status Status Functions
Packit 4a16fb
 * \ingroup PCM
Packit 4a16fb
 * See the \ref pcm page for more details.
Packit 4a16fb
 * \{
Packit 4a16fb
 */
Packit 4a16fb
Packit 4a16fb
size_t snd_pcm_status_sizeof(void);
Packit 4a16fb
/** \hideinitializer
Packit 4a16fb
 * \brief allocate an invalid #snd_pcm_status_t using standard alloca
Packit 4a16fb
 * \param ptr returned pointer
Packit 4a16fb
 */
Packit 4a16fb
#define snd_pcm_status_alloca(ptr) __snd_alloca(ptr, snd_pcm_status)
Packit 4a16fb
int snd_pcm_status_malloc(snd_pcm_status_t **ptr);
Packit 4a16fb
void snd_pcm_status_free(snd_pcm_status_t *obj);
Packit 4a16fb
void snd_pcm_status_copy(snd_pcm_status_t *dst, const snd_pcm_status_t *src);
Packit 4a16fb
snd_pcm_state_t snd_pcm_status_get_state(const snd_pcm_status_t *obj);
Packit 4a16fb
void snd_pcm_status_get_trigger_tstamp(const snd_pcm_status_t *obj, snd_timestamp_t *ptr);
Packit 4a16fb
void snd_pcm_status_get_trigger_htstamp(const snd_pcm_status_t *obj, snd_htimestamp_t *ptr);
Packit 4a16fb
void snd_pcm_status_get_tstamp(const snd_pcm_status_t *obj, snd_timestamp_t *ptr);
Packit 4a16fb
void snd_pcm_status_get_htstamp(const snd_pcm_status_t *obj, snd_htimestamp_t *ptr);
Packit 4a16fb
void snd_pcm_status_get_audio_htstamp(const snd_pcm_status_t *obj, snd_htimestamp_t *ptr);
Packit 4a16fb
void snd_pcm_status_get_driver_htstamp(const snd_pcm_status_t *obj, snd_htimestamp_t *ptr);
Packit 4a16fb
void snd_pcm_status_get_audio_htstamp_report(const snd_pcm_status_t *obj,
Packit 4a16fb
					     snd_pcm_audio_tstamp_report_t *audio_tstamp_report);
Packit 4a16fb
void snd_pcm_status_set_audio_htstamp_config(snd_pcm_status_t *obj,
Packit 4a16fb
					     snd_pcm_audio_tstamp_config_t *audio_tstamp_config);
Packit 4a16fb
Packit 4a16fb
static inline void snd_pcm_pack_audio_tstamp_config(unsigned int *data,
Packit 4a16fb
						snd_pcm_audio_tstamp_config_t *config)
Packit 4a16fb
{
Packit 4a16fb
	*data = config->report_delay;
Packit 4a16fb
	*data <<= 4;
Packit 4a16fb
	*data |= config->type_requested;
Packit 4a16fb
}
Packit 4a16fb
Packit 4a16fb
static inline void snd_pcm_unpack_audio_tstamp_report(unsigned int data, unsigned int accuracy,
Packit 4a16fb
						snd_pcm_audio_tstamp_report_t *report)
Packit 4a16fb
{
Packit 4a16fb
	data >>= 16;
Packit 4a16fb
	report->valid = data & 1;
Packit 4a16fb
	report->actual_type = (data >> 1) & 0xF;
Packit 4a16fb
	report->accuracy_report = (data >> 5) & 1;
Packit 4a16fb
	report->accuracy = accuracy;
Packit 4a16fb
}
Packit 4a16fb
Packit 4a16fb
snd_pcm_sframes_t snd_pcm_status_get_delay(const snd_pcm_status_t *obj);
Packit 4a16fb
snd_pcm_uframes_t snd_pcm_status_get_avail(const snd_pcm_status_t *obj);
Packit 4a16fb
snd_pcm_uframes_t snd_pcm_status_get_avail_max(const snd_pcm_status_t *obj);
Packit 4a16fb
snd_pcm_uframes_t snd_pcm_status_get_overrange(const snd_pcm_status_t *obj);
Packit 4a16fb
Packit 4a16fb
/** \} */
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \defgroup PCM_Description Description Functions
Packit 4a16fb
 * \ingroup PCM
Packit 4a16fb
 * See the \ref pcm page for more details.
Packit 4a16fb
 * \{
Packit 4a16fb
 */
Packit 4a16fb
Packit 4a16fb
const char *snd_pcm_type_name(snd_pcm_type_t type);
Packit 4a16fb
const char *snd_pcm_stream_name(const snd_pcm_stream_t stream);
Packit 4a16fb
const char *snd_pcm_access_name(const snd_pcm_access_t _access);
Packit 4a16fb
const char *snd_pcm_format_name(const snd_pcm_format_t format);
Packit 4a16fb
const char *snd_pcm_format_description(const snd_pcm_format_t format);
Packit 4a16fb
const char *snd_pcm_subformat_name(const snd_pcm_subformat_t subformat);
Packit 4a16fb
const char *snd_pcm_subformat_description(const snd_pcm_subformat_t subformat);
Packit 4a16fb
snd_pcm_format_t snd_pcm_format_value(const char* name);
Packit 4a16fb
const char *snd_pcm_tstamp_mode_name(const snd_pcm_tstamp_t mode);
Packit 4a16fb
const char *snd_pcm_state_name(const snd_pcm_state_t state);
Packit 4a16fb
Packit 4a16fb
/** \} */
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \defgroup PCM_Dump Debug Functions
Packit 4a16fb
 * \ingroup PCM
Packit 4a16fb
 * See the \ref pcm page for more details.
Packit 4a16fb
 * \{
Packit 4a16fb
 */
Packit 4a16fb
Packit 4a16fb
int snd_pcm_dump(snd_pcm_t *pcm, snd_output_t *out);
Packit 4a16fb
int snd_pcm_dump_hw_setup(snd_pcm_t *pcm, snd_output_t *out);
Packit 4a16fb
int snd_pcm_dump_sw_setup(snd_pcm_t *pcm, snd_output_t *out);
Packit 4a16fb
int snd_pcm_dump_setup(snd_pcm_t *pcm, snd_output_t *out);
Packit 4a16fb
int snd_pcm_hw_params_dump(snd_pcm_hw_params_t *params, snd_output_t *out);
Packit 4a16fb
int snd_pcm_sw_params_dump(snd_pcm_sw_params_t *params, snd_output_t *out);
Packit 4a16fb
int snd_pcm_status_dump(snd_pcm_status_t *status, snd_output_t *out);
Packit 4a16fb
Packit 4a16fb
/** \} */
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \defgroup PCM_Direct Direct Access (MMAP) Functions
Packit 4a16fb
 * \ingroup PCM
Packit 4a16fb
 * See the \ref pcm page for more details.
Packit 4a16fb
 * \{
Packit 4a16fb
 */
Packit 4a16fb
Packit 4a16fb
int snd_pcm_mmap_begin(snd_pcm_t *pcm,
Packit 4a16fb
		       const snd_pcm_channel_area_t **areas,
Packit 4a16fb
		       snd_pcm_uframes_t *offset,
Packit 4a16fb
		       snd_pcm_uframes_t *frames);
Packit 4a16fb
snd_pcm_sframes_t snd_pcm_mmap_commit(snd_pcm_t *pcm,
Packit 4a16fb
				      snd_pcm_uframes_t offset,
Packit 4a16fb
				      snd_pcm_uframes_t frames);
Packit 4a16fb
snd_pcm_sframes_t snd_pcm_mmap_writei(snd_pcm_t *pcm, const void *buffer, snd_pcm_uframes_t size);
Packit 4a16fb
snd_pcm_sframes_t snd_pcm_mmap_readi(snd_pcm_t *pcm, void *buffer, snd_pcm_uframes_t size);
Packit 4a16fb
snd_pcm_sframes_t snd_pcm_mmap_writen(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size);
Packit 4a16fb
snd_pcm_sframes_t snd_pcm_mmap_readn(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size);                                                                
Packit 4a16fb
Packit 4a16fb
/** \} */
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \defgroup PCM_Helpers Helper Functions
Packit 4a16fb
 * \ingroup PCM
Packit 4a16fb
 * See the \ref pcm page for more details.
Packit 4a16fb
 * \{
Packit 4a16fb
 */
Packit 4a16fb
Packit 4a16fb
int snd_pcm_format_signed(snd_pcm_format_t format);
Packit 4a16fb
int snd_pcm_format_unsigned(snd_pcm_format_t format);
Packit 4a16fb
int snd_pcm_format_linear(snd_pcm_format_t format);
Packit 4a16fb
int snd_pcm_format_float(snd_pcm_format_t format);
Packit 4a16fb
int snd_pcm_format_little_endian(snd_pcm_format_t format);
Packit 4a16fb
int snd_pcm_format_big_endian(snd_pcm_format_t format);
Packit 4a16fb
int snd_pcm_format_cpu_endian(snd_pcm_format_t format);
Packit 4a16fb
int snd_pcm_format_width(snd_pcm_format_t format);			/* in bits */
Packit 4a16fb
int snd_pcm_format_physical_width(snd_pcm_format_t format);		/* in bits */
Packit 4a16fb
snd_pcm_format_t snd_pcm_build_linear_format(int width, int pwidth, int unsignd, int big_endian);
Packit 4a16fb
ssize_t snd_pcm_format_size(snd_pcm_format_t format, size_t samples);
Packit 4a16fb
uint8_t snd_pcm_format_silence(snd_pcm_format_t format);
Packit 4a16fb
uint16_t snd_pcm_format_silence_16(snd_pcm_format_t format);
Packit 4a16fb
uint32_t snd_pcm_format_silence_32(snd_pcm_format_t format);
Packit 4a16fb
uint64_t snd_pcm_format_silence_64(snd_pcm_format_t format);
Packit 4a16fb
int snd_pcm_format_set_silence(snd_pcm_format_t format, void *buf, unsigned int samples);
Packit 4a16fb
Packit 4a16fb
snd_pcm_sframes_t snd_pcm_bytes_to_frames(snd_pcm_t *pcm, ssize_t bytes);
Packit 4a16fb
ssize_t snd_pcm_frames_to_bytes(snd_pcm_t *pcm, snd_pcm_sframes_t frames);
Packit 4a16fb
long snd_pcm_bytes_to_samples(snd_pcm_t *pcm, ssize_t bytes);
Packit 4a16fb
ssize_t snd_pcm_samples_to_bytes(snd_pcm_t *pcm, long samples);
Packit 4a16fb
Packit 4a16fb
int snd_pcm_area_silence(const snd_pcm_channel_area_t *dst_channel, snd_pcm_uframes_t dst_offset,
Packit 4a16fb
			 unsigned int samples, snd_pcm_format_t format);
Packit 4a16fb
int snd_pcm_areas_silence(const snd_pcm_channel_area_t *dst_channels, snd_pcm_uframes_t dst_offset,
Packit 4a16fb
			  unsigned int channels, snd_pcm_uframes_t frames, snd_pcm_format_t format);
Packit 4a16fb
int snd_pcm_area_copy(const snd_pcm_channel_area_t *dst_channel, snd_pcm_uframes_t dst_offset,
Packit 4a16fb
		      const snd_pcm_channel_area_t *src_channel, snd_pcm_uframes_t src_offset,
Packit 4a16fb
		      unsigned int samples, snd_pcm_format_t format);
Packit 4a16fb
int snd_pcm_areas_copy(const snd_pcm_channel_area_t *dst_channels, snd_pcm_uframes_t dst_offset,
Packit 4a16fb
		       const snd_pcm_channel_area_t *src_channels, snd_pcm_uframes_t src_offset,
Packit 4a16fb
		       unsigned int channels, snd_pcm_uframes_t frames, snd_pcm_format_t format);
Packit 4a16fb
int snd_pcm_areas_copy_wrap(const snd_pcm_channel_area_t *dst_channels,
Packit 4a16fb
			    snd_pcm_uframes_t dst_offset,
Packit 4a16fb
			    const snd_pcm_uframes_t dst_size,
Packit 4a16fb
			    const snd_pcm_channel_area_t *src_channels,
Packit 4a16fb
			    snd_pcm_uframes_t src_offset,
Packit 4a16fb
			    const snd_pcm_uframes_t src_size,
Packit 4a16fb
			    const unsigned int channels,
Packit 4a16fb
			    snd_pcm_uframes_t frames,
Packit 4a16fb
			    const snd_pcm_format_t format);
Packit 4a16fb
Packit 4a16fb
/** \} */
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \defgroup PCM_Hook Hook Extension
Packit 4a16fb
 * \ingroup PCM
Packit 4a16fb
 * See the \ref pcm page for more details.
Packit 4a16fb
 * \{
Packit 4a16fb
 */
Packit 4a16fb
Packit 4a16fb
/** type of pcm hook */
Packit 4a16fb
typedef enum _snd_pcm_hook_type {
Packit 4a16fb
	SND_PCM_HOOK_TYPE_HW_PARAMS = 0,
Packit 4a16fb
	SND_PCM_HOOK_TYPE_HW_FREE,
Packit 4a16fb
	SND_PCM_HOOK_TYPE_CLOSE,
Packit 4a16fb
	SND_PCM_HOOK_TYPE_LAST = SND_PCM_HOOK_TYPE_CLOSE
Packit 4a16fb
} snd_pcm_hook_type_t;
Packit 4a16fb
Packit 4a16fb
/** PCM hook container */
Packit 4a16fb
typedef struct _snd_pcm_hook snd_pcm_hook_t;
Packit 4a16fb
/** PCM hook callback function */
Packit 4a16fb
typedef int (*snd_pcm_hook_func_t)(snd_pcm_hook_t *hook);
Packit 4a16fb
snd_pcm_t *snd_pcm_hook_get_pcm(snd_pcm_hook_t *hook);
Packit 4a16fb
void *snd_pcm_hook_get_private(snd_pcm_hook_t *hook);
Packit 4a16fb
void snd_pcm_hook_set_private(snd_pcm_hook_t *hook, void *private_data);
Packit 4a16fb
int snd_pcm_hook_add(snd_pcm_hook_t **hookp, snd_pcm_t *pcm,
Packit 4a16fb
		     snd_pcm_hook_type_t type,
Packit 4a16fb
		     snd_pcm_hook_func_t func, void *private_data);
Packit 4a16fb
int snd_pcm_hook_remove(snd_pcm_hook_t *hook);
Packit 4a16fb
Packit 4a16fb
/** \} */
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \defgroup PCM_Scope Scope Plugin Extension
Packit 4a16fb
 * \ingroup PCM
Packit 4a16fb
 * See the \ref pcm page for more details.
Packit 4a16fb
 * \{
Packit 4a16fb
 */
Packit 4a16fb
Packit 4a16fb
/** #SND_PCM_TYPE_METER scope functions */
Packit 4a16fb
typedef struct _snd_pcm_scope_ops {
Packit 4a16fb
	/** \brief Enable and prepare it using current params
Packit 4a16fb
	 * \param scope scope handle
Packit 4a16fb
	 */
Packit 4a16fb
	int (*enable)(snd_pcm_scope_t *scope);
Packit 4a16fb
	/** \brief Disable
Packit 4a16fb
	 * \param scope scope handle
Packit 4a16fb
	 */
Packit 4a16fb
	void (*disable)(snd_pcm_scope_t *scope);
Packit 4a16fb
	/** \brief PCM has been started
Packit 4a16fb
	 * \param scope scope handle
Packit 4a16fb
	 */
Packit 4a16fb
	void (*start)(snd_pcm_scope_t *scope);
Packit 4a16fb
	/** \brief PCM has been stopped
Packit 4a16fb
	 * \param scope scope handle
Packit 4a16fb
	 */
Packit 4a16fb
	void (*stop)(snd_pcm_scope_t *scope);
Packit 4a16fb
	/** \brief New frames are present
Packit 4a16fb
	 * \param scope scope handle
Packit 4a16fb
	 */
Packit 4a16fb
	void (*update)(snd_pcm_scope_t *scope);
Packit 4a16fb
	/** \brief Reset status
Packit 4a16fb
	 * \param scope scope handle
Packit 4a16fb
	 */
Packit 4a16fb
	void (*reset)(snd_pcm_scope_t *scope);
Packit 4a16fb
	/** \brief PCM is closing
Packit 4a16fb
	 * \param scope scope handle
Packit 4a16fb
	 */
Packit 4a16fb
	void (*close)(snd_pcm_scope_t *scope);
Packit 4a16fb
} snd_pcm_scope_ops_t;
Packit 4a16fb
Packit 4a16fb
snd_pcm_uframes_t snd_pcm_meter_get_bufsize(snd_pcm_t *pcm);
Packit 4a16fb
unsigned int snd_pcm_meter_get_channels(snd_pcm_t *pcm);
Packit 4a16fb
unsigned int snd_pcm_meter_get_rate(snd_pcm_t *pcm);
Packit 4a16fb
snd_pcm_uframes_t snd_pcm_meter_get_now(snd_pcm_t *pcm);
Packit 4a16fb
snd_pcm_uframes_t snd_pcm_meter_get_boundary(snd_pcm_t *pcm);
Packit 4a16fb
int snd_pcm_meter_add_scope(snd_pcm_t *pcm, snd_pcm_scope_t *scope);
Packit 4a16fb
snd_pcm_scope_t *snd_pcm_meter_search_scope(snd_pcm_t *pcm, const char *name);
Packit 4a16fb
int snd_pcm_scope_malloc(snd_pcm_scope_t **ptr);
Packit 4a16fb
void snd_pcm_scope_set_ops(snd_pcm_scope_t *scope,
Packit 4a16fb
			   const snd_pcm_scope_ops_t *val);
Packit 4a16fb
void snd_pcm_scope_set_name(snd_pcm_scope_t *scope, const char *val);
Packit 4a16fb
const char *snd_pcm_scope_get_name(snd_pcm_scope_t *scope);
Packit 4a16fb
void *snd_pcm_scope_get_callback_private(snd_pcm_scope_t *scope);
Packit 4a16fb
void snd_pcm_scope_set_callback_private(snd_pcm_scope_t *scope, void *val);
Packit 4a16fb
int snd_pcm_scope_s16_open(snd_pcm_t *pcm, const char *name,
Packit 4a16fb
			   snd_pcm_scope_t **scopep);
Packit 4a16fb
int16_t *snd_pcm_scope_s16_get_channel_buffer(snd_pcm_scope_t *scope,
Packit 4a16fb
					      unsigned int channel);
Packit 4a16fb
Packit 4a16fb
/** \} */
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \defgroup PCM_Simple Simple setup functions
Packit 4a16fb
 * \ingroup PCM
Packit 4a16fb
 * See the \ref pcm page for more details.
Packit 4a16fb
 * \{
Packit 4a16fb
 */
Packit 4a16fb
Packit 4a16fb
/** Simple PCM latency type */
Packit 4a16fb
typedef enum _snd_spcm_latency {
Packit 4a16fb
	/** standard latency - for standard playback or capture
Packit 4a16fb
            (estimated latency in one direction 350ms) */
Packit 4a16fb
	SND_SPCM_LATENCY_STANDARD = 0,
Packit 4a16fb
	/** medium latency - software phones etc.
Packit 4a16fb
	    (estimated latency in one direction maximally 25ms */
Packit 4a16fb
	SND_SPCM_LATENCY_MEDIUM,
Packit 4a16fb
	/** realtime latency - realtime applications (effect processors etc.)
Packit 4a16fb
	    (estimated latency in one direction 5ms and better) */
Packit 4a16fb
	SND_SPCM_LATENCY_REALTIME
Packit 4a16fb
} snd_spcm_latency_t;
Packit 4a16fb
Packit 4a16fb
/** Simple PCM xrun type */
Packit 4a16fb
typedef enum _snd_spcm_xrun_type {
Packit 4a16fb
	/** driver / library will ignore all xruns, the stream runs forever */
Packit 4a16fb
	SND_SPCM_XRUN_IGNORE = 0,
Packit 4a16fb
	/** driver / library stops the stream when an xrun occurs */
Packit 4a16fb
	SND_SPCM_XRUN_STOP
Packit 4a16fb
} snd_spcm_xrun_type_t;
Packit 4a16fb
Packit 4a16fb
/** Simple PCM duplex type */
Packit 4a16fb
typedef enum _snd_spcm_duplex_type {
Packit 4a16fb
	/** liberal duplex - the buffer and period sizes might not match */
Packit 4a16fb
	SND_SPCM_DUPLEX_LIBERAL = 0,
Packit 4a16fb
	/** pedantic duplex - the buffer and period sizes MUST match */
Packit 4a16fb
	SND_SPCM_DUPLEX_PEDANTIC
Packit 4a16fb
} snd_spcm_duplex_type_t;
Packit 4a16fb
Packit 4a16fb
int snd_spcm_init(snd_pcm_t *pcm,
Packit 4a16fb
		  unsigned int rate,
Packit 4a16fb
		  unsigned int channels,
Packit 4a16fb
		  snd_pcm_format_t format,
Packit 4a16fb
		  snd_pcm_subformat_t subformat,
Packit 4a16fb
		  snd_spcm_latency_t latency,
Packit 4a16fb
		  snd_pcm_access_t _access,
Packit 4a16fb
		  snd_spcm_xrun_type_t xrun_type);
Packit 4a16fb
Packit 4a16fb
int snd_spcm_init_duplex(snd_pcm_t *playback_pcm,
Packit 4a16fb
			 snd_pcm_t *capture_pcm,
Packit 4a16fb
			 unsigned int rate,
Packit 4a16fb
			 unsigned int channels,
Packit 4a16fb
			 snd_pcm_format_t format,
Packit 4a16fb
			 snd_pcm_subformat_t subformat,
Packit 4a16fb
			 snd_spcm_latency_t latency,
Packit 4a16fb
			 snd_pcm_access_t _access,
Packit 4a16fb
			 snd_spcm_xrun_type_t xrun_type,
Packit 4a16fb
			 snd_spcm_duplex_type_t duplex_type);
Packit 4a16fb
Packit 4a16fb
int snd_spcm_init_get_params(snd_pcm_t *pcm,
Packit 4a16fb
			     unsigned int *rate,
Packit 4a16fb
			     snd_pcm_uframes_t *buffer_size,
Packit 4a16fb
			     snd_pcm_uframes_t *period_size);
Packit 4a16fb
Packit 4a16fb
/** \} */
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \defgroup PCM_Deprecated Deprecated Functions
Packit 4a16fb
 * \ingroup PCM
Packit 4a16fb
 * See the \ref pcm page for more details.
Packit 4a16fb
 * \{
Packit 4a16fb
 */
Packit 4a16fb
Packit 4a16fb
/* Deprecated functions, for compatibility */
Packit 4a16fb
const char *snd_pcm_start_mode_name(snd_pcm_start_t mode) __attribute__((deprecated));
Packit 4a16fb
const char *snd_pcm_xrun_mode_name(snd_pcm_xrun_t mode) __attribute__((deprecated));
Packit 4a16fb
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));
Packit 4a16fb
snd_pcm_start_t snd_pcm_sw_params_get_start_mode(const snd_pcm_sw_params_t *params) __attribute__((deprecated));
Packit 4a16fb
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));
Packit 4a16fb
snd_pcm_xrun_t snd_pcm_sw_params_get_xrun_mode(const snd_pcm_sw_params_t *params) __attribute__((deprecated));
Packit 4a16fb
#if !defined(ALSA_LIBRARY_BUILD) && !defined(ALSA_PCM_OLD_SW_PARAMS_API)
Packit 4a16fb
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));
Packit 4a16fb
int snd_pcm_sw_params_get_xfer_align(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val) __attribute__((deprecated));
Packit 4a16fb
int snd_pcm_sw_params_set_sleep_min(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, unsigned int val) __attribute__((deprecated));
Packit 4a16fb
int snd_pcm_sw_params_get_sleep_min(const snd_pcm_sw_params_t *params, unsigned int *val) __attribute__((deprecated));
Packit 4a16fb
#endif /* !ALSA_LIBRARY_BUILD && !ALSA_PCM_OLD_SW_PARAMS_API */
Packit 4a16fb
#if !defined(ALSA_LIBRARY_BUILD) && !defined(ALSA_PCM_OLD_HW_PARAMS_API)
Packit 4a16fb
int snd_pcm_hw_params_get_tick_time(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir) __attribute__((deprecated));
Packit 4a16fb
int snd_pcm_hw_params_get_tick_time_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir) __attribute__((deprecated));
Packit 4a16fb
int snd_pcm_hw_params_get_tick_time_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir) __attribute__((deprecated));
Packit 4a16fb
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));
Packit 4a16fb
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));
Packit 4a16fb
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));
Packit 4a16fb
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));
Packit 4a16fb
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));
Packit 4a16fb
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));
Packit 4a16fb
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));
Packit 4a16fb
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));
Packit 4a16fb
#endif /* !ALSA_LIBRARY_BUILD && !ALSA_PCM_OLD_HW_PARAMS_API */
Packit 4a16fb
Packit 4a16fb
/** \} */
Packit 4a16fb
Packit 4a16fb
#ifdef __cplusplus
Packit 4a16fb
}
Packit 4a16fb
#endif
Packit 4a16fb
Packit 4a16fb
#endif /* __ALSA_PCM_H */