IF YOU HAVE A SOUNDCARD WHICH HAS ITS OWN DMA RAM, YOU DON'T NEED THIS PROCEDURE.

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 Slackware and Debian distributions, and kernels 2.0.30 and 2.1.63. 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 WORKS, RECONFIGURE THE KERNEL WITH THE FOLLOWING AUDIO SETTINGS:

  • SET THE DMA BUFFER SIZE TO 262144 EVEN THOUGH IT ISN'T AN OPTION. THE CONFIGURATION PROGRAM SHOULD ACCEPT 262144.
  • ANSWER YES ESPECIALLY FOR /dev/dsp SUPPORT.
  • KERNEL 2.1.63 DOESN'T PROMPT FOR DMA BUFFER SIZE OR /dev/dsp. DO THIS INSTEAD FOR 2.1.63:

    LINUX 2.1.63:

    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_BUFFCOUNT 
    
    Make the following change:

    
    #undef DSP_BUFFSIZE
    #define DSP_BUFFSIZE            (256*1024)
    
    #ifndef DSP_BUFFCOUNT 
    
    STAGE 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.
    Change directories back to /usr/src/linux.

    Run make zImage. 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, nomrom included in the distribution does this. It allocates a buffer and automatically detects whether you need 2 buffers for full duplex buffering.

    Copy it to /usr/local/bin so you can boot it at startup by inserting the following highlighted lines into your /etc/rc.d/rc.M file.

    
    # Start up the Nomrom openVR powerplant
    /usr/local/bin/nomrom
    
    Your system should now support the audio required by Broadcast 2.1 the next time you reboot. Be aware that during the first 10 minutes of audio playback after rebooting, the sound driver has been known to swap output channels. This is solved by stopping and restarting playback. The problem only occurs during the first 10 minutes of audio playback after rebooting.