Defcon-1-Logo

           [Home]    [FBSD Articles]    [Scripts Corner]    [Contribute]    [Search]    [FBSD Links]    [Files]

About Us

FreeBSD Articles
  *Hardware
  *Networking
  *Security
  *Software
  *X Windows


Files / Scripts
Newbies Corner
Tech. Talk
Tips and Tricks


FreeBSD Links

Articles in other
Languages :
  *French Articles
  *Spanish Articles

Want to Help ?
 
   Click Here

Email Users5

Search:
 

 


FreeBSD Search:


 

 

Powered-By-Apache-Logo

Installing PnP Sound Cards
AWE64, AWE32, or SB32

IMPORTANT NOTE!

Before proceeding any further, make sure your system supports PnP! Try 'man pnp' and/or 'man pnpinfo' at a shell prompt. If your version of FreeBSD fails on these commands, we strongly recommend upgrading to a later version of FreeBSD. The latest versions of FreeBSD at the time of this writing are 3.3 for the STABLE branch, and 4.0 for the CURRENT, or "developmental" branch.

PART ONE -- Configuring the kernel

We'll assume you already understand the basics of configuring and compiling a kernel. If this is not the case, see section 5 of the FreeBSD Handbook -- Configuring the FreeBSD Kernel. We'll also assume that you've applied any necessary patches to your kernel source tree. For FreeBSD 3.0 and later (i.e., FreeBSD-CURRENT), the awedrv sources are already provided, therefore no patching is necessary. If you're running an earlier (2.2.x) version of FreeBSD, see the instructions included in the awedrv package, available at: http://www.ipass.net/~dbhopper/aa8vb/awedrv/awedrv-0.4.2c-+freebsd.tgz

To take full advantage of your soundcard's capabilities (especially its wavetable synthesis for using Soundfonts for MIDI playback), you'll want to use the Voxware sound driver, not the newer pcm driver from Luigi Rizzo. Here are the necessary entries you'll want to include in your kernel configuration file:

controller pnp0
controller snd0
device sb0 at isa? port 0x220 irq 5 drq 1
device sbxvi0 at isa? drq 5
device sbmidi0 at isa? port 0x330
device opl0 at isa? port 0x388
device awe0 at isa? port 0x620

For FreeBSD versions < 3.0 (e.g., FreeBSD 2.2.x), you'll also need:

options USERCONFIG_BOOT

(*don't* use this under FreeBSD 3.x; this option no longer even exists!)

Configure, build and install the new kernel, but don't reboot just yet!

PART TWO -- Kernel PnP configuration

First of all, you'll want to run the pnpinfo program to determine the number (CSN) your card is assigned within your system's PnP setup. The examples below will assume a CSN of 1. Modify if necessary.

Now you'll want to create a file named "kernel.conf" in your /boot directory. For FreeBSD versions < 3.0, add the following lines to kernel.conf:

USERCONFIG
pnp 1 0 os enable irq0 5 drq0 1 drq1 5 port0 0x220 port1 0x330 port2 0x388
pnp 1 1 os disable
pnp 1 2 os enable port0 0x620 port1 0xa20 port2 0xe20
pnp 1 3 os disable
quit

For FreeBSD 3.x and CURRENT, remove the "USERCONFIG" line from the above. You'll also want to add the following lines to /boot/loader.conf *before* the "autoboot" command, if any (3.x and CURRENT only):

userconfig_script_load="YES"
userconfig_script_name="/boot/kernel.conf"
userconfig_script_type="userconfig_script"

The steps for 3.x/CURRENT above assume you're building an ELF kernel. If your kernel is aout, you'll have to type the pnp configuration commands in manually the first time you boot the new kernel, using the "-c" switch at the boot prompt.

Minor technical note: The above PnP configuration only enables and configures the devices we've listed in our kernel configuration file. Specifically, the game and IDE ports are disabled.

PART THREE -- Making the audio devices

Last but not least, you'll want to make sure that the device special files for your audio devices exist. This is easily accomplished by doing the following:

# cd /dev
# sh MAKEDEV snd0

Now you're ready to reboot!
# shutdown -r now

If all goes well, you should see something similar to the following in your boot-time messages:

sb0 at 0x220 irq 5 drq 1 on isa
snd0: <SoundBlaster 16 4.16>
sbxvi0 at drq 5 on isa
snd0: <SoundBlaster 16 4.16>
sbmidi0 at 0x330 on isa
snd0: <SoundBlaster MPU-401>
opl0 at 0x388 on isa
snd0: <Yamaha OPL3 FM>
awe0 at 0x620 on isa
awe0: <SoundBlaster EMU8000 MIDI (RAM24576k)>

The amount of RAM on the awe0 line will vary, of course, depending on how much memory you have installed on your card.

Last but not least, check the output of /dev/sndstat:

$ cat /dev/sndstat

VoxWare Sound Driver:3.5-alpha15-970902 (Wed Aug 6 22:58:35 PDT 1997 Amancio Hasty@rah.star-gate.com)
Config options:

Installed drivers:
Type 1: OPL-2/OPL-3 FM
Type 2: SoundBlaster
Type 6: SoundBlaster16
Type 25: AWE32 Synth
Type 7: SB16 MIDI

Card config:
SoundBlaster at 0x220 irq 5 drq 1
SoundBlaster16 at 0xffffffff irq 1 drq 5
SB16 MIDI at 0x330 irq 1
OPL-2/OPL-3 FM at 0x388 irq 1
AWE32 Synth at 0x620 irq 1

Audio devices:
0: SoundBlaster 16 4.16

Synth devices:
0: Yamaha OPL-3
1: AWE32-0.4.2c (RAM24576k)

Midi devices:
0: SoundBlaster 16

Midi Timers:
0: System clock

Mixers:
0: SoundBlaster
1: AWE32 Equalizer

Now you're ready to install the nifty AWE audio apps from Randall Hopper's web page at http://www.ipass.net/~dbhopper/aa8vb/awedrv/and start enjoying your soundcard under FreeBSD.

Conrad Sabatier

Email Us

ghostrdr@defcon1.org

This site cannot be duplicated without permission

© 1998 - 2010 Defcon1, www.defcon1.org. Copyrights for all materials on this web site are held by the individual authors, artists, photographers or creators. Materials may not be reproduced or otherwise distributed without permission of www.defcon1.org and the content's original author.