summaryrefslogtreecommitdiff
path: root/audio
diff options
context:
space:
mode:
authormycroft <mycroft>1998-03-07 09:58:04 +0000
committermycroft <mycroft>1998-03-07 09:58:04 +0000
commit6a9e903b07fc7ab69e4d0b44be88720a4966edfa (patch)
treec751396a766c7f8eb9bd6c41af53bdee6b92319c /audio
parentd0ef6dd1f6597e12fcec1a091478135be4898fa0 (diff)
downloadpkgsrc-6a9e903b07fc7ab69e4d0b44be88720a4966edfa.tar.gz
Use native audio method.
Diffstat (limited to 'audio')
-rw-r--r--audio/nspmod/patches/patch-aa245
-rw-r--r--audio/nspmod/patches/patch-ab21
-rw-r--r--audio/nspmod/patches/patch-ac17
-rw-r--r--audio/nspmod/patches/patch-af48
-rw-r--r--audio/nspmod/patches/patch-ba46
-rw-r--r--audio/nspmod/patches/patch-bb283
6 files changed, 341 insertions, 319 deletions
diff --git a/audio/nspmod/patches/patch-aa b/audio/nspmod/patches/patch-aa
deleted file mode 100644
index 27557f1828c..00000000000
--- a/audio/nspmod/patches/patch-aa
+++ /dev/null
@@ -1,245 +0,0 @@
-*** dacio-linux.c.orig Wed Sep 3 14:57:59 1997
---- dacio-linux.c Wed Sep 3 14:50:20 1997
-***************
-*** 3,9 ****
---- 3,13 ----
- #include <fcntl.h> /*O_WRONLY*/
- #include <sys/ioctl.h> /*(ioctl)*/
- #include <unistd.h> /*(write)*/
-+ #if defined(LINUX)
- #include <sys/soundcard.h> /*SNDCTL_XXX*/
-+ #else
-+ #include <machine/soundcard.h>
-+ #endif
- #include <errno.h> /*EINTR*/
- #include "defs.h" /*u8,u16*/
- #include "dacio.h" /*(dacioXXX)*/
-***************
-*** 47,53 ****
- static struct {
- union {
- u8 *p8;
-! u16 *p16;
- } p;
- u8 *top;
- u8 *bot;
---- 51,57 ----
- static struct {
- union {
- u8 *p8;
-! i15 *p16;
- } p;
- u8 *top;
- u8 *bot;
-***************
-*** 67,77 ****
- exit(1);
- }
- #endif
-! tmp = AFMT_U8;
- if (ioctl(fd, SNDCTL_DSP_SETFMT, &tmp) < 0) {
- perror("dacioConf");
- exit(1);
- }
- /*fprintf(stderr, "fmt = 0x%x\n", tmp);*/
-
- if (ioctl(fd, SNDCTL_DSP_STEREO, &dcp->stereo) < 0) {
---- 71,109 ----
- exit(1);
- }
- #endif
-! switch (dcp->bits) {
-! case 0:
-! case 8:
-! dcp->bits = 8;
-! tmp = AFMT_U8; break;
-! case 16:
-! tmp = AFMT_S16_LE; break;
-! default:
-! fprintf(stderr, "Don't know how to handle %d bit output.\n", dcp->bits);
-! exit(1);
-! break;
-! }
-!
- if (ioctl(fd, SNDCTL_DSP_SETFMT, &tmp) < 0) {
- perror("dacioConf");
- exit(1);
- }
-+
-+ switch (tmp) {
-+ case AFMT_U8:
-+ if (dcp->bits != 8) {
-+ fprintf(stderr, "soundcard doesn't support 8bits.\n");
-+ exit(1);
-+ }
-+ break;
-+ case AFMT_S16_LE:
-+ if (dcp->bits != 16) {
-+ fprintf(stderr, "soundcard doesn't support 16bits.\n");
-+ exit(1);
-+ }
-+ break;
-+ }
-+
- /*fprintf(stderr, "fmt = 0x%x\n", tmp);*/
-
- if (ioctl(fd, SNDCTL_DSP_STEREO, &dcp->stereo) < 0) {
-***************
-*** 90,99 ****
- perror("dacioConf");
- exit(1);
- }
-! /*fprintf(stderr, "buffer size = 0x%x\n", buf.size);*/
- dci = *dcp;
- /*if (buf.top != NULL) free(buf.top);*/
-! buf.top = memPerm(buf.size * sizeof(u8));
- buf.p.p8 = buf.top;
- buf.bot = buf.top + buf.size;
- }
---- 122,136 ----
- perror("dacioConf");
- exit(1);
- }
-! /*fprintf(stderr, "sound buffer size = 0x%x\n", buf.size);*/
-! tmp = buf.size;
-! while (tmp <= (0.1 * (dcp->speed * (dcp->stereo+1) * (dcp->bits/8))))
-! tmp += buf.size;
-! buf.size = tmp;
-! /*fprintf(stderr, "buffer size = 0x%x\n", buf.size);*/
- dci = *dcp;
- /*if (buf.top != NULL) free(buf.top);*/
-! buf.top = memPerm(buf.size);
- buf.p.p8 = buf.top;
- buf.bot = buf.top + buf.size;
- }
-***************
-*** 115,121 ****
- int s;
-
- if (buf.p.p8 <= buf.top) return;
-! for ( ; buf.p.p8 < buf.bot; buf.p.p8++) *buf.p.p8 = 128;
- RETRY:
- s = write(fd, buf.top, buf.size);
- if (s < buf.size) {
---- 152,165 ----
- int s;
-
- if (buf.p.p8 <= buf.top) return;
-! switch (dci.bits) {
-! case 8:
-! for ( ; buf.p.p8 < buf.bot; buf.p.p8++) *buf.p.p8 = 128;
-! break;
-! case 16:
-! for ( ; buf.p.p8 < buf.bot; buf.p.p16++) *buf.p.p16 = 0;
-! break;
-! }
- RETRY:
- s = write(fd, buf.top, buf.size);
- if (s < buf.size) {
-***************
-*** 179,184 ****
---- 223,230 ----
- (tmpvar & ~255)? ~tmpvar >> 16 : tmpvar ) /* 16 will be OK */
- /* ~(tmpvar >> 16) makes longer asm */
- #endif
-+ #define to16bit(x) \
-+ (((x) * gv) >> 12)
-
- /* stereo */
- static void
-***************
-*** 186,199 ****
- {
- const i31 *inbufp = inbuf.p;
- u8 *u8p = buf.p.p8;
-
-! for (; n > 0; n--) {
-! i31x tmp;
-! *u8p++ = to8bit(*inbufp++, tmp); /* L */
-! *u8p++ = to8bit(*inbufp++, tmp); /* R */
- }
- inbuf.p = inbufp;
-- buf.p.p8 = u8p;
- }
-
- /* mono */
---- 232,257 ----
- {
- const i31 *inbufp = inbuf.p;
- u8 *u8p = buf.p.p8;
-+ i15 *s15p = buf.p.p16;
-
-! switch (dci.bits) {
-! case 8:
-! for (; n > 0; n--) {
-! i31x tmp;
-! *u8p++ = to8bit(*inbufp++, tmp); /* L */
-! *u8p++ = to8bit(*inbufp++, tmp); /* R */
-! }
-! buf.p.p8 = u8p;
-! break;
-! case 16:
-! for (; n > 0; n--) {
-! *s15p++ = to16bit(*inbufp++); /* L */
-! *s15p++ = to16bit(*inbufp++); /* R */
-! }
-! buf.p.p16 = s15p;
-! break;
- }
- inbuf.p = inbufp;
- }
-
- /* mono */
-***************
-*** 202,220 ****
- {
- const i31 *inbufp = inbuf.p;
- u8 *u8p = buf.p.p8;
-
-! for (; n > 0; n--) {
-! i31x tmp;
-! *u8p++ = to8bit(*inbufp, tmp);
-! inbufp += 2;
- }
- inbuf.p = inbufp;
-- buf.p.p8 = u8p;
- }
-
- #define dacioOutHirev(x) \
- if (dci.stereo) dacioOutHirevS(x); else dacioOutHirevM(x)
-! #define bufRest() (dci.stereo? (buf.bot - buf.p.p8)/2 : buf.bot - buf.p.p8)
-
- void
- dacioOut(void)
---- 260,290 ----
- {
- const i31 *inbufp = inbuf.p;
- u8 *u8p = buf.p.p8;
-+ i15 *s16p = buf.p.p16;
-
-! switch (dci.bits) {
-! case 8:
-! for (; n > 0; n--) {
-! i31x tmp;
-! *u8p++ = to8bit(*inbufp, tmp);
-! inbufp += 2;
-! }
-! buf.p.p8 = u8p;
-! break;
-! case 16:
-! for (; n > 0; n--) {
-! *s16p++ = to16bit(*inbufp);
-! inbufp += 2;
-! }
-! buf.p.p16 = s16p;
-! break;
- }
- inbuf.p = inbufp;
- }
-
- #define dacioOutHirev(x) \
- if (dci.stereo) dacioOutHirevS(x); else dacioOutHirevM(x)
-! #define bufRest() ((dci.stereo? (buf.bot - buf.p.p8)/2 : buf.bot - buf.p.p8)/(dci.bits/8))
-
- void
- dacioOut(void)
diff --git a/audio/nspmod/patches/patch-ab b/audio/nspmod/patches/patch-ab
deleted file mode 100644
index 07273f38949..00000000000
--- a/audio/nspmod/patches/patch-ab
+++ /dev/null
@@ -1,21 +0,0 @@
-*** Makefile.orig Sun Sep 17 06:18:20 1995
---- Makefile Tue Jun 3 02:48:46 1997
-***************
-*** 25,32 ****
-
- #}
-
-! CFLAGS = $(CFLAGS_OS) $(CFLAGS_OPT) $(CFLAGS_EXT)
-! CFLAGS_HIOPT_ = $(CFLAGS_OS) $(CFLAGS_HIOPT) $(CFLAGS_EXT)
- LDFLAGS = $(LDFLAGS_OS) $(LDFLAGS_EXT)
- LIBS = $(LIBS_EXT) $(LIBS_OS)
-
---- 25,32 ----
-
- #}
-
-! #CFLAGS = $(CFLAGS_OS) $(CFLAGS_OPT) $(CFLAGS_EXT)
-! CFLAGS_HIOPT_ = $(CFLAGS) $(CFLAGS_HIOPT)
- LDFLAGS = $(LDFLAGS_OS) $(LDFLAGS_EXT)
- LIBS = $(LIBS_EXT) $(LIBS_OS)
-
diff --git a/audio/nspmod/patches/patch-ac b/audio/nspmod/patches/patch-ac
index e031445d0fd..2e65bf08481 100644
--- a/audio/nspmod/patches/patch-ac
+++ b/audio/nspmod/patches/patch-ac
@@ -1,5 +1,5 @@
-*** nspmod.c.orig Wed Sep 3 14:58:19 1997
---- nspmod.c Wed Sep 3 14:55:06 1997
+*** nspmod.c.orig Sat Sep 16 04:10:37 1995
+--- nspmod.c Sat Mar 7 04:43:55 1998
***************
*** 1,4 ****
--- 1,5 ----
@@ -19,7 +19,10 @@
printf(" -e show events\n");
printf(" -f # output sample rate\n");
***************
-*** 62,69 ****
+*** 59,69 ****
+ static OptInfo oi;
+ int optChar;
+
oi.outRate = DEF_OUTRATE;
oi.ovsFreq = -1;
/*oi.repLimit = 1;*/
@@ -28,7 +31,11 @@
case 'c': oi.onlyCh = (i15x)strtol(optarg, NULL, 0) | 0x100; break;
case 'e': oi.showEvents++; break;
case 'f': oi.outRate = (u16x)strtol(optarg, NULL, 0); break;
---- 64,72 ----
+--- 61,73 ----
+ static OptInfo oi;
+ int optChar;
+
++ oi.bits = 8;
oi.outRate = DEF_OUTRATE;
oi.ovsFreq = -1;
/*oi.repLimit = 1;*/
@@ -40,7 +47,7 @@
case 'f': oi.outRate = (u16x)strtol(optarg, NULL, 0); break;
***************
*** 116,121 ****
---- 119,125 ----
+--- 120,126 ----
lookOverFile(p, statbuf.st_size);
dacioInit();
diff --git a/audio/nspmod/patches/patch-af b/audio/nspmod/patches/patch-af
deleted file mode 100644
index 6b5f66ead81..00000000000
--- a/audio/nspmod/patches/patch-af
+++ /dev/null
@@ -1,48 +0,0 @@
-diff -u ../../work/nspmod-0.1/Makefile ./Makefile
---- ../../work/nspmod-0.1/Makefile Fri Oct 31 23:04:12 1997
-+++ ./Makefile Fri Oct 31 23:03:13 1997
-@@ -6,12 +6,12 @@
-
- ## Linux
- CFLAGS_OS = -Wall
--#CFLAGS_OS += -DDAC_DEV=\"/dev/dsp2\"
-+CFLAGS_OS += -DDAC_DEV=\"/dev/audio\"
- #CFLAGS_OS += -pedantic
- CFLAGS_OPT = -g
- CFLAGS_HIOPT = -O2 -funroll-loops
- LDFLAGS_OS =
--LIBS_OS =
-+LIBS_OS = -lossaudio
- DACIO_ARCH = dacio-linux.c
-
- ## A certain SVR4.2 based OS
-@@ -26,7 +26,7 @@
- #}
-
- #CFLAGS = $(CFLAGS_OS) $(CFLAGS_OPT) $(CFLAGS_EXT)
--CFLAGS_HIOPT_ = $(CFLAGS) $(CFLAGS_HIOPT)
-+CFLAGS_HIOPT_ = $(CFLAGS) $(CFLAGS_HIOPT) $(CFLAGS_OS)
- LDFLAGS = $(LDFLAGS_OS) $(LDFLAGS_EXT)
- LIBS = $(LIBS_EXT) $(LIBS_OS)
-
-@@ -37,7 +37,7 @@
- inst.o hirev.o mem.o
- OBJS = $(OBJS0) dacio.o
- $(PROG): $(OBJS)
-- $(CC) $(LDFLAGS) -o $@ $(OBJS)
-+ $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
-
- hirev.o: hirev.c
- $(CC) $(CFLAGS_HIOPT_) -c hirev.c
-diff -u ../../work/nspmod-0.1/dacio-linux.c ./dacio-linux.c
---- ../../work/nspmod-0.1/dacio-linux.c Fri Oct 31 23:04:12 1997
-+++ ./dacio-linux.c Fri Oct 31 22:59:59 1997
-@@ -5,6 +5,8 @@
- #include <unistd.h> /*(write)*/
- #if defined(LINUX)
- #include <sys/soundcard.h> /*SNDCTL_XXX*/
-+#elif defined(__NetBSD__)
-+#include <soundcard.h>
- #else
- #include <machine/soundcard.h>
- #endif
diff --git a/audio/nspmod/patches/patch-ba b/audio/nspmod/patches/patch-ba
new file mode 100644
index 00000000000..9177c5217bd
--- /dev/null
+++ b/audio/nspmod/patches/patch-ba
@@ -0,0 +1,46 @@
+*** Makefile.orig Sun Sep 17 09:18:20 1995
+--- Makefile Fri Mar 6 05:56:27 1998
+***************
+*** 6,17 ****
+
+ ## Linux
+! CFLAGS_OS = -Wall
+ #CFLAGS_OS += -DDAC_DEV=\"/dev/dsp2\"
+ #CFLAGS_OS += -pedantic
+! CFLAGS_OPT = -g
+! CFLAGS_HIOPT = -O2 -funroll-loops
+! LDFLAGS_OS =
+! LIBS_OS =
+! DACIO_ARCH = dacio-linux.c
+
+ ## A certain SVR4.2 based OS
+--- 6,17 ----
+
+ ## Linux
+! #CFLAGS_OS = -Wall
+ #CFLAGS_OS += -DDAC_DEV=\"/dev/dsp2\"
+ #CFLAGS_OS += -pedantic
+! #CFLAGS_OPT = -g
+! #CFLAGS_HIOPT = -O2 -funroll-loops
+! #LDFLAGS_OS =
+! #LIBS_OS =
+! #DACIO_ARCH = dacio-linux.c
+
+ ## A certain SVR4.2 based OS
+***************
+*** 23,26 ****
+--- 23,36 ----
+ #LIBS_OS =
+ #DACIO_ARCH = dacio-ews48.c
++
++ ## NetBSD
++ CFLAGS_OS = -Wall
++ CFLAGS_OS += -DDAC_DEV=\"/dev/audio\"
++ CFLAGS_OS += -pedantic
++ CFLAGS_OPT = -g
++ CFLAGS_HIOPT = -O2 -funroll-loops
++ LDFLAGS_OS =
++ LIBS_OS =
++ DACIO_ARCH = dacio-netbsd.c
+
+ #}
diff --git a/audio/nspmod/patches/patch-bb b/audio/nspmod/patches/patch-bb
new file mode 100644
index 00000000000..42e600273df
--- /dev/null
+++ b/audio/nspmod/patches/patch-bb
@@ -0,0 +1,283 @@
+*** /dev/null Fri Mar 6 05:54:22 1998
+--- dacio-netbsd.c Fri Mar 6 06:51:04 1998
+***************
+*** 0 ****
+--- 1,278 ----
++ #include <stdio.h> /*(perror)*/
++ #include <fcntl.h> /*O_WRONLY*/
++ #include <sys/ioctl.h> /*(ioctl)*/
++ #include <string.h> /*(memset)*/
++ #include <unistd.h> /*(write)*/
++ #include <sys/audioio.h> /*SNDCTL_XXX*/
++ #include <errno.h> /*EINTR*/
++ #include "defs.h" /*u8,u16*/
++ #include "dacio.h" /*(dacioXXX)*/
++ #include "mem.h" /*(memPerm)*/
++
++ #if 0
++ #define LIM_SIZE (32 * 256) /* 32ch * 8bit */
++
++ static u8 *lim;
++
++ static void
++ makeLim(void)
++ {
++ u8 *p;
++ i15x i;
++
++ lim = (u8 *)memPerm(LIM_SIZE) + LIM_SIZE/2;
++ p = lim-128;
++ for (i = 0; i < 256; i++, p++) *p = i;
++ for (; p < lim + LIM_SIZE/2; p++) *p = 255;
++ }
++ #endif
++
++ static int fd;
++
++ #ifndef DAC_DEV
++ #define DAC_DEV "/dev/audio"
++ #endif
++
++ void
++ dacioInit(void)
++ {
++ fd = open(DAC_DEV, O_WRONLY);
++ if (fd < 0) {
++ perror("dacioInit");
++ exit(1);
++ }
++ /*makeLim();*/
++ }
++
++ static struct {
++ union {
++ u8 *p8;
++ i15 *p16;
++ } p;
++ u8 *top;
++ u8 *bot;
++ int size;
++ int shift;
++ } buf;
++
++ #define bufRest() ((buf.bot - buf.p.p8) >> buf.shift)
++
++ static DacioConfInfo dci;
++
++ void
++ dacioConf(DacioConfInfo *dcp)
++ {
++ audio_info_t info;
++
++ #if 0
++ if (ioctl(fd, AUDIO_FLUSH, 0) < 0) {
++ perror("dacioConf");
++ exit(1);
++ }
++ #endif
++ AUDIO_INITINFO(&info);
++ info.play.encoding = AUDIO_ENCODING_LINEAR;
++ info.play.precision = dcp->bits;
++ info.play.channels = dcp->stereo ? 2 : 1;
++ info.play.sample_rate = dcp->speed;
++ if (ioctl(fd, AUDIO_SETINFO, &info) < 0) {
++ perror("dacioConf");
++ exit(1);
++ }
++ /*fprintf(stderr, "fmt = 0x%x\n", tmp);*/
++
++ if (ioctl(fd, AUDIO_GETINFO, &info) < 0) {
++ perror("dacioConf");
++ exit(1);
++ }
++ buf.size = info.play.buffer_size;
++ /*fprintf(stderr, "buffer size = 0x%x\n", buf.size);*/
++ dci = *dcp;
++ /*if (buf.top != NULL) free(buf.top);*/
++ buf.top = memPerm(buf.size);
++ buf.p.p8 = buf.top;
++ buf.bot = buf.top + buf.size;
++ buf.shift = dci.stereo + ffs(dci.bits / 8) - 1;
++ }
++
++ void
++ dacioSync(void)
++ {
++ if (ioctl(fd, AUDIO_DRAIN, 0) < 0) {
++ perror("dacioSync");
++ exit(1);
++ }
++ }
++
++ /* OS independent part (?) */
++
++ void
++ dacioFlush(void)
++ {
++ i15x n;
++ u8 *u8p;
++ i15 *i15p;
++ int s;
++
++ if (buf.p.p8 <= buf.top) return;
++
++ n = bufRest() << dci.stereo;
++ switch (dci.bits) {
++ case 8:
++ u8p = buf.p.p8;
++ for (; n > 0; n--)
++ *u8p++ = 128;
++ buf.p.p8 = u8p;
++ break;
++ case 16:
++ i15p = buf.p.p16;
++ for (; n > 0; n--)
++ *i15p++ = 0;
++ buf.p.p16 = i15p;
++ break;
++ }
++
++ RETRY:
++ s = write(fd, buf.top, buf.size);
++ if (s < buf.size) {
++ if (s < 0) {
++ if (errno == EINTR) goto RETRY;
++ perror("dacioFlush");
++ } else fprintf(stderr, "wrote only %d bytes\n", s);
++ exit(1);
++ }
++ buf.p.p8 = buf.top;
++ }
++
++ static struct {
++ const i31 *p0;
++ const i31 *p;
++ i15x len;
++ } inbuf;
++
++ void
++ dacioIncomingBuf(const i31 *bp)
++ {
++ inbuf.p0 = bp;
++ }
++
++ void
++ dacioIncomingBufLen(i15x len)
++ {
++ inbuf.len = len;
++ }
++
++ static i15x gv = 0x40*0x40; /* default g.v = m.v = 64 */
++
++ /* gv = 0(min)..64*128(max) */
++ void
++ dacioGlobalVol(i15x v)
++ {
++ gv = v;
++ }
++
++ #define VOL_MAX (64*64*128) /* vol max * g.v max * m.v max */
++ #define VOL_MAX_LOG ( 6+ 6+ 7) /* 1 << VOL_MAX_LOG == VOL_MAX */
++ #define LEV_MAX (128*VOL_MAX)
++
++ #if 0
++ #define to8bit(x, /*i31x*/tmpvar) \
++ ( tmpvar = (x) * gv, \
++ (tmpvar >= LEV_MAX) ? 255 : \
++ (tmpvar < -LEV_MAX) ? 0 : \
++ (u32x)tmpvar/VOL_MAX ^ 128 )
++ /* ^^^^^^ see asm output w/o this */
++ #define to8bit(x, /*i31x*/tmpvar) \
++ ( tmpvar = (x) * gv + LEV_MAX, \
++ (tmpvar & ~(LEV_MAX*2-1)) ? \
++ ((tmpvar < 0)? 0 : 255) : \
++ (u32x)tmpvar/VOL_MAX)
++ #define to8bit(x, /*i31x*/tmpvar) lim[(x) * gv >> VOL_MAX_LOG]
++ #else
++ /* almost the same CPU usage as lim[] table mathod */
++ #define to8bit(x, /*i31x*/tmpvar) \
++ ( tmpvar = ((x) * gv + LEV_MAX) >> VOL_MAX_LOG, \
++ (tmpvar & ~255)? ~tmpvar >> 16 : tmpvar ) /* 16 will be OK */
++ /* ~(tmpvar >> 16) makes longer asm */
++ #endif
++ #define to16bit(x) \
++ ( ((x) * gv) >> 12 )
++
++ /* stereo */
++ static void
++ dacioOutHirevS(i15x n)
++ {
++ const i31 *inbufp = inbuf.p;
++ u8 *u8p;
++ i15 *i15p;
++
++ switch (dci.bits) {
++ case 8:
++ u8p = buf.p.p8;
++ for (; n > 0; n--) {
++ i31x tmp;
++ *u8p++ = to8bit(*inbufp++, tmp); /* L */
++ *u8p++ = to8bit(*inbufp++, tmp); /* R */
++ }
++ buf.p.p8 = u8p;
++ break;
++ case 16:
++ i15p = buf.p.p16;
++ for (; n > 0; n--) {
++ *i15p++ = to16bit(*inbufp++); /* L */
++ *i15p++ = to16bit(*inbufp++); /* R */
++ }
++ buf.p.p16 = i15p;
++ break;
++ }
++ inbuf.p = inbufp;
++ }
++
++ /* mono */
++ static void
++ dacioOutHirevM(i15x n)
++ {
++ const i31 *inbufp = inbuf.p;
++ u8 *u8p;
++ i15 *i15p;
++
++ switch (dci.bits) {
++ case 8:
++ u8p = buf.p.p8;
++ for (; n > 0; n--) {
++ i31x tmp;
++ *u8p++ = to8bit(*inbufp, tmp);
++ inbufp += 2;
++ }
++ buf.p.p8 = u8p;
++ break;
++ case 16:
++ i15p = buf.p.p16;
++ for (; n > 0; n--) {
++ *i15p++ = to16bit(*inbufp);
++ inbufp += 2;
++ }
++ buf.p.p16 = i15p;
++ break;
++ }
++ inbuf.p = inbufp;
++ }
++
++ #define dacioOutHirev(x) \
++ if (dci.stereo) dacioOutHirevS(x); else dacioOutHirevM(x)
++
++ void
++ dacioOut(void)
++ {
++ i31x iLen;
++ i31x oLen;
++
++ inbuf.p = inbuf.p0;
++ iLen = inbuf.len;
++ while ((oLen = bufRest()) <= iLen) {
++ iLen -= oLen;
++ dacioOutHirev(oLen);
++ dacioFlush();
++ }
++ dacioOutHirev(iLen);
++ }