Start a PCM playback channel running


#include <sys/asoundlib.h>

int snd_pcm_playback_go ( snd_pcm_t *handle );


BlackBerry 10.0.0


The handle for the PCM device, which you must have opened by calling snd_pcm_open_name(), snd_pcm_open(), or snd_pcm_open_preferred().



The snd_pcm_playback_go() function starts the playback channel running.

You should call this function only when the channel is in the SND_PCM_STATUS_READY state, and you should ensure that two or more audio fragments have been written into the audio interface before issuing the go command, to prevent the audio channel/stream from going into the UNDERRUN state.

Calling this function is required if you've set your channel's start state to SND_PCM_START_GO (see snd_pcm_plugin_params()). You can use this function to "kick start" early a playback channel that has a start state of SND_PCM_START_DATA or SND_PCM_START_FULL.

If the parameters are valid (i.e, the function returns zero), then the driver state is changed to SND_PCM_STATUS_RUNNING.

This function is safe to use with plugin-aware functions. This call is used identically to snd_pcm_plugin_params().


EOK on success, a negative errno upon failure. The errno values are available in the errno.h file.


Additional information for common error values:
The state of handle is invalid or an invalid state change occurred. You can call snd_pcm_channel_status() to check if the state change was invalid.
Indicates that there's insufficient data in the buffer to play. You should write more data to the buffer.
Insufficient audio fragments have been written to the audio interface (when writing to the software mixer device).


QNX Neutrino

Cancellation point No
Interrupt handler No
Signal handler Yes
Thread Read the Caveats


This function is not thread safe if handle (snd_pcm_t) is used across multiple threads.

Last modified: 2014-06-24

Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus