Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages   Examples  

pcm.c File Reference

PCM Interface. More...


Functions

const char * snd_pcm_name (snd_pcm_t *pcm)
 get identifier of PCM handle

snd_pcm_type_t snd_pcm_type (snd_pcm_t *pcm)
 get type of PCM handle

snd_pcm_stream_t snd_pcm_stream (snd_pcm_t *pcm)
 get stream for a PCM handle

int snd_pcm_close (snd_pcm_t *pcm)
 close PCM handle

int snd_pcm_nonblock (snd_pcm_t *pcm, int nonblock)
 set nonblock mode

int snd_pcm_info (snd_pcm_t *pcm, snd_pcm_info_t *info)
 Obtain general (static) information for PCM handle.

int snd_pcm_hw_params_current (snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
 Retreive current PCM hardware configuration chosen with snd_pcm_hw_params.

int snd_pcm_hw_params (snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
 Install one PCM hardware configuration chosen from a configuration space and snd_pcm_prepare it.

int snd_pcm_hw_free (snd_pcm_t *pcm)
 Remove PCM hardware configuration and free associated resources.

int snd_pcm_sw_params (snd_pcm_t *pcm, snd_pcm_sw_params_t *params)
 Install PCM software configuration defined by params.

int snd_pcm_status (snd_pcm_t *pcm, snd_pcm_status_t *status)
 Obtain status (runtime) information for PCM handle.

snd_pcm_state_t snd_pcm_state (snd_pcm_t *pcm)
 Return PCM state.

int snd_pcm_hwsync (snd_pcm_t *pcm)
 Synchronize stream position with hardware.

int snd_pcm_delay (snd_pcm_t *pcm, snd_pcm_sframes_t *delayp)
 Obtain delay for a running PCM handle.

int snd_pcm_resume (snd_pcm_t *pcm)
 Resume from suspend, no samples are lost.

int snd_pcm_prepare (snd_pcm_t *pcm)
 Prepare PCM for use.

int snd_pcm_reset (snd_pcm_t *pcm)
 Reset PCM position.

int snd_pcm_start (snd_pcm_t *pcm)
 Start a PCM.

int snd_pcm_drop (snd_pcm_t *pcm)
 Stop a PCM dropping pending frames.

int snd_pcm_drain (snd_pcm_t *pcm)
 Stop a PCM preserving pending frames.

int snd_pcm_pause (snd_pcm_t *pcm, int enable)
 Pause/resume PCM.

snd_pcm_sframes_t snd_pcm_rewind (snd_pcm_t *pcm, snd_pcm_uframes_t frames)
 Move application frame position backward.

snd_pcm_sframes_t snd_pcm_forward (snd_pcm_t *pcm, snd_pcm_uframes_t frames)
 Move application frame position forward.

snd_pcm_sframes_t snd_pcm_writei (snd_pcm_t *pcm, const void *buffer, snd_pcm_uframes_t size)
 Write interleaved frames to a PCM.

snd_pcm_sframes_t snd_pcm_writen (snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size)
 Write non interleaved frames to a PCM.

snd_pcm_sframes_t snd_pcm_readi (snd_pcm_t *pcm, void *buffer, snd_pcm_uframes_t size)
 Read interleaved frames from a PCM.

snd_pcm_sframes_t snd_pcm_readn (snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size)
 Read non interleaved frames to a PCM.

int snd_pcm_link (snd_pcm_t *pcm1, snd_pcm_t *pcm2)
 Link two PCMs.

int snd_pcm_unlink (snd_pcm_t *pcm)
 Remove a PCM from a linked group.

int snd_pcm_poll_descriptors_count (snd_pcm_t *pcm)
 get count of poll descriptors for PCM handle

int snd_pcm_poll_descriptors (snd_pcm_t *pcm, struct pollfd *pfds, unsigned int space)
 get poll descriptors

int snd_pcm_poll_descriptors_revents (snd_pcm_t *pcm, struct pollfd *pfds, unsigned int nfds, unsigned short *revents)
 get returned events from poll descriptors

const char * snd_pcm_stream_name (snd_pcm_stream_t stream)
 get name of PCM stream

const char * snd_pcm_access_name (snd_pcm_access_t acc)
 get name of PCM access type

const char * snd_pcm_format_name (snd_pcm_format_t format)
 get name of PCM sample format

const char * snd_pcm_format_description (snd_pcm_format_t format)
 get description of PCM sample format

snd_pcm_format_t snd_pcm_format_value (const char *name)
 get PCM sample format from name

const char * snd_pcm_subformat_name (snd_pcm_subformat_t subformat)
 get name of PCM sample subformat

const char * snd_pcm_subformat_description (snd_pcm_subformat_t subformat)
 get description of PCM sample subformat

const char * snd_pcm_start_mode_name (snd_pcm_start_t mode)
 (DEPRECATED) get name of PCM start mode setting

const char * snd_pcm_xrun_mode_name (snd_pcm_xrun_t mode)
 (DEPRECATED) get name of PCM xrun mode setting

const char * snd_pcm_tstamp_mode_name (snd_pcm_tstamp_t mode)
 get name of PCM tstamp mode setting

const char * snd_pcm_state_name (snd_pcm_state_t state)
 get name of PCM state

const char * snd_pcm_type_name (snd_pcm_type_t type)
 get name of PCM type

int snd_pcm_dump_hw_setup (snd_pcm_t *pcm, snd_output_t *out)
 Dump current hardware setup for PCM.

int snd_pcm_dump_sw_setup (snd_pcm_t *pcm, snd_output_t *out)
 Dump current software setup for PCM.

int snd_pcm_dump_setup (snd_pcm_t *pcm, snd_output_t *out)
 Dump current setup (hardware and software) for PCM.

int snd_pcm_status_dump (snd_pcm_status_t *status, snd_output_t *out)
 Dump status.

int snd_pcm_dump (snd_pcm_t *pcm, snd_output_t *out)
 Dump PCM info.

snd_pcm_sframes_t snd_pcm_bytes_to_frames (snd_pcm_t *pcm, ssize_t bytes)
 Convert bytes in frames for a PCM.

ssize_t snd_pcm_frames_to_bytes (snd_pcm_t *pcm, snd_pcm_sframes_t frames)
 Convert frames in bytes for a PCM.

long snd_pcm_bytes_to_samples (snd_pcm_t *pcm, ssize_t bytes)
 Convert bytes in samples for a PCM.

ssize_t snd_pcm_samples_to_bytes (snd_pcm_t *pcm, long samples)
 Convert samples in bytes for a PCM.

int snd_async_add_pcm_handler (snd_async_handler_t **handler, snd_pcm_t *pcm, snd_async_callback_t callback, void *private_data)
 Add an async handler for a PCM.

snd_pcm_tsnd_async_handler_get_pcm (snd_async_handler_t *handler)
 Return PCM handle related to an async handler.

int snd_pcm_open (snd_pcm_t **pcmp, const char *name, snd_pcm_stream_t stream, int mode)
 Opens a PCM.

int snd_pcm_open_lconf (snd_pcm_t **pcmp, const char *name, snd_pcm_stream_t stream, int mode, snd_config_t *lconf)
 Opens a PCM using local configuration.

int snd_pcm_wait (snd_pcm_t *pcm, int timeout)
 Wait for a PCM to become ready.

snd_pcm_sframes_t snd_pcm_avail_update (snd_pcm_t *pcm)
 Return number of frames ready to be read/written.

int snd_pcm_area_silence (const snd_pcm_channel_area_t *dst_area, snd_pcm_uframes_t dst_offset, unsigned int samples, snd_pcm_format_t format)
 Silence an area.

int snd_pcm_areas_silence (const snd_pcm_channel_area_t *dst_areas, snd_pcm_uframes_t dst_offset, unsigned int channels, snd_pcm_uframes_t frames, snd_pcm_format_t format)
 Silence one or more areas.

int snd_pcm_area_copy (const snd_pcm_channel_area_t *dst_area, snd_pcm_uframes_t dst_offset, const snd_pcm_channel_area_t *src_area, snd_pcm_uframes_t src_offset, unsigned int samples, snd_pcm_format_t format)
 Copy an area.

int snd_pcm_areas_copy (const snd_pcm_channel_area_t *dst_areas, snd_pcm_uframes_t dst_offset, const snd_pcm_channel_area_t *src_areas, snd_pcm_uframes_t src_offset, unsigned int channels, snd_pcm_uframes_t frames, snd_pcm_format_t format)
 Copy one or more areas.

int snd_pcm_hw_params_dump (snd_pcm_hw_params_t *params, snd_output_t *out)
 Dump a PCM hardware configuration space.

int snd_pcm_hw_params_can_mmap_sample_resolution (const snd_pcm_hw_params_t *params)
 Check, if hardware supports sample-resolution mmap for given configuration.

int snd_pcm_hw_params_is_double (const snd_pcm_hw_params_t *params)
 Check, if hardware does double buffering for start/stop for given configuration.

int snd_pcm_hw_params_is_batch (const snd_pcm_hw_params_t *params)
 Check, if hardware does double buffering for data transfers for given configuration.

int snd_pcm_hw_params_is_block_transfer (const snd_pcm_hw_params_t *params)
 Check, if hardware does block transfers for samples for given configuration.

int snd_pcm_hw_params_can_overrange (const snd_pcm_hw_params_t *params)
 Check, if hardware supports overrange detection.

int snd_pcm_hw_params_can_pause (const snd_pcm_hw_params_t *params)
 Check, if hardware supports pause.

int snd_pcm_hw_params_can_resume (const snd_pcm_hw_params_t *params)
 Check, if hardware supports resume.

int snd_pcm_hw_params_is_half_duplex (const snd_pcm_hw_params_t *params)
 Check, if hardware does half-duplex only.

int snd_pcm_hw_params_is_joint_duplex (const snd_pcm_hw_params_t *params)
 Check, if hardware does joint-duplex (playback and capture are somewhat correlated).

int snd_pcm_hw_params_can_sync_start (const snd_pcm_hw_params_t *params)
 Check, if hardware supports synchronized start with sample resolution.

int snd_pcm_hw_params_get_rate_numden (const snd_pcm_hw_params_t *params, unsigned int *rate_num, unsigned int *rate_den)
 Get rate exact info from a configuration space.

int snd_pcm_hw_params_get_sbits (const snd_pcm_hw_params_t *params)
 Get sample resolution info from a configuration space.

int snd_pcm_hw_params_get_fifo_size (const snd_pcm_hw_params_t *params)
 Get hard are FIFO size info from a configuration space.

int snd_pcm_hw_params_any (snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
 Fill params with a full configuration space for a PCM.

size_t snd_pcm_access_mask_sizeof ()
 get size of snd_pcm_access_mask_t

int snd_pcm_access_mask_malloc (snd_pcm_access_mask_t **ptr)
 allocate an empty snd_pcm_access_mask_t using standard malloc

void snd_pcm_access_mask_free (snd_pcm_access_mask_t *obj)
 frees a previously allocated snd_pcm_access_mask_t

void snd_pcm_access_mask_copy (snd_pcm_access_mask_t *dst, const snd_pcm_access_mask_t *src)
 copy one snd_pcm_access_mask_t to another

void snd_pcm_access_mask_none (snd_pcm_access_mask_t *mask)
 reset all bits in a snd_pcm_access_mask_t

void snd_pcm_access_mask_any (snd_pcm_access_mask_t *mask)
 set all bits in a snd_pcm_access_mask_t

int snd_pcm_access_mask_test (const snd_pcm_access_mask_t *mask, snd_pcm_access_t val)
 test the presence of an access type in a snd_pcm_access_mask_t

int snd_pcm_access_mask_empty (const snd_pcm_access_mask_t *mask)
 test, if given a snd_pcm_access_mask_t is empty

void snd_pcm_access_mask_set (snd_pcm_access_mask_t *mask, snd_pcm_access_t val)
 make an access type present in a snd_pcm_access_mask_t

void snd_pcm_access_mask_reset (snd_pcm_access_mask_t *mask, snd_pcm_access_t val)
 make an access type missing from a snd_pcm_access_mask_t

size_t snd_pcm_format_mask_sizeof ()
 get size of snd_pcm_format_mask_t

int snd_pcm_format_mask_malloc (snd_pcm_format_mask_t **ptr)
 allocate an empty snd_pcm_format_mask_t using standard malloc

void snd_pcm_format_mask_free (snd_pcm_format_mask_t *obj)
 frees a previously allocated snd_pcm_format_mask_t

void snd_pcm_format_mask_copy (snd_pcm_format_mask_t *dst, const snd_pcm_format_mask_t *src)
 copy one snd_pcm_format_mask_t to another

void snd_pcm_format_mask_none (snd_pcm_format_mask_t *mask)
 reset all bits in a snd_pcm_format_mask_t

void snd_pcm_format_mask_any (snd_pcm_format_mask_t *mask)
 set all bits in a snd_pcm_format_mask_t

int snd_pcm_format_mask_test (const snd_pcm_format_mask_t *mask, snd_pcm_format_t val)
 test the presence of a format in a snd_pcm_format_mask_t

int snd_pcm_format_mask_empty (const snd_pcm_format_mask_t *mask)
 test, if given a snd_pcm_format_mask_t is empty

void snd_pcm_format_mask_set (snd_pcm_format_mask_t *mask, snd_pcm_format_t val)
 make a format present in a snd_pcm_format_mask_t

void snd_pcm_format_mask_reset (snd_pcm_format_mask_t *mask, snd_pcm_format_t val)
 make a format missing from a snd_pcm_format_mask_t

size_t snd_pcm_subformat_mask_sizeof ()
 get size of snd_pcm_subformat_mask_t

int snd_pcm_subformat_mask_malloc (snd_pcm_subformat_mask_t **ptr)
 allocate an empty snd_pcm_subformat_mask_t using standard malloc

void snd_pcm_subformat_mask_free (snd_pcm_subformat_mask_t *obj)
 frees a previously allocated snd_pcm_subformat_mask_t

void snd_pcm_subformat_mask_copy (snd_pcm_subformat_mask_t *dst, const snd_pcm_subformat_mask_t *src)
 copy one snd_pcm_subformat_mask_t to another

void snd_pcm_subformat_mask_none (snd_pcm_subformat_mask_t *mask)
 reset all bits in a snd_pcm_subformat_mask_t

void snd_pcm_subformat_mask_any (snd_pcm_subformat_mask_t *mask)
 set all bits in a snd_pcm_subformat_mask_t

int snd_pcm_subformat_mask_test (const snd_pcm_subformat_mask_t *mask, snd_pcm_subformat_t val)
 test the presence of a subformat in a snd_pcm_subformat_mask_t

int snd_pcm_subformat_mask_empty (const snd_pcm_subformat_mask_t *mask)
 test, if given a snd_pcm_subformat_mask_t is empty

void snd_pcm_subformat_mask_set (snd_pcm_subformat_mask_t *mask, snd_pcm_subformat_t val)
 make a subformat present in a snd_pcm_subformat_mask_t

void snd_pcm_subformat_mask_reset (snd_pcm_subformat_mask_t *mask, snd_pcm_subformat_t val)
 make a subformat missing from a snd_pcm_subformat_mask_t

size_t snd_pcm_hw_params_sizeof ()
 get size of snd_pcm_hw_params_t

int snd_pcm_hw_params_malloc (snd_pcm_hw_params_t **ptr)
 allocate an invalid snd_pcm_hw_params_t using standard malloc

void snd_pcm_hw_params_free (snd_pcm_hw_params_t *obj)
 frees a previously allocated snd_pcm_hw_params_t

void snd_pcm_hw_params_copy (snd_pcm_hw_params_t *dst, const snd_pcm_hw_params_t *src)
 copy one snd_pcm_hw_params_t to another

int snd_pcm_hw_params_get_access (const snd_pcm_hw_params_t *params, snd_pcm_access_t *access)
 Extract access type from a configuration space.

int snd_pcm_hw_params_test_access (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t access)
 Verify if an access type is available inside a configuration space for a PCM.

int snd_pcm_hw_params_set_access (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t access)
 Restrict a configuration space to contain only one access type.

int snd_pcm_hw_params_set_access_first (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t *access)
 Restrict a configuration space to contain only its first access type.

int snd_pcm_hw_params_set_access_last (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t *access)
 Restrict a configuration space to contain only its last access type.

int snd_pcm_hw_params_set_access_mask (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_mask_t *mask)
 Restrict a configuration space to contain only a set of access types.

int snd_pcm_hw_params_get_access_mask (snd_pcm_hw_params_t *params, snd_pcm_access_mask_t *mask)
 Get access mask from a configuration space.

int snd_pcm_hw_params_get_format (const snd_pcm_hw_params_t *params, snd_pcm_format_t *format)
 Extract format from a configuration space.

int snd_pcm_hw_params_test_format (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t format)
 Verify if a format is available inside a configuration space for a PCM.

int snd_pcm_hw_params_set_format (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t format)
 Restrict a configuration space to contain only one format.

int snd_pcm_hw_params_set_format_first (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t *format)
 Restrict a configuration space to contain only its first format.

int snd_pcm_hw_params_set_format_last (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t *format)
 Restrict a configuration space to contain only its last format.

int snd_pcm_hw_params_set_format_mask (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_mask_t *mask)
 Restrict a configuration space to contain only a set of formats.

void snd_pcm_hw_params_get_format_mask (snd_pcm_hw_params_t *params, snd_pcm_format_mask_t *mask)
 Get format mask from a configuration space.

int snd_pcm_hw_params_get_subformat (const snd_pcm_hw_params_t *params, snd_pcm_subformat_t *subformat)
 Extract subformat from a configuration space.

int snd_pcm_hw_params_test_subformat (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t subformat)
 Verify if a subformat is available inside a configuration space for a PCM.

int snd_pcm_hw_params_set_subformat (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t subformat)
 Restrict a configuration space to contain only one subformat.

int snd_pcm_hw_params_set_subformat_first (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t *subformat)
 Restrict a configuration space to contain only its first subformat.

int snd_pcm_hw_params_set_subformat_last (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t *subformat)
 Restrict a configuration space to contain only its last subformat.

int snd_pcm_hw_params_set_subformat_mask (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_mask_t *mask)
 Restrict a configuration space to contain only a set of subformats.

void snd_pcm_hw_params_get_subformat_mask (snd_pcm_hw_params_t *params, snd_pcm_subformat_mask_t *mask)
 Get subformat mask from a configuration space.

int snd_pcm_hw_params_get_channels (const snd_pcm_hw_params_t *params, unsigned int *val)
 Extract channels from a configuration space.

int snd_pcm_hw_params_get_channels_min (const snd_pcm_hw_params_t *params, unsigned int *val)
 Extract minimum channels count from a configuration space.

int snd_pcm_hw_params_get_channels_max (const snd_pcm_hw_params_t *params, unsigned int *val)
 Extract maximum channels count from a configuration space.

int snd_pcm_hw_params_test_channels (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val)
 Verify if a channels count is available inside a configuration space for a PCM.

int snd_pcm_hw_params_set_channels (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val)
 Restrict a configuration space to contain only one channels count.

int snd_pcm_hw_params_set_channels_min (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val)
 Restrict a configuration space with a minimum channels count.

int snd_pcm_hw_params_set_channels_max (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val)
 Restrict a configuration space with a maximum channels count.

int snd_pcm_hw_params_set_channels_minmax (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *min, unsigned int *max)
 Restrict a configuration space to have channels counts in a given range.

int snd_pcm_hw_params_set_channels_near (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val)
 Restrict a configuration space to have channels count nearest to a target.

int snd_pcm_hw_params_set_channels_first (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val)
 Restrict a configuration space to contain only its minimum channels count.

int snd_pcm_hw_params_set_channels_last (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val)
 Restrict a configuration space to contain only its maximum channels count.

int snd_pcm_hw_params_get_rate (const snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
 Extract rate from a configuration space.

int snd_pcm_hw_params_get_rate_min (const snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
 Extract minimum rate from a configuration space.

int snd_pcm_hw_params_get_rate_max (const snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
 Extract maximum rate from a configuration space.

int snd_pcm_hw_params_test_rate (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir)
 Verify if a rate is available inside a configuration space for a PCM.

int snd_pcm_hw_params_set_rate (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir)
 Restrict a configuration space to contain only one rate.

int snd_pcm_hw_params_set_rate_min (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
 Restrict a configuration space with a minimum rate.

int snd_pcm_hw_params_set_rate_max (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
 Restrict a configuration space with a maximum rate.

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)
 Restrict a configuration space to have rates in a given range.

int snd_pcm_hw_params_set_rate_near (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
 Restrict a configuration space to have rate nearest to a target.

int snd_pcm_hw_params_set_rate_first (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
 Restrict a configuration space to contain only its minimum rate.

int snd_pcm_hw_params_set_rate_last (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
 Restrict a configuration space to contain only its maximum rate.

int snd_pcm_hw_params_get_period_time (const snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
 Extract period time from a configuration space.

int snd_pcm_hw_params_get_period_time_min (const snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
 Extract minimum period time from a configuration space.

int snd_pcm_hw_params_get_period_time_max (const snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
 Extract maximum period time from a configuration space.

int snd_pcm_hw_params_test_period_time (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir)
 Verify if a period time is available inside a configuration space for a PCM.

int snd_pcm_hw_params_set_period_time (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir)
 Restrict a configuration space to contain only one period time.

int snd_pcm_hw_params_set_period_time_min (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
 Restrict a configuration space with a minimum period time.

int snd_pcm_hw_params_set_period_time_max (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
 Restrict a configuration space with a maximum period time.

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)
 Restrict a configuration space to have period times in a given range.

int snd_pcm_hw_params_set_period_time_near (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
 Restrict a configuration space to have period time nearest to a target.

int snd_pcm_hw_params_set_period_time_first (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
 Restrict a configuration space to contain only its minimum period time.

int snd_pcm_hw_params_set_period_time_last (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
 Restrict a configuration space to contain only its maximum period time.

int snd_pcm_hw_params_get_period_size (const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val, int *dir)
 Extract period size from a configuration space.

int snd_pcm_hw_params_get_period_size_min (const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val, int *dir)
 Extract minimum period size from a configuration space.

int snd_pcm_hw_params_get_period_size_max (const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val, int *dir)
 Extract maximum period size from a configuration space.

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)
 Verify if a period size is available inside a configuration space for a PCM.

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)
 Restrict a configuration space to contain only one period size.

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)
 Restrict a configuration space with a minimum period size.

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)
 Restrict a configuration space with a maximum period size.

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)
 Restrict a configuration space to have period sizes in a given range.

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)
 Restrict a configuration space to have period size nearest to a target.

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)
 Restrict a configuration space to contain only its minimum period size.

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)
 Restrict a configuration space to contain only its maximum period size.

int snd_pcm_hw_params_set_period_size_integer (snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
 Restrict a configuration space to contain only integer period sizes.

int snd_pcm_hw_params_get_periods (const snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
 Extract periods from a configuration space.

int snd_pcm_hw_params_get_periods_min (const snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
 Extract minimum periods count from a configuration space.

int snd_pcm_hw_params_get_periods_max (const snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
 Extract maximum periods count from a configuration space.

int snd_pcm_hw_params_test_periods (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir)
 Verify if a periods count is available inside a configuration space for a PCM.

int snd_pcm_hw_params_set_periods (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir)
 Restrict a configuration space to contain only one periods count.

int snd_pcm_hw_params_set_periods_min (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
 Restrict a configuration space with a minimum periods count.

int snd_pcm_hw_params_set_periods_max (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
 Restrict a configuration space with a maximum periods count.

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)
 Restrict a configuration space to have periods counts in a given range.

int snd_pcm_hw_params_set_periods_near (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
 Restrict a configuration space to have periods count nearest to a target.

int snd_pcm_hw_params_set_periods_first (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
 Restrict a configuration space to contain only its minimum periods count.

int snd_pcm_hw_params_set_periods_last (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
 Restrict a configuration space to contain only its maximum periods count.

int snd_pcm_hw_params_set_periods_integer (snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
 Restrict a configuration space to contain only integer periods counts.

int snd_pcm_hw_params_get_buffer_time (const snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
 Extract buffer time from a configuration space.

int snd_pcm_hw_params_get_buffer_time_min (const snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
 Extract minimum buffer time from a configuration space.

int snd_pcm_hw_params_get_buffer_time_max (const snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
 Extract maximum buffer time from a configuration space.

int snd_pcm_hw_params_test_buffer_time (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir)
 Verify if a buffer time is available inside a configuration space for a PCM.

int snd_pcm_hw_params_set_buffer_time (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir)
 Restrict a configuration space to contain only one buffer time.

int snd_pcm_hw_params_set_buffer_time_min (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
 Restrict a configuration space with a minimum buffer time.

int snd_pcm_hw_params_set_buffer_time_max (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
 Restrict a configuration space with a maximum buffer time.

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)
 Restrict a configuration space to have buffer times in a given range.

int snd_pcm_hw_params_set_buffer_time_near (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
 Restrict a configuration space to have buffer time nearest to a target.

int snd_pcm_hw_params_set_buffer_time_first (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
 Restrict a configuration space to contain only its minimum buffer time.

int snd_pcm_hw_params_set_buffer_time_last (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
 Restrict a configuration space to contain only its maximum buffered time.

int snd_pcm_hw_params_get_buffer_size (const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val)
 Extract buffer size from a configuration space.

int snd_pcm_hw_params_get_buffer_size_min (const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val)
 Extract minimum buffer size from a configuration space.

int snd_pcm_hw_params_get_buffer_size_max (const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val)
 Extract maximum buffer size from a configuration space.

int snd_pcm_hw_params_test_buffer_size (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t val)
 Verify if a buffer size is available inside a configuration space for a PCM.

int snd_pcm_hw_params_set_buffer_size (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t val)
 Restrict a configuration space to contain only one buffer size.

int snd_pcm_hw_params_set_buffer_size_min (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val)
 Restrict a configuration space with a minimum buffer size.

int snd_pcm_hw_params_set_buffer_size_max (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val)
 Restrict a configuration space with a maximum buffer size.

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)
 Restrict a configuration space to have buffer sizes in a given range.

int snd_pcm_hw_params_set_buffer_size_near (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val)
 Restrict a configuration space to have buffer size nearest to a target.

int snd_pcm_hw_params_set_buffer_size_first (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val)
 Restrict a configuration space to contain only its minimum buffer size.

int snd_pcm_hw_params_set_buffer_size_last (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val)
 Restrict a configuration space to contain only its maximum buffer size.

int snd_pcm_hw_params_get_tick_time (const snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
 Extract tick time from a configuration space.

int snd_pcm_hw_params_get_tick_time_min (const snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
 Extract minimum tick time from a configuration space.

int snd_pcm_hw_params_get_tick_time_max (const snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
 Extract maximum tick time from a configuration space.

int snd_pcm_hw_params_test_tick_time (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir)
 Verify if a tick time is available inside a configuration space for a PCM.

int snd_pcm_hw_params_set_tick_time (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir)
 Restrict a configuration space to contain only one tick time.

int snd_pcm_hw_params_set_tick_time_min (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
 Restrict a configuration space with a minimum tick time.

int snd_pcm_hw_params_set_tick_time_max (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
 Restrict a configuration space with a maximum tick time.

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)
 Restrict a configuration space to have tick times in a given range.

int snd_pcm_hw_params_set_tick_time_near (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
 Restrict a configuration space to have tick time nearest to a target.

int snd_pcm_hw_params_set_tick_time_first (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
 Restrict a configuration space to contain only its minimum tick time.

int snd_pcm_hw_params_set_tick_time_last (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir)
 Restrict a configuration space to contain only its maximum tick time.

int snd_pcm_hw_params_get_min_align (const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val)
 Get the minimum transfer align value in samples.

int snd_pcm_sw_params_current (snd_pcm_t *pcm, snd_pcm_sw_params_t *params)
 Return current software configuration for a PCM.

int snd_pcm_sw_params_dump (snd_pcm_sw_params_t *params, snd_output_t *out)
 Dump a software configuration.

size_t snd_pcm_sw_params_sizeof ()
 get size of snd_pcm_sw_params_t

int snd_pcm_sw_params_malloc (snd_pcm_sw_params_t **ptr)
 allocate an invalid snd_pcm_sw_params_t using standard malloc

void snd_pcm_sw_params_free (snd_pcm_sw_params_t *obj)
 frees a previously allocated snd_pcm_sw_params_t

void snd_pcm_sw_params_copy (snd_pcm_sw_params_t *dst, const snd_pcm_sw_params_t *src)
 copy one snd_pcm_sw_params_t to another

int snd_pcm_sw_params_set_start_mode (snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_start_t val)
 (DEPRECATED) Set start mode inside a software configuration container

snd_pcm_start_t snd_pcm_sw_params_get_start_mode (const snd_pcm_sw_params_t *params)
 (DEPRECATED) Get start mode from a software configuration container

int snd_pcm_sw_params_set_xrun_mode (snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_xrun_t val)
 (DEPRECATED) Set xrun mode inside a software configuration container

snd_pcm_xrun_t snd_pcm_sw_params_get_xrun_mode (const snd_pcm_sw_params_t *params)
 (DEPRECATED) Get xrun mode from a software configuration container

int snd_pcm_sw_params_set_tstamp_mode (snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_tstamp_t val)
 Set timestamp mode inside a software configuration container.

int snd_pcm_sw_params_get_tstamp_mode (const snd_pcm_sw_params_t *params, snd_pcm_tstamp_t *val)
 Get timestamp mode from a software configuration container.

int snd_pcm_sw_params_set_sleep_min (snd_pcm_t *pcm, snd_pcm_sw_params_t *params, unsigned int val)
 Set minimum number of ticks to sleep inside a software configuration container.

int snd_pcm_sw_params_get_sleep_min (const snd_pcm_sw_params_t *params, unsigned int *val)
 Get minimum numbers of ticks to sleep from a software configuration container.

int snd_pcm_sw_params_set_avail_min (snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val)
 Set avail min inside a software configuration container.

int snd_pcm_sw_params_get_avail_min (const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val)
 Get avail min from a software configuration container.

int snd_pcm_sw_params_set_xfer_align (snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val)
 Set xfer align inside a software configuration container.

int snd_pcm_sw_params_get_xfer_align (const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val)
 Get xfer align from a software configuration container.

int snd_pcm_sw_params_set_start_threshold (snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val)
 Set start threshold inside a software configuration container.

int snd_pcm_sw_params_get_start_threshold (const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val)
 Get start threshold from a software configuration container.

int snd_pcm_sw_params_set_stop_threshold (snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val)
 Set stop threshold inside a software configuration container.

int snd_pcm_sw_params_get_stop_threshold (const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val)
 Get stop threshold from a software configuration container.

int snd_pcm_sw_params_set_silence_threshold (snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val)
 Set silence threshold inside a software configuration container.

int snd_pcm_sw_params_get_silence_threshold (const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val)
 Get silence threshold from a software configuration container.

int snd_pcm_sw_params_set_silence_size (snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val)
 Set silence size inside a software configuration container.

int snd_pcm_sw_params_get_silence_size (const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val)
 Get silence size from a software configuration container.

size_t snd_pcm_status_sizeof ()
 get size of snd_pcm_status_t

int snd_pcm_status_malloc (snd_pcm_status_t **ptr)
 allocate an invalid snd_pcm_status_t using standard malloc

void snd_pcm_status_free (snd_pcm_status_t *obj)
 frees a previously allocated snd_pcm_status_t

void snd_pcm_status_copy (snd_pcm_status_t *dst, const snd_pcm_status_t *src)
 copy one snd_pcm_status_t to another

snd_pcm_state_t snd_pcm_status_get_state (const snd_pcm_status_t *obj)
 Get state from a PCM status container (see snd_pcm_state).

void snd_pcm_status_get_trigger_tstamp (const snd_pcm_status_t *obj, snd_timestamp_t *ptr)
 Get trigger timestamp from a PCM status container.

void snd_pcm_status_get_trigger_htstamp (const snd_pcm_status_t *obj, snd_htimestamp_t *ptr)
 Get trigger hi-res timestamp from a PCM status container.

void snd_pcm_status_get_tstamp (const snd_pcm_status_t *obj, snd_timestamp_t *ptr)
 Get "now" timestamp from a PCM status container.

void snd_pcm_status_get_htstamp (const snd_pcm_status_t *obj, snd_htimestamp_t *ptr)
 Get "now" hi-res timestamp from a PCM status container.

snd_pcm_sframes_t snd_pcm_status_get_delay (const snd_pcm_status_t *obj)
 Get delay from a PCM status container (see snd_pcm_delay).

snd_pcm_uframes_t snd_pcm_status_get_avail (const snd_pcm_status_t *obj)
 Get number of frames available from a PCM status container (see snd_pcm_avail_update).

snd_pcm_uframes_t snd_pcm_status_get_avail_max (const snd_pcm_status_t *obj)
 Get maximum number of frames available from a PCM status container after last snd_pcm_status call.

snd_pcm_uframes_t snd_pcm_status_get_overrange (const snd_pcm_status_t *obj)
 Get count of ADC overrange detections since last call.

size_t snd_pcm_info_sizeof ()
 get size of snd_pcm_info_t

int snd_pcm_info_malloc (snd_pcm_info_t **ptr)
 allocate an invalid snd_pcm_info_t using standard malloc

void snd_pcm_info_free (snd_pcm_info_t *obj)
 frees a previously allocated snd_pcm_info_t

void snd_pcm_info_copy (snd_pcm_info_t *dst, const snd_pcm_info_t *src)
 copy one snd_pcm_info_t to another

unsigned int snd_pcm_info_get_device (const snd_pcm_info_t *obj)
 Get device from a PCM info container.

unsigned int snd_pcm_info_get_subdevice (const snd_pcm_info_t *obj)
 Get subdevice from a PCM info container.

snd_pcm_stream_t snd_pcm_info_get_stream (const snd_pcm_info_t *obj)
 Get stream (direction) from a PCM info container.

int snd_pcm_info_get_card (const snd_pcm_info_t *obj)
 Get card from a PCM info container.

const char * snd_pcm_info_get_id (const snd_pcm_info_t *obj)
 Get id from a PCM info container.

const char * snd_pcm_info_get_name (const snd_pcm_info_t *obj)
 Get name from a PCM info container.

const char * snd_pcm_info_get_subdevice_name (const snd_pcm_info_t *obj)
 Get subdevice name from a PCM info container.

snd_pcm_class_t snd_pcm_info_get_class (const snd_pcm_info_t *obj)
 Get class from a PCM info container.

snd_pcm_subclass_t snd_pcm_info_get_subclass (const snd_pcm_info_t *obj)
 Get subclass from a PCM info container.

unsigned int snd_pcm_info_get_subdevices_count (const snd_pcm_info_t *obj)
 Get subdevices count from a PCM info container.

unsigned int snd_pcm_info_get_subdevices_avail (const snd_pcm_info_t *obj)
 Get available subdevices count from a PCM info container.

snd_pcm_sync_id_t snd_pcm_info_get_sync (const snd_pcm_info_t *obj)
 Get hardware synchronization ID from a PCM info container.

void snd_pcm_info_set_device (snd_pcm_info_t *obj, unsigned int val)
 Set wanted device inside a PCM info container (see snd_ctl_pcm_info).

void snd_pcm_info_set_subdevice (snd_pcm_info_t *obj, unsigned int val)
 Set wanted subdevice inside a PCM info container (see snd_ctl_pcm_info).

void snd_pcm_info_set_stream (snd_pcm_info_t *obj, snd_pcm_stream_t val)
 Set wanted stream inside a PCM info container (see snd_ctl_pcm_info).

int snd_pcm_mmap_begin (snd_pcm_t *pcm, const snd_pcm_channel_area_t **areas, snd_pcm_uframes_t *offset, snd_pcm_uframes_t *frames)
 Application request to access a portion of direct (mmap) area.

snd_pcm_sframes_t snd_pcm_mmap_commit (snd_pcm_t *pcm, snd_pcm_uframes_t offset, snd_pcm_uframes_t frames)
 Application has completed the access to area requested with snd_pcm_mmap_begin.


Detailed Description

PCM Interface.

Author:
Jaroslav Kysela <perex@suse.cz> , Abramo Bagnara <abramo@alsa-project.org>
Date:
2000-2001
PCM Interface is designed to write or read digital audio frames. A frame is the data unit converted into/from sound in one time unit (1/rate seconds), by example if you set your playback PCM rate to 44100 you'll hear 44100 frames per second. The size in bytes of a frame may be obtained from bits needed to store a sample and channels count.

See the PCM (digital audio) interface page for more details.


Function Documentation

int snd_async_add_pcm_handler snd_async_handler_t **    handler,
snd_pcm_t   pcm,
snd_async_callback_t    callback,
void *    private_data
 

Add an async handler for a PCM.

Parameters:
handler  Returned handler handle
pcm  PCM handle
callback  Callback function
private_data  Callback private data
Returns:
0 otherwise a negative error code on failure
The asynchronous callback is called when period boundary elapses.

snd_pcm_t* snd_async_handler_get_pcm snd_async_handler_t   handler
 

Return PCM handle related to an async handler.

Parameters:
handler  Async handler handle
Returns:
PCM handle

void snd_pcm_access_mask_any snd_pcm_access_mask_t   mask
 

set all bits in a snd_pcm_access_mask_t

Parameters:
mask  pointer to mask

void snd_pcm_access_mask_copy snd_pcm_access_mask_t   dst,
const snd_pcm_access_mask_t   src
 

copy one snd_pcm_access_mask_t to another

Parameters:
dst  pointer to destination
src  pointer to source

int snd_pcm_access_mask_empty const snd_pcm_access_mask_t   mask
 

test, if given a snd_pcm_access_mask_t is empty

Parameters:
mask  pointer to mask
Return values:
0  not empty
1  empty

void snd_pcm_access_mask_free snd_pcm_access_mask_t   obj
 

frees a previously allocated snd_pcm_access_mask_t

Parameters:
pointer  to object to free

int snd_pcm_access_mask_malloc snd_pcm_access_mask_t **    ptr
 

allocate an empty snd_pcm_access_mask_t using standard malloc

Parameters:
ptr  returned pointer
Returns:
0 on success otherwise negative error code

void snd_pcm_access_mask_none snd_pcm_access_mask_t   mask
 

reset all bits in a snd_pcm_access_mask_t

Parameters:
mask  pointer to mask

void snd_pcm_access_mask_reset snd_pcm_access_mask_t   mask,
snd_pcm_access_t    val
 

make an access type missing from a snd_pcm_access_mask_t

Parameters:
mask  pointer to mask
val  access type

void snd_pcm_access_mask_set snd_pcm_access_mask_t   mask,
snd_pcm_access_t    val
 

make an access type present in a snd_pcm_access_mask_t

Parameters:
mask  pointer to mask
val  access type

size_t snd_pcm_access_mask_sizeof void   
 

get size of snd_pcm_access_mask_t

Returns:
size in bytes

int snd_pcm_access_mask_test const snd_pcm_access_mask_t   mask,
snd_pcm_access_t    val
 

test the presence of an access type in a snd_pcm_access_mask_t

Parameters:
mask  pointer to mask
val  access type

const char* snd_pcm_access_name snd_pcm_access_t    acc
 

get name of PCM access type

Parameters:
access  PCM access type
Returns:
ascii name of PCM access type

int snd_pcm_area_copy const snd_pcm_channel_area_t   dst_area,
snd_pcm_uframes_t    dst_offset,
const snd_pcm_channel_area_t   src_area,
snd_pcm_uframes_t    src_offset,
unsigned int    samples,
snd_pcm_format_t    format
 

Copy an area.

Parameters:
dst_area  destination area specification
dst_offset  offset in frames inside destination area
src_area  source area specification
src_offset  offset in frames inside source area
samples  samples to copy
format  PCM sample format
Returns:
0 on success otherwise a negative error code

int snd_pcm_area_silence const snd_pcm_channel_area_t   dst_area,
snd_pcm_uframes_t    dst_offset,
unsigned int    samples,
snd_pcm_format_t    format
 

Silence an area.

Parameters:
dst_area  area specification
dst_offset  offset in frames inside area
samples  samples to silence
format  PCM sample format
Returns:
0 on success otherwise a negative error code

int snd_pcm_areas_copy const snd_pcm_channel_area_t   dst_areas,
snd_pcm_uframes_t    dst_offset,
const snd_pcm_channel_area_t   src_areas,
snd_pcm_uframes_t    src_offset,
unsigned int    channels,
snd_pcm_uframes_t    frames,
snd_pcm_format_t    format
 

Copy one or more areas.

Parameters:
dst_areas  destination areas specification (one for each channel)
dst_offset  offset in frames inside destination area
src_areas  source areas specification (one for each channel)
src_offset  offset in frames inside source area
channels  channels count
frames  frames to copy
format  PCM sample format
Returns:
0 on success otherwise a negative error code

int snd_pcm_areas_silence const snd_pcm_channel_area_t   dst_areas,
snd_pcm_uframes_t    dst_offset,
unsigned int    channels,
snd_pcm_uframes_t    frames,
snd_pcm_format_t    format
 

Silence one or more areas.

Parameters:
dst_areas  areas specification (one for each channel)
dst_offset  offset in frames inside area
channels  channels count
frames  frames to silence
format  PCM sample format
Returns:
0 on success otherwise a negative error code

snd_pcm_sframes_t snd_pcm_avail_update snd_pcm_t   pcm
 

Return number of frames ready to be read/written.

Parameters:
pcm  PCM handle
Returns:
a positive number of frames ready otherwise a negative error code
On capture does all the actions needed to transport to application level all the ready frames across underlying layers.

snd_pcm_sframes_t snd_pcm_bytes_to_frames snd_pcm_t   pcm,
ssize_t    bytes
 

Convert bytes in frames for a PCM.

Parameters:
pcm  PCM handle
bytes  quantity in bytes
Returns:
quantity expressed in frames

long snd_pcm_bytes_to_samples snd_pcm_t   pcm,
ssize_t    bytes
 

Convert bytes in samples for a PCM.

Parameters:
pcm  PCM handle
bytes  quantity in bytes
Returns:
quantity expressed in samples

int snd_pcm_close snd_pcm_t   pcm
 

close PCM handle

Parameters:
pcm  PCM handle
Returns:
0 on success otherwise a negative error code
Closes the specified PCM handle and frees all associated resources.

int snd_pcm_delay snd_pcm_t   pcm,
snd_pcm_sframes_t   delayp
 

Obtain delay for a running PCM handle.

Parameters:
pcm  PCM handle
delayp  Returned delay in frames
Returns:
0 on success otherwise a negative error code
Delay is distance between current application frame position and sound frame position. It's positive and less than buffer size in normal situation, negative on playback underrun and greater than buffer size on capture overrun.

Note this function does not update the actual r/w pointer for applications. The function snd_pcm_avail_update() have to be called before any read/write/begin+commit operation.

int snd_pcm_drain snd_pcm_t   pcm
 

Stop a PCM preserving pending frames.

Parameters:
pcm  PCM handle
Returns:
0 on success otherwise a negative error code
Return values:
-ESTRPIPE  a suspend event occurred
For playback wait for all pending frames to be played and then stop the PCM. For capture stop PCM permitting to retrieve residual frames.

int snd_pcm_drop snd_pcm_t   pcm
 

Stop a PCM dropping pending frames.

Parameters:
pcm  PCM handle
Returns:
0 on success otherwise a negative error code

int snd_pcm_dump snd_pcm_t   pcm,
snd_output_t   out
 

Dump PCM info.

Parameters:
pcm  PCM handle
out  Output handle
Returns:
0 on success otherwise a negative error code

int snd_pcm_dump_hw_setup snd_pcm_t   pcm,
snd_output_t   out
 

Dump current hardware setup for PCM.

Parameters:
pcm  PCM handle
out  Output handle
Returns:
0 on success otherwise a negative error code

int snd_pcm_dump_setup snd_pcm_t   pcm,
snd_output_t   out
 

Dump current setup (hardware and software) for PCM.

Parameters:
pcm  PCM handle
out  Output handle
Returns:
0 on success otherwise a negative error code

int snd_pcm_dump_sw_setup snd_pcm_t   pcm,
snd_output_t   out
 

Dump current software setup for PCM.

Parameters:
pcm  PCM handle
out  Output handle
Returns:
0 on success otherwise a negative error code

const char* snd_pcm_format_description snd_pcm_format_t    format
 

get description of PCM sample format

Parameters:
format  PCM sample format
Returns:
ascii description of PCM sample format

void snd_pcm_format_mask_any snd_pcm_format_mask_t   mask
 

set all bits in a snd_pcm_format_mask_t

Parameters:
mask  pointer to mask

void snd_pcm_format_mask_copy snd_pcm_format_mask_t   dst,
const snd_pcm_format_mask_t   src
 

copy one snd_pcm_format_mask_t to another

Parameters:
dst  pointer to destination
src  pointer to source

int snd_pcm_format_mask_empty const snd_pcm_format_mask_t   mask
 

test, if given a snd_pcm_format_mask_t is empty

Parameters:
mask  pointer to mask
Return values:
0  not empty
1  empty

void snd_pcm_format_mask_free snd_pcm_format_mask_t   obj
 

frees a previously allocated snd_pcm_format_mask_t

Parameters:
pointer  to object to free

int snd_pcm_format_mask_malloc snd_pcm_format_mask_t **    ptr
 

allocate an empty snd_pcm_format_mask_t using standard malloc

Parameters:
ptr  returned pointer
Returns:
0 on success otherwise negative error code

void snd_pcm_format_mask_none snd_pcm_format_mask_t   mask
 

reset all bits in a snd_pcm_format_mask_t

Parameters:
mask  pointer to mask

void snd_pcm_format_mask_reset snd_pcm_format_mask_t   mask,
snd_pcm_format_t    val
 

make a format missing from a snd_pcm_format_mask_t

Parameters:
mask  pointer to mask
val  format

void snd_pcm_format_mask_set snd_pcm_format_mask_t   mask,
snd_pcm_format_t    val
 

make a format present in a snd_pcm_format_mask_t

Parameters:
mask  pointer to mask
val  format

size_t snd_pcm_format_mask_sizeof void   
 

get size of snd_pcm_format_mask_t

Returns:
size in bytes

int snd_pcm_format_mask_test const snd_pcm_format_mask_t   mask,
snd_pcm_format_t    val
 

test the presence of a format in a snd_pcm_format_mask_t

Parameters:
mask  pointer to mask
val  format

const char* snd_pcm_format_name snd_pcm_format_t    format
 

get name of PCM sample format

Parameters:
format  PCM sample format
Returns:
ascii name of PCM sample format

snd_pcm_format_t snd_pcm_format_value const char *    name
 

get PCM sample format from name

Parameters:
name  PCM sample format name (case insensitive)
Returns:
PCM sample format

snd_pcm_sframes_t snd_pcm_forward snd_pcm_t   pcm,
snd_pcm_uframes_t    frames
 

Move application frame position forward.

Parameters:
pcm  PCM handle
frames  wanted skip in frames
Returns:
a positive number for actual skip otherwise a negative error code

ssize_t snd_pcm_frames_to_bytes snd_pcm_t   pcm,
snd_pcm_sframes_t    frames
 

Convert frames in bytes for a PCM.

Parameters:
pcm  PCM handle
frames  quantity in frames
Returns:
quantity expressed in bytes

int snd_pcm_hw_free snd_pcm_t   pcm
 

Remove PCM hardware configuration and free associated resources.

Parameters:
pcm  PCM handle
Returns:
0 on success otherwise a negative error code

int snd_pcm_hw_params snd_pcm_t   pcm,
snd_pcm_hw_params_t   params
 

Install one PCM hardware configuration chosen from a configuration space and snd_pcm_prepare it.

Parameters:
pcm  PCM handle
params  Configuration space definition container
Returns:
0 on success otherwise a negative error code
The configuration is chosen fixing single parameters in this order: first access, first format, first subformat, min channels, min rate, min period time, max buffer size, min tick time

int snd_pcm_hw_params_any snd_pcm_t   pcm,
snd_pcm_hw_params_t   params
 

Fill params with a full configuration space for a PCM.

Parameters:
pcm  PCM handle
params  Configuration space

int snd_pcm_hw_params_can_mmap_sample_resolution const snd_pcm_hw_params_t   params
 

Check, if hardware supports sample-resolution mmap for given configuration.

Parameters:
param  Configuration space
Returns:
Boolean value
Return values:
0  Hardware doesn't support sample-resolution mmap
1  Hardware supports sample-resolution mmap
The return value is always one when given configuration is not exactly one. Usually, snd_pcm_hw_params() function chooses one configuration from the configuration space.

int snd_pcm_hw_params_can_overrange const snd_pcm_hw_params_t   params
 

Check, if hardware supports overrange detection.

Parameters:
param  Configuration space
Returns:
Boolean value
Return values:
0  Hardware doesn't support overrange detection
1  Hardware supports overrange detection
It is not allowed to call this function when given configuration is not exactly one. Usually, snd_pcm_hw_params() function chooses one configuration from the configuration space.

int snd_pcm_hw_params_can_pause const snd_pcm_hw_params_t   params
 

Check, if hardware supports pause.

Parameters:
param  Configuration space
Returns:
Boolean value
Return values:
0  Hardware doesn't support pause
1  Hardware supports pause
It is not allowed to call this function when given configuration is not exactly one. Usually, snd_pcm_hw_params() function chooses one configuration from the configuration space.

int snd_pcm_hw_params_can_resume const snd_pcm_hw_params_t   params
 

Check, if hardware supports resume.

Parameters:
param  Configuration space
Returns:
Boolean value
Return values:
0  Hardware doesn't support resume
1  Hardware supports resume
It is not allowed to call this function when given configuration is not exactly one. Usually, snd_pcm_hw_params() function chooses one configuration from the configuration space.

int snd_pcm_hw_params_can_sync_start const snd_pcm_hw_params_t   params
 

Check, if hardware supports synchronized start with sample resolution.

Parameters:
param  Configuration space
Returns:
Boolean value
Return values:
0  Hardware doesn't support synchronized start
1  Hardware supports synchronized start
It is not allowed to call this function when given configuration is not exactly one. Usually, snd_pcm_hw_params() function chooses one configuration from the configuration space.

void snd_pcm_hw_params_copy snd_pcm_hw_params_t   dst,
const snd_pcm_hw_params_t   src
 

copy one snd_pcm_hw_params_t to another

Parameters:
dst  pointer to destination
src  pointer to source

int snd_pcm_hw_params_current snd_pcm_t   pcm,
snd_pcm_hw_params_t   params
 

Retreive current PCM hardware configuration chosen with snd_pcm_hw_params.

Parameters:
pcm  PCM handle
params  Configuration space definition container
Returns:
0 on success otherwise a negative error code

int snd_pcm_hw_params_dump snd_pcm_hw_params_t   params,
snd_output_t   out
 

Dump a PCM hardware configuration space.

Parameters:
params  Configuration space
out  Output handle
Returns:
0 on success otherwise a negative error code

void snd_pcm_hw_params_free snd_pcm_hw_params_t   obj
 

frees a previously allocated snd_pcm_hw_params_t

Parameters:
pointer  to object to free

int snd_pcm_hw_params_get_access const snd_pcm_hw_params_t   params,
snd_pcm_access_t   access
 

Extract access type from a configuration space.

Parameters:
params  Configuration space
access  Returned value
Returns:
access type otherwise a negative error code if not exactly one is present
Note: To use this function add 'define ALSA_PCM_NEW_HW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

int snd_pcm_hw_params_get_access_mask snd_pcm_hw_params_t   params,
snd_pcm_access_mask_t   mask
 

Get access mask from a configuration space.

Parameters:
params  Configuration space
mask  Returned Access mask

int snd_pcm_hw_params_get_buffer_size const snd_pcm_hw_params_t   params,
snd_pcm_uframes_t   val
 

Extract buffer size from a configuration space.

Parameters:
params  Configuration space
val  Returned buffer size in frames
Returns:
0 otherwise a negative error code if not exactly one is present
Note: To use this function add 'define ALSA_PCM_NEW_HW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

int snd_pcm_hw_params_get_buffer_size_max const snd_pcm_hw_params_t   params,
snd_pcm_uframes_t   val
 

Extract maximum buffer size from a configuration space.

Parameters:
params  Configuration space
val  Returned approximate maximum buffer size in frames
dir  Sub unit direction
Returns:
0 otherwise a negative error code
Exact value is <,=,> the returned one following dir (-1,0,1)

Note: To use this function add 'define ALSA_PCM_NEW_HW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

int snd_pcm_hw_params_get_buffer_size_min const snd_pcm_hw_params_t   params,
snd_pcm_uframes_t   val
 

Extract minimum buffer size from a configuration space.

Parameters:
params  Configuration space
val  Returned approximate minimum buffer size in frames
dir  Sub unit direction
Returns:
0 otherwise a negative error code
Exact value is <,=,> the returned one following dir (-1,0,1)

Note: To use this function add 'define ALSA_PCM_NEW_HW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

int snd_pcm_hw_params_get_buffer_time const snd_pcm_hw_params_t   params,
unsigned int *    val,
int *    dir
 

Extract buffer time from a configuration space.

Parameters:
params  Configuration space
approximate  buffer duration in us
val  Returned buffer time in us
dir  Sub unit direction
Returns:
0 otherwise a negative error code if not exactly one is present
Actual exact value is <,=,> the approximate one following dir (-1, 0, 1)

Note: To use this function add 'define ALSA_PCM_NEW_HW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

int snd_pcm_hw_params_get_buffer_time_max const snd_pcm_hw_params_t   params,
unsigned int *    val,
int *    dir
 

Extract maximum buffer time from a configuration space.

Parameters:
params  Configuration space
val  approximate maximum buffer duration in us
dir  Sub unit direction
Returns:
0 otherwise a negative error code
Exact value is <,=,> the returned one following dir (-1,0,1)

Note: To use this function add 'define ALSA_PCM_NEW_HW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

int snd_pcm_hw_params_get_buffer_time_min const snd_pcm_hw_params_t   params,
unsigned int *    val,
int *    dir
 

Extract minimum buffer time from a configuration space.

Parameters:
params  Configuration space
val  approximate minimum buffer duration in us
dir  Sub unit direction
Returns:
0 otherwise a negative error code
Exact value is <,=,> the returned one following dir (-1,0,1)

Note: To use this function add 'define ALSA_PCM_NEW_HW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

int snd_pcm_hw_params_get_channels const snd_pcm_hw_params_t   params,
unsigned int *    val
 

Extract channels from a configuration space.

Parameters:
params  Configuration space
val  Returned channels count
Returns:
0 otherwise a negative error code if not exactly one is present
Note: To use this function add 'define ALSA_PCM_NEW_HW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

int snd_pcm_hw_params_get_channels_max const snd_pcm_hw_params_t   params,
unsigned int *    val
 

Extract maximum channels count from a configuration space.

Parameters:
params  Configuration space
val  maximum channels count
Returns:
0 otherwise a negative error code
Note: To use this function add 'define ALSA_PCM_NEW_HW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

int snd_pcm_hw_params_get_channels_min const snd_pcm_hw_params_t   params,
unsigned int *    val
 

Extract minimum channels count from a configuration space.

Parameters:
params  Configuration space
val  minimum channels count
Returns:
0 otherwise a negative error code
Note: To use this function add 'define ALSA_PCM_NEW_HW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

int snd_pcm_hw_params_get_fifo_size const snd_pcm_hw_params_t   params
 

Get hard are FIFO size info from a configuration space.

Parameters:
params  Configuration space
Returns:
FIFO size in frames otherwise a negative error code if the info is not available
It is not allowed to call this function when given configuration is not exactly one. Usually, snd_pcm_hw_params() function chooses one configuration from the configuration space.

int snd_pcm_hw_params_get_format const snd_pcm_hw_params_t   params,
snd_pcm_format_t   format
 

Extract format from a configuration space.

Parameters:
params  Configuration space
format  returned format
Returns:
format otherwise a negative error code if not exactly one is present
Note: To use this function add 'define ALSA_PCM_NEW_HW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

void snd_pcm_hw_params_get_format_mask snd_pcm_hw_params_t   params,
snd_pcm_format_mask_t   mask
 

Get format mask from a configuration space.

Parameters:
params  Configuration space
mask  Returned Format mask

int snd_pcm_hw_params_get_min_align const snd_pcm_hw_params_t   params,
snd_pcm_uframes_t   val
 

Get the minimum transfer align value in samples.

Parameters:
params  Configuration space
val  Returned minimum align value
Returns:
0 otherwise a negative error code if not exactly one is present

int snd_pcm_hw_params_get_period_size const snd_pcm_hw_params_t   params,
snd_pcm_uframes_t   val,
int *    dir
 

Extract period size from a configuration space.

Parameters:
params  Configuration space
val  Returned approximate period size in frames
dir  Sub unit direction
Returns:
0 otherwise a negative error code if not exactly one is present
Actual exact value is <,=,> the approximate one following dir (-1, 0, 1)

Note: To use this function add 'define ALSA_PCM_NEW_HW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

int snd_pcm_hw_params_get_period_size_max const snd_pcm_hw_params_t   params,
snd_pcm_uframes_t   val,
int *    dir
 

Extract maximum period size from a configuration space.

Parameters:
params  Configuration space
val  approximate minimum period size in frames
dir  Sub unit direction
Returns:
0 otherwise a negative error code
Exact value is <,=,> the returned one following dir (-1,0,1)

Note: To use this function add 'define ALSA_PCM_NEW_HW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

int snd_pcm_hw_params_get_period_size_min const snd_pcm_hw_params_t   params,
snd_pcm_uframes_t   val,
int *    dir
 

Extract minimum period size from a configuration space.

Parameters:
params  Configuration space
val  approximate minimum period size in frames
dir  Sub unit direction
Returns:
0 otherwise a negative error code
Exact value is <,=,> the returned one following dir (-1,0,1)

Note: To use this function add 'define ALSA_PCM_NEW_HW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

int snd_pcm_hw_params_get_period_time const snd_pcm_hw_params_t   params,
unsigned int *    val,
int *    dir
 

Extract period time from a configuration space.

Parameters:
params  Configuration space
val  Returned approximate period duration in us
dir  Sub unit direction
Returns:
0 otherwise a negative error code if not exactly one is present
Actual exact value is <,=,> the approximate one following dir (-1, 0, 1)

Note: To use this function add 'define ALSA_PCM_NEW_HW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

int snd_pcm_hw_params_get_period_time_max const snd_pcm_hw_params_t   params,
unsigned int *    val,
int *    dir
 

Extract maximum period time from a configuration space.

Parameters:
params  Configuration space
val  approximate maximum period duration in us
dir  Sub unit direction
Returns:
0 otherwise a negative error code
Exact value is <,=,> the returned one following dir (-1,0,1)

Note: To use this function add 'define ALSA_PCM_NEW_HW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

int snd_pcm_hw_params_get_period_time_min const snd_pcm_hw_params_t   params,
unsigned int *    val,
int *    dir
 

Extract minimum period time from a configuration space.

Parameters:
params  Configuration space
val  approximate minimum period duration in us
dir  Sub unit direction
Returns:
0 otherwise a negative error code
Exact value is <,=,> the returned one following dir (-1,0,1)

Note: To use this function add 'define ALSA_PCM_NEW_HW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

int snd_pcm_hw_params_get_periods const snd_pcm_hw_params_t   params,
unsigned int *    val,
int *    dir
 

Extract periods from a configuration space.

Parameters:
params  Configuration space
val  approximate periods per buffer
dir  Sub unit direction
Returns:
0 otherwise a negative error code if not exactly one is present
Actual exact value is <,=,> the approximate one following dir (-1, 0, 1)

Note: To use this function add 'define ALSA_PCM_NEW_HW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

int snd_pcm_hw_params_get_periods_max const snd_pcm_hw_params_t   params,
unsigned int *    val,
int *    dir
 

Extract maximum periods count from a configuration space.

Parameters:
params  Configuration space
val  approximate maximum periods per buffer
dir  Sub unit direction
Returns:
0 otherwise a negative error code
Exact value is <,=,> the returned one following dir (-1,0,1)

Note: To use this function add 'define ALSA_PCM_NEW_HW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

int snd_pcm_hw_params_get_periods_min const snd_pcm_hw_params_t   params,
unsigned int *    val,
int *    dir
 

Extract minimum periods count from a configuration space.

Parameters:
params  Configuration space
val  approximate minimum periods per buffer
dir  Sub unit direction
Returns:
0 otherwise a negative error code
Exact value is <,=,> the returned one following dir (-1,0,1)

Note: To use this function add 'define ALSA_PCM_NEW_HW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

int snd_pcm_hw_params_get_rate const snd_pcm_hw_params_t   params,
unsigned int *    val,
int *    dir
 

Extract rate from a configuration space.

Parameters:
params  Configuration space
val  Returned approximate rate
dir  Sub unit direction
Returns:
0 otherwise a negative error code if not exactly one is present
Actual exact value is <,=,> the approximate one following dir (-1, 0, 1)

Note: To use this function add 'define ALSA_PCM_NEW_HW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

int snd_pcm_hw_params_get_rate_max const snd_pcm_hw_params_t   params,
unsigned int *    val,
int *    dir
 

Extract maximum rate from a configuration space.

Parameters:
params  Configuration space
val  Returned approximate maximum rate
dir  Sub unit direction
Returns:
0 otherwise a negative error code
Exact value is <,=,> the returned one following dir (-1,0,1)

Note: To use this function add 'define ALSA_PCM_NEW_HW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

int snd_pcm_hw_params_get_rate_min const snd_pcm_hw_params_t   params,
unsigned int *    val,
int *    dir
 

Extract minimum rate from a configuration space.

Parameters:
params  Configuration space
val  Returned approximate minimum rate
dir  Sub unit direction
Returns:
0 otherwise a negative error code
Exact value is <,=,> the returned one following dir (-1,0,1)

Note: To use this function add 'define ALSA_PCM_NEW_HW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

int snd_pcm_hw_params_get_rate_numden const snd_pcm_hw_params_t   params,
unsigned int *    rate_num,
unsigned int *    rate_den
 

Get rate exact info from a configuration space.

Parameters:
params  Configuration space
rate_num  Pointer to returned rate numerator
rate_den  Pointer to returned rate denominator
Returns:
0 otherwise a negative error code if the info is not available
It is not allowed to call this function when given configuration is not exactly one. Usually, snd_pcm_hw_params() function chooses one configuration from the configuration space.

int snd_pcm_hw_params_get_sbits const snd_pcm_hw_params_t   params
 

Get sample resolution info from a configuration space.

Parameters:
params  Configuration space
Returns:
signification bits in sample otherwise a negative error code if the info is not available
It is not allowed to call this function when given configuration is not exactly one. Usually, snd_pcm_hw_params() function chooses one configuration from the configuration space.

int snd_pcm_hw_params_get_subformat const snd_pcm_hw_params_t   params,
snd_pcm_subformat_t   subformat
 

Extract subformat from a configuration space.

Parameters:
params  Configuration space
subformat  Returned subformat value
Returns:
subformat otherwise a negative error code if not exactly one is present
Note: To use this function add 'define ALSA_PCM_NEW_HW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

void snd_pcm_hw_params_get_subformat_mask snd_pcm_hw_params_t   params,
snd_pcm_subformat_mask_t   mask
 

Get subformat mask from a configuration space.

Parameters:
params  Configuration space
mask  Returned Subformat mask

int snd_pcm_hw_params_get_tick_time const snd_pcm_hw_params_t   params,
unsigned int *    val,
int *    dir
 

Extract tick time from a configuration space.

Parameters:
params  Configuration space
val  Returned approximate tick duration in us
dir  Sub unit direction
Returns:
0 otherwise a negative error code if not exactly one is present
Actual exact value is <,=,> the approximate one following dir (-1, 0, 1)

Note: To use this function add 'define ALSA_PCM_NEW_HW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

int snd_pcm_hw_params_get_tick_time_max const snd_pcm_hw_params_t   params,
unsigned int *    val,
int *    dir
 

Extract maximum tick time from a configuration space.

Parameters:
params  Configuration space
val  Returned approximate maximum tick duration in us
dir  Sub unit direction
Returns:
0 otherwise a negative error code
Exact value is <,=,> the returned one following dir (-1,0,1)

Note: To use this function add 'define ALSA_PCM_NEW_HW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

int snd_pcm_hw_params_get_tick_time_min const snd_pcm_hw_params_t   params,
unsigned int *    val,
int *    dir
 

Extract minimum tick time from a configuration space.

Parameters:
params  Configuration space
val  Returned approximate minimum tick duration in us
dir  Sub unit direction
Returns:
0 otherwise a negative error code
Exact value is <,=,> the returned one following dir (-1,0,1)

Note: To use this function add 'define ALSA_PCM_NEW_HW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

int snd_pcm_hw_params_is_batch const snd_pcm_hw_params_t   params
 

Check, if hardware does double buffering for data transfers for given configuration.

Parameters:
param  Configuration space
Returns:
Boolean value
Return values:
0  Hardware doesn't do double buffering for data transfers
1  Hardware does double buffering for data transfers
It is not allowed to call this function when given configuration is not exactly one. Usually, snd_pcm_hw_params() function chooses one configuration from the configuration space.

int snd_pcm_hw_params_is_block_transfer const snd_pcm_hw_params_t   params
 

Check, if hardware does block transfers for samples for given configuration.

Parameters:
param  Configuration space
Returns:
Boolean value
Return values:
0  Hardware doesn't block transfers
1  Hardware does block transfers
It is not allowed to call this function when given configuration is not exactly one. Usually, snd_pcm_hw_params() function chooses one configuration from the configuration space.

int snd_pcm_hw_params_is_double const snd_pcm_hw_params_t   params
 

Check, if hardware does double buffering for start/stop for given configuration.

Parameters:
param  Configuration space
Returns:
Boolean value
Return values:
0  Hardware doesn't do double buffering for start/stop
1  Hardware does double buffering for start/stop
It is not allowed to call this function when given configuration is not exactly one. Usually, snd_pcm_hw_params() function chooses one configuration from the configuration space.

int snd_pcm_hw_params_is_half_duplex const snd_pcm_hw_params_t   params
 

Check, if hardware does half-duplex only.

Parameters:
param  Configuration space
Returns:
Boolean value
Return values:
0  Hardware doesn't do half-duplex
1  Hardware does half-duplex
It is not allowed to call this function when given configuration is not exactly one. Usually, snd_pcm_hw_params() function chooses one configuration from the configuration space.

int snd_pcm_hw_params_is_joint_duplex const snd_pcm_hw_params_t   params
 

Check, if hardware does joint-duplex (playback and capture are somewhat correlated).

Parameters:
param  Configuration space
Returns:
Boolean value
Return values:
0  Hardware doesn't do joint-duplex
1  Hardware does joint-duplex
It is not allowed to call this function when given configuration is not exactly one. Usually, snd_pcm_hw_params() function chooses one configuration from the configuration space.

int snd_pcm_hw_params_malloc snd_pcm_hw_params_t **    ptr
 

allocate an invalid snd_pcm_hw_params_t using standard malloc

Parameters:
ptr  returned pointer
Returns:
0 on success otherwise negative error code

int snd_pcm_hw_params_set_access snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
snd_pcm_access_t    access
 

Restrict a configuration space to contain only one access type.

Parameters:
pcm  PCM handle
params  Configuration space
access  access type
Returns:
0 otherwise a negative error code if configuration space would become empty

int snd_pcm_hw_params_set_access_first snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
snd_pcm_access_t   access
 

Restrict a configuration space to contain only its first access type.

Parameters:
pcm  PCM handle
params  Configuration space
access  Returned first access type
Returns:
0 otherwise a negative error code
Note: To use this function add 'define ALSA_PCM_NEW_HW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

int snd_pcm_hw_params_set_access_last snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
snd_pcm_access_t   access
 

Restrict a configuration space to contain only its last access type.

Parameters:
pcm  PCM handle
params  Configuration space
val  Returned last access type
Returns:
0 otherwise a negative error code
Note: To use this function add 'define ALSA_PCM_NEW_HW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

int snd_pcm_hw_params_set_access_mask snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
snd_pcm_access_mask_t   mask
 

Restrict a configuration space to contain only a set of access types.

Parameters:
pcm  PCM handle
params  Configuration space
mask  Access mask
Returns:
0 otherwise a negative error code

int snd_pcm_hw_params_set_buffer_size snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
snd_pcm_uframes_t    val
 

Restrict a configuration space to contain only one buffer size.

Parameters:
pcm  PCM handle
params  Configuration space
val  buffer size in frames
Returns:
0 otherwise a negative error code if configuration space would become empty
Wanted exact value is <,=,> val following dir (-1,0,1)

int snd_pcm_hw_params_set_buffer_size_first snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
snd_pcm_uframes_t   val
 

Restrict a configuration space to contain only its minimum buffer size.

Parameters:
pcm  PCM handle
params  Configuration space
val  Returned minimum buffer size in frames
Returns:
buffer size in frames
Note: To use this function add 'define ALSA_PCM_NEW_HW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

int snd_pcm_hw_params_set_buffer_size_last snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
snd_pcm_uframes_t   val
 

Restrict a configuration space to contain only its maximum buffer size.

Parameters:
pcm  PCM handle
params  Configuration space
val  Returned maximum buffer size in frames
Returns:
0 otherwise a negative error code
Note: To use this function add 'define ALSA_PCM_NEW_HW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

int snd_pcm_hw_params_set_buffer_size_max snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
snd_pcm_uframes_t   val
 

Restrict a configuration space with a maximum buffer size.

Parameters:
pcm  PCM handle
params  Configuration space
val  approximate maximum buffer size in frames (on return filled with actual maximum)
dir  Sub unit direction (on return filled with actual direction)
Returns:
0 otherwise a negative error code if configuration space would become empty
Wanted/actual exact minimum is <,=,> val following dir (-1,0,1)

int snd_pcm_hw_params_set_buffer_size_min snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
snd_pcm_uframes_t   val
 

Restrict a configuration space with a minimum buffer size.

Parameters:
pcm  PCM handle
params  Configuration space
val  approximate minimum buffer size in frames (on return filled with actual minimum)
dir  Sub unit direction (on return filled with actual direction)
Returns:
0 otherwise a negative error code if configuration space would become empty
Wanted/actual exact minimum is <,=,> val following dir (-1,0,1)

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
 

Restrict a configuration space to have buffer sizes in a given range.

Parameters:
pcm  PCM handle
params  Configuration space
min  approximate minimum buffer size in frames (on return filled with actual minimum)
mindir  Sub unit direction for minimum (on return filled with actual direction)
max  approximate maximum buffer size in frames (on return filled with actual maximum)
maxdir  Sub unit direction for maximum (on return filled with actual direction)
Returns:
0 otherwise a negative error code if configuration space would become empty
Wanted/actual exact min/max is <,=,> val following dir (-1,0,1)

int snd_pcm_hw_params_set_buffer_size_near snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
snd_pcm_uframes_t   val
 

Restrict a configuration space to have buffer size nearest to a target.

Parameters:
pcm  PCM handle
params  Configuration space
val  approximate target buffer size in frames / returned chosen approximate target buffer size in frames
Returns:
approximate chosen buffer size in frames
target/chosen exact value is <,=,> val following dir (-1,0,1)

Note: To use this function add 'define ALSA_PCM_NEW_HW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

int snd_pcm_hw_params_set_buffer_time snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
unsigned int    val,
int    dir
 

Restrict a configuration space to contain only one buffer time.

Parameters:
pcm  PCM handle
params  Configuration space
val  approximate buffer duration in us
dir  Sub unit direction
Returns:
0 otherwise a negative error code if configuration space would become empty
Wanted exact value is <,=,> val following dir (-1,0,1)

int snd_pcm_hw_params_set_buffer_time_first snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
unsigned int *    val,
int *    dir
 

Restrict a configuration space to contain only its minimum buffer time.

Parameters:
pcm  PCM handle
params  Configuration space
val  Returned approximate minimum buffer duration in us
dir  Sub unit direction
Returns:
0 otherwise a negative error code
Actual exact value is <,=,> the approximate one following dir (-1, 0, 1)

Note: To use this function add 'define ALSA_PCM_NEW_HW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

int snd_pcm_hw_params_set_buffer_time_last snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
unsigned int *    val,
int *    dir
 

Restrict a configuration space to contain only its maximum buffered time.

Parameters:
pcm  PCM handle
params  Configuration space
val  Returned approximate maximum buffer duration in us
dir  Sub unit direction
Returns:
0 otherwise a negative error code
Actual exact value is <,=,> the approximate one following dir (-1, 0, 1)

Note: To use this function add 'define ALSA_PCM_NEW_HW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

int snd_pcm_hw_params_set_buffer_time_max snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
unsigned int *    val,
int *    dir
 

Restrict a configuration space with a maximum buffer time.

Parameters:
pcm  PCM handle
params  Configuration space
val  approximate maximum buffer duration in us (on return filled with actual maximum)
dir  Sub unit direction (on return filled with actual direction)
Returns:
0 otherwise a negative error code if configuration space would become empty
Wanted/actual exact maximum is <,=,> val following dir (-1,0,1)

int snd_pcm_hw_params_set_buffer_time_min snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
unsigned int *    val,
int *    dir
 

Restrict a configuration space with a minimum buffer time.

Parameters:
pcm  PCM handle
params  Configuration space
val  approximate minimum buffer duration in us (on return filled with actual minimum)
dir  Sub unit direction (on return filled with actual direction)
Returns:
0 otherwise a negative error code if configuration space would become empty
Wanted/actual exact minimum is <,=,> val following dir (-1,0,1)

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
 

Restrict a configuration space to have buffer times in a given range.

Parameters:
pcm  PCM handle
params  Configuration space
min  approximate minimum buffer duration in us (on return filled with actual minimum)
mindir  Sub unit direction for minimum (on return filled with actual direction)
max  approximate maximum buffer duration in us (on return filled with actual maximum)
maxdir  Sub unit direction for maximum (on return filled with actual direction)
Returns:
0 otherwise a negative error code if configuration space would become empty
Wanted/actual exact min/max is <,=,> val following dir (-1,0,1)

int snd_pcm_hw_params_set_buffer_time_near snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
unsigned int *    val,
int *    dir
 

Restrict a configuration space to have buffer time nearest to a target.

Parameters:
pcm  PCM handle
params  Configuration space
val  approximate target buffer duration in us / returned chosen approximate target buffer duration
Returns:
approximate chosen buffer duration in us
target/chosen exact value is <,=,> val following dir (-1,0,1)

Note: To use this function add 'define ALSA_PCM_NEW_HW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

int snd_pcm_hw_params_set_channels snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
unsigned int    val
 

Restrict a configuration space to contain only one channels count.

Parameters:
pcm  PCM handle
params  Configuration space
val  channels count
Returns:
0 otherwise a negative error code if configuration space would become empty

int snd_pcm_hw_params_set_channels_first snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
unsigned int *    val
 

Restrict a configuration space to contain only its minimum channels count.

Parameters:
pcm  PCM handle
params  Configuration space
val  minimum channels count
Returns:
0 otherwise a negative error code
Note: To use this function add 'define ALSA_PCM_NEW_HW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

int snd_pcm_hw_params_set_channels_last snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
unsigned int *    val
 

Restrict a configuration space to contain only its maximum channels count.

Parameters:
pcm  PCM handle
params  Configuration space
val  maximum channels count
Returns:
0 otherwise a negative error code
Note: To use this function add 'define ALSA_PCM_NEW_HW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

int snd_pcm_hw_params_set_channels_max snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
unsigned int *    val
 

Restrict a configuration space with a maximum channels count.

Parameters:
pcm  PCM handle
params  Configuration space
val  maximum channels count (on return filled with actual maximum)
Returns:
0 otherwise a negative error code if configuration space would become empty

int snd_pcm_hw_params_set_channels_min snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
unsigned int *    val
 

Restrict a configuration space with a minimum channels count.

Parameters:
pcm  PCM handle
params  Configuration space
val  minimum channels count (on return filled with actual minimum)
Returns:
0 otherwise a negative error code if configuration space would become empty

int snd_pcm_hw_params_set_channels_minmax snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
unsigned int *    min,
unsigned int *    max
 

Restrict a configuration space to have channels counts in a given range.

Parameters:
pcm  PCM handle
params  Configuration space
min  minimum channels count (on return filled with actual minimum)
max  maximum channels count (on return filled with actual maximum)
Returns:
0 otherwise a negative error code if configuration space would become empty

int snd_pcm_hw_params_set_channels_near snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
unsigned int *    val
 

Restrict a configuration space to have channels count nearest to a target.

Parameters:
pcm  PCM handle
params  Configuration space
val  target channels count, returned chosen channels count
Returns:
chosen channels count
Note: To use this function add 'define ALSA_PCM_NEW_HW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

int snd_pcm_hw_params_set_format snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
snd_pcm_format_t    format
 

Restrict a configuration space to contain only one format.

Parameters:
pcm  PCM handle
params  Configuration space
format  format
Returns:
0 otherwise a negative error code

int snd_pcm_hw_params_set_format_first snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
snd_pcm_format_t   format
 

Restrict a configuration space to contain only its first format.

Parameters:
pcm  PCM handle
params  Configuration space
format  Returned first format
Returns:
0 otherwise a negative error code
Note: To use this function add 'define ALSA_PCM_NEW_HW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

int snd_pcm_hw_params_set_format_last snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
snd_pcm_format_t   format
 

Restrict a configuration space to contain only its last format.

Parameters:
pcm  PCM handle
params  Configuration space
format  Returned last format
Returns:
0 otherwise a negative error code
Note: To use this function add 'define ALSA_PCM_NEW_HW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

int snd_pcm_hw_params_set_format_mask snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
snd_pcm_format_mask_t   mask
 

Restrict a configuration space to contain only a set of formats.

Parameters:
pcm  PCM handle
params  Configuration space
mask  Format mask
Returns:
0 otherwise a negative error code

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
 

Restrict a configuration space to contain only one period size.

Parameters:
pcm  PCM handle
params  Configuration space
val  approximate period size in frames
dir  Sub unit direction
Returns:
0 otherwise a negative error code if configuration space would become empty
Wanted exact value is <,=,> val following dir (-1,0,1)

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
 

Restrict a configuration space to contain only its minimum period size.

Parameters:
pcm  PCM handle
params  Configuration space
val  Returned maximum approximate period size in frames
dir  Sub unit direction
Returns:
0 otherwise a negative error code
Actual exact value is <,=,> the approximate one following dir (-1, 0, 1)

Note: To use this function add 'define ALSA_PCM_NEW_HW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

int snd_pcm_hw_params_set_period_size_integer snd_pcm_t   pcm,
snd_pcm_hw_params_t   params
 

Restrict a configuration space to contain only integer period sizes.

Parameters:
pcm  PCM handle
params  Configuration space
Returns:
0 otherwise a negative error code if configuration space would become empty

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
 

Restrict a configuration space to contain only its maximum period size.

Parameters:
pcm  PCM handle
params  Configuration space
val  Returned maximum approximate period size in frames
dir  Sub unit direction
Returns:
0 otherwise a negative error code
Actual exact value is <,=,> the approximate one following dir (-1, 0, 1)

Note: To use this function add 'define ALSA_PCM_NEW_HW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

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
 

Restrict a configuration space with a maximum period size.

Parameters:
pcm  PCM handle
params  Configuration space
val  approximate maximum period size in frames (on return filled with actual maximum)
dir  Sub unit direction (on return filled with actual direction)
Returns:
0 otherwise a negative error code if configuration space would become empty
Wanted/actual exact minimum is <,=,> val following dir (-1,0,1)

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
 

Restrict a configuration space with a minimum period size.

Parameters:
pcm  PCM handle
params  Configuration space
val  approximate minimum period size in frames (on return filled with actual minimum)
dir  Sub unit direction (on return filled with actual direction)
Returns:
0 otherwise a negative error code if configuration space would become empty
Wanted/actual exact minimum is <,=,> val following dir (-1,0,1)

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
 

Restrict a configuration space to have period sizes in a given range.

Parameters:
pcm  PCM handle
params  Configuration space
min  approximate minimum period size in frames (on return filled with actual minimum)
mindir  Sub unit direction for minimum (on return filled with actual direction)
max  approximate maximum period size in frames (on return filled with actual maximum)
maxdir  Sub unit direction for maximum (on return filled with actual direction)
Returns:
0 otherwise a negative error code if configuration space would become empty
Wanted/actual exact min/max is <,=,> val following dir (-1,0,1)

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
 

Restrict a configuration space to have period size nearest to a target.

Parameters:
pcm  PCM handle
params  Configuration space
val  approximate target period size in frames / returned chosen approximate target period size
Returns:
0 otherwise a negative error code
target/chosen exact value is <,=,> val following dir (-1,0,1)

Note: To use this function add 'define ALSA_PCM_NEW_HW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

int snd_pcm_hw_params_set_period_time snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
unsigned int    val,
int    dir
 

Restrict a configuration space to contain only one period time.

Parameters:
pcm  PCM handle
params  Configuration space
val  approximate period duration in us
dir  Sub unit direction
Returns:
0 otherwise a negative error code if configuration space would become empty
Wanted exact value is <,=,> val following dir (-1,0,1)

int snd_pcm_hw_params_set_period_time_first snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
unsigned int *    val,
int *    dir
 

Restrict a configuration space to contain only its minimum period time.

Parameters:
pcm  PCM handle
params  Configuration space
val  Returned approximate period duration in us
dir  Sub unit direction
Returns:
0 otherwise a negative error code
Actual exact value is <,=,> the approximate one following dir (-1, 0, 1)

Note: To use this function add 'define ALSA_PCM_NEW_HW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

int snd_pcm_hw_params_set_period_time_last snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
unsigned int *    val,
int *    dir
 

Restrict a configuration space to contain only its maximum period time.

Parameters:
pcm  PCM handle
params  Configuration space
dir  Sub unit direction
Returns:
approximate period duration in us
Actual exact value is <,=,> the approximate one following dir (-1, 0, 1)

Note: To use this function add 'define ALSA_PCM_NEW_HW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

int snd_pcm_hw_params_set_period_time_max snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
unsigned int *    val,
int *    dir
 

Restrict a configuration space with a maximum period time.

Parameters:
pcm  PCM handle
params  Configuration space
val  approximate maximum period duration in us (on return filled with actual maximum)
dir  Sub unit direction (on return filled with actual direction)
Returns:
0 otherwise a negative error code if configuration space would become empty
Wanted/actual exact maximum is <,=,> val following dir (-1,0,1)

int snd_pcm_hw_params_set_period_time_min snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
unsigned int *    val,
int *    dir
 

Restrict a configuration space with a minimum period time.

Parameters:
pcm  PCM handle
params  Configuration space
val  approximate minimum period duration in us (on return filled with actual minimum)
dir  Sub unit direction (on return filled with actual direction)
Returns:
0 otherwise a negative error code if configuration space would become empty
Wanted/actual exact minimum is <,=,> val following dir (-1,0,1)

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
 

Restrict a configuration space to have period times in a given range.

Parameters:
pcm  PCM handle
params  Configuration space
min  approximate minimum period duration in us (on return filled with actual minimum)
mindir  Sub unit direction for minimum (on return filled with actual direction)
max  approximate maximum period duration in us (on return filled with actual maximum)
maxdir  Sub unit direction for maximum (on return filled with actual direction)
Returns:
0 otherwise a negative error code if configuration space would become empty
Wanted/actual exact min/max is <,=,> val following dir (-1,0,1)

int snd_pcm_hw_params_set_period_time_near snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
unsigned int *    val,
int *    dir
 

Restrict a configuration space to have period time nearest to a target.

Parameters:
pcm  PCM handle
params  Configuration space
val  approximate target period duration in us / returned chosen approximate target period duration
Returns:
approximate chosen period duration in us
target/chosen exact value is <,=,> val following dir (-1,0,1)

Note: To use this function add 'define ALSA_PCM_NEW_HW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

int snd_pcm_hw_params_set_periods snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
unsigned int    val,
int    dir
 

Restrict a configuration space to contain only one periods count.

Parameters:
pcm  PCM handle
params  Configuration space
val  approximate periods per buffer
dir  Sub unit direction
Returns:
0 otherwise a negative error code if configuration space would become empty
Wanted exact value is <,=,> val following dir (-1,0,1)

int snd_pcm_hw_params_set_periods_first snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
unsigned int *    val,
int *    dir
 

Restrict a configuration space to contain only its minimum periods count.

Parameters:
pcm  PCM handle
params  Configuration space
val  Returned approximate minimum periods per buffer
dir  Sub unit direction
Returns:
0 otherwise a negative error code
Actual exact value is <,=,> the approximate one following dir (-1, 0, 1)

Note: To use this function add 'define ALSA_PCM_NEW_HW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

int snd_pcm_hw_params_set_periods_integer snd_pcm_t   pcm,
snd_pcm_hw_params_t   params
 

Restrict a configuration space to contain only integer periods counts.

Parameters:
pcm  PCM handle
params  Configuration space
Returns:
0 otherwise a negative error code if configuration space would become empty

int snd_pcm_hw_params_set_periods_last snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
unsigned int *    val,
int *    dir
 

Restrict a configuration space to contain only its maximum periods count.

Parameters:
pcm  PCM handle
params  Configuration space
val  Returned approximate maximum periods per buffer
dir  Sub unit direction
Returns:
0 otherwise a negative error code
Actual exact value is <,=,> the approximate one following dir (-1, 0, 1)

Note: To use this function add 'define ALSA_PCM_NEW_HW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

int snd_pcm_hw_params_set_periods_max snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
unsigned int *    val,
int *    dir
 

Restrict a configuration space with a maximum periods count.

Parameters:
pcm  PCM handle
params  Configuration space
val  approximate maximum periods per buffer (on return filled with actual maximum)
dir  Sub unit direction (on return filled with actual direction)
Returns:
0 otherwise a negative error code if configuration space would become empty
Wanted/actual exact maximum is <,=,> val following dir (-1,0,1)

int snd_pcm_hw_params_set_periods_min snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
unsigned int *    val,
int *    dir
 

Restrict a configuration space with a minimum periods count.

Parameters:
pcm  PCM handle
params  Configuration space
val  approximate minimum periods per buffer (on return filled with actual minimum)
dir  Sub unit direction (on return filled with actual direction)
Returns:
0 otherwise a negative error code if configuration space would become empty
Wanted/actual exact minimum is <,=,> val following dir (-1,0,1)

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
 

Restrict a configuration space to have periods counts in a given range.

Parameters:
pcm  PCM handle
params  Configuration space
min  approximate minimum periods per buffer (on return filled with actual minimum)
mindir  Sub unit direction for minimum (on return filled with actual direction)
max  approximate maximum periods per buffer (on return filled with actual maximum)
maxdir  Sub unit direction for maximum (on return filled with actual direction)
Returns:
0 otherwise a negative error code if configuration space would become empty
Wanted/actual exact min/max is <,=,> val following dir (-1,0,1)

int snd_pcm_hw_params_set_periods_near snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
unsigned int *    val,
int *    dir
 

Restrict a configuration space to have periods count nearest to a target.

Parameters:
pcm  PCM handle
params  Configuration space
val  approximate target periods per buffer / returned chosen approximate target periods per buffer
Returns:
approximate chosen periods per buffer
target/chosen exact value is <,=,> val following dir (-1,0,1)

Note: To use this function add 'define ALSA_PCM_NEW_HW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

int snd_pcm_hw_params_set_rate snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
unsigned int    val,
int    dir
 

Restrict a configuration space to contain only one rate.

Parameters:
pcm  PCM handle
params  Configuration space
val  approximate rate
dir  Sub unit direction
Returns:
0 otherwise a negative error code if configuration space would become empty
Wanted exact value is <,=,> val following dir (-1,0,1)

int snd_pcm_hw_params_set_rate_first snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
unsigned int *    val,
int *    dir
 

Restrict a configuration space to contain only its minimum rate.

Parameters:
pcm  PCM handle
params  Configuration space
val  Returned minimum approximate rate
dir  Sub unit direction
Returns:
0 otherwise a negative error code
Actual exact value is <,=,> the approximate one following dir (-1, 0, 1)

Note: To use this function add 'define ALSA_PCM_NEW_HW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

int snd_pcm_hw_params_set_rate_last snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
unsigned int *    val,
int *    dir
 

Restrict a configuration space to contain only its maximum rate.

Parameters:
pcm  PCM handle
params  Configuration space
val  Returned maximum approximate rate
dir  Sub unit direction
Returns:
0 otherwise a negative error code
Actual exact value is <,=,> the approximate one following dir (-1, 0, 1)

Note: To use this function add 'define ALSA_PCM_NEW_HW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

int snd_pcm_hw_params_set_rate_max snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
unsigned int *    val,
int *    dir
 

Restrict a configuration space with a maximum rate.

Parameters:
pcm  PCM handle
params  Configuration space
val  approximate maximum rate (on return filled with actual maximum)
dir  Sub unit direction (on return filled with actual direction)
Returns:
0 otherwise a negative error code if configuration space would become empty
Wanted/actual exact maximum is <,=,> val following dir (-1,0,1)

int snd_pcm_hw_params_set_rate_min snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
unsigned int *    val,
int *    dir
 

Restrict a configuration space with a minimum rate.

Parameters:
pcm  PCM handle
params  Configuration space
val  approximate minimum rate (on return filled with actual minimum)
dir  Sub unit direction (on return filled with actual direction)
Returns:
0 otherwise a negative error code if configuration space would become empty
Wanted/actual exact minimum is <,=,> val following dir (-1,0,1)

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
 

Restrict a configuration space to have rates in a given range.

Parameters:
pcm  PCM handle
params  Configuration space
min  approximate minimum rate (on return filled with actual minimum)
mindir  Sub unit direction for minimum (on return filled with actual direction)
max  approximate maximum rate (on return filled with actual maximum)
maxdir  Sub unit direction for maximum (on return filled with actual direction)
Returns:
0 otherwise a negative error code if configuration space would become empty
Wanted/actual exact min/max is <,=,> val following dir (-1,0,1)

int snd_pcm_hw_params_set_rate_near snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
unsigned int *    val,
int *    dir
 

Restrict a configuration space to have rate nearest to a target.

Parameters:
pcm  PCM handle
params  Configuration space
val  approximate target rate / returned approximate set rate
Returns:
approximate chosen rate
target/chosen exact value is <,=,> val following dir (-1,0,1)

Note: To use this function add 'define ALSA_PCM_NEW_HW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

int snd_pcm_hw_params_set_subformat snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
snd_pcm_subformat_t    subformat
 

Restrict a configuration space to contain only one subformat.

Parameters:
pcm  PCM handle
params  Configuration space
subformat  subformat value
Returns:
0 otherwise a negative error code if configuration space would become empty

int snd_pcm_hw_params_set_subformat_first snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
snd_pcm_subformat_t   subformat
 

Restrict a configuration space to contain only its first subformat.

Parameters:
pcm  PCM handle
params  Configuration space
subformat  Returned subformat
Returns:
0 otherwise a negative error code
Note: To use this function add 'define ALSA_PCM_NEW_HW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

int snd_pcm_hw_params_set_subformat_last snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
snd_pcm_subformat_t   subformat
 

Restrict a configuration space to contain only its last subformat.

Parameters:
pcm  PCM handle
params  Configuration space
subformat  Returned subformat
Returns:
0 otherwise a negative error code
Note: To use this function add 'define ALSA_PCM_NEW_HW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

int snd_pcm_hw_params_set_subformat_mask snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
snd_pcm_subformat_mask_t   mask
 

Restrict a configuration space to contain only a set of subformats.

Parameters:
pcm  PCM handle
params  Configuration space
mask  Subformat mask
Returns:
0 otherwise a negative error code

int snd_pcm_hw_params_set_tick_time snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
unsigned int    val,
int    dir
 

Restrict a configuration space to contain only one tick time.

Parameters:
pcm  PCM handle
params  Configuration space
val  approximate tick duration in us
dir  Sub unit direction
Returns:
0 otherwise a negative error code if configuration space would become empty
Wanted exact value is <,=,> val following dir (-1,0,1)

int snd_pcm_hw_params_set_tick_time_first snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
unsigned int *    val,
int *    dir
 

Restrict a configuration space to contain only its minimum tick time.

Parameters:
pcm  PCM handle
params  Configuration space
val  Returned approximate minimum tick duration in us
dir  Sub unit direction
Returns:
0 otherwise a negative error code
Actual exact value is <,=,> the approximate one following dir (-1, 0, 1)

Note: To use this function add 'define ALSA_PCM_NEW_HW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

int snd_pcm_hw_params_set_tick_time_last snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
unsigned int *    val,
int *    dir
 

Restrict a configuration space to contain only its maximum tick time.

Parameters:
pcm  PCM handle
params  Configuration space
val  Returned approximate maximum tick duration in us
dir  Sub unit direction
Returns:
0 otherwise a negative error code
Actual exact value is <,=,> the approximate one following dir (-1, 0, 1)

Note: To use this function add 'define ALSA_PCM_NEW_HW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

int snd_pcm_hw_params_set_tick_time_max snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
unsigned int *    val,
int *    dir
 

Restrict a configuration space with a maximum tick time.

Parameters:
pcm  PCM handle
params  Configuration space
val  approximate maximum tick duration in us (on return filled with actual maximum)
dir  Sub unit direction (on return filled with actual direction)
Returns:
0 otherwise a negative error code if configuration space would become empty
Wanted/actual exact maximum is <,=,> val following dir (-1,0,1)

int snd_pcm_hw_params_set_tick_time_min snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
unsigned int *    val,
int *    dir
 

Restrict a configuration space with a minimum tick time.

Parameters:
pcm  PCM handle
params  Configuration space
val  approximate minimum tick duration in us (on return filled with actual minimum)
dir  Sub unit direction (on return filled with actual direction)
Returns:
0 otherwise a negative error code if configuration space would become empty
Wanted/actual exact minimum is <,=,> val following dir (-1,0,1)

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
 

Restrict a configuration space to have tick times in a given range.

Parameters:
pcm  PCM handle
params  Configuration space
min  approximate minimum tick duration in us (on return filled with actual minimum)
mindir  Sub unit direction for minimum (on return filled with actual direction)
max  approximate maximum tick duration in us (on return filled with actual maximum)
maxdir  Sub unit direction for maximum (on return filled with actual direction)
Returns:
0 otherwise a negative error code if configuration space would become empty
Wanted/actual exact min/max is <,=,> val following dir (-1,0,1)

int snd_pcm_hw_params_set_tick_time_near snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
unsigned int *    val,
int *    dir
 

Restrict a configuration space to have tick time nearest to a target.

Parameters:
pcm  PCM handle
params  Configuration space
val  approximate target tick duration in us / returned chosen approximate target tick duration in us
Returns:
approximate chosen tick duration in us
target/chosen exact value is <,=,> val following dir (-1,0,1)

Note: To use this function add 'define ALSA_PCM_NEW_HW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

size_t snd_pcm_hw_params_sizeof void   
 

get size of snd_pcm_hw_params_t

Returns:
size in bytes

int snd_pcm_hw_params_test_access snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
snd_pcm_access_t    access
 

Verify if an access type is available inside a configuration space for a PCM.

Parameters:
pcm  PCM handle
params  Configuration space
access  access type
Returns:
0 if available a negative error code otherwise

int snd_pcm_hw_params_test_buffer_size snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
snd_pcm_uframes_t    val
 

Verify if a buffer size is available inside a configuration space for a PCM.

Parameters:
pcm  PCM handle
params  Configuration space
val  buffer size in frames
dir  Sub unit direction
Returns:
0 if available a negative error code otherwise
Wanted exact value is <,=,> val following dir (-1,0,1)

int snd_pcm_hw_params_test_buffer_time snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
unsigned int    val,
int    dir
 

Verify if a buffer time is available inside a configuration space for a PCM.

Parameters:
pcm  PCM handle
params  Configuration space
val  approximate buffer duration in us
dir  Sub unit direction
Returns:
0 if available a negative error code otherwise
Wanted exact value is <,=,> val following dir (-1,0,1)

int snd_pcm_hw_params_test_channels snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
unsigned int    val
 

Verify if a channels count is available inside a configuration space for a PCM.

Parameters:
pcm  PCM handle
params  Configuration space
val  channels count
Returns:
0 if available a negative error code otherwise

int snd_pcm_hw_params_test_format snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
snd_pcm_format_t    format
 

Verify if a format is available inside a configuration space for a PCM.

Parameters:
pcm  PCM handle
params  Configuration space
format  format
Returns:
0 if available a negative error code otherwise

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
 

Verify if a period size is available inside a configuration space for a PCM.

Parameters:
pcm  PCM handle
params  Configuration space
val  approximate period size in frames
dir  Sub unit direction
Returns:
0 if available a negative error code otherwise
Wanted exact value is <,=,> val following dir (-1,0,1)

int snd_pcm_hw_params_test_period_time snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
unsigned int    val,
int    dir
 

Verify if a period time is available inside a configuration space for a PCM.

Parameters:
pcm  PCM handle
params  Configuration space
val  approximate period duration in us
dir  Sub unit direction
Returns:
0 if available a negative error code otherwise
Wanted exact value is <,=,> val following dir (-1,0,1)

int snd_pcm_hw_params_test_periods snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
unsigned int    val,
int    dir
 

Verify if a periods count is available inside a configuration space for a PCM.

Parameters:
pcm  PCM handle
params  Configuration space
val  approximate periods per buffer
dir  Sub unit direction
Returns:
0 if available a negative error code otherwise
Wanted exact value is <,=,> val following dir (-1,0,1)

int snd_pcm_hw_params_test_rate snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
unsigned int    val,
int    dir
 

Verify if a rate is available inside a configuration space for a PCM.

Parameters:
pcm  PCM handle
params  Configuration space
val  approximate rate
dir  Sub unit direction
Returns:
0 if available a negative error code otherwise
Wanted exact value is <,=,> val following dir (-1,0,1)

int snd_pcm_hw_params_test_subformat snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
snd_pcm_subformat_t    subformat
 

Verify if a subformat is available inside a configuration space for a PCM.

Parameters:
pcm  PCM handle
params  Configuration space
subformat  subformat value
Returns:
0 if available a negative error code otherwise

int snd_pcm_hw_params_test_tick_time snd_pcm_t   pcm,
snd_pcm_hw_params_t   params,
unsigned int    val,
int    dir
 

Verify if a tick time is available inside a configuration space for a PCM.

Parameters:
pcm  PCM handle
params  Configuration space
val  approximate tick duration in us
dir  Sub unit direction
Returns:
0 if available a negative error code otherwise
Wanted exact value is <,=,> val following dir (-1,0,1)

int snd_pcm_hwsync snd_pcm_t   pcm
 

Synchronize stream position with hardware.

Parameters:
pcm  PCM handle
Returns:
0 on success otherwise a negative error code
Note this function does not update the actual r/w pointer for applications. The function snd_pcm_avail_update() have to be called before any read/write/begin+commit operation.

int snd_pcm_info snd_pcm_t   pcm,
snd_pcm_info_t   info
 

Obtain general (static) information for PCM handle.

Parameters:
pcm  PCM handle
info  Information container
Returns:
0 on success otherwise a negative error code

void snd_pcm_info_copy snd_pcm_info_t   dst,
const snd_pcm_info_t   src
 

copy one snd_pcm_info_t to another

Parameters:
dst  pointer to destination
src  pointer to source

void snd_pcm_info_free snd_pcm_info_t   obj
 

frees a previously allocated snd_pcm_info_t

Parameters:
pointer  to object to free

int snd_pcm_info_get_card const snd_pcm_info_t   obj
 

Get card from a PCM info container.

Parameters:
obj  PCM info container
Returns:
card number otherwise a negative error code if not associable to a card

snd_pcm_class_t snd_pcm_info_get_class const snd_pcm_info_t   obj
 

Get class from a PCM info container.

Parameters:
obj  PCM info container
Returns:
class of PCM

unsigned int snd_pcm_info_get_device const snd_pcm_info_t   obj
 

Get device from a PCM info container.

Parameters:
obj  PCM info container
Returns:
device number

const char* snd_pcm_info_get_id const snd_pcm_info_t   obj
 

Get id from a PCM info container.

Parameters:
obj  PCM info container
Returns:
short id of PCM

const char* snd_pcm_info_get_name const snd_pcm_info_t   obj
 

Get name from a PCM info container.

Parameters:
obj  PCM info container
Returns:
name of PCM

snd_pcm_stream_t snd_pcm_info_get_stream const snd_pcm_info_t   obj
 

Get stream (direction) from a PCM info container.

Parameters:
obj  PCM info container
Returns:
stream

snd_pcm_subclass_t snd_pcm_info_get_subclass const snd_pcm_info_t   obj
 

Get subclass from a PCM info container.

Parameters:
obj  PCM info container
Returns:
subclass of PCM

unsigned int snd_pcm_info_get_subdevice const snd_pcm_info_t   obj
 

Get subdevice from a PCM info container.

Parameters:
obj  PCM info container
Returns:
subdevice number

const char* snd_pcm_info_get_subdevice_name const snd_pcm_info_t   obj
 

Get subdevice name from a PCM info container.

Parameters:
obj  PCM info container
Returns:
name of used PCM subdevice

unsigned int snd_pcm_info_get_subdevices_avail const snd_pcm_info_t   obj
 

Get available subdevices count from a PCM info container.

Parameters:
obj  PCM info container
Returns:
available subdevices count of PCM

unsigned int snd_pcm_info_get_subdevices_count const snd_pcm_info_t   obj
 

Get subdevices count from a PCM info container.

Parameters:
obj  PCM info container
Returns:
subdevices total count of PCM

snd_pcm_sync_id_t snd_pcm_info_get_sync const snd_pcm_info_t   obj
 

Get hardware synchronization ID from a PCM info container.

Parameters:
obj  PCM info container
Returns:
hardware synchronization ID

int snd_pcm_info_malloc snd_pcm_info_t **    ptr
 

allocate an invalid snd_pcm_info_t using standard malloc

Parameters:
ptr  returned pointer
Returns:
0 on success otherwise negative error code

void snd_pcm_info_set_device snd_pcm_info_t   obj,
unsigned int    val
 

Set wanted device inside a PCM info container (see snd_ctl_pcm_info).

Parameters:
obj  PCM info container
val  Device number

void snd_pcm_info_set_stream snd_pcm_info_t   obj,
snd_pcm_stream_t    val
 

Set wanted stream inside a PCM info container (see snd_ctl_pcm_info).

Parameters:
obj  PCM info container
val  Stream

void snd_pcm_info_set_subdevice snd_pcm_info_t   obj,
unsigned int    val
 

Set wanted subdevice inside a PCM info container (see snd_ctl_pcm_info).

Parameters:
obj  PCM info container
val  Subdevice number

size_t snd_pcm_info_sizeof void   
 

get size of snd_pcm_info_t

Returns:
size in bytes

int snd_pcm_link snd_pcm_t   pcm1,
snd_pcm_t   pcm2
 

Link two PCMs.

Parameters:
pcm1  first PCM handle
pcm2  first PCM handle
Returns:
0 on success otherwise a negative error code
The two PCMs will start/stop/prepare in sync.

int snd_pcm_mmap_begin snd_pcm_t   pcm,
const snd_pcm_channel_area_t **    areas,
snd_pcm_uframes_t   offset,
snd_pcm_uframes_t   frames
 

Application request to access a portion of direct (mmap) area.

Parameters:
pcm  PCM handle
areas  Returned mmap channel areas
offset  Returned mmap area offset in area steps (== frames)
frames  mmap area portion size in frames (wanted on entry, contiguous available on exit)
Returns:
0 on success otherwise a negative error code
It is necessary to call the snd_pcm_avail_update() function directly before this call. Otherwise, this function can return a wrong count of available frames.

The function should be called before a sample-direct area can be accessed. The resulting size parameter is always less or equal to the input count of frames and can be zero, if no frames can be processed (the ring buffer is full).

See the snd_pcm_mmap_commit() function to finish the frame processing in the direct areas.

snd_pcm_sframes_t snd_pcm_mmap_commit snd_pcm_t   pcm,
snd_pcm_uframes_t    offset,
snd_pcm_uframes_t    frames
 

Application has completed the access to area requested with snd_pcm_mmap_begin.

Parameters:
pcm  PCM handle
offset  area offset in area steps (== frames)
size  area portion size in frames
Returns:
count of transferred frames otherwise a negative error code
You should pass this function the offset value that snd_pcm_mmap_begin() returned. The frames parameter should hold the number of frames you have written or read to/from the audio buffer. The frames parameter must never exceed the contiguous frames count that snd_pcm_mmap_begin() returned. Each call to snd_pcm_mmap_begin() must be followed by a call to snd_pcm_mmap_commit().

Example:

  double phase = 0;
  const snd_pcm_area_t *areas;
  snd_pcm_sframes_t avail, size, commitres;
  snd_pcm_uframes_t offset, frames;
  int err;

  avail = snd_pcm_avail_update(pcm);
  if (avail < 0)
    error(avail);
  // at this point, we can transfer at least 'avail' frames
  
  // we want to process frames in chunks (period_size)
  if (avail < period_size)
    goto _skip;
  size = period_size;
  // it is possible that contiguous areas are smaller, thus we use a loop
  while (size > 0) {
    frames = size;

    err = snd_pcm_mmap_begin(pcm_handle, &areas, &offset, &frames);
    if (err < 0)
      error(err);
    // this function fills the areas from offset with count of frames
    generate_sine(areas, offset, frames, &phase);
    commitres = snd_pcm_mmap_commit(pcm_handle, offset, frames);
    if (commitres < 0 || commitres != frames)
      error(commitres >= 0 ? -EPIPE : commitres);
      
    size -= frames;
  }
 _skip:

Look to the Sine-wave generator example for more details about the generate_sine function.

const char* snd_pcm_name snd_pcm_t   pcm
 

get identifier of PCM handle

Parameters:
pcm  PCM handle
Returns:
ascii identifier of PCM handle
Returns the ASCII identifier of given PCM handle. It's the same identifier specified in snd_pcm_open().

int snd_pcm_nonblock snd_pcm_t   pcm,
int    nonblock
 

set nonblock mode

Parameters:
pcm  PCM handle
nonblock  0 = block, 1 = nonblock mode
Returns:
0 on success otherwise a negative error code

int snd_pcm_open snd_pcm_t **    pcmp,
const char *    name,
snd_pcm_stream_t    stream,
int    mode
 

Opens a PCM.

Parameters:
pcmp  Returned PCM handle
name  ASCII identifier of the PCM handle
stream  Wanted stream
mode  Open mode (see SND_PCM_NONBLOCK, SND_PCM_ASYNC)
Returns:
0 on success otherwise a negative error code

int snd_pcm_open_lconf snd_pcm_t **    pcmp,
const char *    name,
snd_pcm_stream_t    stream,
int    mode,
snd_config_t   lconf
 

Opens a PCM using local configuration.

Parameters:
pcmp  Returned PCM handle
name  ASCII identifier of the PCM handle
stream  Wanted stream
mode  Open mode (see SND_PCM_NONBLOCK, SND_PCM_ASYNC)
lconf  Local configuration
Returns:
0 on success otherwise a negative error code

int snd_pcm_pause snd_pcm_t   pcm,
int    enable
 

Pause/resume PCM.

Parameters:
pcm  PCM handle
pause  0 = resume, 1 = pause
Returns:
0 on success otherwise a negative error code

int snd_pcm_poll_descriptors snd_pcm_t   pcm,
struct pollfd *    pfds,
unsigned int    space
 

get poll descriptors

Parameters:
pcm  PCM handle
pfds  array of poll descriptors
space  space in the poll descriptor array
Returns:
count of filled descriptors

int snd_pcm_poll_descriptors_count snd_pcm_t   pcm
 

get count of poll descriptors for PCM handle

Parameters:
pcm  PCM handle
Returns:
count of poll descriptors

int snd_pcm_poll_descriptors_revents snd_pcm_t   pcm,
struct pollfd *    pfds,
unsigned int    nfds,
unsigned short *    revents
 

get returned events from poll descriptors

Parameters:
pcm  PCM handle
pfds  array of poll descriptors
nfds  count of poll descriptors
revents  returned events
Returns:
zero if success, otherwise a negative error code

int snd_pcm_prepare snd_pcm_t   pcm
 

Prepare PCM for use.

Parameters:
pcm  PCM handle
Returns:
0 on success otherwise a negative error code

snd_pcm_sframes_t snd_pcm_readi snd_pcm_t   pcm,
void *    buffer,
snd_pcm_uframes_t    size
 

Read interleaved frames from a PCM.

Parameters:
pcm  PCM handle
buffer  frames containing buffer
size  frames to be written
Returns:
a positive number of frames actually read otherwise a negative error code
Return values:
-EBADFD  PCM is not in the right state (SND_PCM_STATE_PREPARED or SND_PCM_STATE_RUNNING)
-EPIPE  an overrun occurred
-ESTRPIPE  a suspend event occurred (stream is suspended and waiting for an application recovery)
If the blocking behaviour was selected, then routine waits until all requested bytes are filled. The count of bytes can be less only if a signal or underrun occurred.

If the non-blocking behaviour is selected, then routine doesn't wait at all.

snd_pcm_sframes_t snd_pcm_readn snd_pcm_t   pcm,
void **    bufs,
snd_pcm_uframes_t    size
 

Read non interleaved frames to a PCM.

Parameters:
pcm  PCM handle
bufs  frames containing buffers (one for each channel)
size  frames to be written
Returns:
a positive number of frames actually read otherwise a negative error code
Return values:
-EBADFD  PCM is not in the right state (SND_PCM_STATE_PREPARED or SND_PCM_STATE_RUNNING)
-EPIPE  an overrun occurred
-ESTRPIPE  a suspend event occurred (stream is suspended and waiting for an application recovery)
If the blocking behaviour was selected, then routine waits until all requested bytes are filled. The count of bytes can be less only if a signal or underrun occurred.

If the non-blocking behaviour is selected, then routine doesn't wait at all.

int snd_pcm_reset snd_pcm_t   pcm
 

Reset PCM position.

Parameters:
pcm  PCM handle
Returns:
0 on success otherwise a negative error code
Reduce PCM delay to 0.

int snd_pcm_resume snd_pcm_t   pcm
 

Resume from suspend, no samples are lost.

Parameters:
pcm  PCM handle
Returns:
0 on success otherwise a negative error code
Return values:
-EAGAIN  resume can't be proceed immediately (audio hardware is probably still suspended)
-ENOSYS  hardware doesn't support this feature
This function can be used when the stream is in the suspend state to do the fine resume from this state. Not all hardware supports this feature, when an -ENOSYS error is returned, use the snd_pcm_prepare function to recovery.

snd_pcm_sframes_t snd_pcm_rewind snd_pcm_t   pcm,
snd_pcm_uframes_t    frames
 

Move application frame position backward.

Parameters:
pcm  PCM handle
frames  wanted displacement in frames
Returns:
a positive number for actual displacement otherwise a negative error code

ssize_t snd_pcm_samples_to_bytes snd_pcm_t   pcm,
long    samples
 

Convert samples in bytes for a PCM.

Parameters:
pcm  PCM handle
samples  quantity in samples
Returns:
quantity expressed in bytes

int snd_pcm_start snd_pcm_t   pcm
 

Start a PCM.

Parameters:
pcm  PCM handle
Returns:
0 on success otherwise a negative error code

const char* snd_pcm_start_mode_name snd_pcm_start_t    mode
 

(DEPRECATED) get name of PCM start mode setting

Parameters:
mode  PCM start mode
Returns:
ascii name of PCM start mode setting

snd_pcm_state_t snd_pcm_state snd_pcm_t   pcm
 

Return PCM state.

Parameters:
pcm  PCM handle
Returns:
PCM state snd_pcm_state_t of given PCM handle

const char* snd_pcm_state_name snd_pcm_state_t    state
 

get name of PCM state

Parameters:
state  PCM state
Returns:
ascii name of PCM state

int snd_pcm_status snd_pcm_t   pcm,
snd_pcm_status_t   status
 

Obtain status (runtime) information for PCM handle.

Parameters:
pcm  PCM handle
status  Status container
Returns:
0 on success otherwise a negative error code

void snd_pcm_status_copy snd_pcm_status_t   dst,
const snd_pcm_status_t   src
 

copy one snd_pcm_status_t to another

Parameters:
dst  pointer to destination
src  pointer to source

int snd_pcm_status_dump snd_pcm_status_t   status,
snd_output_t   out
 

Dump status.

Parameters:
status  Status container
out  Output handle
Returns:
0 on success otherwise a negative error code

void snd_pcm_status_free snd_pcm_status_t   obj
 

frees a previously allocated snd_pcm_status_t

Parameters:
pointer  to object to free

snd_pcm_uframes_t snd_pcm_status_get_avail const snd_pcm_status_t   obj
 

Get number of frames available from a PCM status container (see snd_pcm_avail_update).

Returns:
Number of frames ready to be read/written

snd_pcm_uframes_t snd_pcm_status_get_avail_max const snd_pcm_status_t   obj
 

Get maximum number of frames available from a PCM status container after last snd_pcm_status call.

Returns:
Maximum number of frames ready to be read/written

snd_pcm_sframes_t snd_pcm_status_get_delay const snd_pcm_status_t   obj
 

Get delay from a PCM status container (see snd_pcm_delay).

Returns:
Delay in frames
Delay is distance between current application frame position and sound frame position. It's positive and less than buffer size in normal situation, negative on playback underrun and greater than buffer size on capture overrun.

void snd_pcm_status_get_htstamp const snd_pcm_status_t   obj,
snd_htimestamp_t   ptr
 

Get "now" hi-res timestamp from a PCM status container.

Parameters:
ptr  Pointer to returned timestamp

snd_pcm_uframes_t snd_pcm_status_get_overrange const snd_pcm_status_t   obj
 

Get count of ADC overrange detections since last call.

Returns:
Count of ADC overrange detections

snd_pcm_state_t snd_pcm_status_get_state const snd_pcm_status_t   obj
 

Get state from a PCM status container (see snd_pcm_state).

Returns:
PCM state

void snd_pcm_status_get_trigger_htstamp const snd_pcm_status_t   obj,
snd_htimestamp_t   ptr
 

Get trigger hi-res timestamp from a PCM status container.

Parameters:
ptr  Pointer to returned timestamp

void snd_pcm_status_get_trigger_tstamp const snd_pcm_status_t   obj,
snd_timestamp_t   ptr
 

Get trigger timestamp from a PCM status container.

Parameters:
ptr  Pointer to returned timestamp

void snd_pcm_status_get_tstamp const snd_pcm_status_t   obj,
snd_timestamp_t   ptr
 

Get "now" timestamp from a PCM status container.

Parameters:
ptr  Pointer to returned timestamp

int snd_pcm_status_malloc snd_pcm_status_t **    ptr
 

allocate an invalid snd_pcm_status_t using standard malloc

Parameters:
ptr  returned pointer
Returns:
0 on success otherwise negative error code

size_t snd_pcm_status_sizeof void   
 

get size of snd_pcm_status_t

Returns:
size in bytes

snd_pcm_stream_t snd_pcm_stream snd_pcm_t   pcm
 

get stream for a PCM handle

Parameters:
pcm  PCM handle
Returns:
stream of PCM handle
Returns the type snd_pcm_stream_t of given PCM handle.

const char* snd_pcm_stream_name snd_pcm_stream_t    stream
 

get name of PCM stream

Parameters:
stream  PCM stream
Returns:
ascii name of PCM stream

const char* snd_pcm_subformat_description snd_pcm_subformat_t    subformat
 

get description of PCM sample subformat

Parameters:
subformat  PCM sample subformat
Returns:
ascii description of PCM sample subformat

void snd_pcm_subformat_mask_any snd_pcm_subformat_mask_t   mask
 

set all bits in a snd_pcm_subformat_mask_t

Parameters:
mask  pointer to mask

void snd_pcm_subformat_mask_copy snd_pcm_subformat_mask_t   dst,
const snd_pcm_subformat_mask_t   src
 

copy one snd_pcm_subformat_mask_t to another

Parameters:
dst  pointer to destination
src  pointer to source

int snd_pcm_subformat_mask_empty const snd_pcm_subformat_mask_t   mask
 

test, if given a snd_pcm_subformat_mask_t is empty

Parameters:
mask  pointer to mask
Return values:
0  not empty
1  empty

void snd_pcm_subformat_mask_free snd_pcm_subformat_mask_t   obj
 

frees a previously allocated snd_pcm_subformat_mask_t

Parameters:
pointer  to object to free

int snd_pcm_subformat_mask_malloc snd_pcm_subformat_mask_t **    ptr
 

allocate an empty snd_pcm_subformat_mask_t using standard malloc

Parameters:
ptr  returned pointer
Returns:
0 on success otherwise negative error code

void snd_pcm_subformat_mask_none snd_pcm_subformat_mask_t   mask
 

reset all bits in a snd_pcm_subformat_mask_t

Parameters:
mask  pointer to mask

void snd_pcm_subformat_mask_reset snd_pcm_subformat_mask_t   mask,
snd_pcm_subformat_t    val
 

make a subformat missing from a snd_pcm_subformat_mask_t

Parameters:
mask  pointer to mask
val  subformat

void snd_pcm_subformat_mask_set snd_pcm_subformat_mask_t   mask,
snd_pcm_subformat_t    val
 

make a subformat present in a snd_pcm_subformat_mask_t

Parameters:
mask  pointer to mask
val  subformat

size_t snd_pcm_subformat_mask_sizeof void   
 

get size of snd_pcm_subformat_mask_t

Returns:
size in bytes

int snd_pcm_subformat_mask_test const snd_pcm_subformat_mask_t   mask,
snd_pcm_subformat_t    val
 

test the presence of a subformat in a snd_pcm_subformat_mask_t

Parameters:
mask  pointer to mask
val  subformat

const char* snd_pcm_subformat_name snd_pcm_subformat_t    subformat
 

get name of PCM sample subformat

Parameters:
format  PCM sample subformat
Returns:
ascii name of PCM sample subformat

int snd_pcm_sw_params snd_pcm_t   pcm,
snd_pcm_sw_params_t   params
 

Install PCM software configuration defined by params.

Parameters:
pcm  PCM handle
params  Configuration container
Returns:
0 on success otherwise a negative error code

void snd_pcm_sw_params_copy snd_pcm_sw_params_t   dst,
const snd_pcm_sw_params_t   src
 

copy one snd_pcm_sw_params_t to another

Parameters:
dst  pointer to destination
src  pointer to source

int snd_pcm_sw_params_current snd_pcm_t   pcm,
snd_pcm_sw_params_t   params
 

Return current software configuration for a PCM.

Parameters:
pcm  PCM handle
params  Software configuration container
Returns:
0 on success otherwise a negative error code

int snd_pcm_sw_params_dump snd_pcm_sw_params_t   params,
snd_output_t   out
 

Dump a software configuration.

Parameters:
params  Software configuration container
out  Output handle
Returns:
0 on success otherwise a negative error code

void snd_pcm_sw_params_free snd_pcm_sw_params_t   obj
 

frees a previously allocated snd_pcm_sw_params_t

Parameters:
pointer  to object to free

int snd_pcm_sw_params_get_avail_min const snd_pcm_sw_params_t   params,
snd_pcm_uframes_t   val
 

Get avail min from a software configuration container.

Parameters:
params  Software configuration container
val  returned minimum available frames to consider PCM ready
Returns:
0 otherwise a negative error code
Note: To use this function add 'define ALSA_PCM_NEW_SW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

int snd_pcm_sw_params_get_silence_size const snd_pcm_sw_params_t   params,
snd_pcm_uframes_t   val
 

Get silence size from a software configuration container.

Parameters:
params  Software configuration container
val  Returned silence size in frames (0 for disabled)
Returns:
0 otherwise a negative error code
A portion of playback buffer is overwritten with silence when playback underrun is nearer than silence threshold (see snd_pcm_sw_params_set_silence_threshold)

Note: To use this function add 'define ALSA_PCM_NEW_SW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

int snd_pcm_sw_params_get_silence_threshold const snd_pcm_sw_params_t   params,
snd_pcm_uframes_t   val
 

Get silence threshold from a software configuration container.

Parameters:
params  Software configuration container
val  Returned silence threshold in frames
Returns:
0 otherwise a negative error value
A portion of playback buffer is overwritten with silence (see snd_pcm_sw_params_get_silence_size) when playback underrun is nearer than silence threshold

Note: To use this function add 'define ALSA_PCM_NEW_SW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

int snd_pcm_sw_params_get_sleep_min const snd_pcm_sw_params_t   params,
unsigned int *    val
 

Get minimum numbers of ticks to sleep from a software configuration container.

Parameters:
params  Software configuration container
val  returned minimum number of ticks to sleep or 0 if tick timer is disabled
Returns:
0 otherwise a negative error code
Note: To use this function add 'define ALSA_PCM_NEW_SW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

snd_pcm_start_t snd_pcm_sw_params_get_start_mode const snd_pcm_sw_params_t   params
 

(DEPRECATED) Get start mode from a software configuration container

Parameters:
params  Software configuration container
Returns:
start mode

int snd_pcm_sw_params_get_start_threshold const snd_pcm_sw_params_t   params,
snd_pcm_uframes_t   val
 

Get start threshold from a software configuration container.

Parameters:
params  Software configuration container
val  Returned start threshold in frames
Returns:
0 otherwise a negative error code
PCM is automatically started when playback frames available to PCM are >= threshold or when requested capture frames are >= threshold

Note: To use this function add 'define ALSA_PCM_NEW_SW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

int snd_pcm_sw_params_get_stop_threshold const snd_pcm_sw_params_t   params,
snd_pcm_uframes_t   val
 

Get stop threshold from a software configuration container.

Parameters:
params  Software configuration container
val  Returned stop threshold in frames
Returns:
0 otherwise a negative error code
PCM is automatically stopped in SND_PCM_STATE_XRUN state when available frames is >= threshold

Note: To use this function add 'define ALSA_PCM_NEW_SW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

int snd_pcm_sw_params_get_tstamp_mode const snd_pcm_sw_params_t   params,
snd_pcm_tstamp_t   val
 

Get timestamp mode from a software configuration container.

Parameters:
params  Software configuration container
val  Returned timestamp
Returns:
0 otherwise a negative error code
Note: To use this function add 'define ALSA_PCM_NEW_HW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

int snd_pcm_sw_params_get_xfer_align const snd_pcm_sw_params_t   params,
snd_pcm_uframes_t   val
 

Get xfer align from a software configuration container.

Parameters:
params  Software configuration container
val  returned chunk size (frames are attempted to be transferred in chunks)
0  otherwise a negative error code
Note: To use this function add 'define ALSA_PCM_NEW_SW_PARAMS_API' before 'include <alsa/asoundlib.h>' to enable this new function prototype. Using of older function with same name is deprecated.

snd_pcm_xrun_t snd_pcm_sw_params_get_xrun_mode const snd_pcm_sw_params_t   params
 

(DEPRECATED) Get xrun mode from a software configuration container

Parameters:
params  Software configuration container
Returns:
xrun mode

int snd_pcm_sw_params_malloc snd_pcm_sw_params_t **    ptr
 

allocate an invalid snd_pcm_sw_params_t using standard malloc

Parameters:
ptr  returned pointer
Returns:
0 on success otherwise negative error code

int snd_pcm_sw_params_set_avail_min snd_pcm_t   pcm,
snd_pcm_sw_params_t   params,
snd_pcm_uframes_t    val
 

Set avail min inside a software configuration container.

Parameters:
pcm  PCM handle
params  Software configuration container
val  Minimum avail frames to consider PCM ready
Returns:
0 otherwise a negative error code
Note: This is similar to setting an OSS wakeup point. The valid values for 'val' are determined by the specific hardware. Most PC sound cards can only accept power of 2 frame counts (i.e. 512, 1024, 2048). You cannot use this as a high resolution timer - it is limited to how often the sound card hardware raises an interrupt. Note that you can greatly improve the reponses using snd_pcm_sw_params_set_sleep_min where another timing source is used.

int snd_pcm_sw_params_set_silence_size snd_pcm_t   pcm,
snd_pcm_sw_params_t   params,
snd_pcm_uframes_t    val
 

Set silence size inside a software configuration container.

Parameters:
pcm  PCM handle
params  Software configuration container
val  Silence size in frames (0 for disabled)
Returns:
0 otherwise a negative error code
A portion of playback buffer is overwritten with silence when playback underrun is nearer than silence threshold (see snd_pcm_sw_params_set_silence_threshold)

The special case is when silence size value is equal or greater than boundary. The whole ring buffer is filled with silence at start. Later, only just processed area is filled with silence. Note: silence_threshold must be set to zero.

int snd_pcm_sw_params_set_silence_threshold snd_pcm_t   pcm,
snd_pcm_sw_params_t   params,
snd_pcm_uframes_t    val
 

Set silence threshold inside a software configuration container.

Parameters:
pcm  PCM handle
params  Software configuration container
val  Silence threshold in frames
Returns:
0 otherwise a negative error code
A portion of playback buffer is overwritten with silence (see snd_pcm_sw_params_set_silence_size) when playback underrun is nearer than silence threshold

int snd_pcm_sw_params_set_sleep_min snd_pcm_t   pcm,
snd_pcm_sw_params_t   params,
unsigned int    val
 

Set minimum number of ticks to sleep inside a software configuration container.

Parameters:
pcm  PCM handle
params  Software configuration container
val  Minimum ticks to sleep or 0 to disable the use of tick timer
Returns:
0 otherwise a negative error code

int snd_pcm_sw_params_set_start_mode snd_pcm_t   pcm,
snd_pcm_sw_params_t   params,
snd_pcm_start_t    val
 

(DEPRECATED) Set start mode inside a software configuration container

Parameters:
pcm  PCM handle
params  Software configuration container
val  Start mode
Returns:
0 otherwise a negative error code

int snd_pcm_sw_params_set_start_threshold snd_pcm_t   pcm,
snd_pcm_sw_params_t   params,
snd_pcm_uframes_t    val
 

Set start threshold inside a software configuration container.

Parameters:
pcm  PCM handle
params  Software configuration container
val  Start threshold in frames
Returns:
0 otherwise a negative error code
PCM is automatically started when playback frames available to PCM are >= threshold or when requested capture frames are >= threshold

int snd_pcm_sw_params_set_stop_threshold snd_pcm_t   pcm,
snd_pcm_sw_params_t   params,
snd_pcm_uframes_t    val
 

Set stop threshold inside a software configuration container.

Parameters:
pcm  PCM handle
params  Software configuration container
val  Stop threshold in frames
Returns:
0 otherwise a negative error code
PCM is automatically stopped in SND_PCM_STATE_XRUN state when available frames is >= threshold

int snd_pcm_sw_params_set_tstamp_mode snd_pcm_t   pcm,
snd_pcm_sw_params_t   params,
snd_pcm_tstamp_t    val
 

Set timestamp mode inside a software configuration container.

Parameters:
pcm  PCM handle
params  Software configuration container
val  Timestamp mode
Returns:
0 otherwise a negative error code

int snd_pcm_sw_params_set_xfer_align snd_pcm_t   pcm,
snd_pcm_sw_params_t   params,
snd_pcm_uframes_t    val
 

Set xfer align inside a software configuration container.

Parameters:
pcm  PCM handle
params  Software configuration container
val  Chunk size (frames are attempted to be transferred in chunks)
Returns:
0 otherwise a negative error code

int snd_pcm_sw_params_set_xrun_mode snd_pcm_t   pcm,
snd_pcm_sw_params_t   params,
snd_pcm_xrun_t    val
 

(DEPRECATED) Set xrun mode inside a software configuration container

Parameters:
pcm  PCM handle
params  Software configuration container
val  Xrun mode
Returns:
0 otherwise a negative error code

size_t snd_pcm_sw_params_sizeof void   
 

get size of snd_pcm_sw_params_t

Returns:
size in bytes

const char* snd_pcm_tstamp_mode_name snd_pcm_tstamp_t    mode
 

get name of PCM tstamp mode setting

Parameters:
mode  PCM tstamp mode
Returns:
ascii name of PCM tstamp mode setting

snd_pcm_type_t snd_pcm_type snd_pcm_t   pcm
 

get type of PCM handle

Parameters:
pcm  PCM handle
Returns:
type of PCM handle
Returns the type snd_pcm_type_t of given PCM handle.

const char* snd_pcm_type_name snd_pcm_type_t    type
 

get name of PCM type

Parameters:
type  PCM type
Returns:
ascii name of PCM type

int snd_pcm_unlink snd_pcm_t   pcm
 

Remove a PCM from a linked group.

Parameters:
pcm  PCM handle
Returns:
0 on success otherwise a negative error code

int snd_pcm_wait snd_pcm_t   pcm,
int    timeout
 

Wait for a PCM to become ready.

Parameters:
pcm  PCM handle
timeout  maximum time in milliseconds to wait
Returns:
a positive value on success otherwise a negative error code (-EPIPE for the xrun and -ESTRPIPE for the suspended status)
Return values:
0  timeout occurred
1  PCM stream is ready for I/O

snd_pcm_sframes_t snd_pcm_writei snd_pcm_t   pcm,
const void *    buffer,
snd_pcm_uframes_t    size
 

Write interleaved frames to a PCM.

Parameters:
pcm  PCM handle
buffer  frames containing buffer
size  frames to be written
Returns:
a positive number of frames actually written otherwise a negative error code
Return values:
-EBADFD  PCM is not in the right state (SND_PCM_STATE_PREPARED or SND_PCM_STATE_RUNNING)
-EPIPE  an underrun occurred
-ESTRPIPE  a suspend event occurred (stream is suspended and waiting for an application recovery)
If the blocking behaviour is selected, then routine waits until all requested bytes are played or put to the playback ring buffer. The count of bytes can be less only if a signal or underrun occurred.

If the non-blocking behaviour is selected, then routine doesn't wait at all.

snd_pcm_sframes_t snd_pcm_writen snd_pcm_t   pcm,
void **    bufs,
snd_pcm_uframes_t    size
 

Write non interleaved frames to a PCM.

Parameters:
pcm  PCM handle
bufs  frames containing buffers (one for each channel)
size  frames to be written
Returns:
a positive number of frames actually written otherwise a negative error code
Return values:
-EBADFD  PCM is not in the right state (SND_PCM_STATE_PREPARED or SND_PCM_STATE_RUNNING)
-EPIPE  an underrun occurred
-ESTRPIPE  a suspend event occurred (stream is suspended and waiting for an application recovery)
If the blocking behaviour is selected, then routine waits until all requested bytes are played or put to the playback ring buffer. The count of bytes can be less only if a signal or underrun occurred.

If the non-blocking behaviour is selected, then routine doesn't wait at all.

const char* snd_pcm_xrun_mode_name snd_pcm_xrun_t    mode
 

(DEPRECATED) get name of PCM xrun mode setting

Parameters:
mode  PCM xrun mode
Returns:
ascii name of PCM xrun mode setting


Generated on Mon Oct 27 12:34:47 2003 for ALSA project - the C library reference by doxygen1.2.18