NOTE: This document only describes the Sun/Solaris specific
information you need to know. Read README.UNIX as well.

    mikmod Sun audio driver
    =======================
Valtteri Vuorikoski <vuori@sci.fi>

--------------------------------------------------------------------
Tor Norbye <tor@cs.stanford.edu>, Jan 8 1997:
I've added makefiles and updated the driver from 2.15 to work
with 3.0.2. To build, run the script "build-mikmod.sun.sh".
It's customized for Solaris. Change occurrences of -DSOLARIS
to -DSUN in makefiles if necessary.

Also, I've added a flag to force the sound to go to the headphones
instead of the speaker. This is necessary since on Sun Workstations
it's not enough to plug in the headphones; the output will still
go to the speaker and not on the headphones. If you're going to
play mods at work, this flag may be for you...

If you *want* the output to go to the speaker, remove the
-DUSE_HEADPHONE flag from playercode/makefile.sun.

You'll notice that the makefiles use the gnu compiler instead
of Sun's own compiler. That's because the sourcecode contains
a number of gnuisms, like function calls without prototypes
etc. If you don't have a gnu compiler readily available,
adapting the code is straightforward but tedious. I just
didn't want to touch *all* the sourcefiles in this update.

One last note: Below, Valtteri (the author of the driver) describes
known limitations etc. of the board.  I can add that on my
Ultra workstation (Solaris 2.5.1), things work fine. 
I get 16 bit stereo sound at 44.1khz. So you might not need
the -m -f 8000 stuff he describes. Try without first.

Finally, if you can't get the drivers to work, you can always
convert the 16bit stereo output file (music.raw) to a .au
file with the following:

audioconvert -o out.au -f sun -i \
rate=44.1k,channels=stereo,encoding=linear16 music.raw

You can then play this with
    audioplay -p headphone -v 10 out.au

Now on to Valtteri's notes.

Happy mikmod'ing;
  -- Tor Norbye
--------------------------------------------------------------------


Supported configurations
------------------------
 The Sun audio driver is currently known to work on Solaris 2.5 with
the AMD audio device (8-bit, 8khz, mono ulaw) commonly found in older
Sun workstations. The previous version has been tested on SunOS 4.1.3_U1,
and this should still be supported.

 The driver should work for most releases of SunOS 4.1.x and Solaris
2.x (except perhaps the notoriously bugged pre-2.3 versions). It has
not been tested with the DBRI audio device (44khz, 16-bit, stereo)
commonly found in newer Sun workstations.

 The driver will not compile on NetBSD/sparc, but that audio interface
is fairly close to the Solaris audio interface. Patches for NetBSD
audio would be nice to have.

Using the mikmod Sun audio driver
---------------------------------
 You will need to use the switches -f 8000 -m -8 to get correct audio
with the amd audio device, since it only supports 8khz 8-bit mono. If
you specify incorrect values, the initialization of the audio device
will fail. If you are not sure what device you have, try with only
the name of the mod file as the argument. If that doesn't work, try
the above.

 As a possibly useful note, to play music.raw that the 'raw' driver in
mikmod outputs to /dev/audio with sox, the following command line works:

sox -t raw -c 1 -r 8000 -u -b music.raw -t raw -U -r 8000 -c 1 -b /dev/audio

 though you have to use this to output to the file (with the exact line
above):

mikmod -d 1 -f 8000 -m -8 <mod file>

 The data in music.raw is then in an 8-bit unsigned linear mono format. If
you want better-quality audio, you should vary the options accordingly.

Copyrights, disclaimers and contributors
----------------------------------------
 Parts of drv_sun.c are from the the SOX package by Lance Norskog. Parts
of the code are copyright Jef Poskanzer and Lance Norskog. The following
is the license/copyright for SOX:

Sound Tools may be used for any purpose.  Source
distributions must include the copyright notices.  Binary
distributions must include acknowledgements to the creators.
The files I wrote are copyright Lance Norskog.
The contributed files are copyright by their respective authors.

** Copyright (C) 1989 by Jef Poskanzer.
**
** Permission to use, copy, modify, and distribute this software and its
** documentation for any purpose and without fee is hereby granted, provided
** that the above copyright notice appear in all copies and that both that
** copyright notice and this permission notice appear in supporting
** documentation.  This software is provided "as is" without express or
** implied warranty.

 Fix to load_xm.c to play correctly on big-endian machines by
Sebastiaan A. Megens <sam@cs.vu.nl>.

 Tighter integration with the rest of the Unix mikmod package by
Steve McIntyre <stevem@chiark.greenend.org.uk>.

