OTHERWISE, YOU WANT TO GET THE MOST FOR YOUR BUCK. YOU HAVE A SOUNDBLASTER 16 OR SOMETHING WHICH USES SYSTEM RAM FOR ITS DMA BUFFERING.
YOU WILL HAVE FITS IF YOU ATTEMPT TO RUN PROCESSOR INTENSIVE PROGRAMS LIKE BROADCAST 2.0 OR MAPLAY SINCE OSS ONLY ALLOWS DMA BUFFERS OF 64K AND ONLY ON A GOOD DAY WHEN MEMORY ISN'T FRAGMENTED. FOR MOST PEOPLE INCREASING THE DMA BUFFER SIZE RATHER THAN GETTING A FASTER COMPUTER IS WHAT'S NEEDED TO LOSE THE CHOPPINESS.
THIS PROCEDURE INCREASES THE DMA BUFFER SIZE TO THE MAXIMUM POSSIBLE.
This technique can only be done with OSS/Free, the sound driver which comes with the Linux distribution, since you need the source code. This procedure has been done on Debian distributions and kernel 2.0.35. The sound card was SB16.
STAGE 1
GET YOUR SOUND DRIVER WORKING THE WAY THEY TELL YOU TO IN THE HOWTOS. AFTER SATISFYING YOURSELF THAT IT WORKSDO THIS:
cd to /usr/src/linux/drivers/sound.
Find the following lines in sound_config.h
#undef DSP_BUFFSIZE #define DSP_BUFFSIZE (64*1024) #ifndef DSP_BUFFCOUNTMake the following change:
#undef DSP_BUFFSIZE #define DSP_BUFFSIZE (256*1024) #ifndef DSP_BUFFCOUNTSTAGE 2
cd TO /usr/src/linux/drivers/sound/
Copy soundcard.c to soundcard.bak in case something breaks.
Find the following lines in soundcard.c:
if (chan < 4) dma_pagesize = 64 * 1024; else dma_pagesize = 128 * 1024;
Make the following highlighted changes:
if (chan < 4) dma_pagesize = 256 * 1024; else dma_pagesize = 256 * 1024;This forces OSS to allocate the maximum buffer all the time. Now find the following lines in soundcard.c:
void sound_free_dmap (int dev, struct dma_buffparms *dmap) { int sz, size, i; unsigned long start_addr, end_addr; if (dmap->raw_buf == NULL) return; /* already done */ if (dmap->mapping_flags & DMA_MAP_MAPPED)Make the following highlighted changes:
void sound_free_dmap (int dev, struct dma_buffparms *dmap) { int sz, size, i; unsigned long start_addr, end_addr; return; if (dmap->raw_buf == NULL) return; /* already done */This causes OSS to reserve the buffer whether the sound driver is opened or not.
Run make bzImage. You don't need to clean anything.
Do whatever they tell you to do after that to boot off of the new kernel.
STAGE 3
When you're satisfied that the new kernel boots, it's time to guarantee that the larger buffer gets reserved at startup. The best way to do this is to open and close the sound driver to force it to allocate a buffer. If your soundcard does full duplex, or rather, if OSS supports full duplex for your soundcard, you'll need to force it to allocate a record and playback buffer.
This program, soundtest included in the distribution does this. It allocates a buffer and automatically detects whether you need 2 buffers for full duplex buffering.
Your system should now support the audio required by Broadcast 2.1 the next time you reboot or load the sound module.