  Sound Blaster AWE 32/64 HOWTO
    Marcus Brinkmann <Marcus.Brinkmann@ruhr-uni-
  bochum.de>
  v1.2, 11  1998

           
  Sound Blaster 32 (SB AWE 32, SB AWE 64)  Creative Labs  
   Linux,   AWE Sound Driver Extension  
  Takashi Iwai. ,      
    (playres)    SB AWE.   
    Debian GNU/Linux,       
     Linux.
  ______________________________________________________________________

  Table of Contents


  1. 

     1.1 
     1.2  
     1.3     
     1.4 Feedback
     1.5  

  2.  

     2.1 
     2.2       SB AWE
     2.3      Plug and Play 
     2.4      loadable kernel modules
     2.5      driver   

  3.        SB AWE

     3.1    
     3.2 
     3.3 Compile  
     3.4 

  4.   Driver 

     4.1 /proc/devices, /dev/sndstat
     4.2  - The Raw Audio Device
     4.3  -  OPL-2/OPL-3
     4.4  -     (Wave Table Synthesis)
     4.5 
     4.6  -    Raw Audio Device
     4.7   MIDI

  5.   AWE Driver

     5.1 sfxload
     5.2 drvmidi

  6. 

     6.1  
     6.2 
     6.3  - 


  ______________________________________________________________________



  [1m1.  [0m



     Sound Blaster AWE HOWTO.    
           Sound Blaster
  32     ,     
    (Wave Table synthesis).    
     SB,    SB 32  .    Sound
  Blaster        DOS  Windows,
     Linux      
      Linux .  ,  Creative Labs 
       Windows   DOS,    
         SB  Linux.  
          
      SB AWE    Linux.



  [1m1.1.  [0m




           AWE Driver FAQ
    ISA PnP FAQ.     ``Sources''   
       .     ,
       SB AWE.     
     Hannu Savolainen <http://www.4front-tech.com/usslite>,
     driver        Linux
  kernel.  !


      Nicola Bernardelli
  <mailto:n.bern@mail.protos.it>       AWE64.
   ,     .

     SGML Tools SGML Tools
  <ftp://sunsite.unc.edu/pub/Linux/utils/text/sgml-tools-0.99.0.tar.gz>,
    HOWTO     format,  
       .


  [1m1.2.   [0m




     [1m 1.0[0m
         

     [1m 1.1[0m
          ( Curt!),  
          isapnp,    sunsite   
        mirrors

     [1m 1.2[0m
           !, ,  
         (  ispell)







  [1m1.3.      [0m


   , , ,    
     HOWTO,  email    :
  voulariba@hellug.gr     : evris@hellug.gr 
   : ep@rocketmail.com

         Home Page  , Sound Blaster
  AWE HOWTO <http://homepage.ruhr-uni-
  bochum.de/Marcus.Brinkmann/soundblaster.html>.

         upload  
  anonymous ftp sites     that archive,
    
  <ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO/mini>.


    Hypertext    Linux HOWTOs   
   World-Wide-Web sites,    <http://sunsite.unc.edu/LDP/>. 
     CD-ROM  Linux   HOWTOs,
      directory /usr/doc.

    Arnaud Launay zoro@lsol.tm.fr,     
     !       
   http <http://www.freenix.fr/linux/HOWTO>  anonymous ftp
  <ftp://ftp.lip6.fr/pub/linux/french/docs/HOWTO>.

            ,
           .



  [1m1.4.  Feedback[0m

    ,  ,      HOWTO. 
    , ,  ,    
  , Marcus.Brinkmann@ruhr-uni-bochum.de,     
     .

         
  (boot scripts .)    Linux, .. Red Hat  SuSE
  Linux.

        CD-ROM    ,  
     .      
  .         Linux
  Documentation Project       
  .       Linux HOWTO, linux-
  howto@sunsite.unc.edu,   .


  [1m1.5.   [0m


  Copyright 1997 Marcus Brinkmann.    HOWTO   
  ;     /   
   GNU General Public License      Free
  Software Foundation,      2  ,  ( 
   )       .  
           ,  [1m[0m
  [1m [22m.       [1m [22m
  [1m    [22m.     GNU
  General Public License   .


  M      GNU General Public License
    Free Software Foundation Free Software Foundation
  <http://www.fsf.org>,Inc., 675 Mass Ave, Cambridge, MA 02139, USA.


  [1m2.   [0m



  [1m2.1.  [0m


            Sound
  Blaster WE 32   Sound Blaster AWE 64  Creative Labs  Linux
   .      GNU/Linux Debian GNU/Linux
  <http://www.debian.org>   Intel i586 ,    
     but   Linux    
     driver   Linux (  
     ).

      Linux Sound HOWTO ( ``
  '') .       
  Sound HOWTO,     ,   
      .


  [1m2.2.        SB AWE[0m


     SB AWE 32   raw audio device,  
  OPL-2/OPL-3 ,  MPU-401 MIDI  32  EMU 8000  
    (        
     Linux Sound HOWTO).      
            
     .

    SB AWE 64     SB AWE 32   
   Wave Guide     Creative Labs  .  
      Linux ,    32 
           raw wave
  devices.    Creative Labs     
  Linux drivers,  driver  Wave Guide synthesis  
     Windows 3.1    Windows 95.


    ,      Linux,  SB AWE 32  
  SB AWE 64   .     , 
     SB AWE       
   ( ).



  [1m2.3.       Plug and Play [0m


          Intel  ISA
  PnP ,      ``Plug and Play''. 
  ,          ,
            
   . ,      
   :


  1.   PnP Bios,      Bios  
         PnP      .  
             SB AWE
     PnP ,,       PnP Bios,  .
         Bios     PnP
             
          .      
         raw wave,     
       MIDI,  .    ,  PnP
     Bios     .


  2.       PnP.  
       Linux kernel (2.0.x)    
             
     , ,    PnP.

  3.    ,     ,
         PnP.      
     .



       PnP  
  Linux   ``isapnptools'' (  ``''  
  ``'').       
   ISA PnP   ,      .


  [1m2.4.       loadable kernel modules[0m


   device drivers     modules   
  compile  .      
  modules  Kernel HOWTO   Module HOWTO (  ``
  '').

     PnP ,      
    loadable kernel module.      
    driver   ,       
  module          . 
           ISA PnP 
  ,   driver        ISA PnP .

   module        insmod sound 
  modprobe -a sound    script   Linux (
  Debian,          sound 
  /etc/modules).        kerneld, 
       modules .

     kerneld        
   module   AWE,       module
   ,       Wave Table
        ,    
          module.   kerneld
     modules      default,
        module     
  .

      module     
           
  .  :      module
       kerneld .   
    ,    kerneld    
   module  .

          mixer    
      module.      
      ``'' (    
    mixer     module  ).
   ,    kerneld    module, 
        mixer,  '   
       module       
    kerneld   .



  [1m2.5.       driver   [0m


          
   loadable module.     PnP card,  
      module,    PnP 
      isapnptools   module ..

     ,      compile 
  .       '  .  
  ,          . 
       Lite   OSS (USS) driver . 
      driver (3.5.4)     SB
  AWE,   SB 16  .  ,    raw audio
  device   OPL-2/OPL-3   ,   
       MIDI   Wave Table.

       Wave Table device,   
     driver    4Front Technologies
  <http://www.4front-tech.com> (     
  , ),     patch      AWE 32
  Sound Driver Extension  Takashi Iwai.      
            
  .

   AWE32 Sound Driver Extension (  ```'')  
      GNU         
     EMU 8000   SB AWE.

    awedrv      
    (    2.1.x)   
             
   .


  [1m3.         SB AWE[0m



  [1m3.1.     [0m


        SB AWE   Linux:


      Linux   (..    Debian GNU/Linux
     ),

      SB AWE 32    (... SB32, SB32 PnP, SB AWE64,
     ...),

          Linux,    
     OSS/Free ( ,  
     /usr/src/Linux/drivers/sound/Readme),

     AWE 32 sound driver extensions.


      PnP,   :


       isapnptools.

     ``''       
     .

      Debian GNU/Linux ,    
     kernel-source-<version>, awe-drv    
  isapnptools.         awe-*  
     .   kernel-package   compile
     .


  [1m3.2.  [0m


            
            DOS 
  Windows.

             
        PnP.     
   source    compile     isapnptools
  (    Debian binary ),  :



       # pnpdump > /etc/isapnp.conf





   root.     '    
    PnP  ,     devices  . 
      ,      
   DMA, IO  interrupts       
    DOS  Windows     (  Win95,
    resources     ,   
  resources  device manager).    
          isapnptools.

  [4m:[24m  isapnptools       
   I/O   SB AWE Wave Table .   
     WaveTable  isapnp.conf     
     HOWTO.        I/O base
  .


  [4m:[24m    isapnp-faq,    isapnp
         
  (logical device).       :



       Error occurred executing request 'LD 2' on or around line...




      (VERIFYLD N)    isapnp.conf.
        1.10  
   .        1.10 
  ,     POKE    logical
  device .   isapnp-faq  
       .    ,
     (      isapnp 
   ).

  [4m:[24m       (WAITFORKEY), 
          
  pnpdump.

    isapnp.conf     PnP (  )
        (  `` - 
  <tt>isapnp.conf</tt>'').

      Debian,    .  
  isapnp       /etc/init.d/boot   
   ,        scripts
   :


  ______________________________________________________________________
  # Configure the isa plug and play boards before loading
  # modules. Need to do this before loading modules to get
  # a chance of configuring and starting PnP boards before
  # the drivers mess all this up.
  #
  if [ -x /etc/init.d/isapnp ]
  then
    /etc/init.d/isapnp start
  fi
  ______________________________________________________________________



    /etc/init.d/isapnp 


  ______________________________________________________________________
  #! /bin/sh
  # /etc/init.d/isapnp: configure Plug and Play boards
  test -x /sbin/isapnp || exit 0
  /sbin/isapnp /etc/isapnp.conf
  exit 0
  ______________________________________________________________________




       Linux,   .    
   (      ?).
      isapnp     modules (
  ).




  [1m3.3.  Compile  [0m


       compile     
    AWE Driver Extension patch  driver .  
           awedrv extension (
        /drivers/sound/lowlevel/ ),  
        awedrv .  
    directory    awedrv.  ,  
      script     patches
     .
            
     script .  script    
      ,     patch. 
       drivers/sound/lowlevel/awe_wav.c
     script      .

           .  
       compile  ,   Sound HOWTO
    Kernel HOWTO  .   directory 
      (/usr/src/linux  ),  :



       # make config





   make menuconfig  make xconfig.      
      .      
       ,     
  .      Enable loadable module support 
  Y,      driver   loadable module
  (    PnP),      
        .

    ,        
  .    Y   M  [4m[24m   PnP.   
    M,  module,    PnP.     
  compile     module    PnP  
   PnP      module .

          Y ,    
  N :


  ______________________________________________________________________
  Sound Blaster (SB, SBPro, SB16, clones) support (CONFIG_SB) [Y/n/?]
  Generic OPL2/OPL3 FM synthesizer support (CONFIG_ADLIB) [Y/n/?]
  /dev/dsp and /dev/audio support (CONFIG_AUDIO) [Y/n/?]
  MIDI interface support (CONFIG_MIDI) [Y/n/?]
  FM synthesizer (YM3812/OPL-3) support (CONFIG_YM3812) [Y/n/?]
  lowlevel sound driver support [Y/n/?]
  AWE32 support (CONFIG_AWE32_SYNTH) [Y/n/?]
  ______________________________________________________________________




          Wave Table. 
      SB 16   driver   OSS/Free.

  ,     I/O  .   
  isapnp.conf  ,   .   ,  
  default , .

           
     (    SBC_IRQ  SB_MPU_BASE 
        






  ______________________________________________________________________
  I/O base for SB Check from manual of the card (SBC_BASE) [220]
  Sound Blaster IRQ Check from manual of the card (SBC_IRQ) [5]
  Sound Blaster DMA 0, 1 or 3 (SBC_DMA) [1]
  Sound Blaster 16 bit DMA (_REQUIRED_for SB16, Jazz16, SMW) 5, 6 or 7
  (use 1 for 8 bit cards) (SB_DMA2) [5]
  MPU401 I/O base of SB16, Jazz16 and ES1688 Check from manual of the card
  (SB_MPU_BASE) [330]
  SB MPU401 IRQ (Jazz16, SM Wave and ES1688) Use -1 with SB16 (SB_MPU_IRQ) [-1]
  ______________________________________________________________________




     compile  .   Debian   
     kernel-package.     
  compile          debian.
      /usr/doc/kernel-package/.   
  :



       # make-kpkg clean
       # make-kpkg -revision custom.1.0 kernel_image




    dpkg -i /usr/src/kernel-image-2.0.29_custom.1.0_i386.deb.

       Linux,    
    compile   .     make modules
   make modules_install.   Sound HOWTO    Kernel
  HOWTO   .


  [1m3.4.  [0m


      ,     
  (       
  ).  .

      PnP     isapnp  
  script  (  ),  :



       # /sbin/isapnp /etc/isapnp.conf
       Board 1 has Identity 74 00 00 e3 10 48 00 8c 0e:  CTL0048 Serial No 58128
       [checksum 74]




       driver ,    
  compiled  module:



       # modprobe -a sound
       AWE32 Sound Driver v0.3.3e (DRAM 2048k)




            ( 
       AWE64  4096k,  ``'' 
  28672k),       awedrv  
        
  /usr/src/linux/drivers/sound/lowlevel/awe_config.h,  :



       #define AWE_DEFAULT_MEM_SIZE  4096   /* kbytes */




  ,      compile   (  
  modules ,    ).

   ,       module  .
      kerneld (    
     1.4)        
     sound to /etc/modules  ( Debian)  
  /sbin/modprobe -a sound  script  .



  [1m4.    Driver [0m



  [1m4.1.  /proc/devices, /dev/sndstat[0m


  A    ,    
     .      
  loadable module,      ( 
    module    modprobe -r sound ) 



       # modprobe -a sound trace_init=1
       Sound initialization started

       <Sound Blaster 16 (4.13)> at 0x220 irq 5 dma 1,5
       <Sound Blaster 16> at 0x330 irq 5 dma 0
       <Yamaha OPL3 FM> at 0x388
       Sound initialization complete
       AWE32 Sound Driver v0.3.3e (DRAM 2048k)




        /proc,    
   



       # cat /proc/devices
       Character devices:
       [...]
       14 sound
       [...]






        devices   /dev/.
    Sound HOWTO  .    /dev/sndstat
      module  :



       # cat /dev/sndstat
       Sound Driver:3.5.4-960630 (Sat Oct 11 19:35:14 CEST 1997 root,
       Linux flora 2.0.29 #1 Sat Oct 11 19:12:56 CEST 1997 i586 unknown)
       Kernel: Linux flora 2.0.29 #1 Sat Oct 11 19:36:23 CEST 1997 i586
       Config options: 0

       Installed drivers:
       Type 1: OPL-2/OPL-3 FM
       Type 2: Sound Blaster
       ype 7: SB MPU-401

       Card config:
       Sound Blaster at 0x220 irq 5 drq 1,5
       SB MPU-401 at 0x330 irq 5 drq 0
       OPL-2/OPL-3 FM at 0x388 drq 0

       Audio devices:
       0: Sound Blaster 16 (4.13)

       Synth devices:
       0: Yamaha OPL-3
       1: AWE32 Driver v0.3.3e (DRAM 2048k)

       Midi devices:
       0: Sound Blaster 16

       Timers:
       0: System clock

       Mixers:
       0: Sound Blaster
       1: AWE32 Equalizer




        ,      
  .       ,    
  ``'',   .



  [1m4.2.   - The Raw Audio Device[0m


       .au (Sun workstation)   
  raw file,  



       # cat bell.au > /dev/audio




  .




  # cat sample > /dev/dsp




            Audio Device
  0: Sound Blaster 16 (4.3).



  [1m4.3.   -  OPL-2/OPL-3[0m


        OPL-2/OPL-3 FM   
   MIDI     ,    playmidi
  ( Appendix B).    



       # playmidi -f dance.mid





  





       # playmidi -4 dance.mid





       OPL-2,   OPL-3  MIDI .  
    ,    playmidi:    FM 
   .

        Driver   OSS/Free Sound
  Driver:       MIDI   
  (    ).  ,   SB AWE, 
        Wave Table   AWE
  Sound Driver Extension.


  [1m4.4.   -     (Wave Table Synthesis)[0m


   AWE Driver Extension      (awesfx) 
        EMU 8000 Wave Table. ,  
          -   
          ROM !   
       Windows -     
  *.sfb  *.sf2.

     ROM     SYNTHGM.SBK, 
     SYNTHGS.SBK   SYNTHMT.SBK,   
   SAMPLE.SBK.        
   ftp  www.   EMU Homepage,  web site  Creative
  Labs,       Chaos,    
  (     site  AWE Driver).


       GM (ROM) 



       # sfxload -i synthgm.sbk




       midi      SB AWE :



       # drvmidi dance.mid






  [1m4.5.  [0m


          .  
   raw audio    MIDI ,   
    mixer.

    ,      .     
  devices   :



     [1mYamaha OPL-3[0m
        Synth or FM

     [1mAWE32 Driver[0m
        Synth or FM (does anyone know a mixer were the last two are
        separated from each other?)

     [1mSound Blaster 16 (4.13)[0m
        PCM or DSP

     [1mPC Speaker (still alive)[0m
        Spkr

        CD ROM,   
      ,    , , , 
       .  
      .



  [1m4.6.   -    Raw Audio Device[0m


       :   CD
  ROM,    mic,       line
  in.      .     
     ,    Raw Audio Device, 
  :






  # cdplay
  # dd bs=8k count=5 </dev/dsp >music.au
  5+0 records in
  5+0 records out
  # cat music.au >/dev/dsp




           .



  [1m4.7.    MIDI[0m


  ,       MIDI !


  [1m5.    AWE Driver[0m



  [1m5.1.  sfxload[0m


       DRAM      
   sfxload.        
  -   (bank),   bank 0  default. , 
   sfxload synthgs.sbk,         GS.
          (Sound Font
  Banks),       -b,  :



       # sfxload synthgs.sbk
       # sfxload -b1 sample.sbk
       # drvmidi sfx.mid




      default Sound Font Bank 
    module.       :



       post-install sound /usr/bin/sfxload synthgm.sbk




     /etc/conf.modules.

          sfxload.



  [1m5.2.  drvmidi[0m


     drvmidi,     AWE Driver 
      MIDI.      midi 
     :


       # drvmidi waltz.mid




          drvmidi.



  [1m6.  [0m



  [1m6.1.   [0m



     [1m Linux Sound HOWTO[0m
        : Jeff Tranter, <jeff_tranter@pobox.com> 
        : v1.17, 4  1997    
        Sound HOWTO (  sunsite.unc.edu   sites).
             compile    
        ,     sound devices,   .

           HOWTO    Sound HOWTO.



     [1m Linux Sound Playing HOWTO[0m
        : Yoo C. Chung, <wacko@laplace.snu.ac.kr> 
        : v1.4, 13  1997      
        Sound Playing HOWTO.     formats  
           .



     [1m AWE Driver FAQ[0m
        : Takashi Iwai <iwai@dragon.mm.t.u-tokyo.ac.jp> :
        <http://bahamut.mm.t.u-tokyo.ac.jp/~iwai/awedrv/awedrv-faq.html>
              AWE Driver 
          Wave Table  Sound Blaster , 
         .



     [1m ISA PnP FAQ[0m
        : Peter Fox <fox@roestock.demon.co.uk> :
        <http://www.roestock.demon.co.uk/isapnptools/isapnpfaq.html> 
             ISA PnP  ,  
           .




  [1m6.2.  [0m




     isapnptools
        : Peter Fox <fox@roestock.demon.co.uk>

         : 1.11

        :  <http://www.roestock.demon.co.uk/isapnptools/index.html>

          patches,  bugs  ,   
          'isapnp'    
        isapnp@roestock.demon.co.uk.



     awedrv
        : <iwai@dragon.mm.t.u-tokyo.ac.jp>

         : 0.4.2c

        :   <http://bahamut.mm.t.u-tokyo.ac.jp/~iwai/awedrv/>


     [1mLinux kernel[0m
        : Linus Torvald   

         :   ,     
        2.0.29

        : ,      Linux :)



     [1mOSS/Free[0m
        : Hannu Savolainen (  
        <http://www.4front-tech.com/usslite    e-mail>).

         :   3.5.5-beta1

        :         Linux

        :    <http://www.4front-tech.com/usslite>  
         mirror <http://personal.eunet.fi/pp/voxware>.



  [1m6.3.   -  isapnp.conf[0m


      ISA PnP    pnpdump, 
  devices   PnP    .  , 
    (  ),    devices:



    LD 0: Audio Device

    LD 1: IDE Device

    LD 2: WaveTable Device

    LD 3: Gameport Device


    LD 1 ,    CD ROM    
  IDE    .      IDE  SB ,   LD
  1    Gameport Device   LD 3   .

  ,    ``''  
  (!)       .





  ______________________________________________________________________
  # $Id: pnpdump.c,v 1.9 1997/06/10 21:37:32 fox Exp $
  # This is free software, see the sources for details.
  # This software has NO WARRANTY, use at your OWN RISK
  #
  # For details of this file format, see isapnp.conf(5)
  #
  # For latest information on isapnp and pnpdump see:
  # http://www.roestock.demon.co.uk/isapnptools/
  #
  # Compiler flags: -DREALTIME -DNEEDSETSCHEDULER

  (READPORT 0x0203)
  (ISOLATE)
  (IDENTIFY *)

  # Try the following if you get error messages like
  # Error occurred executing request 'LD 2' on or around line...

  #(VERIFYLD N)

  # ANSI string -->Creative SB32 PnP<--

  (CONFIGURE CTL0048/58128 (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)
  ))

  (CONFIGURE CTL0048/58128 (LD 1
  #     ANSI string -->IDE<--

  # (INT 0 (IRQ 10 (MODE +E)))
  # (IO 0 (BASE 0x0168))
  # (IO 1 (BASE 0x036e))

  # (ACT Y)
  ))

  (CONFIGURE CTL0048/58128 (LD 2
  #     ANSI string -->WaveTable<--

    (IO 0 (BASE 0x0620))
    (IO 1 (BASE 0x0A20))
    (IO 2 (BASE 0x0E20))

    (ACT Y)
  ))

  (CONFIGURE CTL0048/58128 (LD 3
  #     ANSI string -->Game<--

    (IO 0 (BASE 0x0200))
    (ACT Y)
  ))

  # Returns all cards to the "Wait for Key" state
  (WAITFORKEY)
  ______________________________________________________________________


































































