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