AWEDRV FREQUENTLY ASKED QUESTIONS

FAQ ver.1.18

----------------------------------------------------------------------------

1. INSTALLATION
     Q1.1: What is awedrv? What can I do with this?
     Q1.2: From where can I download AWE32 sound driver for Linux and
     FreeBSD?
     Q1.3*: What options should be set to configure sound module for AWE32?
     Q1.4*: I have an SB32-PnP card, and my linux crashes while booting.
     Why?
     Q1.5*: I installed ISA PnP tools, but still awedrv says "can't detect
     AWE32".
     Q1.6: Where can I find the sf1to2.exe mentioned in the installation
     document?
     Q1.7*: Can I load my GM file automatically on the sound driver module?
     Q1.8*: I can't install properly on my linux-2.0.0 from Slackware 96.
2. LOADING SAMPLES
     Q2.1: How can I play my midi files using awe driver? What configuration
     is necessary?
     Q2.2: I loaded the GM or GS presets distributed by CreativeLabs, but I
     can't hear some instruments. How are these used?
     Q2.3: I have a midi file with a specified SBK file. How can I listen to
     it?
     Q2.4: I have GUS patch files. Can I use these samples?
     Q2.5: I often see a "bad checksum" error when loading.
     Q2.6: I couldn't load my 2MB GM/GS preset from CreativeLabs.
     Q2.7: I couldn't load Chaos 2MB GM/GS preset.
     Q2.8: I have no DRAM in my card - can I still play midi files with it?
     Q2.9: How can I play midi files using the default ROM fonts that come
     with my card?
3. PLAYING MIDI FILES
     Q3.1: drvmidi plays strange sounds when I use an addtional SoundFont
     file.
     Q3.2: I changed chorus and reverb modes using drvmidi, but nothing
     changed. Why?
     Q3.3: Many clicking noises can be heard in some midi files.
     Q3.4: Sounds are too loud!
     Q3.5*: How can MIDI files be played from Netscape?
     Q3.6: Some sounds changed after updating sfxload.
     Q3.7: My trace window of drvmidi is empty. How can I use it?
     Q3.8: A strange piano sound is heard instead of drum sounds.
4. PROGRAMMING & MISCELLANEOUS
     Q4.1: I'm planning to write a music player for AWE32. How can I control
     the AWE32 driver from my program?
     Q4.2: I want a MOD player!

The questions with asterisk(*) indicate the Linux specific problems.

----------------------------------------------------------------------------

1. INSTALLATION

Q1.1: What is awedrv? What can I do with this?

Awedrv is the sound driver extension to OSS-Lite or USS-Lite (aka VoxWare)
for AWE32 and its compatible wave synthesizer card by CreativeLabs. This
driver provides a basic way to control Emu8000 chip on AWE32 board through
/dev/sequencer and /dev/sequencer2 devices as well as other synth drivers
like FM-OPL3 and GUS wave drivers. In this sense, this is not exactly a midi
driver, but you can play midi files using some midi players supporting the
awedrv listed below.

The current driver is distributed both as a lowlevel driver to OSS-Lite with
Linux 2.1.x kernel, USS-Lite with Linux 2.0.x kernel, and also as a patch to
VoxWare 3.0.x with Linux 1.2.x kernel or FreeBSD. Both environments are
confirmed to work fine. However a little attention is necessary to use this
driver on PnP cards. See Q1.4 and Q1.5 for installation on PnP cards.

The programs supporting awedrv are:

   * MIDI Sequencers
        o drvmidi MIDI player program (awemidi-0.x.x.tar)
        o playmidi with a patch file (playmidi-2.3+awe0.3.diff)
        o Jazz works without any patch (but not perfectly yet)
   * Games
        o DOOM musserver with a patch file (musserver+awe0.3.diff)
   * Module Players
        o xmp, officially supporting the AWE driver.
        o gmod module player with a small patch working as a GUS compatilble
          driver (see Q4.2).
   * Others
        o Netscape 3.0 MIDI Plug-in

----------------------------------------------------------------------------

Q1.2: From where can I download AWE32 sound driver for Linux and FreeBSD?

You can download from my web page:
         http://bahamut.mm.t.u-tokyo.ac.jp/~iwai/awedrv/index.html

Also the following mirroring sites are available:

   * UK - http://www.lpsg.demon.co.uk/awe32.html

----------------------------------------------------------------------------

Q1.3*: What options should be set to configure sound module for AWE32?

