		            ** Sound for LTSP v0.3 **
	            ** Boris Reisig (boris@microtrader.com) **
	     Maintained by Andrew Williams (mistik1@geeksinthehood.net)


Intro:
	Here is a package I quickly put together to allow fellow LTSP
	users to get sound working on their workstation. I have it working
	on a few systems already. I hope you enjoy. Their still are some
	bugs so your feedback is appreciated.


Requirements:
	- LTSP v3.0.0 or higher [Please use ltspsound-0.2b for earlier versions]
	- Required files on the server....
		- libm.so.6
		- libc.so.6
		- libX11.so.6
		- libdl.so.2
		- ld-linux.so.2
	NASD Module
	- To use auinfo[from soundutils], you also need the following libraries
		[libXt.so.6,libSM.so.6,libICE.so.6,libXext.so.6]
	ESD module
	- To use 'esd' you *MUST* have Esound libraries installed on the server
	  It's best to have Esound prefixed to /usr as the ltsp_sound scripts
	  search for then in /usr/lib	  
	- Bash [as your default shell. Just because it reads /etc/profile]

How to install:
	- tar -zxvf ltsp_sound-<version>.tar.gz
	- cd ltsp_sound
	- less README	[RTFM most notably the example section below]
	- q	[Quits less "for the un initiated ;-)"]
	- ./install.sh


How to use it:
	- To enable sound, add a "SOUND = Y" to ltsp.conf
	- Next you have to load your sound card driver and
	- add it using a line
	- This version requires that you load the 'soundcore' or 'sound'
	- module first (depending on the requirements of your card) unless.
	- You can specify 'auto' for a module name to utalize LTSP builtin 
	- AutoDetect routine.
	  SMODULE_01 = auto
	- You specify aditional modules along with auto, this is usefull for some
	- troublesome sound cards or those that require additional modules along 
	- with thier own
	- It is very important that your workstation exist in /etc/hosts or your 
	- DNS records for this to work properly,
	- For the server to automatically determine the sound daemon in use on 
	- your workstation you *MUST NOT* place the sound settings in the [Default]
	- section of your lts.conf, place all sound setting as [ws002] type sections
	- Thats it.

	Example: lts.conf
==============================================================================
	[ws001]
          SOUND              = Y
          SOUND_DAEMON       = nasd   # This can be 'nasd', or 'esd' at this time
	  VOLUME	     = 100 # Speaker & WAVE volume pecentage
	  MIC_VOLUME	     = 100 # Microphone volume
	  CD_VOLUME	     = 75  # CD Audio volume
	  SMODULE_01         = soundcore
	  SMODULE_02	     = uart401
	  SMODULE_03	     = sb io=0x220 irq=5 dma=1
==============================================================================

The above example loads up a sb-compatible sound card. [uart401 is needed
*before* the 'sb' file.

	- For nasd you can use auinfo from the sound utils package .
	  This will tell if everything is working properly.
	  You can do it two ways.
	    a)On the server, you need to temporarily export the workstation
	      ip on the command line into the AUDIOSERVER sting and then
	      run "auinfo". Example:

		- export AUDIOSERVER="192.168.0.2:0"    [or "ws002:0" ]
		- auinfo

	    b) Log into your diskless workstation and go to the command
	       line and run "auinfo" from the command prompt.

	  If you get information back, then everything is working fine.

	- For esd you can use the esdctl tool to test connectivity and status
	- of the esd daemon. The format is esdctl -s [host:port] <option>
	  [mistik1@devbox ~/]$ esdctl -s ws002:16001 standbymode
	  server is running
	  [mistik1@devbox ~/]$
	- If you see this then you are ready to go
	- Use esdctl -h for more options

