jack/jack-1.9.6-suspend_resume.patch

23 lines
988 B
Diff
Raw Permalink Normal View History

Index: /jack2/trunk/jackmp/linux/alsa/JackAlsaDriver.cpp
===================================================================
--- /jack2/trunk/jackmp/linux/alsa/JackAlsaDriver.cpp (revision 4081)
+++ /jack2/trunk/jackmp/linux/alsa/JackAlsaDriver.cpp (revision 4088)
@@ -1189,4 +1189,17 @@
}
}
+
+ if (snd_pcm_status_get_state(status) == SND_PCM_STATE_SUSPENDED) {
+ jack_error("**** alsa_pcm: pcm in suspended state, resuming it" );
+ 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