From d0b795f25b705ff883368ba3e49f31c3541d3b11 Mon Sep 17 00:00:00 2001 From: cg Date: Sat, 23 Dec 2000 03:16:13 +0000 Subject: update code dealing with snd_dbuf objects to do so using a functional interface modify chn_setblocksize() to pick a default soft-blocksize appropriate to the sample rate and format in use. it will aim for a power of two size small enough to generate block sizes of at most 20ms. it will also set the hard-blocksize taking into account rate/format conversions in use. update drivers to implement setblocksize correctly: updated, tested: sb16, emu10k1, maestro, solo updated, untested: ad1816, ess, mss, sb8, csa not updated: ds1, es137x, fm801, neomagic, t4dwave, via82c686 i lack hardware to test: ad1816, csa, fm801, neomagic others will be updated/tested in the next few days. --- sys/dev/sound/pcm/dsp.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'sys/dev/sound/pcm/dsp.c') diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index 59c14e9..9728afd 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -240,8 +240,10 @@ dsp_ioctl(snddev_info *d, int chan, u_long cmd, caddr_t arg) case AIOGSIZE: /* get the current blocksize */ { struct snd_size *p = (struct snd_size *)arg; - if (wrch) p->play_size = wrch->buffer2nd.blksz; - if (rdch) p->rec_size = rdch->buffer2nd.blksz; + if (wrch) + p->play_size = wrch->buffer2nd.blksz; + if (rdch) + p->rec_size = rdch->buffer2nd.blksz; } break; @@ -287,14 +289,16 @@ dsp_ioctl(snddev_info *d, int chan, u_long cmd, caddr_t arg) if (rdch && wrch) p->formats |= (d->flags & SD_F_SIMPLEX)? 0 : AFMT_FULLDUPLEX; p->mixers = 1; /* default: one mixer */ - p->inputs = d->mixer->devs; + p->inputs = mix_getdevs(d->mixer); p->left = p->right = 100; } break; case AIOSTOP: - if (*arg_i == AIOSYNC_PLAY && wrch) *arg_i = chn_abort(wrch); - else if (*arg_i == AIOSYNC_CAPTURE && rdch) *arg_i = chn_abort(rdch); + if (*arg_i == AIOSYNC_PLAY && wrch) + *arg_i = chn_abort(wrch); + else if (*arg_i == AIOSYNC_CAPTURE && rdch) + *arg_i = chn_abort(rdch); else { printf("AIOSTOP: bad channel 0x%x\n", *arg_i); *arg_i = 0; -- cgit v1.1