ALSA project - the C library reference
Macros | Functions
Hardware Parameters
Collaboration diagram for Hardware Parameters:

Macros

#define snd_pcm_hw_params_alloca(ptr)
 allocate an invalid snd_pcm_hw_params_t using standard alloca More...
 

Functions

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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
int snd_pcm_hw_params_is_monotonic (const snd_pcm_hw_params_t *params)
 Check if timestamps are monotonic for given configuration. More...
 
int snd_pcm_hw_params_can_overrange (const snd_pcm_hw_params_t *params)
 Check if hardware supports overrange detection. More...
 
int snd_pcm_hw_params_can_pause (const snd_pcm_hw_params_t *params)
 Check if hardware supports pause. More...
 
int snd_pcm_hw_params_can_resume (const snd_pcm_hw_params_t *params)
 Check if hardware supports resume. More...
 
int snd_pcm_hw_params_is_half_duplex (const snd_pcm_hw_params_t *params)
 Check if hardware does half-duplex only. More...
 
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) More...
 
int snd_pcm_hw_params_can_sync_start (const snd_pcm_hw_params_t *params)
 Check if hardware supports synchronized start with sample resolution. More...
 
int snd_pcm_hw_params_can_disable_period_wakeup (const snd_pcm_hw_params_t *params)
 Check if hardware can disable period wakeups. More...
 
int snd_pcm_hw_params_supports_audio_wallclock_ts (const snd_pcm_hw_params_t *params)
 Check if hardware supports audio wallclock timestamps. More...
 
int snd_pcm_hw_params_supports_audio_ts_type (const snd_pcm_hw_params_t *params, int type)
 Check if hardware supports type of audio timestamps. More...
 
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. More...
 
int snd_pcm_hw_params_get_sbits (const snd_pcm_hw_params_t *params)
 Get sample resolution info from a configuration space. More...
 
int snd_pcm_hw_params_get_fifo_size (const snd_pcm_hw_params_t *params)
 Get hardware FIFO size info from a configuration space. More...
 
size_t snd_pcm_hw_params_sizeof (void)
 get size of snd_pcm_hw_params_t More...
 
int snd_pcm_hw_params_malloc (snd_pcm_hw_params_t **ptr)
 allocate an invalid snd_pcm_hw_params_t using standard malloc More...
 
void snd_pcm_hw_params_free (snd_pcm_hw_params_t *obj)
 frees a previously allocated snd_pcm_hw_params_t More...
 
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 More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
int snd_pcm_hw_params_get_format (const snd_pcm_hw_params_t *params, snd_pcm_format_t *val)
 Extract format from a configuration space. More...
 
int snd_pcm_hw_params_test_format (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t val)
 Verify if a format is available inside a configuration space for a PCM. More...
 
int snd_pcm_hw_params_set_format (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t val)
 Restrict a configuration space to contain only one format. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
int snd_pcm_hw_params_get_channels (const snd_pcm_hw_params_t *params, unsigned int *val)
 Extract channels from a configuration space. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
int snd_pcm_hw_params_set_rate_resample (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val)
 Restrict a configuration space to contain only real hardware rates. More...
 
int snd_pcm_hw_params_get_rate_resample (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val)
 Extract resample state from a configuration space. More...
 
int snd_pcm_hw_params_set_export_buffer (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val)
 Restrict a configuration space to allow the buffer to be accessible from outside. More...
 
int snd_pcm_hw_params_get_export_buffer (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val)
 Extract buffer accessibility from a configuration space. More...
 
int snd_pcm_hw_params_set_period_wakeup (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val)
 Restrict a configuration space to settings without period wakeups. More...
 
int snd_pcm_hw_params_get_period_wakeup (snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val)
 Extract period wakeup flag from a configuration space. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
int snd_pcm_hw_params_get_period_size (const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *frames, int *dir)
 Extract period size from a configuration space. More...
 
int snd_pcm_hw_params_get_period_size_min (const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *frames, int *dir)
 Extract minimum period size from a configuration space. More...
 
int snd_pcm_hw_params_get_period_size_max (const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *frames, int *dir)
 Extract maximum period size from a configuration space. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 

Detailed Description

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

Macro Definition Documentation

◆ snd_pcm_hw_params_alloca

#define snd_pcm_hw_params_alloca (   ptr)

allocate an invalid snd_pcm_hw_params_t using standard alloca

Parameters
ptrreturned pointer
Examples
/test/latency.c, and /test/pcm.c.

Function Documentation

◆ snd_pcm_hw_params_any()

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
pcmPCM handle
paramsConfiguration space

The configuration space will be filled with all possible ranges for the PCM device.

Examples
/test/latency.c, and /test/pcm.c.

◆ snd_pcm_hw_params_can_disable_period_wakeup()

int snd_pcm_hw_params_can_disable_period_wakeup ( const snd_pcm_hw_params_t params)

