diff options
author | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2015-05-11 06:46:23 +0000 |
---|---|---|
committer | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2015-05-11 06:46:23 +0000 |
commit | cb499c42facd77434ebac9a75c6bd41df9f1ed9d (patch) | |
tree | cc19762f9b558b3e3639e919167faf31200d4068 /sys/dev/isa | |
parent | e7adfc42b4982d81907aac13902bddc965027d8d (diff) |
Remove all audio format conversion code from the kernel (btw holding
the kernel_lock), as we already do better conversions in
user-mode. Yet, no need for every single driver to fiddle with the
conversion code as they are done transparently by common MI code. With
help from armani and miod, support from mpi
ok armani@
Diffstat (limited to 'sys/dev/isa')
-rw-r--r-- | sys/dev/isa/ad1848.c | 73 | ||||
-rw-r--r-- | sys/dev/isa/ess.c | 58 | ||||
-rw-r--r-- | sys/dev/isa/files.isa | 14 | ||||
-rw-r--r-- | sys/dev/isa/files.isapnp | 4 | ||||
-rw-r--r-- | sys/dev/isa/gus.c | 53 | ||||
-rw-r--r-- | sys/dev/isa/sbdsp.c | 80 |
6 files changed, 41 insertions, 241 deletions
diff --git a/sys/dev/isa/ad1848.c b/sys/dev/isa/ad1848.c index 50694c5c9ba..4dcde647b05 100644 --- a/sys/dev/isa/ad1848.c +++ b/sys/dev/isa/ad1848.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ad1848.c,v 1.41 2015/05/08 07:25:36 jsg Exp $ */ +/* $OpenBSD: ad1848.c,v 1.42 2015/05/11 06:46:21 ratchov Exp $ */ /* $NetBSD: ad1848.c,v 1.45 1998/01/30 02:02:38 augustss Exp $ */ /* @@ -81,7 +81,6 @@ #include <sys/audioio.h> #include <dev/audio_if.h> -#include <dev/auconv.h> #include <dev/isa/isavar.h> #include <dev/isa/isadmavar.h> @@ -907,8 +906,6 @@ ad1848_mixer_set_port(struct ad1848_softc *ac, struct ad1848_devmap *map, int ad1848_query_encoding(void *addr, struct audio_encoding *fp) { - struct ad1848_softc *sc = addr; - switch (fp->index) { case 0: strlcpy(fp->name, AudioEmulaw, sizeof fp->name); @@ -934,40 +931,6 @@ ad1848_query_encoding(void *addr, struct audio_encoding *fp) fp->precision = 8; fp->flags = 0; break; - case 4: /* only on CS4231 */ - strlcpy(fp->name, AudioEslinear_be, sizeof fp->name); - fp->encoding = AUDIO_ENCODING_SLINEAR_BE; - fp->precision = 16; - fp->flags = sc->mode == 1 ? AUDIO_ENCODINGFLAG_EMULATED : 0; - break; - - /* emulate some modes */ - case 5: - strlcpy(fp->name, AudioEslinear, sizeof fp->name); - fp->encoding = AUDIO_ENCODING_SLINEAR; - fp->precision = 8; - fp->flags = AUDIO_ENCODINGFLAG_EMULATED; - break; - case 6: - strlcpy(fp->name, AudioEulinear_le, sizeof fp->name); - fp->encoding = AUDIO_ENCODING_ULINEAR_LE; - fp->precision = 16; - fp->flags = AUDIO_ENCODINGFLAG_EMULATED; - break; - case 7: - strlcpy(fp->name, AudioEulinear_be, sizeof fp->name); - fp->encoding = AUDIO_ENCODING_ULINEAR_BE; - fp->precision = 16; - fp->flags = AUDIO_ENCODINGFLAG_EMULATED; - break; - case 8: /* only on CS4231 */ - if (sc->mode == 1) - return EINVAL; - strlcpy(fp->name, AudioEadpcm, sizeof fp->name); - fp->encoding = AUDIO_ENCODING_ADPCM; - fp->precision = 8; - fp->flags = 0; - break; default: return EINVAL; /*NOTREACHED*/ @@ -984,46 +947,36 @@ ad1848_set_params(void *addr, int setmode, int usemode, struct audio_params *p, { struct ad1848_softc *sc = addr; int error, bits, enc; - void (*pswcode)(void *, u_char *buf, int cnt); - void (*rswcode)(void *, u_char *buf, int cnt); DPRINTF(("ad1848_set_params: %d %d %d %ld\n", p->encoding, p->precision, p->channels, p->sample_rate)); enc = p->encoding; - pswcode = rswcode = 0; switch (enc) { case AUDIO_ENCODING_SLINEAR_LE: - if (p->precision == 8) { - enc = AUDIO_ENCODING_ULINEAR_LE; - pswcode = rswcode = change_sign8; - } + if (p->precision == 8) + return EINVAL; break; case AUDIO_ENCODING_SLINEAR_BE: - if (p->precision == 16 && sc->mode == 1) { - enc = AUDIO_ENCODING_SLINEAR_LE; - pswcode = rswcode = swap_bytes; - } + if (p->precision == 16) + return EINVAL; break; case AUDIO_ENCODING_ULINEAR_LE: - if (p->precision == 16) { - enc = AUDIO_ENCODING_SLINEAR_LE; - pswcode = rswcode = change_sign16_le; - } + if (p->precision == 16) + return EINVAL; break; case AUDIO_ENCODING_ULINEAR_BE: - if (p->precision == 16) { - enc = AUDIO_ENCODING_SLINEAR_LE; - pswcode = swap_bytes_change_sign16_le; - rswcode = change_sign16_swap_bytes_le; - } + if (p->precision == 16) + return EINVAL; break; } switch (enc) { - case AUDIO_ENCODING_ULAW: + case AUDIO_ENCODING_ULAW: + p->precision = 8; bits = FMT_ULAW; break; case AUDIO_ENCODING_ALAW: + p->precision = 8; bits = FMT_ALAW; break; case AUDIO_ENCODING_ADPCM: @@ -1058,8 +1011,6 @@ ad1848_set_params(void *addr, int setmode, int usemode, struct audio_params *p, if (error) return error; - p->sw_code = pswcode; - r->sw_code = rswcode; p->bps = AUDIO_BPS(p->precision); r->bps = AUDIO_BPS(r->precision); p->msb = 1; diff --git a/sys/dev/isa/ess.c b/sys/dev/isa/ess.c index 0aec993d924..22b322e907c 100644 --- a/sys/dev/isa/ess.c +++ b/sys/dev/isa/ess.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ess.c,v 1.20 2014/09/14 14:17:25 jsg Exp $ */ +/* $OpenBSD: ess.c,v 1.21 2015/05/11 06:46:21 ratchov Exp $ */ /* $NetBSD: ess.c,v 1.44.4.1 1999/06/21 01:18:00 thorpej Exp $ */ /* @@ -81,8 +81,6 @@ #include <sys/audioio.h> #include <dev/audio_if.h> -#include <dev/auconv.h> -#include <dev/mulaw.h> #include <dev/isa/isavar.h> #include <dev/isa/isadmavar.h> @@ -1121,47 +1119,23 @@ ess_query_encoding(void *addr, struct audio_encoding *fp) fp->flags = 0; break; case 1: - strlcpy(fp->name, AudioEmulaw, sizeof fp->name); - fp->encoding = AUDIO_ENCODING_ULAW; - fp->precision = 8; - fp->flags = AUDIO_ENCODINGFLAG_EMULATED; - break; - case 2: - strlcpy(fp->name, AudioEalaw, sizeof fp->name); - fp->encoding = AUDIO_ENCODING_ALAW; - fp->precision = 8; - fp->flags = AUDIO_ENCODINGFLAG_EMULATED; - break; - case 3: strlcpy(fp->name, AudioEslinear, sizeof fp->name); fp->encoding = AUDIO_ENCODING_SLINEAR; fp->precision = 8; fp->flags = 0; break; - case 4: + case 2: strlcpy(fp->name, AudioEslinear_le, sizeof fp->name); fp->encoding = AUDIO_ENCODING_SLINEAR_LE; fp->precision = 16; fp->flags = 0; break; - case 5: + case 3: strlcpy(fp->name, AudioEulinear_le, sizeof fp->name); fp->encoding = AUDIO_ENCODING_ULINEAR_LE; fp->precision = 16; fp->flags = 0; break; - case 6: - strlcpy(fp->name, AudioEslinear_be, sizeof fp->name); - fp->encoding = AUDIO_ENCODING_SLINEAR_BE; - fp->precision = 16; - fp->flags = AUDIO_ENCODINGFLAG_EMULATED; - break; - case 7: - strlcpy(fp->name, AudioEulinear_be, sizeof fp->name); - fp->encoding = AUDIO_ENCODING_ULINEAR_BE; - fp->precision = 16; - fp->flags = AUDIO_ENCODINGFLAG_EMULATED; - break; default: return EINVAL; } @@ -1217,31 +1191,15 @@ ess_set_params(void *addr, int setmode, int usemode, if (p->channels > 2) p->channels = 2; - p->factor = 1; - p->sw_code = 0; switch (p->encoding) { case AUDIO_ENCODING_SLINEAR_BE: case AUDIO_ENCODING_ULINEAR_BE: - if (p->precision == 16) - p->sw_code = swap_bytes; + if (p->precision != 8) + return EINVAL; break; case AUDIO_ENCODING_SLINEAR_LE: case AUDIO_ENCODING_ULINEAR_LE: break; - case AUDIO_ENCODING_ULAW: - if (mode == AUMODE_PLAY) { - p->factor = 2; - p->sw_code = mulaw_to_ulinear16_le; - } else - p->sw_code = ulinear8_to_mulaw; - break; - case AUDIO_ENCODING_ALAW: - if (mode == AUMODE_PLAY) { - p->factor = 2; - p->sw_code = alaw_to_ulinear16_le; - } else - p->sw_code = ulinear8_to_alaw; - break; default: return (EINVAL); } @@ -1301,7 +1259,7 @@ ess_audio1_trigger_output(void *addr, void *start, void *end, int blksize, ess_write_x_reg(sc, ESS_XCMD_AUDIO_CTRL, reg); reg = ess_read_x_reg(sc, ESS_XCMD_AUDIO1_CTRL1); - if (param->precision * param->factor == 16) + if (param->precision == 16) reg |= ESS_AUDIO1_CTRL1_FIFO_SIZE; else reg &= ~ESS_AUDIO1_CTRL1_FIFO_SIZE; @@ -1365,7 +1323,7 @@ ess_audio2_trigger_output(void *addr, void *start, void *end, int blksize, } reg = ess_read_mix_reg(sc, ESS_MREG_AUDIO2_CTRL2); - if (param->precision * param->factor == 16) + if (param->precision == 16) reg |= ESS_AUDIO2_CTRL2_FIFO_SIZE; else reg &= ~ESS_AUDIO2_CTRL2_FIFO_SIZE; @@ -1440,7 +1398,7 @@ ess_audio1_trigger_input(void *addr, void *start, void *end, int blksize, ess_write_x_reg(sc, ESS_XCMD_AUDIO_CTRL, reg); reg = ess_read_x_reg(sc, ESS_XCMD_AUDIO1_CTRL1); - if (param->precision * param->factor == 16) + if (param->precision == 16) reg |= ESS_AUDIO1_CTRL1_FIFO_SIZE; else reg &= ~ESS_AUDIO1_CTRL1_FIFO_SIZE; diff --git a/sys/dev/isa/files.isa b/sys/dev/isa/files.isa index f28f80ce6e0..565e2bfb1be 100644 --- a/sys/dev/isa/files.isa +++ b/sys/dev/isa/files.isa @@ -1,4 +1,4 @@ -# $OpenBSD: files.isa,v 1.117 2014/12/04 21:03:51 tedu Exp $ +# $OpenBSD: files.isa,v 1.118 2015/05/11 06:46:21 ratchov Exp $ # $NetBSD: files.isa,v 1.21 1996/05/16 03:45:55 mycroft Exp $ # # Config file and device description for machine-independent ISA code. @@ -222,7 +222,7 @@ define sbdsp {} file dev/isa/sbdsp.c sbdsp # SoundBlaster family -device sb: audio, isa_dma, sbdsp, mulaw, auconv, mpu, midibus +device sb: audio, isa_dma, sbdsp, mpu, midibus file dev/isa/sb.c sb attach sb at isa with sb_isa @@ -231,12 +231,12 @@ file dev/isa/sb_isa.c sb & (sb_isa | sb_isapnp) # Soundcards based on Sierra's Aria chipset. # Such as the Prometheus Aria 16 or the Diamond # sonic sound. -device aria: audio, mulaw +device aria: audio attach aria at isa file dev/isa/aria.c aria # ProAudio Spectrum -device pas: audio, isa_dma, sbdsp, mulaw, auconv +device pas: audio, isa_dma, sbdsp attach pas at isa file dev/isa/pas.c pas @@ -250,21 +250,21 @@ file dev/isa/ics2101.c ics2101 # Microsoft Windows Sound System -device wss: audio, isa_dma, ad1848, auconv +device wss: audio, isa_dma, ad1848 file dev/isa/wss.c wss attach wss at isa with wss_isa file dev/isa/wss_isa.c wss & (wss_isa | wss_isapnp) # ESS Technology ES1887/ES888/ES1888 -device ess {} : audio, isa_dma, mulaw, auconv, midibus +device ess {} : audio, isa_dma, midibus file dev/isa/ess.c ess # Gravis UltraSound & UltraSound MAX. # Use the "flags" keyword in a config file to specify an extra DMA # channel for full-duplex operation. -device gus: audio, isa_dma, ics2101, ad1848, mulaw, auconv +device gus: audio, isa_dma, ics2101, ad1848 file dev/isa/gus.c gus attach gus at isa with gus_isa diff --git a/sys/dev/isa/files.isapnp b/sys/dev/isa/files.isapnp index ddd27a512d0..76f1f6c77b5 100644 --- a/sys/dev/isa/files.isapnp +++ b/sys/dev/isa/files.isapnp @@ -1,4 +1,4 @@ -# $OpenBSD: files.isapnp,v 1.32 2014/10/12 18:51:23 miod Exp $ +# $OpenBSD: files.isapnp,v 1.33 2015/05/11 06:46:21 ratchov Exp $ # $NetBSD: files.isapnp,v 1.7 1997/10/16 17:16:36 matt Exp $ # # Config file and device description for machine-independent ISAPnP code. @@ -64,7 +64,7 @@ attach rt at isapnp with rt_isapnp file dev/isa/rt_isapnp.c rt_isapnp # Yamaha OPL3-SA3 -device ym: audio, isa_dma, ad1848, auconv, midibus +device ym: audio, isa_dma, ad1848, midibus attach ym at isapnp with ym_isapnp file dev/isa/ym.c ym_isapnp file dev/isa/ym_isapnp.c ym_isapnp diff --git a/sys/dev/isa/gus.c b/sys/dev/isa/gus.c index ea3abdfc068..cc16c8ca3b1 100644 --- a/sys/dev/isa/gus.c +++ b/sys/dev/isa/gus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gus.c,v 1.41 2014/09/14 14:17:25 jsg Exp $ */ +/* $OpenBSD: gus.c,v 1.42 2015/05/11 06:46:21 ratchov Exp $ */ /* $NetBSD: gus.c,v 1.51 1998/01/25 23:48:06 mycroft Exp $ */ /*- @@ -106,8 +106,6 @@ #include <machine/cpufunc.h> #include <sys/audioio.h> #include <dev/audio_if.h> -#include <dev/mulaw.h> -#include <dev/auconv.h> #include <dev/isa/isavar.h> #include <dev/isa/isadmavar.h> @@ -1485,12 +1483,8 @@ gus_set_params(void *addr, int setmode, int usemode, struct audio_params *p, struct gus_softc *sc = addr; switch (p->encoding) { - case AUDIO_ENCODING_ULAW: - case AUDIO_ENCODING_ALAW: case AUDIO_ENCODING_SLINEAR_LE: case AUDIO_ENCODING_ULINEAR_LE: - case AUDIO_ENCODING_SLINEAR_BE: - case AUDIO_ENCODING_ULINEAR_BE: break; default: return (EINVAL); @@ -1520,20 +1514,6 @@ gus_set_params(void *addr, int setmode, int usemode, struct audio_params *p, if (setmode & AUMODE_PLAY) sc->sc_orate = p->sample_rate; - switch (p->encoding) { - case AUDIO_ENCODING_ULAW: - p->sw_code = mulaw_to_ulinear8; - r->sw_code = ulinear8_to_mulaw; - break; - case AUDIO_ENCODING_ALAW: - p->sw_code = alaw_to_ulinear8; - r->sw_code = ulinear8_to_alaw; - break; - case AUDIO_ENCODING_ULINEAR_BE: - case AUDIO_ENCODING_SLINEAR_BE: - r->sw_code = p->sw_code = swap_bytes; - break; - } p->bps = AUDIO_BPS(p->precision); r->bps = AUDIO_BPS(r->precision); p->msb = r->msb = 1; @@ -3147,54 +3127,29 @@ gus_query_encoding(void *addr, struct audio_encoding *fp) { switch (fp->index) { case 0: - strlcpy(fp->name, AudioEmulaw, sizeof fp->name); - fp->encoding = AUDIO_ENCODING_ULAW; - fp->precision = 8; - fp->flags = AUDIO_ENCODINGFLAG_EMULATED; - break; - case 1: strlcpy(fp->name, AudioEslinear, sizeof fp->name); fp->encoding = AUDIO_ENCODING_SLINEAR; fp->precision = 8; fp->flags = 0; break; - case 2: + case 1: strlcpy(fp->name, AudioEslinear_le, sizeof fp->name); fp->encoding = AUDIO_ENCODING_SLINEAR_LE; fp->precision = 16; fp->flags = 0; break; - case 3: + case 2: strlcpy(fp->name, AudioEulinear, sizeof fp->name); fp->encoding = AUDIO_ENCODING_ULINEAR; fp->precision = 8; fp->flags = 0; break; - case 4: + case 3: strlcpy(fp->name, AudioEulinear_le, sizeof fp->name); fp->encoding = AUDIO_ENCODING_ULINEAR_LE; fp->precision = 16; fp->flags = 0; break; - case 5: - strlcpy(fp->name, AudioEslinear_be, sizeof fp->name); - fp->encoding = AUDIO_ENCODING_SLINEAR_BE; - fp->precision = 16; - fp->flags = AUDIO_ENCODINGFLAG_EMULATED; - break; - case 6: - strlcpy(fp->name, AudioEulinear_be, sizeof fp->name); - fp->encoding = AUDIO_ENCODING_ULINEAR_BE; - fp->precision = 16; - fp->flags = AUDIO_ENCODINGFLAG_EMULATED; - break; - case 7: - strlcpy(fp->name, AudioEalaw, sizeof fp->name); - fp->encoding = AUDIO_ENCODING_ALAW; - fp->precision = 8; - fp->flags = AUDIO_ENCODINGFLAG_EMULATED; - break; - default: return(EINVAL); /*NOTREACHED*/ diff --git a/sys/dev/isa/sbdsp.c b/sys/dev/isa/sbdsp.c index 594fd067418..9d4ef0a393e 100644 --- a/sys/dev/isa/sbdsp.c +++ b/sys/dev/isa/sbdsp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sbdsp.c,v 1.34 2014/09/14 14:17:25 jsg Exp $ */ +/* $OpenBSD: sbdsp.c,v 1.35 2015/05/11 06:46:21 ratchov Exp $ */ /* * Copyright (c) 1991-1993 Regents of the University of California. @@ -61,8 +61,6 @@ #include <sys/audioio.h> #include <dev/audio_if.h> #include <dev/midi_if.h> -#include <dev/mulaw.h> -#include <dev/auconv.h> #include <dev/isa/isavar.h> #include <dev/isa/isadmavar.h> @@ -531,8 +529,6 @@ sbdsp_set_params(addr, setmode, usemode, play, rec) struct sbdsp_softc *sc = addr; struct sbmode *m; u_int rate, tc, bmode; - void (*swcode)(void *, u_char *buf, int cnt); - int factor; int model; int chan; struct audio_params *p; @@ -633,44 +629,24 @@ sbdsp_set_params(addr, setmode, usemode, play, rec) if (m->model == -1) return EINVAL; rate = p->sample_rate; - swcode = 0; - factor = 1; tc = 1; bmode = -1; if (model == SB_16) { switch (p->encoding) { case AUDIO_ENCODING_SLINEAR_BE: if (p->precision == 16) - swcode = swap_bytes; + return EINVAL; /* fall into */ case AUDIO_ENCODING_SLINEAR_LE: bmode = SB_BMODE_SIGNED; break; case AUDIO_ENCODING_ULINEAR_BE: if (p->precision == 16) - swcode = swap_bytes; + return EINVAL; /* fall into */ case AUDIO_ENCODING_ULINEAR_LE: bmode = SB_BMODE_UNSIGNED; break; - case AUDIO_ENCODING_ULAW: - if (mode == AUMODE_PLAY) { - swcode = mulaw_to_ulinear16_le; - factor = 2; - m = &sbpmodes[PLAY16]; - } else - swcode = ulinear8_to_mulaw; - bmode = SB_BMODE_UNSIGNED; - break; - case AUDIO_ENCODING_ALAW: - if (mode == AUMODE_PLAY) { - swcode = alaw_to_ulinear16_le; - factor = 2; - m = &sbpmodes[PLAY16]; - } else - swcode = ulinear8_to_alaw; - bmode = SB_BMODE_UNSIGNED; - break; default: return EINVAL; } @@ -680,24 +656,6 @@ sbdsp_set_params(addr, setmode, usemode, play, rec) switch (p->encoding) { case AUDIO_ENCODING_SLINEAR_LE: break; - case AUDIO_ENCODING_ULINEAR_LE: - swcode = change_sign16_le; - break; - case AUDIO_ENCODING_SLINEAR_BE: - swcode = swap_bytes; - break; - case AUDIO_ENCODING_ULINEAR_BE: - swcode = mode == AUMODE_PLAY ? - swap_bytes_change_sign16_le : change_sign16_swap_bytes_le; - break; - case AUDIO_ENCODING_ULAW: - swcode = mode == AUMODE_PLAY ? - mulaw_to_ulinear8 : ulinear8_to_mulaw; - break; - case AUDIO_ENCODING_ALAW: - swcode = mode == AUMODE_PLAY ? - alaw_to_ulinear8 : ulinear8_to_alaw; - break; default: return EINVAL; } @@ -705,21 +663,9 @@ sbdsp_set_params(addr, setmode, usemode, play, rec) p->sample_rate = SB_TC_TO_RATE(tc) / p->channels; } else { switch (p->encoding) { - case AUDIO_ENCODING_SLINEAR_BE: - case AUDIO_ENCODING_SLINEAR_LE: - swcode = change_sign8; - break; case AUDIO_ENCODING_ULINEAR_BE: case AUDIO_ENCODING_ULINEAR_LE: break; - case AUDIO_ENCODING_ULAW: - swcode = mode == AUMODE_PLAY ? - mulaw_to_ulinear8 : ulinear8_to_mulaw; - break; - case AUDIO_ENCODING_ALAW: - swcode = mode == AUMODE_PLAY ? - alaw_to_ulinear8 : ulinear8_to_alaw; - break; default: return EINVAL; } @@ -742,13 +688,11 @@ sbdsp_set_params(addr, setmode, usemode, play, rec) sc->sc_i.dmachan = chan; } - p->sw_code = swcode; - p->factor = factor; p->bps = AUDIO_BPS(p->precision); p->msb = 1; - DPRINTF(("sbdsp_set_params: model=%d, mode=%d, rate=%ld, prec=%d, chan=%d, enc=%d -> tc=%02x, cmd=%02x, bmode=%02x, cmdchan=%02x, swcode=%p, factor=%d\n", + DPRINTF(("sbdsp_set_params: model=%d, mode=%d, rate=%ld, prec=%d, chan=%d, enc=%d -> tc=%02x, cmd=%02x, bmode=%02x, cmdchan=%02x\n", sc->sc_model, mode, p->sample_rate, p->precision, p->channels, - p->encoding, tc, m->cmd, bmode, m->cmdchan, swcode, factor)); + p->encoding, tc, m->cmd, bmode, m->cmdchan)); } @@ -763,15 +707,7 @@ sbdsp_set_params(addr, setmode, usemode, play, rec) usemode == (AUMODE_PLAY | AUMODE_RECORD) && sc->sc_i.dmachan == sc->sc_o.dmachan) { DPRINTF(("sbdsp_set_params: fd=%d, usemode=%d, idma=%d, odma=%d\n", sc->sc_fullduplex, usemode, sc->sc_i.dmachan, sc->sc_o.dmachan)); - if (sc->sc_o.dmachan == sc->sc_drq8) { - /* Use 16 bit DMA for playing by expanding the samples. */ - play->sw_code = linear8_to_linear16_le; - play->factor = 2; - sc->sc_o.modep = &sbpmodes[PLAY16]; - sc->sc_o.dmachan = sc->sc_drq16; - } else { - return EINVAL; - } + return EINVAL; } DPRINTF(("sbdsp_set_params ichan=%d, ochan=%d\n", sc->sc_i.dmachan, sc->sc_o.dmachan)); @@ -1233,7 +1169,7 @@ sbdsp_trigger_input(addr, start, end, blksize, intr, arg, param) { struct sbdsp_softc *sc = addr; int stereo = param->channels == 2; - int width = param->precision * param->factor; + int width = param->precision; int filter; int rc; @@ -1370,7 +1306,7 @@ sbdsp_trigger_output(addr, start, end, blksize, intr, arg, param) { struct sbdsp_softc *sc = addr; int stereo = param->channels == 2; - int width = param->precision * param->factor; + int width = param->precision; int cmd; int rc; |