pkgsrc-wip/py-fastaudio/patches/patch-af
2004-03-31 15:23:26 +00:00

38 lines
1,013 B
Text

$NetBSD: patch-af,v 1.5 2004/03/31 15:23:27 mpasternak Exp $
--- pa_unix_oss/pa_unix_oss.c.orig Mon Jun 30 11:05:50 2003
+++ pa_unix_oss/pa_unix_oss.c
@@ -44,7 +44,16 @@
#ifdef __linux__
#include <linux/soundcard.h>
#else
-#include <machine/soundcard.h> /* JH20010905 */
+# ifdef __NetBSD__
+# include <soundcard.h>
+# include <sys/audioio.h>
+# else
+# ifdef __FreeBSD__
+# include <sys/soundcard.h>
+# else
+# include <machine/soundcard.h> /* JH20010905 */
+# endif
+# endif
#endif
@@ -237,7 +246,14 @@ PaError Pa_SetupDeviceFormat( int devHan
return paHostError;
}
-
+#ifdef __NetBSD__
+ tmp = 1;
+ if ( ioctl(devHandle,AUDIO_SETFD, &tmp) == -1) {
+ ERR_RPT(("Pa_SetupDeviceFormat: could not AUDIO_SETFD. Fastaudio will properly work on NetBSD only with full-duplex soundcard.\n" ));
+ return paHostError;
+ }
+#endif
+
/* Set number of channels. */
tmp = numChannels;
if (ioctl(devHandle, SNDCTL_DSP_CHANNELS, &numChannels) == -1)