From owner-freebsd-stable Sat Apr 8 13:48:14 2000 Delivered-To: freebsd-stable@freebsd.org Received: from mail-1.sjc.telocity.net (mail-1.sjc.telocity.net [216.227.56.41]) by hub.freebsd.org (Postfix) with ESMTP id F071437B5D7; Sat, 8 Apr 2000 13:48:01 -0700 (PDT) (envelope-from otter@otter.cc) Received: from otter.cc (dsl-216-227-91-85.telocity.com [216.227.91.85]) by mail-1.sjc.telocity.net (8.9.3/8.9.3) with ESMTP id NAA24906; Sat, 8 Apr 2000 13:46:18 -0700 (PDT) Message-ID: <38EEF255.FDFD4A6F@otter.cc> Date: Sat, 08 Apr 2000 04:48:21 -0400 From: Otter X-Mailer: Mozilla 4.7 [en] (X11; I; FreeBSD 5.0-CURRENT i386) X-Accept-Language: en MIME-Version: 1.0 To: frank@exit.com Cc: Brandon Fosdick , Walter Brameld , freebsd-questions@FreeBSD.ORG, freebsd-stable@FreeBSD.ORG, diskiller@borg-cube.com, ghostrdr@defcon1.org, torqued@pobox.com Subject: Re: SBLive! on FreeBSD 4.0 & 5.0 HOWTOs References: <200004080030.RAA06933@realtime.exit.com> Content-Type: multipart/mixed; boundary="------------2FEFDB8BF862C3E547A49F5D" Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG This is a multi-part message in MIME format. --------------2FEFDB8BF862C3E547A49F5D Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Ok gang... here's the delivery as I promised. I've split up the info for both 4.0 and 5.0 versions. I've tested both of these, and source references are in the text. I hope this helps owners of the SB Live! cards. I'm sending these to the webmasters of http://www.defcon1.org and http://defcon1.erudition.net for posting in case anyone needs them at a later date. Regards, -Otter --------------2FEFDB8BF862C3E547A49F5D Content-Type: text/html; charset=us-ascii; name="sblive-4.x-HOWTO.html" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="sblive-4.x-HOWTO.html"
Support for Your SBLive! Sound Card on FreeBSD 4.0

 First, I'd like to thank Luigi Rizzo and Cameron Grant for cranking out a
working pcm sound driver that supports the SB LIVE!, as well as Seigo
Tanimura for documenting their work in the pcm man page. Thanks guys!
 Second, thanks to Martin Miskin, Walter Brameld, and Frank for spanking
me on the mailing lists. My first HOWTO for the SB Live should not have had any
parts assumed. I was running 5.0-current and assumed that the pcm driver
would be about the same since the 5.0 branch from 4.0 was so recent. This
HOWTO is strictly for FreeBSD 4.0-RELEASE (if you run -stable, YMMV) and
most of it was documented by Walter. I've installed 4.0-R just to
test the sound card to verify it works here too. Walter, thanks for the
input!

Now, on to the good stuff...

1) Make sure you have source files on your hard drive. Then:

cd /usr/src/sys/dev/sound/pci

Now add a few files to our present working directory that we just changed
to. Fetch the two files, emu10k1.c and emu10k1.h from:

ftp://ftp.freebsd.org/pub/FreeBSD/FreeBSD-current/src/sys/dev/sound/pci/

2) Edit emu10k1.c. Look for the following line (somewhere around line 1163):

codec = ac97_create(dev, sc, NULL, emu_rdcd, emu_wrcd);

Remove the NULL entry. It should now say:

codec = ac97_create(dev, sc, emu_rdcd, emu_wrcd);

3) Place these files in /usr/src/sys/dev/sound/pci. You may also wish
to keep a backup so your first CVSUP doesn't flush them down the
toilet.

4) Edit /usr/src/sys/conf/files and insert the following line in the
appropriate place (alphabetically, around line 980):

dev/sound/pci/emu10k1.c optional pcm pci

5) Edit your kernel config file and make sure it has the following two
devices:

device pcm
device pci

6) Recompile your kernel and reboot. dmesg should show the following:

