Message-Id: <199706282234.SAA13676@delorie.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Sat, 28 Jun 1997 18:32:45 -0500 To: xorxe AT asturies DOT org From: Conrad Wei-Li Song Subject: Re: Sound Programming Cc: djgpp AT delorie DOT com Precedence: bulk At 10:14 AM 6/26/97 -0600, you wrote: >So it seems to be a problem of speed on the ISR handler routine, >which is totally in C (no assembly)... but Allegro and MikMod sources >doesn't use assembler language enough and they do not make this >kind of noise (MikMod makes some clicks on my 486... on my pentium >I've not try it yet) > >If I'm right and the last hypothesis is the correct... but can I do? >I want to use functions from the standard library as cprintf... > OK. Somebody correct me if I'm wrong, but two things come to mind: 1. A big DMA buffer can work to your disadvantage as much as a tiny buffer. Don't forget that among other things there's interrupt overhead as well as sections of code which may disable hardware interrupts. 2. It's much faster to reprogram the DMA to a different memory address than it is to copy the new buffer on top of the old one. My plan (although I've never tried it), would be to set up two DMA buffers and cycle between them. On a soundcard IRQ, you'll just reprogram the DMA to the other buffer, and then transfer new data to your old one. That way, you're not so hard pressed for time.