Check if hardware can disable period wakeups.

Parameters
paramsConfiguration space
Return values
0Hardware cannot disable period wakeups
1Hardware can disable period wakeups

◆ snd_pcm_hw_params_can_mmap_sample_resolution()

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
paramsConfiguration space
Return values
0Hardware doesn't support sample-resolution mmap
1Hardware supports sample-resolution mmap

This function should only be called when the configuration space contains a single configuration. Call snd_pcm_hw_params to choose a single configuration from the configuration space.

◆ snd_pcm_hw_params_can_overrange()

int snd_pcm_hw_params_can_overrange ( const snd_pcm_hw_params_t params)

Check if hardware supports overrange detection.

Parameters
paramsConfiguration space
Return values
0Hardware doesn't support overrange detection
1Hardware supports overrange detection

This function should only be called when the configuration space contains a single configuration. Call snd_pcm_hw_params to choose a single configuration from the configuration space.

◆ snd_pcm_hw_params_can_pause()

int snd_pcm_hw_params_can_pause ( const snd_pcm_hw_params_t params)

Check if hardware supports pause.

Parameters
paramsConfiguration space
Return values
0Hardware doesn't support pause
1Hardware supports pause

This function should only be called when the configuration space contains a single configuration. Call snd_pcm_hw_params to choose a single configuration from the configuration space.

◆ snd_pcm_hw_params_can_resume()

int snd_pcm_hw_params_can_resume ( const snd_pcm_hw_params_t params)

Check if hardware supports resume.

Parameters
paramsConfiguration space
Return values
0Hardware doesn't support resume
1Hardware supports resume

This function should only be called when the configuration space contains a single configuration. Call snd_pcm_hw_params to choose a single configuration from the configuration space.

◆ snd_pcm_hw_params_can_sync_start()

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
paramsConfiguration space
Return values
0Hardware doesn't support synchronized start
1Hardware supports synchronized start

This function should only be called when the configuration space contains a single configuration. Call snd_pcm_hw_params to choose a single configuration from the configuration space.

◆ snd_pcm_hw_params_copy()

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
dstpointer to destination
srcpointer to source
Examples
/test/latency.c.

◆ snd_pcm_hw_params_free()

void snd_pcm_hw_params_free ( snd_pcm_hw_params_t obj)

frees a previously allocated snd_pcm_hw_params_t

Parameters
objpointer to object to free

◆ snd_pcm_hw_params_get_access()

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
paramsConfiguration space
accessReturned value
Returns
access type otherwise a negative error code if the configuration space does not contain a single value

◆ snd_pcm_hw_params_get_access_mask()

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
paramsConfiguration space
maskReturned Access mask

◆ snd_pcm_hw_params_get_buffer_size()

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
paramsConfiguration space
valReturned buffer size in frames
Returns
0 otherwise a negative error code if the configuration space does not contain a single value
Examples
/test/latency.c, and /test/pcm.c.

◆ snd_pcm_hw_params_get_buffer_size_max()

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
paramsConfiguration space
valReturned approximate maximum buffer size in frames
Returns
0 otherwise a negative error code

Exact value is <,=,> the returned one following dir (-1,0,1)

◆ snd_pcm_hw_params_get_buffer_size_min()

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
paramsConfiguration space
valReturned approximate minimum buffer size in frames
Returns
0 otherwise a negative error code

◆ snd_pcm_hw_params_get_buffer_time()

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
paramsConfiguration space
valReturned buffer time in us
dirSub unit direction
Returns
0 otherwise a negative error code if the configuration space does not contain a single value

Actual exact value is <,=,> the approximate one following dir (-1, 0, 1)

◆ snd_pcm_hw_params_get_buffer_time_max()

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
paramsConfiguration space
valapproximate maximum buffer duration in us
dirSub unit direction
Returns
0 otherwise a negative error code

Exact value is <,=,> the returned one following dir (-1,0,1)

◆ snd_pcm_hw_params_get_buffer_time_min()

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
paramsConfiguration space
valapproximate minimum buffer duration in us
dirSub unit direction
Returns
0 otherwise a negative error code

Exact value is <,=,> the returned one following dir (-1,0,1)

◆ snd_pcm_hw_params_get_channels()

int snd_pcm_hw_params_get_channels ( const snd_pcm_hw_params_t params,
unsigned int *  val 
)

Extract channels from a configuration space.

Parameters
paramsConfiguration space
valReturned channels count
Returns
0 otherwise a negative error code if the configuration space does not contain a single value

◆ snd_pcm_hw_params_get_channels_max()

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
paramsConfiguration space
valmaximum channels count
Returns
0 otherwise a negative error code

◆ snd_pcm_hw_params_get_channels_min()

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
paramsConfiguration space
valminimum channels count
Returns
0 otherwise a negative error code

◆ snd_pcm_hw_params_get_export_buffer()

