Fix a bug in the mood line parser.
[paraslash.git] / INSTALL
1 INSTALL
2 =======
3
4 ----
5 Any knowledge of how to work with mouse and icons is not required.
6
7 ---------------------------
8 Install all needed packages
9 ---------------------------
10 See
11 <<
12 <a href="REQUIREMENTS.html"> REQUIREMENTS </a>
13 >>
14 for a list of required software. You don't need everything listed
15 there. In particular, mp3, ogg vorbis and aac, ortp support is
16 optional. Autoconf will detect what is installed on your system
17 and will only try to build those executables that can be built with
18 your setup.
19
20 Note that no special library (not even the mp3 decoding library libmad)
21 is needed for para_server if you only want to stream mp3 files.
22 Also, it's fine to use para_server on a box without sound card as
23 para_server only sends the audio stream to connected clients.
24
25 -------------------------
26 Install server and client
27 -------------------------
28
29 Install the package on all machines, you'd like this software to run on:
30
31 (./configure && make) > /dev/null
32
33 There should be no errors but probably some warnings about missing
34 software packages which usually implies that not all audio formats will
35 be supported. If headers or libs are installed at unusual locations
36 you might need to tell the configure script to find them. Try
37
38 ./configure --help
39
40 to see a list of options. If the paraslash package was compiled
41 successfully, execute as root,
42
43 make install
44
45 -----------------------------------
46 Setup user list and create rsa keys
47 -----------------------------------
48
49 If you already have your rsa keys, skip this step. If you are new
50 to paraslash, you have to generate an rsa key pair for each user you
51 want to allow to connect. You need at least one user.
52
53 Let's assume that you'd like to run the server on host server_host
54 as user foo, and that you want to connect from client_host as user bar.
55
56 As foo@server_host, create ~/.paraslash/server.users by typing the
57 following commands:
58
59 target=~/.paraslash/server.users
60 key=~/.paraslash/key.pub.bar
61 perms=AFS_READ,AFS_WRITE,VSS_READ,VSS_WRITE
62 mkdir -p ~/.paraslash
63 echo "user bar $key $perms" >> $target
64
65 This gives "bar" the full privileges.
66
67 Change to the bar account on client_host and generate the key-pair
68 with the commands
69
70 key=~/.paraslash/key.bar
71 mkdir -p ~/.paraslash
72 (umask 077 && openssl genrsa -out $key)
73
74 Next, extract its public part:
75
76 pubkey=~/.paraslash/key.pub.bar
77 openssl rsa -in $key -pubout -out $pubkey
78
79 and copy the public key just created to server_host (you may
80 skip this step for a single-user setup, i.e. if foo=bar and
81 server_host=client_host):
82
83 scp $pubkey foo@server_host:.paraslash/
84
85 Finally, tell para_client to connect to server_host:
86
87 conf=~/.paraslash/client.conf
88 echo 'hostname server_host' > $conf
89
90 -----------------
91 Start para_server
92 -----------------
93
94 For this first try, we'll use a debug level of two to make the
95 output of para_server more verbose.
96
97 para_server -l 2
98
99 Now you can use para_client to connect to the server and issue
100 commands. Open a new shell (as "bar" on "client_host" in the above
101 example) and try
102
103 para_client help
104 para_client si
105
106 to retrieve the list of available commands and some server info.
107 Don't proceed if this doesn't work.
108
109 -------------------
110 Create the database
111 -------------------
112
113 para_client init
114
115 This creates some empty tables under ~/.paraslash/afs_database.
116 You normally don't need to look at these tables, but it's good
117 to know that you can start from scratch with
118
119 rm -rf ~/.paraslash/afs_database
120
121 in case something went wrong.
122
123 Next, you need to fill the audio file table of that database with
124 contents so that para_server knows about your audio files. Choose an
125 absolute path to a directory containing some audio files and add them
126 to the audio file table:
127
128 para_client add /my/mp3/dir
129
130 This might take a while, so it is a good idea to start with a directory
131 containing not too many audio files. Note that the table only contains
132 data about the audio files found, not the files themselves.
133
134 Print a list of all audio files found with
135
136 para_client ls
137
138 ------------------------
139 Start streaming manually
140 ------------------------
141
142 para play
143 para stat 2
144
145 This starts streaming and dumps some information about the current
146 audio file to stdout.
147
148 You should now be able to receive the stream and listen to it. If
149 you have mpg123 or xmms handy, execute on client_host
150
151 mpg123 http://server_host:8000/
152 or
153 xmms http://server_host:8000/
154
155 Paraslash comes with its own receiving and playing software, which
156 will be described next. Try the following on client_host (assuming
157 Linux/ALSA and an mp3 stream):
158
159 para_recv -l 2 -r 'http -i server_host' > file.mp3
160 # (interrupt with CTRL+C after a few seconds)
161 ls -l file.mp3 # should not be empty
162 para_filter -f mp3dec -f wav < file.mp3 > file.wav
163 ls -l file.wav # should be much bigger than file.mp3
164 para_write -w alsa < file.wav
165
166 If this works, proceed. Otherwise double check what is logged by
167 para_server and use the --loglevel option of para_recv, para_filter
168 and para_write to increase verbosity.
169
170 Next, put the pieces together:
171
172 para_recv -r 'http -i server_host' \
173 | para_filter -f mp3dec -f wav \
174 | para_write -w alsa
175
176 ---------------------
177 Configure para_audiod
178 ---------------------
179
180 In order to automatically start the right decoder at the right time
181 and to offer to the clients some information on the current audio
182 stream and on paraslash's internal state, you should run the local
183 audio daemon, para_audiod, on every machine in your network which is
184 supposed to play the audio stream. Try
185
186 para_audiod -h
187
188 for help. Usually you have to specify only server_host as the receiver
189 specifier for each supported audio format, like this:
190
191 para_audiod -l 2 -r 'mp3:http -i server_host'
192
193 The preferred way to use para_audiod is to run it once at system start
194 as an unprivileged user. para_audiod needs to create a "well-known"
195 socket for the clients to connect to. The default path for this
196 socket is
197
198 /var/paraslash/audiod_socket.$HOSTNAME
199
200 so the /var/paraslash directory should be owned by the user who
201 runs para_audiod.
202
203 If you want to change the location of the socket, use the -s option
204 for para_audiod or the config file ~/.paraslash/audiod.conf to change
205 the default. Note that in this case you'll also have to specify the
206 same value for para_audioc's -s option.
207
208 If para_server is playing, you should be able to listen to the audio
209 stream as soon as para_audiod is started. Once it is running, try
210
211 para_audioc stat
212
213 That should dump some information to stdout. Other commands include
214
215 para_audioc off
216 para_audioc on
217 para_audioc sb
218 para_audioc term
219 para_audioc cycle
220
221 --------------
222 Start para_gui
223 --------------
224
225 para_gui reads the output of "para_audioc stat" and displays that
226 information in a curses window. It also allows you to bind keys to
227 arbitrary commands. There are several flavours of key-bindings:
228
229 - internal: These are the built-in commands that can not be
230 changed (help, quit, loglevel, version...).
231 - external: Shutdown curses before launching the given command.
232 Useful for starting other ncurses programs from within
233 para_gui, e.g. aumix or dialog scripts. Or, use the mbox
234 output format to write a mailbox containing one mail for each
235 (admissible) file the audio file selector knows about. Then
236 start mutt from within para_gui to browse your collection!
237 - display: Launch the command and display its stdout in
238 para_gui's bottom window.
239 - para: Like display, but start "para_client <specified
240 command>" instead of "<specified command>".
241
242 This concludes the installation notes. Next thing you might to have a look
243 at is how to use paraslash's audio file selector. See
244 <<
245 <a href="README.afs.html"> README.afs</a>
246 >>