fix init message of the playlist selector.
[paraslash.git] / INSTALL
1 Paraslash install notes
2 =======================
3
4 Any knowledge of how to work with mouse and icons is not required.
5
6 Install all needed packages
7 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
8 See README for a list of required software. Don't be afraid of the long
9 list of unusal libraries: Most of them are only needed for optional
10 programs. Autoconf will detect what is installed on your system and
11 will only build those executables that can be built with your setup.
12
13
14 Install server and client
15 ~~~~~~~~~~~~~~~~~~~~~~~~~
16 Install the package on all machines, you'd like this software to run on:
17
18         (./configure && make) > /dev/null
19
20 There should be no errors (but probably many warnings about missing
21 software). Then, as root,
22
23         make install
24
25 Setup user list and create rsa keys
26 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
27 If you already have your rsa keys, skip this step. If you are new
28 to paraslash, you have to generate an rsa key pair for each user you
29 want to allow to connect. You need at least one user.
30
31 Let's assume that you'd like to run the server on host server_host
32 as user foo, and that you want to connect from client_host as user bar.
33
34 As foo@server_host, create ~/.paraslash/server.users by typing the
35 following commands:
36
37         target=~/.paraslash/server.users
38         key=~/.paraslash/key.pub.bar
39         perms=DB_READ,DB_WRITE,AFS_READ,AFS_WRITE
40         mkdir -p ~/.paraslash
41         echo "user bar $key $perms" >> $target
42
43 This gives bar full privileges.
44
45 Change to the bar account on client_host and generate the key-pair
46 with the commands
47
48         key=~/.paraslash/key.bar
49         mkdir -p ~/.paraslash
50         (umask 077 && openssl genrsa -out $key)
51
52 Next, extract its public part:
53
54         pubkey=~/.paraslash/key.pub.bar
55         openssl rsa -in $key -pubout -out $pubkey
56
57 and copy the public key just created to server_host (you may
58 skip this step for a single-user setup, i.e. if foo=bar and
59 server_host=client_host):
60
61         scp $pubkey foo@server_host:.paraslash/
62
63 Finally, tell para_client to connect to server_host:
64
65         echo 'hostname server_host' > ~/.paraslash/client.conf
66
67 Start para_server
68 ~~~~~~~~~~~~~~~~~
69 For the first try, we'll use the default audio file selector, the
70 "random" selector which chooses audio files from the given directory
71 by random. You have to tell para_server via the --random_dir command
72 line option where this selector should look for audio files.
73
74         para_server --random_dir=/my/mp3/directory
75
76 Now you can use para_client to connect to the server and issue
77 commands. Open a new shell (as "bar" on "client_host" in the above
78 example) and try
79
80         para_client help
81         para_client si
82
83 to retrieve the list of available commands and some server info.
84
85 Start streaming manually
86 ~~~~~~~~~~~~~~~~~~~~~~~~
87
88         para_client play
89         para_client stat 2
90
91 This starts streaming and dumps some information on the current song
92 to stdout.
93
94 You should now be able to receive and listen to the stream. To check
95 this, try the following on client_host (assuming alsa and an mp3
96 stream):
97
98         para_recv -r 'http -i server_host' > file.mp3 #interrupt after a few seconds
99         ls -l file.mp3 # should not be empty
100         para_filter -f mp3dec -f wav < file.mp3 > file.wav
101         ls -l file.wav # should be much bigger than file.mp3
102         para_write -w alsa < file.wav
103
104 If this works, proceed. Otherwise doublecheck what is logged by
105 para_server and use the --loglevel option of para_recv, para_filter
106 and para_write to increase verbosity.
107
108 Next, put the pieces together:
109
110         para_recv -r 'http -i server_host' | para_filter -f mp3dec -f wav | para_write -w alsa
111         or
112         mpg123 http://server_host:8000/
113         or
114         xmms http://server_host:8000/
115
116 Choose an audio file selector
117 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
118 paraslash has three different audio file selectors: random (default),
119 playlist and mysql.
120
121         The random selector chooses files randomly from the given
122         directory.
123
124         The playlist selector allows to send a playlist to para_server
125         via the lpl (load playlist) command. para_server will choose
126         files from the loaded playlist in sequential order.
127
128         The mysql selector stores information about your audio
129         files in a mysql database. It is much more involved than
130         the other two selectors and lets you chose files in many
131         interesting ways. If you like to use the mysql selector,
132         read README.mysql and follow the instructions given there.
133         Return to this document when ready.
134
135 The current audio file selector can be changed at runtime via
136
137         para_client chs new_selector
138
139
140 Configure para_audiod
141 ~~~~~~~~~~~~~~~~~~~~~
142 In order to automatically start the right decoder at the right time
143 and to offer to the clients some information on the current audio
144 stream and on paraslash's internal state, you should run the local
145 audio daemon, para_audiod, on every machine that is supposed to play
146 the audio stream. Try
147
148         para_audiod -h
149
150 for help. Usually you have to specify at least server_host as the
151 receiver specifier for each supported audio format, like this:
152
153         -r 'mp3:http -i server_host'
154
155 The prefered way to use para_audiod is to run it once at system start
156 as an unprivileged user. para_audiod needs to create a "well-known"
157 socket for the clients to connect to. The default path for this
158 socket is
159
160         /var/paraslash/audiod_socket.$HOSTNAME
161
162 so the /var/paraslash directory should be owned by the user who
163 runs para_audiod.
164
165 If you want to change location of the default socket, use the -s
166 option for para_audiod or the config file ~/.paraslash/audiod.conf
167 to change the default. Note that in this case you'll also have to
168 specify the same value for para_audioc's -s option.
169
170 If para_server is playing, you should be able to listen to the audio
171 stream as soon as para_audiod is started.  Once it is running, try
172
173         para_audioc stat
174
175 That should dump some information to stdout. Other commands include
176
177         para_audioc off
178         para_audioc on
179         para_audioc sb
180         para_audioc term
181         para_audioc cycle
182
183
184 Start para_gui
185 ~~~~~~~~~~~~~~
186 para_gui reads the output of "para_audioc stat" and displays that
187 information in a curses window. It also allows you to bind keys to
188 arbitrary commands. There are several flavours of key-bindings:
189
190         o internal: These are the built-in commands that can not be
191         changed (help, quit, loglevel, version...).
192
193         o external: Shutdown curses before launching the given command.
194         Useful for starting other ncurses programs from within
195         para_gui, e.g. aumix or para_dbadm. Or, use
196
197                 para_client mbox
198
199         to write a mailbox containing one mail for each file
200         in the mysql database and start mutt from within para_gui
201         to browse your collection!
202
203         o display: Launch the command and display its stdout in
204         para_gui's bottom window.
205
206         o para: Like display, but start "para_client <specified
207         command>" instead of "<specified command>".
208
209
210 That's all, congratulations. Check out all the other optional gimmics!
211
212 Troubles?
213 ~~~~~~~~~
214 If something went wrong, look at the output. If that does not give
215 you a clue, use loglevel one (option -l 1 for most commands) to show
216 debugging info. Almost all paraslash executables have a brief online
217 help which is displayed by using the -h switch.
218
219 Still not working? Mail the author Andre Noll <maan@systemlinux.org>
220 (english, german, or spanish language). Please provide enough info
221 such as the version of paraslash you are using and relevant parts of
222 the logs.