int snd_pcm_hw_params_get_export_buffer ( snd_pcm_t pcm,
snd_pcm_hw_params_t params,
unsigned int *  val 
)

Extract buffer accessibility from a configuration space.

Parameters
pcmPCM handle
paramsConfiguration space
val0 = disable, 1 = enable exporting buffer
Returns
0 otherwise a negative error code

◆ snd_pcm_hw_params_get_fifo_size()

int snd_pcm_hw_params_get_fifo_size ( const snd_pcm_hw_params_t params)

Get hardware FIFO size info from a configuration space.

Parameters
paramsConfiguration space
Returns
FIFO size in frames otherwise a negative error code if the info is not available

This function should only be called when the configuration space contains a single configuration. Call snd_pcm_hw_params to choose a single configuration from the configuration space.

◆ snd_pcm_hw_params_get_format()

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
paramsConfiguration space
formatreturned format
Returns
format otherwise a negative error code if the configuration space does not contain a single value

◆ snd_pcm_hw_params_get_format_mask()

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
paramsConfiguration space
maskReturned Format mask

◆ snd_pcm_hw_params_get_min_align()

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
paramsConfiguration space
valReturned minimum align value
Returns
0 otherwise a negative error code if the configuration space does not contain a single value

◆ snd_pcm_hw_params_get_period_size()

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
paramsConfiguration space
valReturned approximate period size in frames
dirSub unit direction
Returns
0 otherwise a negative error code if the configuration space does not contain a single value

Actual exact value is <,=,> the approximate one following dir (-1, 0, 1)

Examples
/test/latency.c, and /test/pcm.c.

◆ snd_pcm_hw_params_get_period_size_max()

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
paramsConfiguration space
valapproximate minimum period size in frames
dirSub unit direction
Returns
0 otherwise a negative error code

Exact value is <,=,> the returned one following dir (-1,0,1)

◆ snd_pcm_hw_params_get_period_size_min()

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
paramsConfiguration space
valapproximate minimum period size in frames
dirSub unit direction
Returns
0 otherwise a negative error code

Exact value is <,=,> the returned one following dir (-1,0,1)

◆ snd_pcm_hw_params_get_period_time()

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
paramsConfiguration space
valReturned approximate period duration in us
dirSub unit direction
Returns
0 otherwise a negative error code if the configuration space does not contain a single value

Actual exact value is <,=,> the approximate one following dir (-1, 0, 1)

Examples
/test/latency.c.

◆ snd_pcm_hw_params_get_period_time_max()

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
paramsConfiguration space
valapproximate maximum period duration in us
dirSub unit direction
Returns
0 otherwise a negative error code

Exact value is <,=,> the returned one following dir (-1,0,1)

◆ snd_pcm_hw_params_get_period_time_min()

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
paramsConfiguration space
valapproximate minimum period duration in us
dirSub unit direction
Returns
0 otherwise a negative error code

Exact value is <,=,> the returned one following dir (-1,0,1)

◆ snd_pcm_hw_params_get_period_wakeup()

int snd_pcm_hw_params_get_period_wakeup ( snd_pcm_t pcm,
snd_pcm_hw_params_t params,
unsigned int *  val 
)

Extract period wakeup flag from a configuration space.

Parameters
pcmPCM handle
paramsConfiguration space
val0 = disabled, 1 = enabled period wakeups
Returns
Zero on success, otherwise a negative error code.

◆ snd_pcm_hw_params_get_periods()

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
paramsConfiguration space
valapproximate periods per buffer
dirSub unit direction
Returns
0 otherwise a negative error code if the configuration space does not contain a single value

Actual exact value is <,=,> the approximate one following dir (-1, 0, 1)

◆ snd_pcm_hw_params_get_periods_max()

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
paramsConfiguration space
valapproximate maximum periods per buffer
dirSub unit direction
Returns
0 otherwise a negative error code

Exact value is <,=,> the returned one following dir (-1,0,1)

◆ snd_pcm_hw_params_get_periods_min()

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
paramsConfiguration space
valapproximate minimum periods per buffer
dirSub unit direction
Returns
0 otherwise a negative error code

Exact value is <,=,> the returned one following dir (-1,0,1)

Examples
/test/latency.c.

◆ snd_pcm_hw_params_get_rate()

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
paramsConfiguration space
valReturned approximate rate
dirSub unit direction
Returns
0 otherwise a negative error code if the configuration space does not contain a single value

Actual exact value is <,=,> the approximate one following dir (-1, 0, 1)

◆ snd_pcm_hw_params_get_rate_max()

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
paramsConfiguration space
valReturned approximate maximum rate
dirSub unit direction
Returns
0 otherwise a negative error code

Exact value is <,=,> the returned one following dir (-1,0,1)

