Merge branch 'maint'
[paraslash.git] / INSTALL
diff --git a/INSTALL b/INSTALL
index 7f27f7640606149102680d7c9723bfd49fd5d900..092bf873b373ed482e77754568dfb8fef33e6105 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -7,32 +7,51 @@ Any knowledge of how to work with mouse and icons is not required.
 ---------------------------
 Install all needed packages
 ---------------------------
+See
+<<
+<a href="REQUIREMENTS.html"> REQUIREMENTS </a>
+>>
+for a list of required software. You don't need everything listed
+there. In particular, mp3, ogg vorbis and aac support are all
+optional. The configure script will detect what is installed on your
+system and will only try to build those executables that can be built
+with your setup.
+
+Note that no mp3 library (not even the mp3 decoding library libmad)
+is needed for para_server if you only want to stream mp3 files. Also,
+it's fine to use para_server on a box without sound card as para_server
+only sends the audio stream to connected clients.
 
-See README for a list of required software. Don't be afraid of the long
-list of unusual libraries: Most of them are only needed for optional
-programs. Autoconf will detect what is installed on your system and
-will only build those executables that can be built with your setup.
-
-------------------------
+-------------------------
 Install server and client
 -------------------------
 
-Install the package on all machines, you'd like this software to run on:
+Install the paraslash package on all machines, you'd like this software
+to run on:
 
        (./configure && make) > /dev/null
 
-There should be no errors (but probably many warnings about missing
-software). Then, as root,
+There should be no errors but probably some warnings about missing
+software packages which usually implies that not all audio formats will
+be supported. If headers or libs are installed at unusual locations
+you might need to tell the configure script where to find them. Try
+
+       ./configure --help
+
+to see a list of options. If the paraslash package was compiled
+successfully, execute as root,
 
        make install
 
 -----------------------------------
-Setup user list and create rsa keys
+Setup user list and create RSA keys
 -----------------------------------
 
-If you already have your rsa keys, skip this step. If you are new
-to paraslash, you have to generate an rsa key pair for each user you
-want to allow to connect. You need at least one user.
+Note that the RSA keys for paraslash 0.3.x will not work for version
+0.4.x as the new version requires stronger (2048 bit) keys. If you
+already have your 2048 bit keys, skip this step. If you are new to
+paraslash, you have to generate a key pair for each user you want to
+allow to connect. You need at least one user.
 
 Let's assume that you'd like to run the server on host server_host
 as user foo, and that you want to connect from client_host as user bar.
@@ -40,24 +59,25 @@ as user foo, and that you want to connect from client_host as user bar.
 As foo@server_host, create ~/.paraslash/server.users by typing the
 following commands:
 
+       user=bar
        target=~/.paraslash/server.users
-       key=~/.paraslash/key.pub.bar
+       key=~/.paraslash/key.pub.$user
        perms=AFS_READ,AFS_WRITE,VSS_READ,VSS_WRITE
        mkdir -p ~/.paraslash
-       echo "user bar $key $perms" >> $target
+       echo "user $user $key $perms" >> $target
 
-This gives bar full privileges.
+This gives "bar" the full privileges.
 
-Change to the bar account on client_host and generate the key-pair
+Change to the "bar" account on client_host and generate the key-pair
 with the commands
 
-       key=~/.paraslash/key.bar
+       key=~/.paraslash/key.$LOGNAME
        mkdir -p ~/.paraslash
-       (umask 077 && openssl genrsa -out $key)
+       (umask 077 && openssl genrsa -out $key 2048)
 
 Next, extract its public part:
 
