From owner-freebsd-hardware Fri Dec 11 18:25:14 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id SAA01895 for freebsd-hardware-outgoing; Fri, 11 Dec 1998 18:25:14 -0800 (PST) (envelope-from owner-freebsd-hardware@FreeBSD.ORG) Received: from home.dragondata.com (home.dragondata.com [204.137.237.2]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id SAA01890 for ; Fri, 11 Dec 1998 18:25:12 -0800 (PST) (envelope-from toasty@home.dragondata.com) Received: (from toasty@localhost) by home.dragondata.com (8.8.8/8.8.5) id UAA13709; Fri, 11 Dec 1998 20:24:55 -0600 (CST) From: Kevin Day Message-Id: <199812120224.UAA13709@home.dragondata.com> Subject: Re: sane sound cards? In-Reply-To: <199812120145.PAA10540@pegasus.com> from Richard Foulk at "Dec 11, 1998 3:45:20 pm" To: richard@pegasus.com (Richard Foulk) Date: Fri, 11 Dec 1998 20:24:55 -0600 (CST) Cc: freebsd-hardware@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL43 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hardware@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org > } If you're getting skipping/missing, it's because your system can't keep up > } or there are driver problems. > } > } I have an original Soundblaster 1.0 (giant ISA card) that has a 64 byte > } buffer, but can DMA. I'm able to play mp3's on it with ease. > } > } Look for IRQ conflicts, or try a different audio driver if possible. > > Perhaps I wasn't clear. My system can play them just fine too. But > not if I do a fair amount of other work at the same time. I'm convinced > that a lack of sufficient buffering on the sound card is the only thing > standing in my way. Maybe I wasn't either. :) I can play mp3's on my old soundblaster during a make world -j4, with no skipping... P/200 with 128MB of ram. > } > A larger on-card buffer would make the problem go away. > } > } Not really. You're DMA'ing data from the system to the card, so that will > } never get interrupted with load. > > I don't think you understand how DMA works. Since the transfer is > limited to the buffer on the card it can only transfer tiny bits of data > at a time. > > You can't DMA a megabyte buffer full of data to a card that doesn't have > any place to put it. So a five minute song is going to take roughly > 100,000 separate DMA transfers. That's 100,000 chances for another > process to keep the CPU busy long enough for the sound card to run out > of data. 64 bytes is only a few milliseconds of play time. Unacceptable. At least in my design, you trigger an interrupt/timer/something to go off just before the dma finishes, and in that handler you start up another transfer. I do arcade game programming. In past projects, i've done similar things on funky processors as slow as 33Mhz, with no problem keeping things fed. I'd usually set a timer to expire just before my dma was finished, that triggered an interrupt, and my interrupt handler started the next dma. No matter what was happening, i never missed a dma. Kevin To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hardware" in the body of the message