$NetBSD: patch-ac,v 1.3 2003/12/13 17:59:57 ben Exp $

--- common/devices.cpp.orig	1998-09-28 14:59:27.000000000 -0700
+++ common/devices.cpp
@@ -13,6 +13,7 @@
 #include <unistd.h>
 #include <fcntl.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <sys/ioctl.h>
 #include <sys/soundcard.h>
 
@@ -24,13 +25,26 @@ OpenDSP(DSPInfo * DSP)
 	int val;
 
 	//DSP->fd = open(AUDIO_DEV, O_WRONLY|O_NONBLOCK);
-	DSP->fd = open(DSP->name?DSP->name:AUDIO_DEV, O_WRONLY);
+	//DSP->fd = open(DSP->name?DSP->name:AUDIO_DEV, O_WRONLY);
+	if (DSP->rawdump) {
+		DSP->fd = open(DSP->name, O_WRONLY|O_CREAT);
+	} else {
+		DSP->fd = open(DSP->name?DSP->name:AUDIO_DEV, O_WRONLY);
+	}
+
 	if (DSP->fd == -1) {
 		return -1;
 	}
 
 	val = SND_FORMAT;
       dsp_format:
+	if (DSP->rawdump) {
+		DSP->snd_format = SND_FORMAT;
+		DSP->bits_per_sample = 16;
+		DSP->stereo_support = 1;
+		DSP->sample_rate = DEFAULT_RATE;
+		return 0;
+	}
 	if (ioctl(DSP->fd, SNDCTL_DSP_SETFMT, &val) == -1) {
 		perror("ioctl SNDCTL_DSP_SETFMT failed");
 		exit(-1);
@@ -76,7 +90,7 @@ OpenDSP(DSPInfo * DSP)
 	}
 	DSP->sample_rate = val;
 
-	ioctl(DSP->fd, SNDCTL_DSP_RESET);
+	ioctl(DSP->fd, SNDCTL_DSP_RESET, NULL);
 	return 0;
 }
 