-       pubkey=~/.paraslash/key.pub.bar
+       pubkey=~/.paraslash/key.pub.$LOGNAME
        openssl rsa -in $key -pubout -out $pubkey
 
 and copy the public key just created to server_host (you may
@@ -75,12 +95,18 @@ Finally, tell para_client to connect to server_host:
 Start para_server
 -----------------
 
-For the first try, we'll use the default audio file selector, the
-"random" selector which chooses audio files from the given directory
-by random. You have to tell para_server via the --random_dir command
-line option where this selector should look for audio files.
+Before starting the server make sure you have write permissions to
+the directory /var/paraslash.
+
+       sudo chown $LOGNAME /var/paraslash
+
+Alternatively, use the --afs_socket Option to specify a different
+location for the afs command socket.
+
+For this first try, we'll use the info loglevel to make the output
+of para_server more verbose.
 
-       para_server --random_dir=/my/mp3/directory
+       para_server -l info
 
 Now you can use para_client to connect to the server and issue
 commands. Open a new shell (as "bar" on "client_host" in the above
@@ -90,23 +116,60 @@ example) and try
        para_client si
 
 to retrieve the list of available commands and some server info.
+Don't proceed if this doesn't work.
+
+-------------------
+Create the database
+-------------------
+
+       para_client init
+
+This creates some empty tables under ~/.paraslash/afs_database-0.4.
+You normally don't need to look at these tables, but it's good to
+know that you can start from scratch with
+
+       rm -rf ~/.paraslash/afs_database-0.4
+
+in case something went wrong.
+
+Next, you need to fill the audio file table of that database with
+contents so that para_server knows about your audio files.  Choose an
+absolute path to a directory containing some audio files and add them
+to the audio file table:
+
+       para_client add /my/mp3/dir
+
+This might take a while, so it is a good idea to start with a directory
+containing not too many audio files. Note that the table only contains
+data about the audio files found, not the files themselves.
+
+Print a list of all audio files found with
+
+       para_client ls
 
 ------------------------
 Start streaming manually
 ------------------------
 
        para_client play
-       para_client stat 2
+       para_client -- stat -n=2
+
+This starts streaming and dumps some information about the current
+audio file to stdout.
+
+You should now be able to receive the stream and listen to it. If
+you have mpg123 or xmms handy, execute on client_host
 
-This starts streaming and dumps some information on the current song
-to stdout.
+       mpg123 http://server_host:8000/
+or
+       xmms http://server_host:8000/
 
-You should now be able to receive and listen to the stream. To check
-this, try the following on client_host (assuming alsa and an mp3
-stream):
+Paraslash comes with its own receiving and playing software, which
+will be described next. Try the following on client_host (assuming
+Linux/ALSA and an mp3 stream):
 
        para_recv -r 'http -i server_host' > file.mp3
-       # (interrupt after a few seconds)
+       # (interrupt with CTRL+C after a few seconds)
        ls -l file.mp3 # should not be empty
        para_filter -f mp3dec -f wav < file.mp3 > file.wav
        ls -l file.wav # should be much bigger than file.mp3
@@ -121,33 +184,6 @@ Next, put the pieces together:
        para_recv -r 'http -i server_host' \
                | para_filter -f mp3dec -f wav \
                | para_write -w alsa
-       or
-       mpg123 http://server_host:8000/
-       or
-       xmms http://server_host:8000/
-
------------------------------
-Choose an audio file selector
------------------------------
-
-paraslash has three different audio file selectors: random (default),
-playlist and mysql.
-
-       - The random selector chooses files randomly from the given
-         directory.
-       - The playlist selector allows to send a playlist to para_server
-         via the lpl (load playlist) command. para_server will choose
-         files from the loaded playlist in sequential order.
-       - The mysql selector stores information about your audio
-         files in a mysql database. It is much more involved than
-         the other two selectors and lets you chose files in many
-         interesting ways. If you like to use the mysql selector,
-         read README.mysql and follow the instructions given there.
-         Return to this document when ready.
-
-The current audio file selector can be changed at runtime via
-
-       para_client chs new_selector
 
 ---------------------
 Configure para_audiod
@@ -156,15 +192,15 @@ Configure para_audiod
 In order to automatically start the right decoder at the right time
 and to offer to the clients some information on the current audio
 stream and on paraslash's internal state, you should run the local
-audio daemon, para_audiod, on every machine that is supposed to play
-the audio stream. Try
+audio daemon, para_audiod, on every machine in your network which is
+supposed to play the audio stream. Try
 
        para_audiod -h
 
-for help. Usually you have to specify at least server_host as the
-receiver specifier for each supported audio format, like this:
+for help. Usually you have to specify only server_host as the receiver
+specifier for each supported audio format, like this:
 
-       -r 'mp3:http -i server_host'
+       para_audiod -l info -r 'mp3:http -i server_host'
 
 The preferred way to use para_audiod is to run it once at system start
 as an unprivileged user. para_audiod needs to create a "well-known"
@@ -173,13 +209,13 @@ socket is
 
        /var/paraslash/audiod_socket.$HOSTNAME
 
-so the /var/paraslash directory should be owned by the user who
+so the /var/paraslash directory should be writable for the user who
 runs para_audiod.
 
-If you want to change location of the default socket, use the -s
+If you want to change the location of the socket, use the --socket
 option for para_audiod or the config file ~/.paraslash/audiod.conf
 to change the default. Note that in this case you'll also have to
-specify the same value for para_audioc's -s option.
+specify the same value for para_audioc's --socket option.
 
 If para_server is playing, you should be able to listen to the audio
 stream as soon as para_audiod is started.  Once it is running, try
@@ -206,26 +242,17 @@ arbitrary commands. There are several flavours of key-bindings:
          changed (help, quit, loglevel, version...).
        - external: Shutdown curses before launching the given command.
          Useful for starting other ncurses programs from within
-         para_gui, e.g. aumix or para_dbadm. Or, use "para_client
-         mbox" to write a mailbox containing one mail for each file
-         in the mysql database and start mutt from within para_gui
-         to browse your collection!
+         para_gui, e.g.  aumix or dialog scripts. Or, use the mbox
+         output format to write a mailbox containing one mail for each
+         (admissible) file the audio file selector knows about. Then
+         start mutt from within para_gui to browse your collection!
        - display: Launch the command and display its stdout in
          para_gui's bottom window.
        - para: Like display, but start "para_client <specified
          command>" instead of "<specified command>".
 
-
-That's all, congratulations. Check out all the other optional gimmicks!
-
-Troubles?
-~~~~~~~~~
-If something went wrong, look at the output. If that does not give
-you a clue, use loglevel one (option -l 1 for most commands) to show
-debugging info. Almost all paraslash executables have a brief online
-help which is displayed by using the -h switch.
-
-Still not working? Mail the author Andre Noll <maan@systemlinux.org>
-(english, german, or spanish language). Please provide enough info
-such as the version of paraslash you are using and relevant parts of
-the logs.
+This concludes the installation notes. Next thing you might to have a look
+at is how to use paraslash's audio file selector. See
+<<
+<a href="README.afs.html"> README.afs</a>
+>>