From f733c022dce1a8ad6040812ec447136a2852dc27 Mon Sep 17 00:00:00 2001
From: Sam Thursfield <sam@afuera.me.uk>
Date: Mon, 20 Jul 2020 10:19:18 +0200
Subject: [PATCH] s_audio_alsa: Fix input/output confusion

This could lead to an assert failure inside ALSA if the output device
wasn't open and we tried to configure it anyway.
---
 pd/src/s_audio_alsa.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/pd/src/s_audio_alsa.c b/pd/src/s_audio_alsa.c
index 9cbe017d6..beeb81291 100644
--- a/pd/src/s_audio_alsa.c
+++ b/pd/src/s_audio_alsa.c
@@ -747,10 +747,10 @@ static void alsa_checkiosync( void)
             }
             if (result < 0)
             {
-                post("output snd_pcm_delay failed: %s", snd_strerror(result));
-                if (snd_pcm_status(alsa_outdev[iodev].a_handle,
+                post("input snd_pcm_delay failed: %s", snd_strerror(result));
+                if (snd_pcm_status(alsa_indev[iodev].a_handle,
                     alsa_status) < 0)
-                    post("output snd_pcm_status failed");
+                    post("input snd_pcm_status failed");
                 else post("astate %d",
                      snd_pcm_status_get_state(alsa_status));
                 return;
-- 
GitLab