pcm0: <Creative EMU10K1> port 0xe400-0xe41f irq 10 at device 9.0 on pci0
pci0: <unknown card> (vendor=0x1102, dev=0x7002) at 9.1

Cat /dev/sndstat should show:

FreeBSD Audio Driver (newpcm) Apr 7 2000 13:12:21
Installed devices:
pcm0: <Creative EMU10K1> at io 0xe400 irq 10 (1p/0r channels duplex)

or something similar, io and irq may vary.

7) Finally, make the sound device in your /dev directory:

/dev/MAKEDEV snd0

8) Reboot.

9) Start your favorite audio application. It's time to rock and roll.

Some people have reported "DAC not ready" errors and/or problems with the
AC_97 references. This HOWTO was tested on a clean ftp install of 4.0-R on
todays date, April 8, 2000. Good Luck with your system(s)!

-Christopher D. Holden
christopher.holden@sbt.siemens.com
 
  --------------2FEFDB8BF862C3E547A49F5D Content-Type: text/html; charset=us-ascii; name="sblive-5.x-HOWTO.html" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="sblive-5.x-HOWTO.html" Title

Support for your SB Live! Sound Card in FreeBSD 5.0 (April 7,2000)

This work is documented and tested from source code which was updated (via cvsup) on April 6, 2000. You can start the process by adding support in your kernel for devices pcm. Detailed info on building custom kernels can be found at

http://www.freebsd.org/handbook/kernelconfig.html

So you can see what little I added to my kernel, here is my sound support:

                device pcm
                device pci

The last line is a generic driver required so that the programs we use will work with PCI configuration registers. The SB Live! cards are PCI. Make sure you have this device option in the kernel. No, I'm no wiz on this topic. I just pulled that from the first line of "man pci" to state its purpose. Now that we've got support in the kernel, we can complete rebuilding the kernel as needed. Let's move on to making our audio device.

                cd /dev

This is where I'm a little questionable to the exact step of "what to do". I had older legacy devices working in here before i got to this point. If I remember correctly, i think I did:

            ./MAKEDEV snd0

to get my audio device made. In my /dev directory, I do have the following which should help you in what to look for:

            kashmir# ls -la /dev/audio*
            lrwxrwxrwx 1 root wheel 6 Feb 21 11:05 /dev/audio -> audio0
            crw-rw-rw- 1 root wheel 30, 4 Feb 21 11:05 /dev/audio0

            kashmir# ls -la /dev/dsp*
            lrwxrwxrwx 1 root wheel 4 Feb 21 11:05 /dev/dsp -> dsp0
            crw-rw-rw- 1 root wheel 30, 3 Apr 6 11:52 /dev/dsp0
            lrwxrwxrwx 1 root wheel 5 Feb 21 11:05 /dev/dspW -> dspW0
            crw-rw-rw- 1 root wheel 30, 5 Feb 21 11:05 /dev/dsp

            kashmir# cat sndstat
            FreeBSD Audio Driver (newpcm) Apr 6 2000 10:54:54
            Installed devices:
            pcm0: <Creative EMU10K1> at io 0xdc00 irq 11 (1p/0r channels duplex)

Now we need to check a file in the sound driver. Make sure that the SB Live! chipset is available to the pcm driver. Look in the file:

            /usr/src/sys/conf/files

by making sure that the line

            dev/sound/pci/emu10k1.c optional pcm pci

is NOT commented out in the file. OK. Save the file to the same name that you opened it as. And reboot!

Upon rebooting, watch your dmesg output. You should see something similar to:

            pcm0: <Creative EMU10K1> port 0xdc00-0xdc1f irq 11 at device 12.0 on pci0
            pci0: <unknown card> (vendor=0x1102, dev=0x7002) at 12.1

If it went too fast, you can always do a

            /sbin/dmesg | grep pc or /sbin/dmesg | grep pcm

The latter will narrow down your report if you have other PCI devices.

Now put it to the test. Fire up your favorite audio application and crank up the music loud enough to upset the neighbors.

-Christopher D. Holden
christopher.holden@sbt.siemens.com --------------2FEFDB8BF862C3E547A49F5D-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message