FAQ ver.1.24
Takashi Iwai ( iwai@ww.uni-erlangen.de)
Original site: http://bahamut.mm.t.u-tokyo.ac.jp/~iwai/awedrv/awedrv-faq.html
Awedrv is the sound driver extension to OSS/Free (aka USS-Lite or VoxWare)
for AWE32 and its compatible wave synthesizer cards (SB32 and AWE64 series) 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.
Also from driver v0.3, awedrv behaves as a GUS compatible driver, too.
(The module players use this feature.)
You can play midi and module files using some sequencer programs
listed below.
The current driver is distributed both as a lowlevel driver to OSS/Free with Linux 2.1.x, 2.0.x kernels, and as a patch to OSS/Free-3.0.x (aka VoxWare) with Linux 1.2.x kernels and FreeBSD. Both environments are confirmed to work fine. However a little attention is necessary to use this driver on PnP cards. See Q2.3, Q2.4 and Q2.8 for installation on PnP cards.
The programs supporting awedrv are:
musserver+awe0.4.diff
)
You can download from my web page:
Also the following mirroring sites are available:
Yes. It works as a AWE32 compatible driver, but the software synthesizer is not supported. So only 32 voices (30 voices when DRAM is on board) are available.
To play a sound using awedrv, you need awesfx utility to load samples on the driver, and midi player programs which support awedrv. Basically, awedrv doesn't have any sound information in it at beginning. So, users must prepare their own SoundFont files using sfxload program (included in awesfx utils). This procedure is necessary even for ROM sounds (see Q3.3). Awesfx utility can be downloaded also from the web site above (Q1.2).
To load the SoundFont file onto the AWE driver,
use sfxload utility.
For example, to load your GM SoundFont file synthgm.sbk
,
% sfxload synthgmNote: when you're using the older version of driver and utilities than ver.0.4, the additional option '
-i
' is required.
This option means to remove all samples on the driver
before loading this sample.
Now you can hear your midi files by a midi player like drvmidi (distributed in awemidi package).
% drvmidi sample.midSee Q3.4 to how to use specified SBK or SF2 files with a midi file.
The new drvmidi (v0.4.0) has a function of "dynamic loaindg" of samples on demand. This enables to play most of MIDI files with 2MB GM/GS soundfonts on only 512kB DRAM soundcards.
% drvmidi -L 2mbgmgs sample.midSee Q3.12 and Q3.13 for details.
So far, some module players are available (see Q1.1). Both xmp and gmod support awedrv as default. See the installation instruction for more details.
Note: both programs watches read selection of the sequencer device. To support this, you need to activate MIDI input interface on SB16 driver when configuring the sound module.
See INSTALL.awe
file in awedrv source package for details.
Basically, you only need to run install.sh
script
on the awedrv source directory as root user.
% su # sh ./install.shThen, reconfigure the kernel options. See Q2.2 about which options to be set.
# cd /usr/src/linux # make xconfig or # make menuconfigNow, remake and install the kernel and modules.
# make # make modules; make modules_install
Basically, to configure awedrv, say Yes only to "lowlevel sound driver support" and "AWE32 wave synth". (If you're using OSS/Free-3.0.x (aka 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.
In my case, the sound part of .config
file looks like:
# # Sound # CONFIG_SOUND=m # CONFIG_PAS is not set CONFIG_SB=y CONFIG_ADLIB=y # CONFIG_GUS is not set # CONFIG_MPU401 is not set # CONFIG_UART6850 is not set # CONFIG_PSS is not set # CONFIG_GUS16 is not set # CONFIG_GUSMAX is not set # CONFIG_MSS is not set # CONFIG_SSCAPE is not set # CONFIG_TRIX is not set # CONFIG_MAD16 is not set # CONFIG_CS4232 is not set # CONFIG_MAUI is not set CONFIG_AUDIO=y CONFIG_MIDI=y CONFIG_YM3812=y SBC_BASE=220 SBC_IRQ=7 SBC_DMA=1 SB_DMA2=7 SB_MPU_BASE=300 SB_MPU_IRQ=-1 DSP_BUFFSIZE=65536 CONFIG_LOWLEVEL_SOUND=y # CONFIG_ACI_MIXER is not set CONFIG_AWE32_SYNTH=y
BTW, please do not copy these values directly to your kernel. IRQ and DMA numbers of SB card may be different on each machine. In usual cases, MPU base address may be 0x330. I set this value as different one to avoid confliction between SCSI card. (The setting in Q2.3 is 0x330 because this is Neal's machine.)
This is a problem in PnP initialization. Because the original Linux kernels don't support initialization of PnP cards yet, some special treatment is necessary before loading sound driver. There're a couple of ways to solve this:
loadlin
to boot linux.
The Linux PnP driver enables to configure the PnP devices from kernel. This driver has been originally developed by Tom Lees. The current awedrv (0.4.3) includes the PnP driver interface so that no patch is necessary. See the PnP driver project homepage for more details,
Neal Sanche (neal@nsdev.ocunix.on.ca) summarizes the procedure to install on PnP card by ISAPnP tool that:
The steps you need to do in order to get sound working:
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.
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.
DON'T FORGET TO ADD TWO I/O PORTS, 0xA20 and 0xe20, for WaveTable!
These ports are never detected by pnpdump, but must be initialized.
(See Q2.4)
(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.
Check WaveTable entries in your /etc/isapnp.conf
file.
AWE32 uses three I/O ports, normally 0x620, 0xa20, and 0xe20,
but in the default ouput from pnpdump
is
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) ))
See the ISA PnP FAQ page ( http://www.roestock.demon.co.uk/isapnptools/isapnpfaq.html ) for details.
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 synthgmSimilary, it's possible to set the mixer volume automatically,
post-install sound /usr/local/bin/setmix -f /etc/mixrc;\ /usr/local/bin/sfxload synthgm
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. Sorry for incovenience...
See the document INSTALL.frbsd
in awedrv source package
for details.
Also, if you're using a PnP sound card like SB32 PnP or AWE64,
refer to Q2.8.
/usr/src/sys/i386/isa/sound
.
awe_config.h
if necessary.AWE_MAX_SAMPLES
and
AWE_MAX_INFOS
.
device awe0 at isa? port 0x620
See the how-to document by Takuya Koumoto (takuya-k@is.aist-nara.ac.jp) for more details (written in Japanese).
FreeBSD-ISA_PnP_June8.tar.gz
)
pnpinfo
in it.
You may have an output like following:
Checking for Plug-n-Play devices... Trying Read_Port at 203 Trying Read_Port at 243 .. (snip) .. Card assigned CSN #1 Board Vendor ID: CTL009d Board Serial Number: 10005fdc PnP Version: 1.0 Vendor Version: 32 Device Description: Creative SB AWE64 PnP Logical Device ID: CTL0042 (42008c0e) Device Description: Audio Start Dependent Function .. (snip) ..Remember the serial number of your sound card in the message. In this example, it's
10005fdc
. This value must be different
on each sound card.
kernel.patch.2.2-current
) included in
the package to kernel source tree.
# cd /usr/src/sys # patch -p0 < kernel.patch.2.2-current
/usr/src/sys/i386/isa/pnp.c
:#include "pnp.h"with
#include "i386/isa/pnp.h"and the part from line 50 to 103 with the following
{ 0x10005fdc, /* Serial Number */ 2, /* Logical Device Number */ { { -1, -1 }, /* Primary IRQ Number, Type */ { -1, -1 } /* Second IRQ Number, Type */ }, { -1, -1 }, /* DRQ Number */ { 0x620, /* Ports 1 */ 0xa20, /* Ports 2 */ 0xe20, /* Ports 3 */ -1, /* Ports 4 */ -1, /* Ports 5 */ -1, /* Ports 6 */ -1, /* Ports 7 */ -1, /* Ports 8 */ }, { { -1, -1, -1 }, /* Memory desc0 - base, ctrl, range */ { -1, -1, -1 }, /* Memory desc1 - base, ctrl, range */ { -1, -1, -1 }, /* Memory desc2 - base, ctrl, range */ { -1, -1, -1 } /* Memory desc3 - base, ctrl, range */ } }Please put the serial number of your card on the first item.
controller pnp0and
device awe0 at isa? port 0x620 conflicts
The AWE driver itself doesn't have any sound information in it. You need to load the soundfont file at first. See Q1.4 how to load soundfont files.
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.
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.sbkNote: you will have to prepend a path if
synthgm.sbk
is not in the current working directory or search path directories.
If drum sounds are small, you can tune it via -A
option
(see Q3.11).
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.
Just load the SBK file after GM (or GS) presets.
At first, load GM font. (For the older version (v0.3.x), the option -i
is necessary.)
% sfxload synthgmThen, append SBK font after it. If you've already loaded other samples, the additional option
-x
is required.
% sfxload -b 1 foo.sbkDon't forget to add a command option "-b 1" in this case (see Q3.5).
Now you can hear your midi file. Enjoy.
% drvmidi foo.mid
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 Q3.4).
To activate chorus and reverb modes, you have to specify non-zero
values for these effects at loading samples via
-c
and -r
options of sfxload
,
respectively.
% sfxload -c 30 -r 20 synthgm
If this happens when panning status changes, it is due to the
restriction of Emu8000 chip. Try -P
option with drvmidi.
This option suppress the realtime pan position change.
Otherwise, it may be a bug.
I think so, too...
The total volume of the samples can be changed
by using -V
option at loading.
% sfxload -V 40 synthgmThe 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 Q2.5).
Yes.
For example, to load a patch gunshot.pat
onto preset #127,
run
% gusload -p 127 gunshot.pat
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 the case of GS file, it may vary according to system exclusive messages.)
To change the drum state,
use the option -D
.
The positive argument means to turn on the drum channel,
but the negative argument means to turn off.
For example, '-D 16
' option specifies the channel 16
as a drum channel,
and '-D -10
' option
reserves the channel 10 as a normal channel.
Another possibility is the problem of multi-part support.
Drvmidi treats tracks over 16 as second MIDI part.
This feature is suppressed using '-T -1
' option with drvmidi.
Then all tracks are assumed as one MIDI part.
If you're using v0.4.2 driver and sfxload, try -A
option of
sfxload program.
This is an option to control the sensitivity of attenuation level of each
instrument, and it takes a positive (float) digit value.
Generally, the smaller value makes drum sounds louder.
I feel the value 2.0 is better than the default state,
but to keep compatibility with older versions, it's set to 10.0 as default.
% sfxload -A 2 synthgm.sbk
The v0.4.3 driver (and sfxload) uses different way of parameter calculation.
It sounds more similar to DOS/Windows, but a little bit duller than the
former version. The volume calculation method can be switched
by aweset
utility.
% aweset newvolume offNote that drvmidi will change this switch by itself, so aweset doesn't affect its sounds at all. The sound quality via playmidi will be influenced, though. Also, there is a command option
-C
in sfxload
to keep the compatibility with the older versions.
This is a new feature added from ver.0.4.0 to load the required fonts
in a soundfont file "on demand" for each MIDI file.
drvmidi looks up each instrument used in the file before playing, then
it invokes sfxload to load only the required samples.
This function enables us to to play with larger samples on samller soundcard
RAM size.
In most cases, you can play MIDI files via 2MB GM/GS soundfonts
(2mbgmgs.sf2
) on 512kB DRAM.
Of course, it's possible to play 8MB fonts on 2MB DRAM,
or 12MB fonts on 8MB DRAM
(though it'll take a bit long time to load the fonts).
Many soundfont files are distributed on web sites.
I listed them up on the
AWE driver's web page,
To use dynamic loading, the following precodure is necessary.
% sfxload synthgm
-L
(or --dynamic
) option in
the command line of drvmidi.
% drvmidi -L 2mbgmgs foo.mid
Sometimes, drvmidi fails to load all samples due to out of memeory. In such a case, the following message will appear:
preload: couldn't load all fonts.drvmidi uses ROM fonts instead of the samples which are not loaded successfully.
The dynamic loading fonts can be specified in the default setting file. See Q3.13.
The command line options of sfxload and drvmidi can be specified
in the resource files in advance.
The resource file of sfxload are
/etc/sfxloadrc
and ~/.sfxloadrc
,
and
those of drvmidi are
/etc/drvmidirc
and ~/.drvmidirc
,
repsectively.
If both files are specified, the latter one is used.
The sfxload resource file has the following format:
fontname options.. fontname options..The first argument is the soundfont name, and the remaining arguments are command line options to be specified. The font name "
default
" is special, and means that the
default options to be used if any font name doesn't match the given soundfont.
Both short and long options are available.
For example:
default --sense=10 --atten=32 -V100 synthgm --sense=2 -V100
The format of drvmidi resource file is similar to the above.
However, the valid font name is only "default
".
Though drvmidi accepts both short and long options, the option editor
in tkmidi (featured from v0.4.2) can only handle long options.
For example:
default --dynamic=2mbgmgsWith this function, you can use dynamic loading without specifying command line options at each time.
The new drvmidi ver.0.4.2 can emulate the SC88 specific controls;
a couple of sysex controls
including multi part, and some controls like TVF and EG.
As default, the sysex messages of multi-part mode and master volume control
are supported.
Regardless of received sysex status, you can turn on the multi part mode
by specifying the option --multipart=on
.
The effect controls to TVF, EG, etc. are not emulated as default status.
You need to add an option --usefx=on
to drvmidi.
Note that this function is still experimental and inaccurate.
The sound effect varies with the soundfont file, so you should
adjust parameters for your using font file.
Also, You can edit the options and effect parameters above via the option editor in tkmidi.
The new drvmidi (v0.4.2) accepts the bank control defined in XG format.
However, since the drum and sfx presets in XG format are partly different from
one in GS, some preset remapping is required to play back properly with
the usual GS soundfont file.
Drvmidi avoids this problem by assigning the XG drum and sfx presets to
the banks which are not used in GS.
To enable this feature, add the option --xgmap=on
.
To play back this new bank, the driver needs to duplicate the sounds from original GS banks. This can be solved easily using the preset mapping, which is newly supported in awedrv-0.4.2. For example, if you're using synthgs.sbk, load two bank files after it. (These bank files are included in the awesfx / sfxload package.)
% sfxload synthgs % sfxload -b0 xgsfx.bnk % sfxload -b0 xgdrum.bnkThen, the XG banks are mapped from the original GS fonts without using any extra DRAM.
The procedure above becomes easy by writing a virtual bank file. For example, using the bank file (xgdefault.bnk) contains the following,
default synthgs.sbk include xgsfx.bnk include xgdrum.bnkjust load this bank file once, and all things above will be done.
% sfxload xgdefault.bnkAlso, you need to make the similar bank file to use the dynamic loading function in drvmidi:
default 2mbgmgs.sf2 include xgsfx.bnk include xgdrum.bnkBy specifying this bank file in the option
--dynamic
,
drvmidi loads the appropriate fonts automatically even both for GS
and XG format.
Yes, the latest version 0.4.3 uses the different volume parameter calculation. Please refer to Q3.11.
The virtual bank file is a text file describing the list of presets, banks and notes from multiple soundfont files. By using a virtual bank file, you can load a part of sounds from one soundfont file and another part from other soundfont files without re-creating a whole soundfont file. On the other words, it enables to replace or add one instrument with other sounds (even one note in drumset!).
The format of virtual bank file is as follows:
source:destination:file instr-nameThe source and destination are the instrument map to specify the instruments to be replaced, and have the following format:
preset/bank/keynoteThe preset is the MIDI program number (from 0 to 127), and the bank is the MIDI bank number (from 0 to 128). The bank #128 is regarded as a drumset. The keynote is the MIDI key note number (from 0 to 127). If keynote is omitted, the whole instrument will be replaced. If bank is omitted, all matching instruments with preset will be replaced. If preset has an asterisk(*) or number -1, the matching bank will be replaced.
The virtual bank will replace the instruments specified by source field with the instruments by destination field. The file field is a soundfont file name to be loaded. Note that if you use the identical soundfont file several times in one virtual bank file, you must give also the identical name here. The files are searched through the path given to sfxload.
The instr-name field is an optional field to specify the name of this instrument. In the current version of sfxload, this field is ignored.
The virtual bank file accepts also the following format:
source:destination instr-nameUnlike the previous case, this format includes no file field. This enables the preset mapping (linking) and works like a symbolic link of file operation. The source instrument is referred also as the destination instrument. The actual destination instrument needs not exist.
There are two special command directives:
include filename
default filename
This happens when not enough DRAM is on the AWE32 card. Please upgrade memories on your card.
Also, the old drivers have a bug in sample loop addresses. Please use the latest driver (v0.3.3e or later).
If you're using..
The plug-in with MIDI control panel causes a bus error when displaying the directory page (i.e. file://directory/). To avoid this, you need to preload the plug-in file before starting Netscape. It would be convenient to replace netscape as a wrapper script like
#!/bin/sh LD_PRELOAD=$HOME/.netscape/plugins/npmidi.so; export LD_PRELOAD exec /usr/local/bin/netscapeThis bug doesn't appear on the plug-in without control panel window.
Also, if you already add mime types as below, you should edit these configuration files manually. Netscape only appends its list.
~/.mime.types
file:
audio/x-midi exts=mid,midiThen specify the application for this type by adding to
~/.mailcap
:
audio/x-midi; drvmidi %sOf course, you can choose your favorite MIDI players instead of this.
See the AWEDRV programming notes for control of awedrv device.
From ver.0.2, awedrv 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
.)