snd_pcm_state() would return SND_PCM_STATE_XRUNFIXME:handle other error conditions*/ms_error("*** alsa_can_read fixup, trying to recover");snd_pcm_drain(dev);/* Ignore possible error, at least -EAGAIN.*/err = snd_pcm_recover(dev, avail,0);if(err){ ...