diff options
author | Alexey Yakovenko <wakeroid@gmail.com> | 2009-10-20 22:47:22 +0200 |
---|---|---|
committer | Alexey Yakovenko <wakeroid@gmail.com> | 2009-10-20 22:47:22 +0200 |
commit | 573ecdd15712b17a60ecc432c650df75b1b5e62d (patch) | |
tree | 36d79b33689a90f511f8d5c124d5d93022962a61 | |
parent | 258e1269bd8f369fe63c1d0f007bd0cd9e65a16e (diff) |
fixed alsa recover from suspend/xrun regression
-rw-r--r-- | palsa.c | 20 |
1 files changed, 12 insertions, 8 deletions
@@ -338,14 +338,18 @@ palsa_thread (uintptr_t context) { has elapsed. */ if ((err = snd_pcm_wait (audio, 500)) < 0 && state == 1) { - printf ("snd_pcm_wait failed, error: %s\n", snd_strerror (err)); - mutex_unlock (mutex); - snd_pcm_prepare (audio); - continue; - trace ("snd_pcm_wait failed, restarting alsa\n"); - messagepump_push (M_REINIT_SOUND, 0, 0, 0); - mutex_unlock (mutex); - break; + if (err == -ESTRPIPE) { + trace ("alsa: trying to recover from suspend...\n"); + messagepump_push (M_REINIT_SOUND, 0, 0, 0); + mutex_unlock (mutex); + break; + } + else { + trace ("alsa: trying to recover from xrun...\n"); + snd_pcm_prepare (audio); + mutex_unlock (mutex); + continue; + } } /* find out how much space is available for playback data */ |