summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-10-20 22:47:22 +0200
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-10-20 22:47:22 +0200
commit573ecdd15712b17a60ecc432c650df75b1b5e62d (patch)
tree36d79b33689a90f511f8d5c124d5d93022962a61
parent258e1269bd8f369fe63c1d0f007bd0cd9e65a16e (diff)
fixed alsa recover from suspend/xrun regression
-rw-r--r--palsa.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/palsa.c b/palsa.c
index 687ccdfe..8437c3ce 100644
--- a/palsa.c
+++ b/palsa.c
@@ -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 */