Basically, to configure awedrv, say Yes only to "lowlevel sound driver
support" and "AWE32 wave synth". (If you're using VoxWare, only the latter
question will appear.) On AWE32 board, all transfers are done through I/O
ports (not DMA), and awedrv probes these I/O ports automatically, so no need
to specify any address or IRQ at configuration.

Of course, you may want other functions of SoundBlaster like playing and
recording digital sound, FM synthesizer, and mixer support. Awedrv is only
an enhancement to control Emu8000 synthesizer, and such functions are
supported by other SB drivers. So better to keep Yes for all other SB16
options as well.

----------------------------------------------------------------------------

Q1.4*: I have an SB32-PnP card, and my linux crashes while booting. Why?

This is a problem in PnP initialization. Because the Linux 2.0 and older
kernels fail to initialize PnP cards, some special treatment is necessary
before loading sound driver. There're a couple of ways to solve this:

  1. use PnP ISA driver by Tom Lees.
  2. use PnP utilities like ISAPnPtool and PnP4Kernel.
  3. initialize PnP card on DOS and use loadlin to boot linux.

Tom Lees developed a Plug'n'Play ISA driver for Linux kernel. It includes
patches to automatically configure the sound driver (SB16, MPU401, OPL3,
AWE32), and your Plug'n'Play ISA card. This requires to recompile the
kernel. See Tom's web page for more details,
                 http://www.lpsg.demon.co.uk/pnp-linux.html

Neal Sanche (neal@nsdev.ocunix.on.ca) summarizes the procedure to install on
PnP card by ISAPnP tool that:

Setting up SoundBlaster 32 PnP under Linux

