	Installing and using Creative AWE midi sound under Linux.

This documentation is devoted to the Creative Sound Blaster AWE32, AWE64 and 
SB32.

1) Make sure you have an ORIGINAL Creative SB32, AWE32 or AWE64 card. This is 
important, because the driver works only with real Creative cards.

2) If your card is NOT "Plug-n-Play" (I myself don't know Creative AWE non 
plug'n'play cards however) then go to 5th step now. In the other case
proceed to step 3.

3) You should obtain isapnptools. I looked through other PnP packages 
for Linux, but all they are either in deep unstable beta/alpha releases or 
they are much worse than isapnptools. In my case isapnptools were included in 
a Linux distribution (Red Hat 5.0). If you also already have them then go to 
step 4.

The latest copy of isapnptools-1.15 is available from 
ftp://ftp.demon.co.uk/pub/unix/linux/utils/ (I tested isapnptools-1.15.tgz)
You should gunzip/untar it to something like /usr/local/ 
(cp isapnptools-1.15.tgz /usr/local/; cd /usr/local/;
tar -xzf isapnptools-1.15.tgz). 

Compile the package (make) and install it (make install).
If something goes wrong check the INSTALL file in isapnptools-1.15 directory.

4) Now do a "pnpdump > /etc/isapnp.conf". File /etc/isapnp.conf will contain 
info about PnP devices you may have. If you want you can read the manual page
about isapnp.conf file (man isapnp.conf). Most lines of your isapnp.conf file are 
commented. You should uncomment lines which don't conflict with your 
configuration.

ATTENTION! Device Audio should have 1 IRQ, 2 DMA and 3 base I/O resources.
If you don't have such a configuration you should manually add the resources to
the isapnp.conf file. After editing I got these lines in the Audio device
section (I ripped out all the comments):

"(CONFIGURE CTL0044/1132685 (LD 0 (INT 0 (IRQ 5 (MODE +E))) (DMA 0 (CHANNEL 1))
 (DMA 1 (CHANNEL 5)) (IO 0 (BASE 0x220)) (IO 1 (BASE 0x330)) (IO 2 (BASE 0x388))
 (ACT Y)))"

(In your case CTL044/1132685 numbers may be other)

Don't forget to uncomment (ACT Y)!

The next device is the on-board IDE controller. You may enable it if you wish,
but it will not effect sound.

Then WaveTable goes. For some reason Plug-n-Play detects only one I/O port,
but the wavetable needs THREE! My working string is:

"(CONFIGURE CTL044/1132685 (LD 2 (IO 0 (BASE 0x0620)) (IO 1 (BASE 0x0A20)) 
(IO 3 (BASE 0x0E20)) (ACT Y) ))"

Resources 0x0620, 0x0A20 and 0x0E20 should work. Other on-board devices: 
Gameport and StereoEnhance are not required to be inited.

Now you can execute "isapnp /etc/isapnp.conf". No errors should be reported.
If you correctly installed isapnptools, then isapnp will run every boot time.

5) Now you should recompile the kernel. I recommend using development kernels,
because the AWE32 driver is included in them.  ATTENTION!  In kernels 2.1.102, 
2.1.103, 2.1.104-pre1 and 2.1.104 (not the others) the lowlevel sound driver
is not working. You should use the patch available at 
http://members.xoom.com/yar/history.html. If you are using stable kernel
releases 2.0.x, then get the latest version (3.8s9) of 
OSS/Free at http://members.xoom.com/yar/ossfree38s9-linux20x.tar.gz
and gunzip/untar it in /usr/src/ (assuming you keep your kernel source in
/usr/src/linux).  Then go to /usr/src/linux/ and view the README file. That
file contains info about kernel compilation and installation.

In "make (x,menu)config" select in "Sound":
"Sound card support", "100% Sound Blaster compatibles (SB16/32/64, ESS, Jazz16) support",
"Generic OPL2/OPL3 FM synthesizer support" and "FM synthesizer (YM3812/OPL-3) 
support" as <M> (module).

If you use kernel version 2.0.x or version 2.1.y (y <= 2.1.104) skip substep a,
on 2.1.105 or later go through it.

substep a:
In "make (x,menu)config" select in "Sound":
select "OSS sound modules" as <M> (module)

In "Additional low level sound drivers":
"Additional low level sound drivers", "AWE32 synth" as <M> (module).
Select "Additional low level sound drivers" as [y] (or [*] (yes)) (If it is not
available as [y], select it as <M> (module))
Now recompile the kernel (make dep; make (b)zImage; make modules; 
make modules_install), update your boot loader and boot new kernel.

6) Now download awesfx program 
http://members.xoom.com/yar/awesfx-0.4.2.tgz here. Compile it.
Copy sfxload program to /bin (or /sbin if you wish). To enable AWE midi 
synthesis you should also get the sound bank file for general midi from
http://members.xoom.com/yar/synthgm.sbk.gz. Copy it to
/usr and gunzip it there.

7) Edit /etc/rc.d/rc.local, inserting at the end of the file:

modprobe sound
insmod uart401
insmod sb io=0x220 irq=5 dma=1 dma16=5 mpu_io=0x330
insmod awe_wave
sfxload /usr/synthfm.sbk

(on io=0xaaa irq=b.... you should use your own settings)
That will enable the Sound Blaster and AWE wave synthesis.

To play midi files you should get one of these programs:

Playmidi 2.4 or higher: http://playmidi.openprojects.net
Drvmidi 4.2.b: http://members.xoom.com/yar/awemidi-0.4.2b.tgz

(These are available at all major Linux FTP sites and may already be
 in your distribution)

If something goes wrong please e-mail me. All comments and suggestions are
welcome.

			    Yaroslav Rosomakho (alons55@dialup.ptt.ru)
				    http://members.xoom.com/yar
