Sound card configuration under FreeBSD is not the most intuitive or well documented procedure. Here's some info to help you along, and examples from my own, working kernel. I've used the SoundBlaster AWE 32 and AWE 64 cards successfully.
This document will give you simple instructions for the traditional FreeBSD sound driver configuration. If you want to configure your sound card using Luigi's new PnP code, check out Luigi's Sound Drivers Also check out the file /usr/src/sys/i386/isa/sound/sound.doc for more information.
Brief description of IRQ/DRQ settings:
In the following examples, note how the IRQ is set, and how the DRQ is used to encode the DMA channel. This is crucial! Also note that cards such as some Gravis UltraSound (GUS) cards use a 2nd DMA channel. This must be specified in the flags!
SoundBlaster typical setup with one DMA channel:
# Sound blaster with IRQ 5 and DMA channel 1: device sb0 at isa? port 0x220 irq 5 drq 1 vector sbintr
The case is much the same for this example GUS card:
# GUS using IRQ 12 and only one DMA channel (1): device gus0 at isa? port 0x220 irq 12 drq 1 vector gusintr
Finally, an example GUS with two DMA channels. Note that the second DMA channel is configured in the 'flags':
# GUS using IRQ 12 and two DMA channels, 1 and 3: device gus0 at isa? port 0x220 irq 12 drq 1 flags 0x3 vector gusintr
1. Check the LINT file.
LINT is your ally. It contains examples for most types of hardware. My examples will use SoundBlaster specific configs. If you have a different type of Sound Card, or if your card does not work after using my examples, read the LINT file for hints with your card. To get to the Sound Driver part of the LINT file, do this:
a. cd /usr/src/sys/i386/conf/
If you do not have this directory, then you do not have your kernel sources. Back up a page and check for CVSUP information.
b. Read the file LINT, searching for the line:
# Audio drivers: `snd', `sb', `pas', `gus', `pca'
This is the first line of the Audio Drivers section.
2. Edit your kernel config file and add these options:
# Controls all sound devices # snd: Voxware sound support code controller snd0 # sb: SoundBlaster PCM - SoundBlaster, SB Pro, SB16, ProAudioSpectrum device sb0 at isa? port 0x220 irq 5 drq 1 vector sbintr # sbxvi: SoundBlaster 16 device sbxvi0 at isa? drq 5 conflicts # sbmidi: SoundBlaster 16 MIDI interface device sbmidi0 at isa? port 0x330 # opl: Yamaha OPL-2 and OPL-3 FM - SB, SB Pro, SB 16, ProAudioSpectrum device opl0 at isa? port 0x388
Note that if you are using a GUS card, you will have to experiment. Find the gus0 entries in LINT and use them. First you will need to determine whether your GUS card has 1 or 2 DMA channels. Use the 'device gus0' line in place of the 'device sb0' line. Remove the SoundBlaster options which you won't need.
3. Create the snd0 device.
# cd /dev
# ./MAKEDEV snd0
4. Remake your kernel and Reboot.
When you are done with this, you will need to remake your kernel, install the new kernel and reboot your system.
5. Test your /dev/audio.
Grab this ftp://flag.blackened.net/pub/incoming/sounds/sorrydave.au
Try to play it through /dev/audio:
# cat ./sorrydave.au > /dev/audio
Did you hear anything? Were your speakers on? Were your Port and IRQ/DRQ settings correct? These things may need to be tweaked for your particular settings.
FreeBSD for the Lazy and Hopeless