The SoundBlaster 32 PnP, like all plug and play devices, requires
initialization before the Linux device driver is loaded in order to function
properly. This means that some form of initialization is required to hear
sound. Currently many PnP projects (one at
http://www.redhat.com/linux-info/pnp) are being developed. I use a simple
tool called ISAPnP. It is available at:
              http://www.redhat.com/linux-info/pnp/other.html

The steps you need to do in order to get sound working:

  1. Compile your Linux kernel with module support, and compile the sound
     driver as a module. This is important because you must load the module
     after initializing your PnP card under Linux.
  2. Somewhere in your startup scripts (in rc.local, or rc.modules in a
     recent version of RedHat) you must initialize your sound card with some
     tool. ISAPnP is easy to configure and seems very reliable.
  3. Load the sound module. Set your mixer settings.

For example, this is how I initialize the SB32 PnP in my startup scripts:

#!/bin/sh

# initialize PnP devices
if [ -x /sbin/isapnp ]; then
  echo "Configuring PnP devices"
  /sbin/isapnp /etc/isapnp.conf
fi

echo "Loading sound module"
/sbin/modprobe -a sound

ISAPnP is quite an easy program to configure. Here is a copy of my
isapnp.conf file. I used all of the defaults (from the SB manual) for ports
and IRQ settings.

(READPORT 0x0273)
(ISOLATE)
(IDENTIFY *)

# Card 1: (serial identifier 6d 00 0e b0 52 44 00 8c 0e)
# CTL0044 Serial No 962642 [checksum 6d]
# Version 1.0, Vendor version 1.0
# ANSI string -->Creative SB32 PnP<--
#
# Logical device id CTL0031
#
# Edit the entries below to uncomment out the configuration required.
# Note that only the first value of any range is given, this may be changed if required
# Don't forget to uncomment the activate (ACT Y) when happy

(CONFIGURE CTL0044/962642 (LD 0
# ANSI string -->Audio<--
  (INT 0 (IRQ 5 (MODE +E)))
  (DMA 0 (CHANNEL 1))
  (DMA 1 (CHANNEL 5))
  (IO 0 (BASE 0x0220))
  (IO 1 (BASE 0x0330))
  (IO 2 (BASE 0x0388))

  (ACT Y)
))

# Logical device id CTL0021
#
# Edit the entries below to uncomment out the configuration required.
# Note that only the first value of any range is given, this may be changed if required
# Don't forget to uncomment the activate (ACT Y) when happy

(CONFIGURE CTL0044/962642 (LD 2
# ANSI string -->WaveTable<--
  (IO 0 (BASE 0x0620))
  (IO 1 (BASE 0x0a20))
  (IO 2 (BASE 0x0e20))
  (ACT Y)
))

# Logical device id CTL7001
#
# Edit the entries below to uncomment out the configuration required.
# Note that only the first value of any range is given, this may be changed if required
# Don't forget to uncomment the activate (ACT Y) when happy

(CONFIGURE CTL0044/962642 (LD 3
#     Compatible device id PNPb02f
#     ANSI string -->Game<--
#     Logical device decodes 16 bit IO address lines
#         Minimum IO base address 0x0200
#         Maximum IO base address 0x0200
#         IO base alignment 1 bytes
#         Number of IO addresses required: 8
# (IO 0 (BASE 0x0200))
# (ACT Y)
))

# Logical device id CTL0051
#
# Edit the entries below to uncomment out the configuration required.
# Note that only the first value of any range is given, this may be changed if required
# Don't forget to uncomment the activate (ACT Y) when happy

(CONFIGURE CTL0044/962642 (LD 4
#     ANSI string -->StereoEnhance<--
#     Logical device decodes 16 bit IO address lines
#         Minimum IO base address 0x0100
#         Maximum IO base address 0x03f8
#         IO base alignment 8 bytes
#         Number of IO addresses required: 1
  (IO 0 (BASE 0x0108))
(ACT Y)))

That's all there is to it. In the future, the Linux kernel source will
directory support Plug and Play, and there will be no need for the isapnp
tool.

----------------------------------------------------------------------------

Q1.5*: I installed ISA PnP tools, but still awedrv says "can't detect
AWE32".

Check WaveTable entries in you /etc/isapnp.conf file. AWE32 uses three I/O
ports, 0x620, 0xa20, and 0xe20, but in the default ouput from pnpdump is
sometimes lack of the last two pots (0xa20 and 0xe20). In such a case, you
have to add them manually. For example,

# Logical device id CTL0021
(CONFIGURE CTL0044/962642 (LD 2
# ANSI string -->WaveTable<--
  (IO 0 (BASE 0x0620))
  (IO 1 (BASE 0x0A20))
  (IO 2 (BASE 0x0E20))
  (ACT Y)
))

Also, don't forget set (ACT Y), too.

----------------------------------------------------------------------------

Q1.6: Where can I find the sf1to2.exe mentioned in the installation
document?

sf1to2.exe can be found in the latest creative drivers. You can also find on
some web pages, for example,
              http://www.telebyte.nl/sound/programs/sf1to2.exe

The recent awesfx utilities (from 0.1.5d) support both SBK and SF2 files.
Conversion is not necessary for normal use.

----------------------------------------------------------------------------

Q1.7*: Can I load my GM file automatically on the sound driver module?

Yes. You can specify the command to be executed after loading modules in
your /etc/conf.modules file with post-install command. For example,

post-install sound      /usr/local/bin/sfxload -i synthgm.sf2

Similary, it's possible to set the mixer volume automatically,

post-install sound      /usr/local/bin/setmix -f /etc/mixrc;\
                        /usr/local/bin/sfxload -i synthgm.sf2

----------------------------------------------------------------------------

Q1.8*: I can't install properly on my linux-2.0.0 from Slackware 96.

Slackware 96 initially installs Linux-2.0.0 system. The AWE driver doesn't
support this version of sound driver. So please update the kernel version to
the newer one, at least 2.0.21. Sorry for incovenience...

----------------------------------------------------------------------------

2. LOADING SAMPLES

Q2.1: How can I play my midi files using awe driver? What configuration is
necessary?

To play a sound using awedrv, you need awesfx utility to load samples on the
driver, and midi player programs which supports awedrv. Basically, awedrv
doesn't have any sound information in it at beginning. So, users must load
their own SoundFont files using sfxload program in awesfx utils even for ROM
sounds (see Q2.9). Awesfx utility can be downloaded also from my web page:
         http://bahamut.mm.t.u-tokyo.ac.jp/~iwai/awedrv/index.html

To load the SoundFont file (or the converted SFX file) on the AWE driver,
use sfxload utility. For example, to load your GM SoundFont file
synthgm.sf2,

        % sfxload -i synthgm.sf2

The option '-i' means to remove all samples on the driver before loading
this sample. Without this option, the samples are appended. Also, you'd
better to add '-s' option to reduce sample loading time. This option skips
the sample verification with check sum.

Now you can hear your midi file by midi players like drvmidi distributed in
awemidi package.

        % drvmidi sample.mid

See Q2.3 to how to use specified SBK files with midi files.

----------------------------------------------------------------------------

Q2.2: I loaded the GM or GS presets distributed by CreativeLabs, but I can't
hear some instruments. How are these used?

If you're using drvmidi or playmidi player, you can load your SoundFont
files directly using sfxload utility. The recent driver (from v0.3) supports
the multiple instruments including stereo sounds, and the problems below are
solved.

The default GM and GS presets (synthgm.sf2 and synthgs.sf2) hold multiple
instrument definitions. The older driver (v0.1/0.2) could only handle one
instrument per one preset. A patch kit (awepreset-0.2.0) is provided for
this problem. See the instruction in the package for details.

----------------------------------------------------------------------------

Q2.3: I have a midi file with a specified SBK file. How can I listen to it?

Just load the SBK file after GM (or GS) presets. From awesfx-0.1.5d, SBK
file can be loaded without converting to SF2. Don't forget to add a command
option "-b 1" in this case (see Q3.1).

        % sfxload -i synthgm.sf2
        % sfxload -b 1 -s foo.sbk

Now you can hear your midi file. Enjoy.

        % drvmidi foo.mid

----------------------------------------------------------------------------

Q2.4: I have GUS patch files. Can I use these samples?

Yes. You can convert it to SFX file using gus2sfx utility. For example, to
convert gunshot.pat with bank 0, program 127,

        % gus2sfx gunshot.pat gunshot.sfx 0 127

Then you can load this sample by sfxload.

        % sfxload gunshot.sfx

This appends a sample in gunshot.sfx, so other voices except preset 127 are
not changed.

The awedrv 0.2.0 (or later) accepts GUS compatible patches, so you can load
GUS patch files directly gusload utility. For example,

        % gusload -p 127 gunshot.pat

----------------------------------------------------------------------------

Q2.5: I often see a "bad checksum" error when loading.

Occasionally awedrv fails to transfer sample data to DRAM on AWE32. This
shorten the length of actual sample data, and raise up address mismatch. So
impure data may be included during its loop. When you see this message
frequently, initialize AWE32 once by option -I of sfxload, and reload
samples again.

        % sfxload -I synthgs.sf2

Note that the option '-I' doesn't remove samples. It only re-initializes
Emu8000 chip.

----------------------------------------------------------------------------

Q2.6: I couldn't load my 2MB GM/GS preset from CreativeLabs.

If you're using sfxload ver.0.2 or older, please update it to the latest
(ver.0.3 or later) one. There was a bug about zero layered preset in the
older versions.

If you have an error message saying "no space left" from sfxload, increase
the maximum number of samples and voice informations. The AWE driver has two
fixed size tables for sound sample and voice informations, respectively. The
default table size is designed to fit to 512k GS samples, so it'll be short
for 2MB or larger presets. Usually, 600 samples and 3200 voices are enough
for most of presets.

You can see these table sizes from txt2sfx or sfxload using -v option. The
messages are output to standard error.

version = 2.0
sampledata = 160 1843630
presets = 327
instruments = 262
samples = 387
voices=922
max voices=2903
...

Then, edit your awe_config.h as

/*----------------------------------------------------------------
 * maximum size of sample table:
 * the followings are for ROM GM and 512k GS samples.  if your have
 * additional DRAM and SoundFonts, increase these values.
 *----------------------------------------------------------------*/

#define AWE_MAX_SAMPLES 600
#define AWE_MAX_INFOS 3200

and recompile the kernel or modules in your system.

----------------------------------------------------------------------------

Q2.7: I couldn't load Chaos 2MB GM/GS preset.

It's the problem of sfxload utility. Please update it to the newest one
(ver.0.2.99c or later).

Chaos 2M SoundFont file is designed to fit just to 2MB DRAM. The older
sfxload than v0.2.99c appends the 48 size blank loops after each sample, and
this increases the total size over 2MB. The recent sfxload (v0.2.99c) keeps
the total sample size as original unless -B option is specified.

----------------------------------------------------------------------------

Q2.8: I have no DRAM in my card - can I still play midi files with it?

Chris Wedgwood <chris@cyphercom.com> answers:

Yes. You can use the default ROM fonts that are built into the card.
However, it won't necessarily sound very good.

----------------------------------------------------------------------------

Q2.9: How can I play midi files using the default ROM fonts that come with
my card?

Chris Wedgwood <chris@cyphercom.com> answers:

You have to load the ROM fonts into the card using sfxload. To do this you
need a file called 'synthgm.sbk' (or synthgm.sf2) which is installed under
Windows95 and presumably Windows 3.1.

There always seems to be a copy in the 'windows system' directory, and often
another copy amongst the other installed Creative Labs files. The windows
system directory is usually \WINDOWS\SYSTEM.

For the 'purists' who don't have Windows installed - you will probably have
to try and get this file from elsewhere, as it is not stored on the CDROM in
any useful form. (At least not on mine). It appears to be archive in the
win95/sfbank/sfbank.lib file - but I have no details on the format of this).

