From 4f7940386678b9f878f0e693335ffe1fdc17209a Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 19 Oct 2009 05:24:48 +0000 Subject: [PATCH] ALSA write failed (unrecoverable): Resource temporarily unavailable --- src/audio/alsa/SDL_alsa_audio.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/audio/alsa/SDL_alsa_audio.c b/src/audio/alsa/SDL_alsa_audio.c index 540b319a3..3798d2b27 100644 --- a/src/audio/alsa/SDL_alsa_audio.c +++ b/src/audio/alsa/SDL_alsa_audio.c @@ -314,6 +314,11 @@ static void ALSA_PlayAudio(_THIS) while ( frames_left > 0 && this->enabled ) { status = SDL_NAME(snd_pcm_writei)(pcm_handle, sample_buf, frames_left); if ( status < 0 ) { + if ( status == -EAGAIN ) { + /* Apparently snd_pcm_recover() doesn't handle this. Foo. */ + SDL_Delay(1); + continue; + } status = SDL_NAME(snd_pcm_recover)(pcm_handle, status, 0); if ( status < 0 ) { /* Hmm, not much we can do - abort */