◆ snd_pcm_hw_params_get_rate_min()

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
paramsConfiguration space
valReturned approximate minimum rate
dirSub unit direction
Returns
0 otherwise a negative error code

Exact value is <,=,> the returned one following dir (-1,0,1)

◆ snd_pcm_hw_params_get_rate_numden()

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
paramsConfiguration space
rate_numPointer to returned rate numerator
rate_denPointer to returned rate denominator
Returns
0 otherwise a negative error code if the info is not available

This function should only be called when the configuration space contains a single configuration. Call snd_pcm_hw_params to choose a single configuration from the configuration space.

◆ snd_pcm_hw_params_get_rate_resample()

int snd_pcm_hw_params_get_rate_resample ( snd_pcm_t pcm,
snd_pcm_hw_params_t params,
unsigned int *  val 
)

Extract resample state from a configuration space.

Parameters
pcmPCM handle
paramsConfiguration space
val0 = disable, 1 = enable rate resampling
Returns
0 otherwise a negative error code

◆ snd_pcm_hw_params_get_sbits()

int snd_pcm_hw_params_get_sbits ( const snd_pcm_hw_params_t params)

Get sample resolution info from a configuration space.

Parameters
paramsConfiguration space
Returns
signification bits in sample otherwise a negative error code if the info is not available

This function should only be called when the configuration space contains a single configuration. Call snd_pcm_hw_params to choose a single configuration from the configuration space.

◆ snd_pcm_hw_params_get_subformat()

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
paramsConfiguration space
subformatReturned subformat value
Returns
subformat otherwise a negative error code if the configuration space does not contain a single value

◆ snd_pcm_hw_params_get_subformat_mask()

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
paramsConfiguration space
maskReturned Subformat mask

◆ snd_pcm_hw_params_is_batch()

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
paramsConfiguration space
Return values
0Hardware doesn't do double buffering for data transfers
1Hardware does double buffering for data transfers

This function should only be called when the configuration space contains a single configuration. Call snd_pcm_hw_params to choose a single configuration from the configuration space.

◆ snd_pcm_hw_params_is_block_transfer()

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
paramsConfiguration space
Return values
0Hardware doesn't block transfers
1Hardware does block transfers

This function should only be called when the configuration space contains a single configuration. Call snd_pcm_hw_params to choose a single configuration from the configuration space.

◆ snd_pcm_hw_params_is_double()

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
paramsConfiguration space
Return values
0Hardware doesn't do double buffering for start/stop
1Hardware does double buffering for start/stop

This function should only be called when the configuration space contains a single configuration. Call snd_pcm_hw_params to choose a single configuration from the configuration space.

◆ snd_pcm_hw_params_is_half_duplex()

int snd_pcm_hw_params_is_half_duplex ( const snd_pcm_hw_params_t params)

Check if hardware does half-duplex only.

Parameters
paramsConfiguration space
Return values
0Hardware doesn't do half-duplex
1Hardware does half-duplex

This function should only be called when the configuration space contains a single configuration. Call snd_pcm_hw_params to choose a single configuration from the configuration space.

◆ snd_pcm_hw_params_is_joint_duplex()

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
paramsConfiguration space
Return values
0Hardware doesn't do joint-duplex
1Hardware does joint-duplex

This function should only be called when the configuration space contains a single configuration. Call snd_pcm_hw_params to choose a single configuration from the configuration space.

◆ snd_pcm_hw_params_is_monotonic()

int snd_pcm_hw_params_is_monotonic ( const snd_pcm_hw_params_t params)

Check if timestamps are monotonic for given configuration.

Parameters
paramsConfiguration space
Return values
0Device doesn't do monotomic timestamps
1Device does monotonic timestamps

This function should only be called when the configuration space contains a single configuration. Call snd_pcm_hw_params to choose a single configuration from the configuration space.

◆ snd_pcm_hw_params_malloc()

int snd_pcm_hw_params_malloc ( snd_pcm_hw_params_t **  ptr)

allocate an invalid snd_pcm_hw_params_t using standard malloc

Parameters
ptrreturned pointer
Returns
0 on success otherwise negative error code

◆ snd_pcm_hw_params_set_access()

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
pcmPCM handle
paramsConfiguration space
accessaccess type
Returns
0 otherwise a negative error code if configuration space would become empty
Examples
/test/latency.c, and /test/pcm.c.

◆ snd_pcm_hw_params_set_access_first()

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
pcmPCM handle
paramsConfiguration space
accessReturned first access type
Returns
0 otherwise a negative error code

◆ snd_pcm_hw_params_set_access_last()

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
pcmPCM handle
paramsConfiguration space
accessReturned last access type
Returns
0 otherwise a negative error code

◆ snd_pcm_hw_params_set_access_mask()

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
pcmPCM handle
paramsConfiguration space
maskAccess mask
Returns
0 otherwise a negative error code

◆ snd_pcm_hw_params_set_buffer_size()

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
pcmPCM handle
paramsConfiguration space
valbuffer 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)

