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