snd_pcm_channel_prepare

Name

snd_pcm_channel_prepare, snd_pcm_prepare_playback, snd_pcm_prepare_capture -- prepare the selected direction

Synopsis

int snd_pcm_channel_prepare(snd_pcm_t *handle, int channel);

int snd_pcm_prepare_playback(snd_pcm_t *handle);

int snd_pcm_prepare_capture(snd_pcm_t *handle);

Description

Prepare hardware to operation for the specified transfer direction. This call was designed, bacause some hardware requires some time for the initialization. The snd_pcm_channel_go function requires minimal time to start the transfer. Function may be called in all states except SND_PCM_STATUS_NOTREADY (-EBADFD is returned) and SND_PCM_STATUS_RUNNING state (-EBUSY is returned). Function returns zero if successful, otherwise it returns an error code.

If the operation was successful (zero is returned), then the driver state is changed to SND_PCM_STATUS_PREPARED.