◆ snd_pcm_hw_params_set_buffer_size_first()

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
pcmPCM handle
paramsConfiguration space
valReturned minimum buffer size in frames
Returns
buffer size in frames

◆ snd_pcm_hw_params_set_buffer_size_last()

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
pcmPCM handle
paramsConfiguration space
valReturned maximum buffer size in frames
Returns
0 otherwise a negative error code

◆ snd_pcm_hw_params_set_buffer_size_max()

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
pcmPCM handle
paramsConfiguration space
valapproximate maximum buffer size in frames (on return filled with actual maximum)
Returns
0 otherwise a negative error code if configuration space would become empty

◆ snd_pcm_hw_params_set_buffer_size_min()

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
pcmPCM handle
paramsConfiguration space
valapproximate minimum buffer size in frames (on return filled with actual minimum)
Returns
0 otherwise a negative error code if configuration space would become empty

◆ snd_pcm_hw_params_set_buffer_size_minmax()

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
pcmPCM handle
paramsConfiguration space
minapproximate minimum buffer size in frames (on return filled with actual minimum)
maxapproximate maximum buffer size in frames (on return filled with actual maximum)
Returns
0 otherwise a negative error code if configuration space would become empty

◆ snd_pcm_hw_params_set_buffer_size_near()

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
pcmPCM handle
paramsConfiguration space
valapproximate target buffer size in frames / returned chosen approximate target buffer size in frames
Returns
0 otherwise a negative error code if configuration space is empty
Examples
/test/latency.c.

◆ snd_pcm_hw_params_set_buffer_time()

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
pcmPCM handle
paramsConfiguration space
valapproximate buffer duration in us
dirSub 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)

◆ snd_pcm_hw_params_set_buffer_time_first()

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
pcmPCM handle
paramsConfiguration space
valReturned approximate minimum buffer duration in us
dirSub unit direction
Returns
0 otherwise a negative error code

Actual exact value is <,=,> the approximate one following dir (-1, 0, 1)

◆ snd_pcm_hw_params_set_buffer_time_last()

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
pcmPCM handle
paramsConfiguration space
valReturned approximate maximum buffer duration in us
dirSub unit direction
Returns
0 otherwise a negative error code

Actual exact value is <,=,> the approximate one following dir (-1, 0, 1)

◆ snd_pcm_hw_params_set_buffer_time_max()

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
pcmPCM handle
paramsConfiguration space
valapproximate maximum buffer duration in us (on return filled with actual maximum)
dirSub 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)

◆ snd_pcm_hw_params_set_buffer_time_min()

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
pcmPCM handle
paramsConfiguration space
valapproximate minimum buffer duration in us (on return filled with actual minimum)
dirSub 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)

◆ snd_pcm_hw_params_set_buffer_time_minmax()

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
pcmPCM handle
paramsConfiguration space
minapproximate minimum buffer duration in us (on return filled with actual minimum)
mindirSub unit direction for minimum (on return filled with actual direction)
maxapproximate maximum buffer duration in us (on return filled with actual maximum)
maxdirSub 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)

◆ snd_pcm_hw_params_set_buffer_time_near()

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
pcmPCM handle
paramsConfiguration space
valapproximate target buffer duration in us / returned chosen approximate target buffer duration
dirSub unit direction
Returns
0 otherwise a negative error code if configuration space is empty

target/chosen exact value is <,=,> val following dir (-1,0,1)

Examples
/test/pcm.c.

◆ snd_pcm_hw_params_set_channels()

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
pcmPCM handle
paramsConfiguration space
valchannels count
Returns
0 otherwise a negative error code if configuration space would become empty
Examples
/test/latency.c, and /test/pcm.c.

◆ snd_pcm_hw_params_set_channels_first()

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
pcmPCM handle
paramsConfiguration space
valminimum channels count
Returns
0 otherwise a negative error code

◆ snd_pcm_hw_params_set_channels_last()

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
pcmPCM handle
paramsConfiguration space
valmaximum channels count
Returns
0 otherwise a negative error code

◆ snd_pcm_hw_params_set_channels_max()

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
pcmPCM handle
paramsConfiguration space
valmaximum channels count (on return filled with actual maximum)
Returns
0 otherwise a negative error code if configuration space would become empty

◆ snd_pcm_hw_params_set_channels_min()

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
pcmPCM handle
paramsConfiguration space
valminimum channels count (on return filled with actual minimum)
Returns
0 otherwise a negative error code if configuration space would become empty

◆ snd_pcm_hw_params_set_channels_minmax()

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
pcmPCM handle
paramsConfiguration space
minminimum channels count (on return filled with actual minimum)
maxmaximum channels count (on return filled with actual maximum)
Returns
0 otherwise a negative error code if configuration space would become empty

