snd_pcm_get_state
snd_pcm_state_t snd_pcm_get_state(struct snd_pcm_substream *substream);
state = snd_pcm_get_state(substream);
if (snd_pcm_get_state(substream) == SNDRV_PCM_STATE_PREPARED)
state = snd_pcm_get_state(substream);
if (snd_pcm_get_state(substream) == SNDRV_PCM_STATE_DRAINING) {
state = snd_pcm_get_state(substream);
if (snd_pcm_get_state(substream) == SNDRV_PCM_STATE_PREPARED)
state = snd_pcm_get_state(substream);
EXPORT_SYMBOL_GPL(snd_pcm_get_state);