$NetBSD: patch-aa,v 1.3 1998/08/07 10:36:11 agc Exp $ --- sbdsp.c.orig Wed Aug 17 23:11:01 1994 +++ sbdsp.c Fri Jun 19 19:01:35 1998 @@ -21,7 +21,12 @@ #include #else #ifdef LINUXSOUND -#include +#ifdef __NetBSD__ +#include +#include +#else +#include +#endif #else #include #endif @@ -77,8 +82,18 @@ ioctl(fileno(ft->fp), DSP_IOCTL_VOICE, &off); ioctl(fileno(ft->fp), DSP_IOCTL_SPEED, &ft->info.rate); #else +#ifdef __NetBSD__ + { + int fmt = AFMT_U8; + ioctl(fileno(ft->fp), SNDCTL_DSP_SETFMT, &fmt); + } +#endif #if defined(LINUXSOUND) - ioctl(fileno(ft->fp), SNDCTL_DSP_SPEED, ft->info.rate); + #if SOUND_VERSION >= 200 + ioctl(fileno(ft->fp), SOUND_PCM_WRITE_RATE, &ft->info.rate); + #else + ioctl(fileno(ft->fp), SOUND_PCM_WRITE_RATE, ft->info.rate); + #endif #else ioctl(fileno(ft->fp), DSP_IOCTL_VOICE, 0); ioctl(fileno(ft->fp), DSP_IOCTL_SPEED, ft->info.rate); @@ -146,9 +161,19 @@ ioctl(fileno(ft->fp), DSP_IOCTL_VOICE, &on); ioctl(fileno(ft->fp), DSP_IOCTL_SPEED, &ft->info.rate); #else +#ifdef __NetBSD__ + { + int fmt = AFMT_U8; + ioctl(fileno(ft->fp), SNDCTL_DSP_SETFMT, &fmt); + } +#endif #if defined(LINUXSOUND) ioctl(fileno(ft->fp), SNDCTL_DSP_SYNC, 0); - ioctl(fileno(ft->fp), SNDCTL_DSP_SPEED, ft->info.rate); + #if SOUND_VERSION >= 200 + ioctl(fileno(ft->fp), SOUND_PCM_WRITE_RATE, &ft->info.rate); + #else + ioctl(fileno(ft->fp), SOUND_PCM_WRITE_RATE, ft->info.rate); + #endif #else ioctl(fileno(ft->fp), DSP_IOCTL_VOICE, 1); ioctl(fileno(ft->fp), DSP_IOCTL_SPEED, ft->info.rate);