Other Info:

	- Just a warning, If you with to reinstall this package you must make
	- *absolutely* sure that no users are logged in and is using the 
	- /lib/libaudiooss.so.1.0 Simply logout any users then do the following
	- before running ./install.sh to DELETE the libs.
	- # rm -f /lib/libaudiooss.so*
	- # rm -f /lib/libaudio.so*
	- # rm -f /lib/libaudio.a
	- NOTE: Only do this if you want to replace the installed libaudiooss
	- 	files on the server, the install script will not fail if you 
	-	do not delete the above file it simply wont overwrite them :)

Troubleshooting:
	- Q: I installed everything but when I go run auinfo, I keep getting
	     a "auinfo: unable to connect to audio server". Why?
	- A: Check to make sure you have done the following.
	      a) Set your workstation to boot in console mode by setting 
		 RUNLEVEL = 3 in your lts.conf.
		 - Are your sound card modules loaded? [type lsmod]
		 - Is nasd or esd running in memory?
	      b) Do you have SOUND = Y and sound card modules loaded with
		 SMODULE_01=xxxx , SMODULE_02=xxx ?
	- Q: Sound works fine but I cant turn up/down the volume. Why?
	- A: I used older sound libraries in this version. The reason is
	     because the newer libraries have automatic volume control but
	     the audio drops out more often while with the older libraries,
	     the audio doesnt drop out but the trade off is you cant control
	     the volume within the program. Less audio drop outs and
             adjusting the sound on your speakers is much better then
	     choppy sound. I might release both libraries in a later
	     version.

 	- Q: When installing, I keep getting a "/lib/libaudiooss.so.1.0
	     already exists in /etc/profile. Skipping". What does that mean?
	- A: Basically the installation found a LD_PRELOAD=/lib/audiooss.so.1.0
	     in your /etc/profile so it wont overwrite that file. Overwriting
	     it *could* corrupt your /lib/libaudiooss.so.1.0 and if that happens
	     it could disable your system. Beware!
	- Q: During the installation, I got a weird error message. "BASH
	     running less then version 2.xx could cause unforseen problems."
	- A: Bash 2.00 and higher makes it alot more easier to bash script.
	     Basically I havent tested it on bash running anything less then
	     2.04. I have to test later on earlier versions. Its just to
	     display a warning that it might not work.

ChangeLog:
	- 0.1   - Initial Release.
	- 0.1a  - Changed install script. Much more cleaner and checks for
		  important libraries. Also modified lts.conf.sound file.

	- 0.1b	- Fixed install script. Didn't properly check for lts_kmod
		  package. Fixed sound so KDE plays startup sound. Fixed
		  sound in KDE so it will play on non-root users.

	- 0.1c	- Fixed install script to make it check rc.local for nasd
		  before inserting the Startup options. Ported to install to
		  in lts_core-2.09preX. Also added some more error checking
                  so that running the install twice dont hose your box
                  trying to replace /lib/libaudiooss.so -Mistik1-

	- 0.2   - Fixed the problem os loosing sound on the server when logged
		- in locally. Added new version of libaudiooss.so which supports
		- limited volume control.

	- 0.3	- Ok this is almost a total rewrite of all the scripts in use in
		  this package. 
		  Added even better checking of the environment before setting LD_PRELAOD.
		  Changed the ENV settings so they do not get set if you are logged in as
		  'root', logged into the server as user or logged into server from remote
		  host without Xwindows (Thanks Jim)
		  Added esd to the package this time around :-)
		  Note: this new package does not support sound in KDE very well using
		  'nasd'. Ok, added 3 new variables to LTSP
		  Values for these variables are percentages however do not add a '%'
		  symbol
		  VOLUME = 75	## This param is used to set the MAIN & PCM volume
		  MIC_VOLUME = 100 ## This is used to set microphone volume
		  CD_VOLUME = 100	## THis is used to set the volume for CD audio
		  Well you get the idea :-)
		  Added support for PCI sound card autodetected
		  Added compatability checking for Debian systems (Thanks kern)
		  Tons of bugfixes....... whew!!

