Table 5.4. Proc Interface
5.5.1.3. Commonly Used APIs
Some of the commonly used APIs to write an ALSA based application are:
Table 5.5. Commonly Used APIs
Version 02.01.01.08
Name
cards
version
devices
pcm
cardX/ (X = 0-7)
cardX/pcm0p
cardX/pcm0c
Name
snd_pcm_open
snd_pcm_close
snd_pcm_hw_params_any
snd_pcm_hw_params_test_
<<parameter>>
snd_pcm_hw_params_set_
<<parameter>>
snd_pcm_hw_params
snd_pcm_writei
snd_pcm_readi
snd_pcm_prepare
snd_pcm_drop
snd_pcm_drain
Platform Support Products
Description
List of registered cards.
Version and date the driver was built
on.
List of registered ALSA devices.
The list of allocated PCM streams.
The card specific directory.
The
directory
of
the
playback stream.
The directory of the given PCM capture
stream.
Description
Opens a PCM stream.
Closes
a
previously
stream.
Fill params with a full configuration
space for a PCM.
Test
the
availability
parameters like number of channels,
sample rate etc.
snd_pcm_hw_params_test_format,
snd_pcm_hw_params_test_rate, etc.
Set
the
different
parameters.
snd_pcm_hw_params_set_format,
snd_pcm_hw_params_set_rate, etc.
Install one PCM hardware configuration
chosen from a configuration space.
Write interleaved frames to a PCM.
Read interleaved frames from a PCM.
Prepare PCM for use.
Stop a PCM dropping pending frames.
Stop a PCM preserving pending frames.
Audio Driver
Application Interface
given
PCM
opened
PCM
of
important
configuration
57