◆ snd_pcm_hw_params_set_channels_near()

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
pcmPCM handle
paramsConfiguration space
valtarget channels count, returned chosen channels count
Returns
0 otherwise a negative error code if configuration space is empty

◆ snd_pcm_hw_params_set_export_buffer()

int snd_pcm_hw_params_set_export_buffer ( snd_pcm_t pcm,
snd_pcm_hw_params_t params,
unsigned int  val 
)

Restrict a configuration space to allow the buffer to be accessible from outside.

Parameters
pcmPCM handle
paramsConfiguration space
val0 = disable, 1 = enable (default) exporting buffer
Returns
0 otherwise a negative error code

◆ snd_pcm_hw_params_set_format()

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
pcmPCM handle
paramsConfiguration space
formatformat
Returns
0 otherwise a negative error code
Examples
/test/latency.c, and /test/pcm.c.

◆ snd_pcm_hw_params_set_format_first()

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
pcmPCM handle
paramsConfiguration space
formatReturned first format
Returns
0 otherwise a negative error code

◆ snd_pcm_hw_params_set_format_last()

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
pcmPCM handle
paramsConfiguration space
formatReturned last format
Returns
0 otherwise a negative error code

◆ snd_pcm_hw_params_set_format_mask()

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
pcmPCM handle
paramsConfiguration space
maskFormat mask
Returns
0 otherwise a negative error code

◆ snd_pcm_hw_params_set_period_size()

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
pcmPCM handle
paramsConfiguration space
valapproximate period size in frames
dirSub 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)

◆ snd_pcm_hw_params_set_period_size_first()

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
pcmPCM handle
paramsConfiguration space
valReturned maximum approximate period size in frames
dirSub unit direction
Returns
0 otherwise a negative error code

Actual exact value is <,=,> the approximate one following dir (-1, 0, 1)

◆ snd_pcm_hw_params_set_period_size_integer()

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
pcmPCM handle
paramsConfiguration space
Returns
0 otherwise a negative error code if configuration space would become empty

◆ snd_pcm_hw_params_set_period_size_last()

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
pcmPCM handle
paramsConfiguration space
valReturned maximum approximate period size in frames
dirSub unit direction
Returns
0 otherwise a negative error code

Actual exact value is <,=,> the approximate one following dir (-1, 0, 1)

◆ snd_pcm_hw_params_set_period_size_max()

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
pcmPCM handle
paramsConfiguration space
valapproximate maximum period size in frames (on return filled with actual maximum)
dirSub 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)

◆ snd_pcm_hw_params_set_period_size_min()

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
pcmPCM handle
paramsConfiguration space
valapproximate minimum period size in frames (on return filled with actual minimum)
dirSub 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)

◆ snd_pcm_hw_params_set_period_size_minmax()

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
pcmPCM handle
paramsConfiguration space
minapproximate minimum period size in frames (on return filled with actual minimum)
mindirSub unit direction for minimum (on return filled with actual direction)
maxapproximate maximum period size in frames (on return filled with actual maximum)
maxdirSub 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)

◆ snd_pcm_hw_params_set_period_size_near()

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
pcmPCM handle
paramsConfiguration space
valapproximate target period size in frames / returned chosen approximate target period size
dirSub unit direction
Returns
0 otherwise a negative error code if configuration space is empty

target/chosen exact value is <,=,> val following dir (-1,0,1)

Examples
/test/latency.c.

◆ snd_pcm_hw_params_set_period_time()

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
pcmPCM handle
paramsConfiguration space
valapproximate period duration in us
dirSub 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)

◆ snd_pcm_hw_params_set_period_time_first()

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
pcmPCM handle
paramsConfiguration space
valReturned approximate period duration in us
dirSub unit direction
Returns
0 otherwise a negative error code

Actual exact value is <,=,> the approximate one following dir (-1, 0, 1)

◆ snd_pcm_hw_params_set_period_time_last()

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
pcmPCM handle
paramsConfiguration space
valReturned maximum approximate period time
dirSub unit direction
Returns
approximate period duration in us

◆ snd_pcm_hw_params_set_period_time_max()

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
pcmPCM handle
paramsConfiguration space
valapproximate maximum period duration in us (on return filled with actual maximum)
dirSub 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)

◆ snd_pcm_hw_params_set_period_time_min()

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
pcmPCM handle
paramsConfiguration space
valapproximate minimum period duration in us (on return filled with actual minimum)
dirSub 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)

◆ snd_pcm_hw_params_set_period_time_minmax()

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
pcmPCM handle
paramsConfiguration space
minapproximate minimum period duration in us (on return filled with actual minimum)
mindirSub unit direction for minimum (on return filled with actual direction)
maxapproximate maximum period duration in us (on return filled with actual maximum)
maxdirSub 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)

