*BSD News Article 91805


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!news.cs.su.oz.au!metro!metro!munnari.OZ.AU!ihnp4.ucsd.edu!agate!scam!grady
From: grady@scam.XCF.Berkeley.EDU (Steven Grady)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: Sound card woes
Date: 19 Mar 97 22:35:45 GMT
Organization: Experimental Computing Facility, UC Berkeley
Lines: 101
Message-ID: <grady.858810945@scam>
References: <332FECE3.41C67EA6@portal.ca>
Reply-To: grady@xcf.berkeley.edu
NNTP-Posting-Host: scam.xcf.berkeley.edu
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.freebsd.misc:37528

Christoff Snijders <hjcs@portal.ca> writes:

>I am running FreeBSD 2.1.0-RELEASE and am having problems installing my
>sound card.  It's a Soundblaster AWE32PnP (damn the evil thing!), and I
>discovered that it will emulate the Roland MPU-401 or the SoundBlaster
>16.

It's most likely the PnP that's causing the problems.  I recently
went through the process of getting an AWE32PnP to work (it took an
entire day!).  Note that these instructions may not work for a 2.1.0
system -- I'm running 2.1.5.

===

You need to do the following things:

First, grab Sujel Patel's pnp stuff (at http://www.freebsd.org/~smpatel).
Extract it, and compile and run pnpinfo (as root), saving the result in a file.
If you look at the output, you'll find it tells you a few things.
Firstly, there is information about your PnP cards.  In my system,
I only have the SB card, so that's the only one that showed up.
Next, it shows information about different _logical devices_ for
the card.  For simplicity's sake, I decided to only worry about
the "Audio" logical device (the one that says "Audio" as the
Device Description).  The others on my card are "IDE", "WaveTable",
and "Game".  Sometime I'll learn how to set those up as well.

For each logical device, it lists the _supported_ configurations for
the card -- you're going to need to choose _one_ of them (I chose the
"Good Configuration", which is presumably the one the card _wants_
to have.  I assume you can choose a different, "Acceptable Configuration"
of the good one conflicts with something else on your system.

Now, based on the information from pnpinfo, you'll need to create an
entry in isa/pnp.c.  Read Sujal's README file, which tells how to patch
the kernel, and describes the pnp.c modifications.  A shortcut is to
look at the sample/sb16.pnp file in the pnpinfo directory. In my case,
only two entries differed:  the serial number, and the Primary IRQ
number.  The existing value for the IRQ is 10, I changed mine to 5
because that is what the "Good Configuration" had.  Also, note that the
"DRQ" entries in pnp.c correspond to the possible "DMA" values (the
sound blaster uses 2, one for 8-bit and one for 16-bit).  If you have
more trouble, look at the pnpinfo README file.

Once you've made those changes, you'll need to update the kernel
configuration.  You need to do two things; first, put "controller pnp0"
in place.  Second, update all sb values as appropriate.  My entries
are:
    controller      snd0
    device sb0      at isa? port 0x220 irq 5 drq 1 vector sbintr
    device sbxvi0   at isa? drq 5
    device sbmidi0  at isa? port 0x330
    device opl0     at isa? port 0x388

Next, as LINT says, make sure the corresponding values in
i386/isa/sound/sound_config.h are correct.  

OK, recompile and install, then reboot.  At this point, you
should make sure that your BIOS is configured correctly -- I
got hung up because during my experimentation, I had changed
the BIOS to treat certain IRQ and DMA lines as ISA, not PnP.

So, in summary, _four_ things need to be in sync: the pnp.c
struct, the kernel configuration file, sound_config.h, and
the BIOS settings.

Oh, also make sure that you have the devices in /dev:
    # cd /dev
    # ./MAKEDEV snd

Some things to check: the devices should be recognized on boot-up.
My dmesg output includes:
    sb0 at 0x220 irq 5 drq 1 on isa
    sb0: <SoundBlaster 16 4.13>
    sbxvi0 at 0x0 drq 5 on isa
    sbxvo0: <SoundBlaster 16 4.13>
    sbmidi0 at 0x330 on isa
     <SoundBlaster MPU-401>
    opl0 at 0x388 on isa
    opl0: <Yamaha OPL-3 FM>

If anything is not found, it may indicate an error.  Also, the pnp
driver should work.  My dmesg output:
    Checking for Plug-n-Play devices...
    Board Vendor ID: CTL0039     Board Serial Number: 0001d455
	    Configuring (Logical Device 0)

The end result should be that you can cat a .au file to /dev/audio,
and it will play, and then exit (no hangs).  Good luck.

===

	Steven
	grady@xcf.berkeley.edu
School's out!
School's out!
Teacher let the monkeys out!
One was jailed!
One prevailed!
Both asked God: "How have I failed?"
	--traditional grad school chant