$OpenBSD: patch-src_io_c,v 1.3 2015/06/29 22:19:22 ratchov Exp $
--- src/io.c.orig	Thu Aug 21 15:11:40 2008
+++ src/io.c	Fri Jun 26 19:48:45 2015
@@ -28,7 +28,10 @@
 # include <sys/soundcard.h>
 # include <sys/ioctl.h>
 #endif
-#if defined(sun) || defined(__OpenBSD__)
+#if defined(__OpenBSD__)
+# include <sndio.h>
+#endif
+#if defined(sun)
 # include <sys/ioctl.h>
 # include <sys/audioio.h>
 #endif
@@ -1708,7 +1711,7 @@ GList *loop;
 struct stat buf;
 #endif
 
-#if defined(sun) || defined(aix) || defined(__OpenBSD__)
+#if defined(sun) || defined(aix)
 gchar *audiodev;
 #endif
 	dsp = NULL;
@@ -1723,7 +1726,10 @@ gchar *audiodev;
 		dsp = g_list_append(dsp,"/dev/dsp1");
 	}
 #endif
-#if defined(sun) || defined(__OpenBSD__)
+#if defined(__OpenBSD__)
+	dsp = g_list_append(dsp, SIO_DEVANY);
+#endif
+#if defined(sun)
 	/* check if the user has any special audio-hardware running,
 	   which set the AUDIODEV-environment-variable */
 	audiodev = getenv("AUDIODEV");
@@ -1850,7 +1856,7 @@ gchar tmp2[MAXLINE];
 		}	
 	}	
 #endif
-#if defined(sun) || defined(__OpenBSD__)
+#if defined(sun)
 
 	g_snprintf(tmp,MAXLINE,"%s%s",dsp,"ctl");
 
@@ -3601,7 +3607,7 @@ gint mix;
 #if defined(linux) || defined(__FreeBSD__)
 gint val;
 #endif
-#if defined(sun) || defined(__OpenBSD__)
+#if defined(sun)
 audio_info_t ainfo;
 #endif
 #ifdef hpux
@@ -3636,7 +3642,7 @@ struct audio_gain again;
 	return ((val & 0x7f) + ((val >> 8) & 0x7f))/2;
 
 #endif
-#if defined(sun) || defined(__OpenBSD__)
+#if defined(sun)
 
 	dodebug(10,"quering mixer %s\n", setupdata.mix_device);
 	mix = open(setupdata.mix_device, O_RDONLY);
@@ -3724,7 +3730,7 @@ gint set_mixer(gint val) {
 #if !(defined(__MACH__) && defined(__APPLE__)) 
 gint mix;
 #endif
-#if defined(sun) || defined(__OpenBSD__)
+#if defined(sun)
 audio_info_t ainfo;
 #endif
 #ifdef aix
@@ -3760,7 +3766,7 @@ struct audio_gain again;
 	close(mix);
 
 #endif 
-#if defined(sun) || defined(__OpenBSD__)
+#if defined(sun)
 
 	dodebug(10,"setting mixer %s to %d\n", setupdata.mix_device, val);
 	mix = open(setupdata.mix_device, O_WRONLY);
