[Previous] [Contents] [Next]

snd_pcm_channel_prepare()

Prepare the selected direction

Synopsis:

#include <sys/asoundlib.h>

int snd_pcm_channel_prepare( snd_pcm_t * handle, 
                             int channel );

Library:

libasound.so

Description:

The snd_pcm_channel_prepare() function prepares hardware to operate in a specified transfer direction. This call is used when hardware requires time for initialization.

This function may be called in all states except SND_PCM_STATUS_NOTREADY (returns -EBADFD) and SND_PCM_STATUS_RUNNING state (returns -EBUSY). If the operation is successful (zero is returned), the driver state is changed to SND_PCM_STATUS_PREPARED.

Returns:

Zero on success, or an error code.

Errors:

-EINVAL
Invalid handle.
-EBUSY
Channel is running.

Examples:

See the Handling writes section in the Playing Audio Data chapter.

Classification:

ALSA

Safety:
Cancellation point No
Interrupt handler No
Signal handler Yes
Thread Yes

See also:

snd_pcm_plugin_prepare()


[Previous] [Contents] [Next]