diff options
author | cg <cg@FreeBSD.org> | 2000-12-25 01:42:13 +0000 |
---|---|---|
committer | cg <cg@FreeBSD.org> | 2000-12-25 01:42:13 +0000 |
commit | 7fb05e9c25867c5786db0a3d757123ac8789bbec (patch) | |
tree | 57261ac05b502868a2f48c257f407987e967e18c /sys | |
parent | 2f37ea4d17f08a14aeb36c0fea778d8b4d44e0cd (diff) | |
download | FreeBSD-src-7fb05e9c25867c5786db0a3d757123ac8789bbec.zip FreeBSD-src-7fb05e9c25867c5786db0a3d757123ac8789bbec.tar.gz |
update to return correct blocksize- these chips have a fixed irq rate, so
block size varies only with format and rate.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/sound/pci/ds1.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/dev/sound/pci/ds1.c b/sys/dev/sound/pci/ds1.c index 5d76502..f070dee 100644 --- a/sys/dev/sound/pci/ds1.c +++ b/sys/dev/sound/pci/ds1.c @@ -39,6 +39,7 @@ #define DS1_CHANS 4 #define DS1_RECPRIMARY 0 +#define DS1_IRQHZ ((48000 << 8) / 256) struct pbank { volatile u_int32_t Format; @@ -521,6 +522,12 @@ ds1pchan_setspeed(kobj_t obj, void *data, u_int32_t speed) static int ds1pchan_setblocksize(kobj_t obj, void *data, u_int32_t blocksize) { + struct sc_pchinfo *ch = data; + int drate; + + /* irq rate is fixed at 187.5hz */ + drate = ch->spd * sndbuf_getbps(ch->buffer); + blocksize = (drate << 8) / DS1_IRQHZ; return blocksize; } @@ -842,6 +849,7 @@ ds_init(struct sc_info *sc) ds_wr(sc, YDSXGR_NATIVEDACOUTVOL, 0x3fff3fff, 4); ds_wr(sc, YDSXGR_NATIVEADCINVOL, 0x3fff3fff, 4); ds_wr(sc, YDSXGR_NATIVEDACINVOL, 0x3fff3fff, 4); + return 0; } |