ALSA project - the C library reference
Loading...
Searching...
No Matches
pcm_simple.c File Reference

PCM Simple Interface. More...

Functions

int snd_spcm_init (snd_pcm_t *pcm, unsigned int rate, unsigned int channels, snd_pcm_format_t format, snd_pcm_subformat_t subformat, snd_spcm_latency_t latency, snd_pcm_access_t access, snd_spcm_xrun_type_t xrun_type)
 Set up a simple PCM.
 
int snd_spcm_init_duplex (snd_pcm_t *playback_pcm, snd_pcm_t *capture_pcm, unsigned int rate, unsigned int channels, snd_pcm_format_t format, snd_pcm_subformat_t subformat, snd_spcm_latency_t latency, snd_pcm_access_t access, snd_spcm_xrun_type_t xrun_type, snd_spcm_duplex_type_t duplex_type)
 Initialize simple PCMs in the duplex mode.
 
int snd_spcm_init_get_params (snd_pcm_t *pcm, unsigned int *rate, snd_pcm_uframes_t *buffer_size, snd_pcm_uframes_t *period_size)
 Get the set up of simple PCM.
 

Detailed Description

PCM Simple Interface.

Author
Jaroslav Kysela perex.nosp@m.@per.nosp@m.ex.cz
Date
2004

Function Documentation

◆ snd_spcm_init()

int snd_spcm_init ( snd_pcm_t * pcm,
unsigned int rate,
unsigned int channels,
snd_pcm_format_t format,
snd_pcm_subformat_t subformat,
snd_spcm_latency_t latency,
snd_pcm_access_t access,
snd_spcm_xrun_type_t xrun_type )

Set up a simple PCM.

Parameters
pcmPCM handle
rateSample rate
channelsNumber of channels
formatPCM format
subformatPCM subformat
latencyLatency type
accessPCM acceess type
xrun_typeXRUN type
Returns
0 if successful, or a negative error code
Warning
The simple PCM API may be broken in the current release.

◆ snd_spcm_init_duplex()

int snd_spcm_init_duplex ( snd_pcm_t * playback_pcm,
snd_pcm_t * capture_pcm,
unsigned int rate,
unsigned int channels,
snd_pcm_format_t format,
snd_pcm_subformat_t subformat,
snd_spcm_latency_t latency,
snd_pcm_access_t access,
snd_spcm_xrun_type_t xrun_type,
snd_spcm_duplex_type_t duplex_type )

Initialize simple PCMs in the duplex mode.

Parameters
playback_pcmPCM handle for playback
capture_pcmPCM handle for capture
rateSample rate
channelsNumber of channels
formatPCM format
subformatPCM subformat
latencyLatency type
accessPCM acceess type
xrun_typeXRUN type
duplex_typeDuplex mode
Returns
0 if successful, or a negative error code
Warning
The simple PCM API may be broken in the current release.

◆ snd_spcm_init_get_params()

int snd_spcm_init_get_params ( snd_pcm_t * pcm,
unsigned int * rate,
snd_pcm_uframes_t * buffer_size,
snd_pcm_uframes_t * period_size )

Get the set up of simple PCM.

Parameters
pcmPCM handle
ratePointer to store the current sample rate
buffer_sizePointer to store the current buffer size
period_sizePointer to store the current period size
Returns
0 if successful, or a negative error code
Warning
The simple PCM API may be broken in the current release.