To load the ROM fonts type:

        % sfxload synthgm.sbk

(Obviously you will have to prepend a path if synthgm.sbk is not in the
current working directory).

The size of the file is about 35k, it compresses down to about 14k, so
obtaining it via FTP or email shouldn't be a big problem - although there
maybe copyright issues involved. I wouldn't know, I'm not a lawyer.

----------------------------------------------------------------------------

3. PLAYING MIDI FILES

Q3.1: drvmidi plays strange sounds when I use an addtional SoundFont file.

Most of user-defined SoundFont files are designed to be loaded on bank 1.
Try the option -b 1 of sfxload for such a sample (see Q2.3).

----------------------------------------------------------------------------

Q3.2: I changed chorus and reverb modes using drvmidi, but nothing changed.
Why?

To activate chorus and reverb modes, you have to specify non-zero values for
these effects at loading samples by using -c and -r options of sfxload,
respectively.

        % sfxload -i -c 30 -r 20 gm.sfx

----------------------------------------------------------------------------

Q3.3: Many clicking noises can be heard in some midi files.

If this happens when panning status changes, it is due to the restriction of
Emu8000 chip. Otherwise, it may be a bug.

----------------------------------------------------------------------------

Q3.4: Sounds are too loud!

I think so, too... The total volume of the samples can be changed by using
-V option at loading.

        % sfxload -i -V 40 gm.sfx

