1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
$NetBSD: patch-ae,v 1.2 2001/04/17 09:22:32 skrll Exp $
--- kmidi/linux_a.cpp.orig Mon Jan 22 12:14:45 2001
+++ kmidi/linux_a.cpp
@@ -36,6 +36,13 @@
#include <linux/soundcard.h>
#endif
+#ifdef __NetBSD__
+#include <stdio.h>
+#include <sys/ioctl.h>
+#include <soundcard.h>
+#endif
+
+
#ifdef __FreeBSD__
#include <stdio.h>
#include <machine/soundcard.h>
@@ -76,6 +83,9 @@
#ifdef LINUX_SECOND_DEVICE
"Linux 2nd dsp device", 'D',
"/dev/dsp1",
+#elif defined(__NetBSD__)
+ "NetBSD audio device", 'd',
+ "/dev/audio",
#else
"Linux dsp device", 'd',
"/dev/dsp",
@@ -320,13 +330,21 @@
static void flush_output(void)
{
output_data(0, 0);
+#if defined(__NetBSD__)
+ ioctl(dpm.fd, SNDCTL_DSP_SYNC, NULL);
+#else
ioctl(dpm.fd, SNDCTL_DSP_SYNC);
+#endif
}
static void purge_output(void)
{
b_out(dpm.id_character, dpm.fd, 0, -1);
+#if defined(__NetBSD__)
+ ioctl(dpm.fd, SNDCTL_DSP_RESET, NULL);
+#else
ioctl(dpm.fd, SNDCTL_DSP_RESET);
+#endif
}
#endif /* defined(__linux__) || defined(__FreeBSD__) || defined(__bsdi__) */
|