◆ snd_pcm_hw_params_set_period_time_near()

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
pcmPCM handle
paramsConfiguration space
valapproximate target period duration in us / returned chosen approximate target period duration
dirSub unit direction
Returns
0 otherwise a negative error code if configuration space is empty

target/chosen exact value is <,=,> val following dir (-1,0,1)

Examples
/test/pcm.c.

◆ snd_pcm_hw_params_set_period_wakeup()

int snd_pcm_hw_params_set_period_wakeup ( snd_pcm_t pcm,
snd_pcm_hw_params_t params,
unsigned int  val 
)

Restrict a configuration space to settings without period wakeups.

Parameters
pcmPCM handle
paramsConfiguration space
val0 = disable, 1 = enable (default) period wakeup
Returns
Zero on success, otherwise a negative error code.

This function must be called only on devices where non-blocking mode is enabled.

To check whether the hardware does support disabling period wakeups, call snd_pcm_hw_params_can_disable_period_wakeup(). If the hardware does not support this mode, standard period wakeups will be generated.

Even with disabled period wakeups, the period size/time/count parameters are valid; it is suggested to use snd_pcm_hw_params_set_period_size_last().

When period wakeups are disabled, the application must not use any functions that could block on this device. The use of poll should be limited to error cases. The application needs to use an external event or a timer to check the state of the ring buffer and refill it apropriately.

◆ snd_pcm_hw_params_set_periods()

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
pcmPCM handle
paramsConfiguration space
valapproximate periods per buffer
dirSub 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)

◆ snd_pcm_hw_params_set_periods_first()

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
pcmPCM handle
paramsConfiguration space
valReturned approximate minimum periods per buffer
dirSub unit direction
Returns
0 otherwise a negative error code

Actual exact value is <,=,> the approximate one following dir (-1, 0, 1)

◆ snd_pcm_hw_params_set_periods_integer()

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
pcmPCM handle
paramsConfiguration space
Returns
0 otherwise a negative error code if configuration space would become empty

◆ snd_pcm_hw_params_set_periods_last()

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
pcmPCM handle
paramsConfiguration space
valReturned approximate maximum periods per buffer
dirSub unit direction
Returns
0 otherwise a negative error code

Actual exact value is <,=,> the approximate one following dir (-1, 0, 1)

◆ snd_pcm_hw_params_set_periods_max()

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
pcmPCM handle
paramsConfiguration space
valapproximate maximum periods per buffer (on return filled with actual maximum)
dirSub 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)

◆ snd_pcm_hw_params_set_periods_min()

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
pcmPCM handle
paramsConfiguration space
valapproximate minimum periods per buffer (on return filled with actual minimum)
dirSub 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)

◆ snd_pcm_hw_params_set_periods_minmax()

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
pcmPCM handle
paramsConfiguration space
minapproximate minimum periods per buffer (on return filled with actual minimum)
mindirSub unit direction for minimum (on return filled with actual direction)
maxapproximate maximum periods per buffer (on return filled with actual maximum)
maxdirSub 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)

◆ snd_pcm_hw_params_set_periods_near()

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
pcmPCM handle
paramsConfiguration space
valapproximate target periods per buffer / returned chosen approximate target periods per buffer
dirSub unit direction
Returns
0 otherwise a negative error code if configuration space is empty

target/chosen exact value is <,=,> val following dir (-1,0,1)

◆ snd_pcm_hw_params_set_rate()

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
pcmPCM handle
paramsConfiguration space
valapproximate rate
dirSub 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)

◆ snd_pcm_hw_params_set_rate_first()

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
pcmPCM handle
paramsConfiguration space
valReturned minimum approximate rate
dirSub unit direction
Returns
0 otherwise a negative error code

Actual exact value is <,=,> the approximate one following dir (-1, 0, 1)

◆ snd_pcm_hw_params_set_rate_last()

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
pcmPCM handle
paramsConfiguration space
valReturned maximum approximate rate
dirSub unit direction
Returns
0 otherwise a negative error code

Actual exact value is <,=,> the approximate one following dir (-1, 0, 1)

◆ snd_pcm_hw_params_set_rate_max()

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
pcmPCM handle
paramsConfiguration space
valapproximate maximum rate (on return filled with actual maximum)
dirSub 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)

◆ snd_pcm_hw_params_set_rate_min()

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
pcmPCM handle
paramsConfiguration space
valapproximate minimum rate (on return filled with actual minimum)
dirSub 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)

◆ snd_pcm_hw_params_set_rate_minmax()

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
pcmPCM handle
paramsConfiguration space
minapproximate minimum rate (on return filled with actual minimum)
mindirSub unit direction for minimum (on return filled with actual direction)
maxapproximate maximum rate (on return filled with actual maximum)
maxdirSub 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)

◆ snd_pcm_hw_params_set_rate_near()

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
pcmPCM handle
paramsConfiguration space
valapproximate target rate / returned approximate set rate
dirSub unit direction
Returns
0 otherwise a negative error code if configuration space is empty