The value is in percent with a default of 70%.

If you're using linux, the mixer volumes can be set at loading the module
automatically (see Q1.7).

----------------------------------------------------------------------------

Q3.5*: How can MIDI files be played from Netscape?

If you're using..

Netscape 3.0
     The plug-in for Netscape 3.0 is now available. You only install MIDI
     plug-in package, and check the helper list in Options menu. See the
     document in this package for more details.

     Note: if you already add mime types as below, you should edit these
     configuration files manually. Netscape only appends its list.

Other browsers
     Add a new mime type for MIDI files by adding the following to your
     ~/.mime.types file:

     audio/x-midi    exts=mid,midi

     Then specify the application for this type by adding to ~/.mailcap:

     audio/x-midi; drvmidi %s

     Of course, you can choose your favorite MIDI players instead of this.

----------------------------------------------------------------------------

Q3.6: Some sounds changed after updating sfxload.

In the older versions, sfxload uses only the first instrument found in the
same preset. From ver.0.3(beta), the AWE driver can handle multiple
instruments, and along with this improvement, sfxload transfers all the
instrument layers to the driver as default. This results in that different
instruments may be choosed in some presets from the older driver. Such a
difference can be suppressed by changing the search mode as the older way
using -m0 option when loading or converting the SoundFont file.

----------------------------------------------------------------------------

Q3.7: My trace window of drvmidi is empty. How can I use it?

Use -t option. As default, the tracing mode is turned off.

----------------------------------------------------------------------------

Q3.8: A strange piano sound is heard instead of drum sounds.

Some MIDI files use the channel 16 as a drum channel. while only the channel
10 is accepted as a drum in drvmidi as default. In such a case, use -D 16
option. This specifies the channel 16 as a drum channel. The positive
argument means to turn on the drum channel, but the negative argument means
to turn off. So, you can reserve the channel 10 as a normal channel using -D
-10 option.

----------------------------------------------------------------------------

4. PROGRAMMING & MISCELLANEOUS

Q4.1: I'm planning to write a music player for AWE32. How can I control the
AWE32 driver from my program?

See the AWEDRV programming notes for control of awedrv device.

----------------------------------------------------------------------------

Q4.2: I want a MOD player!

Me, too :-)
Awedrv ver.0.2 accepts the GUS compatible patches and hardware controls, so
you can play module players using GUS driver like gmod by a slight
modification. For example, to use gmod for awedrv, just change the line 62
of Sequencer.c for detection of synthesizer card to accept subtype 0x20 like

if (info.synth_type == SYNTH_TYPE_SAMPLE
    && (info.synth_subtype == SAMPLE_TYPE_GUS||info.synth_subtype==0x20))
    gus_dev = i;

(0x20 means SAMPLE_TYPE_AWE32 defined in awe_voice.h.)
That's all. Enjoy listening!

----------------------------------------------------------------------------
Takashi Iwai
iwai@dragon.mm.t.u-tokyo.ac.jp
http://bahamut.mm.t.u-tokyo.ac.jp/~iwai
