From 04ec3a27fab30fe5a645693c41b3d10cacf694bd Mon Sep 17 00:00:00 2001 From: torben Date: Tue, 2 Nov 2010 11:21:30 +0000 Subject: [PATCH] allow recovery when alsa_pcm is in suspended state. git-svn-id: svn+ssh://jackaudio.org/trunk/jack@4075 0c269be4-1314-0410-8aa9-9f06e86f4224 --- drivers/alsa/alsa_driver.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/alsa/alsa_driver.c b/drivers/alsa/alsa_driver.c index 13d476c..94b429c 100644 --- a/drivers/alsa/alsa_driver.c +++ b/drivers/alsa/alsa_driver.c @@ -1151,6 +1151,22 @@ alsa_driver_xrun_recovery (alsa_driver_t *driver, float *delayed_usecs) } } + if (snd_pcm_status_get_state(status) == SND_PCM_STATE_SUSPENDED) + { + MESSAGE("\n\n**** alsa_pcm: pcm in suspended state, resuming it \n\n" ); + if (driver->capture_handle) { + if ((res = snd_pcm_prepare(driver->capture_handle)) + < 0) { + jack_error("error preparing after suspend: %s", snd_strerror(res)); + } + } else { + if ((res = snd_pcm_prepare(driver->playback_handle)) + < 0) { + jack_error("error preparing after suspend: %s", snd_strerror(res)); + } + } + } + if (snd_pcm_status_get_state(status) == SND_PCM_STATE_XRUN && driver->process_count > XRUN_REPORT_DELAY) { struct timeval now, diff, tstamp;