target/chosen exact value is <,=,> val following dir (-1,0,1)

Examples
/test/latency.c, and /test/pcm.c.

◆ snd_pcm_hw_params_set_rate_resample()

int snd_pcm_hw_params_set_rate_resample ( snd_pcm_t pcm,
snd_pcm_hw_params_t params,
unsigned int  val 
)

Restrict a configuration space to contain only real hardware rates.

Parameters
pcmPCM handle
paramsConfiguration space
val0 = disable, 1 = enable (default) rate resampling
Returns
0 otherwise a negative error code
Examples
/test/latency.c, and /test/pcm.c.

◆ snd_pcm_hw_params_set_subformat()

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
pcmPCM handle
paramsConfiguration space
subformatsubformat value
Returns
0 otherwise a negative error code if configuration space would become empty

◆ snd_pcm_hw_params_set_subformat_first()

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
pcmPCM handle
paramsConfiguration space
subformatReturned subformat
Returns
0 otherwise a negative error code

◆ snd_pcm_hw_params_set_subformat_last()

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
pcmPCM handle
paramsConfiguration space
subformatReturned subformat
Returns
0 otherwise a negative error code

◆ snd_pcm_hw_params_set_subformat_mask()

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
pcmPCM handle
paramsConfiguration space
maskSubformat mask
Returns
0 otherwise a negative error code

◆ snd_pcm_hw_params_sizeof()

size_t snd_pcm_hw_params_sizeof ( void  )

get size of snd_pcm_hw_params_t

Returns
size in bytes

◆ snd_pcm_hw_params_supports_audio_ts_type()

int snd_pcm_hw_params_supports_audio_ts_type ( const snd_pcm_hw_params_t params,
int  type 
)

Check if hardware supports type of audio timestamps.

Parameters
paramsConfiguration space
typeAudio timestamp type
Return values
0Hardware doesn't support type of audio timestamps
1Hardware supports type of audio timestamps

This function should only be called when the configuration space contains a single configuration. Call snd_pcm_hw_params to choose a single configuration from the configuration space.

◆ snd_pcm_hw_params_supports_audio_wallclock_ts()

int snd_pcm_hw_params_supports_audio_wallclock_ts ( const snd_pcm_hw_params_t params)

Check if hardware supports audio wallclock timestamps.

Parameters
paramsConfiguration space
Return values
0Hardware doesn't support audio wallclock timestamps
1Hardware supports audio wallclock timestamps

This function should only be called when the configuration space contains a single configuration. Call snd_pcm_hw_params to choose a single configuration from the configuration space.

◆ snd_pcm_hw_params_test_access()

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
pcmPCM handle
paramsConfiguration space
accessaccess type
Returns
0 if available a negative error code otherwise

◆ snd_pcm_hw_params_test_buffer_size()

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
pcmPCM handle
paramsConfiguration space
valbuffer size in frames
Returns
0 if available a negative error code otherwise

Wanted exact value is <,=,> val following dir (-1,0,1)

◆ snd_pcm_hw_params_test_buffer_time()

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
pcmPCM handle
paramsConfiguration space
valapproximate buffer duration in us
dirSub unit direction
Returns
0 if available a negative error code otherwise

Wanted exact value is <,=,> val following dir (-1,0,1)

◆ snd_pcm_hw_params_test_channels()

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
pcmPCM handle
paramsConfiguration space
valchannels count
Returns
0 if available a negative error code otherwise

◆ snd_pcm_hw_params_test_format()

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
pcmPCM handle
paramsConfiguration space
formatformat
Returns
0 if available a negative error code otherwise

◆ snd_pcm_hw_params_test_period_size()

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
pcmPCM handle
paramsConfiguration space
valapproximate period size in frames
dirSub unit direction
Returns
0 if available a negative error code otherwise

Wanted exact value is <,=,> val following dir (-1,0,1)

◆ snd_pcm_hw_params_test_period_time()

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
pcmPCM handle
paramsConfiguration space
valapproximate period duration in us
dirSub unit direction
Returns
0 if available a negative error code otherwise

Wanted exact value is <,=,> val following dir (-1,0,1)

◆ snd_pcm_hw_params_test_periods()

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
pcmPCM handle
paramsConfiguration space
valapproximate periods per buffer
dirSub unit direction
Returns
0 if available a negative error code otherwise

Wanted exact value is <,=,> val following dir (-1,0,1)

◆ snd_pcm_hw_params_test_rate()

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
pcmPCM handle
paramsConfiguration space
valapproximate rate
dirSub unit direction
Returns
0 if available a negative error code otherwise

Wanted exact value is <,=,> val following dir (-1,0,1)

◆ snd_pcm_hw_params_test_subformat()

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
pcmPCM handle
paramsConfiguration space
subformatsubformat value
Returns
0 if available a negative error code otherwise