chiark / gitweb /
server: implement multiple-unicast RTP
[disorder] / doc / disorder_config.5.in
... / ...
CommitLineData
1.\"
2.\" Copyright (C) 2004-2011, 2013 Richard Kettlewell
3.\"
4.\" This program is free software: you can redistribute it and/or modify
5.\" it under the terms of the GNU General Public License as published by
6.\" the Free Software Foundation, either version 3 of the License, or
7.\" (at your option) any later version.
8.\"
9.\" This program is distributed in the hope that it will be useful,
10.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
11.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12.\" GNU General Public License for more details.
13.\"
14.\" You should have received a copy of the GNU General Public License
15.\" along with this program. If not, see <http://www.gnu.org/licenses/>.
16.\"
17.TH disorder_config 5
18.SH NAME
19pkgconfdir/config - DisOrder jukebox configuration
20.SH DESCRIPTION
21The purpose of DisOrder is to organize and play digital audio files, under the
22control of multiple users.
23\fIpkgconfdir/config\fR is the primary configuration file; the web interface
24uses a number of others (see \fBdisorder.cgi\fR(8)).
25.SS Tracks
26DisOrder can be configured with multiple collections of tracks, indexing them
27by their filename, and picking players on the basis of filename patterns (for
28instance, "*.mp3").
29.PP
30Although the model is of filenames, it is not inherent that there are
31corresponding real files - merely that they can be interpreted by the chosen
32player.
33See \fBdisorder\fR(3) for more details about this.
34.PP
35Each track can have a set of preferences associated with it.
36These are simple key-value pairs; they can be used for anything you
37like, but a number of keys have specific meanings.
38See \fBdisorder_preferences\fR(5) for more details about these.
39.SS "Track Names"
40Track names are derived from filenames under the control of regular
41expressions, rather than attempting to interpret format-specific embedded name
42information.
43They can be overridden by setting preferences.
44.PP
45Names for display are distinguished from names for sorting, so with the right
46underlying filenames an album can be displayed in its original order even if
47the displayed track titles are not lexically sorted.
48.SS "Server State"
49A collection of global preferences define various bits of server state: whether
50random play is enabled, what tags to check for when picking at random, etc.
51See \fBdisorder_preferences\fR(5) for more information.
52.SS "Users And Access Control"
53DisOrder distinguishes between multiple users.
54This is for access control and reporting, not to provide different
55views of the world: i.e. preferences and so on are global.
56.PP
57Each user has an associated set of rights which control which commands they may
58execute.
59Normally you would give all users most rights, and expect them to
60cooperate (they are after all presumed to be in a shared sound environment).
61.PP
62The full set of rights are:
63.TP
64.B read
65User can perform read-only operations
66.TP
67.B play
68User can add tracks to the queue
69.TP
70.B "move any"
71User can move any track
72.TP
73.B "move mine"
74User can move their own tracks
75.TP
76.B "move random"
77User can move randomly chosen tracks
78.TP
79.B "remove any"
80User can remove any track
81.TP
82.B "remove mine"
83User can remove their own tracks
84.TP
85.B "remove random"
86User can remove randomly chosen tracks
87.TP
88.B "scratch any"
89User can scratch any track
90.TP
91.B "scratch mine"
92User can scratch their own tracks
93.TP
94.B "scratch random"
95User can scratch randomly chosen tracks
96.TP
97.B volume
98User can change the volume
99.TP
100.B admin
101User can perform admin operations
102.TP
103.B rescan
104User can initiate a rescan
105.TP
106.B register
107User can register new users.
108Normally only the
109.B guest
110user would have this right.
111.TP
112.B userinfo
113User can edit their own userinfo
114.TP
115.B prefs
116User can modify track preferences
117.TP
118.B "global prefs"
119User can modify global preferences
120.TP
121.B pause
122User can pause/resume
123.PP
124Access control is entirely used-based.
125If you configure DisOrder to listen for TCP/IP connections then it will
126accept a connection from anywhere provided the right password is
127available.
128Passwords are never transmitted over TCP/IP connections in clear,
129but everything else is.
130The expected model is that host-based access control is imposed at
131the network layer.
132.SS "Web Interface"
133The web interface is controlled by a collection of template files, one for each
134kind of page, and a collection of option files.
135These are split up and separate from the main configuration file to
136.PP
137See \fBdisorder.cgi\fR(8) for more information.
138.SS "Searching And Tags"
139Search strings contain a list of search terms separated by spaces.
140A search term can either be a single word or a tag, prefixed with "tag:".
141.PP
142Search words are compared without regard to letter case or accents; thus, all
143of the following will be considered to be equal to one another:
144.PP
145.nf
146 LATIN CAPITAL LETTER E
147 LATIN SMALL LETTER E
148 LATIN CAPITAL LETTER E WITH GRAVE
149 LATIN SMALL LETTER E WITH GRAVE
150 LATIN CAPITAL LETTER E plus COMBINING GRAVE ACCENT
151 LATIN SMALL LETTER E plus COMBINING GRAVE ACCENT
152.fi
153.PP
154The same rules apply to tags but in addition leading and trailing whitespace is
155disregarded and all whitespace sequences are treated as equal when they appear
156as internal whitespace.
157.PP
158Where several tags are listed, for instance the tags preference for a track,
159the tags are separated by commas.
160Therefore tags may not contain commas.
161.SH "CONFIGURATION FILE"
162.SS "General Syntax"
163Lines are split into fields separated by whitespace (space, tab, line
164feed, carriage return, form feed).
165Comments are started by the number sign ("#").
166.PP
167Fields may be unquoted (in which case they may not contain spaces and
168may not start with a quotation mark or apostrophe) or quoted by either
169quotation marks or apostrophes.
170Inside quoted fields every character stands for itself, except that
171a backslash can only appear as part of one of the following escape sequences:
172.TP
173.B \e\e
174Backslash
175.TP
176.B \e"
177Quotation mark
178.\" "
179.TP
180.B \e\(aq
181Apostrophe
182.TP
183.B \en
184Line feed
185.PP
186No other escape sequences are allowed.
187.PP
188Within any line the first field is a configuration command and any
189further fields are parameters.
190Lines with no fields are ignored.
191.PP
192After editing the config file use \fBdisorder reconfigure\fR to make
193it re-read it.
194If there is anything wrong with it the daemon will record a log
195message and ignore the new config file.
196(You should fix it before next terminating and restarting the daemon,
197as it cannot start up without a valid config file.)
198.SS "Configuration Files"
199Configuration files are read in the following order:
200.TP
201.I pkgconfdir/config
202.TP
203.I pkgconfdir/config.private
204Should be readable only by the jukebox group.
205Not really useful any more and will be abolished in future.
206.TP
207.I ~\fRUSERNAME\fI/.disorder/passwd
208Per-user client configuration.
209Optional but if it exists must be readable only by the relevant user.
210Would normally contain a \fBpassword\fR directive.
211.TP
212.I pkgconfdir/config.\fRUSERNAME
213Per-user system-controlled client configuration.
214Optional but if it exists must be readable only by the relevant user.
215Would normally contain a \fBpassword\fR directive.
216.IP
217The prefererred location for per-user passwords is \fI~/.disorder/passwd\fR and
218\fBdisorder authorize\fR writes there now.
219.SS "Global Configuration"
220.TP
221.B home \fIDIRECTORY\fR
222The home directory for state files.
223Defaults to
224.IR pkgstatedir .
225The server will create this directory on startup if it does not exist.
226.IP
227This setting cannot be changed during the lifetime of the server.
228.TP
229.B plugins \fIPATH\fR
230Adds a directory to the plugin path.
231(This is also used by the web interface.)
232.IP
233Plugins are opened the first time they are required and never after,
234so after changing a plugin you must restart the server before it is
235guaranteed to take effect.
236.IP
237If
238.B plugins
239is used without arguments the plugin path is cleared.
240.SS "Server Configuration"
241.TP
242.B alias \fIPATTERN\fR
243Defines the pattern use construct virtual filenames from \fBtrackname_\fR
244preferences.
245.IP
246Most characters stand for themselves, the exception being \fB{\fR which is used
247to insert a track name part in the form \fB{\fIname\fB}\fR or
248\fB{/\fIname\fB}\fR.
249.IP
250The difference is that the first form just inserts the name part while the
251second prefixes it with a \fB/\fR if it is nonempty.
252.IP
253The pattern should not attempt to include the collection root, which is
254automatically included, but should include the proper extension.
255.IP
256The default is \fB{/artist}{/album}{/title}{ext}\fR.
257.IP
258This setting cannot be changed during the lifetime of the server.
259.TP
260.B api \fINAME\fR
261Selects the backend used to play sound and to set the volume.
262The following options are available:
263.RS
264.TP
265.B alsa
266Use the ALSA API.
267This is only available on Linux systems, on which it is the default.
268.TP
269.B coreaudio
270Use Apple Core Audio.
271This only available on OS X systems, on which it is the default.
272.TP
273.B oss
274Use the OSS (/dev/dsp) API.
275Not available on all platforms.
276.TP
277.B command
278Execute a command.
279This is the default if
280.B speaker_command
281is specified, or if no native is available.
282.IP
283You might want to set
284.B pause_mode
285with this backend.
286.TP
287.B rtp
288Transmit audio over the network.
289This is the default if \fBbroadcast\fR is specified.
290You can use
291.BR disorder-playrtp (1)
292to receive and play the resulting stream on Linux and OS X.
293.B network
294is a deprecated synonym for this API.
295.RE
296.TP
297.B authorization_algorithm \fIALGORITHM\fR
298Defines the algorithm used to authenticate clients.
299The valid options are sha1 (the default), sha256, sha384 and sha512.
300See
301.BR disorder_protocol (5)
302for more details.
303.TP
304.B broadcast \fR[\fIFAMILY\fR] \fIADDRESS\fR \fIPORT\fR
305Transmit sound data to \fIADDRESS\fR using UDP port \fIPORT\fR.
306This implies \fBapi rtp\fR.
307.IP
308\fIFAMILY\fR can be \fB-4\fR or \fB-6\fR to force IPv4 or IPv6, if this is not
309implied by \fIADDRESS\fR.
310Note that IPv6 is not currently well tested.
311.IP
312See also \fBmulticast_loop\fR and \fBmulticast_ttl\fR.
313.TP
314.B broadcast_from \fR[\fIFAMILY\fR] \fIADDRESS\fR \fIPORT\fR
315Sets the (local) source address used by \fBbroadcast\fR.
316.IP
317\fIFAMILY\fR can be \fB-4\fR or \fB-6\fR to force IPv4 or IPv6, if this is not
318implied by \fIADDRESS\fR.
319Note that IPv6 is not currently well tested.
320.TP
321.B channel \fICHANNEL\fR
322The mixer channel that the volume control should use.
323.IP
324For \fBapi oss\fR the possible values are:
325.RS
326.TP 8
327.B pcm
328Output level for the audio device.
329This is probably what you want and is the default.
330.TP
331.B speaker
332Output level for the PC speaker, if that is connected to the sound card.
333.TP
334.B pcm2
335Output level for alternative codec device.
336.TP
337.B vol
338Master output level.
339The OSS documentation recommends against using this, as it affects all
340output devices.
341.RE
342.IP
343You can also specify channels by number, if you know the right value.
344.IP
345For \fBapi alsa\fR, this is the name of the mixer control to use.
346The default is \fBPCM\fR.
347Use \fBamixer scontrols\fR or similar to get a full list.
348.IP
349For \fBapi coreaudio\fR, volume setting is not currently supported.
350.TP
351.B collection \fIMODULE\fR \fIENCODING\fR \fIROOT\fR
352.TP
353.B collection \fIMODULE\fR \fIROOT\fR
354.TP
355.B collection \fIROOT\fR
356Define a collection of tracks.
357.IP
358\fIMODULE\fR defines which plugin module should be used for this
359collection.
360Use the supplied \fBfs\fR module for tracks that exist as ordinary
361files in the filesystem.
362If no \fIMODULE\fR is specified then \fBfs\fR is assumed.
363.IP
364\fIENCODING\fR defines the encoding of filenames in this collection.
365For \fBfs\fR this would be the encoding you use for filenames.
366Examples might be \fBiso\-8859\-1\fR or \fButf\-8\fR.
367If no encoding is specified then the current locale's character encoding
368is used.
369.IP
370NB that this default depends on the locale the server runs in, which is not
371necessarily the same as that of ordinary users, depending how the system is
372configured.
373It's best to explicitly specify it to be certain.
374.IP
375\fIROOT\fR is the root in the filesystem of the filenames and is
376passed to the plugin module.
377It must be an absolute path and should not end with a "/".
378.TP
379.B cookie_key_lifetime \fISECONDS\fR
380Lifetime of the signing key used in constructing cookies. The default is one
381week.
382.IP
383If this is changed during the lifetime of the server, the current key doesn't
384hvave its lifetime retroactively changed.
385.TP
386.B cookie_login_lifetime \fISECONDS\fR
387Lifetime of a cookie enforced by the server. When the cookie expires the user
388will have to log in again even if their browser has remembered the cookie that
389long. The default is one day.
390.IP
391If this is changed during the lifetime of the server, cookies that have already
392een generated don't hvave their lifetime retroactively changed.
393.TP
394.B default_rights \fIRIGHTS\fR
395Defines the set of rights given to new users.
396The argument is a comma-separated list of rights.
397For the possible values see
398.B "Users And Access Control"
399above.
400.IP
401The default is to allow everything except \fBadmin\fR and \fBregister\fR.
402.TP
403.B device \fINAME\fR
404Sound output device.
405.IP
406For \fBapi oss\fR this is the path to the device to use.
407If it is set to \fBdefault\fR then \fI/dev/dsp\fR and \fI/dev/audio\fR
408will be tried.
409.IP
410For \fBapi alsa\fR this is the device name to use.
411.IP
412For \fBapi coreaudio\fR this can be either the UID or the human-readable
413name of the desired device.
414For a list of names, visit System Preferences -> Sound and look at the Type column.
415For example, you might use "Built-in Output" for the built-in speaker
416or "Built-in Line Output" if you have connected external speakers.
417Remember to quote the name.
418.IP
419The default is \fBdefault\fR, which is intended to map to whatever the system's
420default is.
421.TP
422.B history \fIINTEGER\fR
423Specifies the number of recently played tracks to remember (including
424failed tracks and scratches).
425.IP
426If this is changed during the lifetime of the server, it won't actually reduce
427the size of the list until it is next modified.
428.TP
429.B listen \fR[\fIFAMILY\fR] \fR[\fIHOST\fR] \fISERVICE\fR
430Listen for connections on the address specified by \fIHOST\fR and port
431specified by \fISERVICE\fR.
432If \fIHOST\fR is omitted, or is \fB*\fR, then listens on all local addresses.
433.IP
434\fIFAMILY\fR can be \fB-4\fR or \fB-6\fR to force IPv4 or IPv6, if this is not
435implied by \fIHOST\fR.
436Note that IPv6 is not currently well tested.
437.IP
438Normally the server only listens on a UNIX domain socket.
439.TP
440.B mixer \fIDEVICE\fR
441The mixer device name, if it needs to be specified separately from
442\fBdevice\fR.
443.IP
444For \fBapi oss\fR this should be the path to the mixer device and the default
445is \fI/dev/mixer\fR.
446.IP
447For \fBapi alsa\fR, this is the index of the mixer control to use.
448The default is 0.
449.IP
450For \fBapi coreaudio\fR, volume setting is not currently supported.
451.TP
452.B mount_rescan yes\fR|\fBno
453Determines whether mounts and unmounts will cause an automatic rescan.
454The default is \fByes\fR.
455.TP
456.B multicast_loop yes\fR|\fBno
457Determines whether multicast packets are loop backed to the sending host.
458The default is \fByes\fR.
459This only applies if \fBapi\fR is set to \fBrtp\fR and \fBbroadcast\fR
460is actually a multicast address.
461.TP
462.B multicast_ttl \fIHOPS\fR
463Set the maximum number of hops to send multicast packets.
464This only applies if \fBapi\fR is set to \fBrtp\fR and
465\fBbroadcast\fR is actually a multicast address.
466The default is 1.
467.TP
468.B namepart \fIPART\fR \fIREGEXP\fR \fISUBST\fR [\fICONTEXT\fR [\fIREFLAGS\fR]]
469Determines how to extract trackname part \fIPART\fR from a
470track name (with the collection root part removed).
471Used in \fB@recent@\fR, \fB@playing@\fR and \fB@search@\fR.
472.IP
473Track names can be different in different contexts.
474For instance the sort string might include an initial track number,
475but this would be stripped for the display string.
476\fICONTEXT\fR should be a glob pattern matching the
477contexts in which this directive will be used.
478.IP
479Valid contexts are \fBsort\fR and \fBdisplay\fR.
480.IP
481All the \fBnamepart\fR directives are considered in order.
482The first directive for the right part, that matches the desired context,
483and with a \fIREGEXP\fR that
484matches the track is used, and the value chosen is constructed from
485\fISUBST\fR according to the substitution rules below.
486.IP
487Note that searches use the raw track name and \fBtrackname_\fR preferences but
488not (currently) the results of \fBnamepart\fR, so generating words via this option
489that aren't in the original track name will lead to confusing results.
490.IP
491If you supply no \fBnamepart\fR directives at all then a default set will be
492supplied automatically.
493But if you supply even one then you must supply all of them.
494The defaults are equivalent to:
495.PP
496.nf
497namepart title "/([0-9]+ *[-:] *)?([^/]+)\\.[a-zA-Z0-9]+$" $2 display
498namepart title "/([^/]+)\\.[a-zA-Z0-9]+$" $1 sort
499namepart album "/([^/]+)/[^/]+$" $1 *
500namepart artist "/([^/]+)/[^/]+/[^/]+$" $1 *
501namepart ext "(\\.[a-zA-Z0-9]+)$" $1 *
502.fi
503.IP
504This setting cannot be changed during the lifetime of the server.
505.TP
506.B new_bias \fIWEIGHT\fR
507The weight for new tracks.
508The default is 450000, i.e. recently added tracks are a fifty times as likely
509to be picked as normal.
510.IP
511New values of this option may be picked up from the configuration file even
512without a reload.
513.TP
514.B new_bias_age \fISECONDS\fR
515The maximum age of tracks that \fBnew_bias\fR applies to, in seconds.
516The default is one week.
517.IP
518New values of this option may be picked up from the configuration file even
519without a reload.
520.TP
521.B new_max \fIMAX\fR
522The maximum number of tracks to list when reporting newly noticed tracks.
523The default is 100.
524.TP
525.B nice_rescan \fIPRIORITY\fR
526Set the recan subprocess priority.
527The default is 10.
528.IP
529(Note that higher values mean the process gets less CPU time; UNIX priority
530values are backwards.)
531.TP
532.B nice_server \fIPRIORITY\fR
533Set the server priority.
534This is applied to the server at startup time (and not when you reload
535configuration).
536The server does not use much CPU itself but this value is inherited
537by programs it executes.
538If you have limited CPU then it might help to set this to a small
539negative value.
540The default is 0.
541.IP
542Changes to this value during the lifetime of the server are ignored.
543.TP
544.B nice_speaker \fIPRIORITY\fR
545Set the speaker process priority.
546This is applied to the speaker process at startup time (and not when
547you reload the configuration).
548The speaker process is not massively CPU intensive by today's
549standards but depends on reasonably timely scheduling.
550If you have limited CPU then it might help to set this to a small
551negative value.
552The default is 0.
553.IP
554Changes to this value during the lifetime of the server are ignored.
555.TP
556.B noticed_history
557The maximum days that a track can survive in the database of newly added
558tracks.
559The default is 31.
560.TP
561.B pause_mode \fIMODE
562Sets the pause mode for the \fBcommand\fR backend.
563The possible values are:
564.RS
565.TP
566.B silence
567Send silent (0-value) samples when paused.
568This is the default.
569.TP
570.B suspend
571Stop writing when paused.
572.RE
573.TP
574.B player \fIPATTERN\fR \fIMODULE\fR [\fIOPTIONS.. [\fB\-\-\fR]] \fIARGS\fR...
575Specifies the player for files matching the glob \fIPATTERN\fR.
576\fIMODULE\fR specifies which plugin module to use.
577.IP
578The following options are supported:
579.RS
580.TP
581.B \-\-
582Defines the end of the list of options.
583Needed if the first argument to the plugin starts with a "\-".
584.RE
585.IP
586The following are the standard modules:
587.RS
588.TP
589.B exec \fICOMMAND\fR \fIARGS\fR...
590The command is executed via \fBexecvp\fR(3), not via the shell.
591The \fBPATH\fR environment variable is searched for the executable if it is not
592an absolute path.
593The command is expected to know how to open its own sound device.
594.TP
595.B execraw \fICOMMAND\fR \fIARGS\fR...
596Identical to the \fBexec\fR except that the player is expected to use the
597DisOrder raw player protocol.
598.BR disorder-decode (8)
599can decode several common audio file formats to this format.
600.TP
601.B shell \fR[\fISHELL\fR] \fICOMMAND\fR
602The command is executed using the shell.
603If \fISHELL\fR is specified then that is used, otherwise \fBsh\fR will be used.
604In either case the \fBPATH\fR environment variable is searched for the shell
605executable if it is not an absolute path.
606The track name is stored in the environment variable
607\fBTRACK\fR.
608.IP
609Be careful of the interaction between the configuration file quoting rules and
610the shell quoting rules.
611.RE
612.IP
613If multiple player commands match a track then the first match is used.
614.IP
615For the server to be able to calculate track lengths, there should be a
616.B tracklength
617command corresponding to each
618.B player
619command.
620.IP
621If
622.B player
623is used without arguments, the list of players is cleared.
624.IP
625Although players can be changed during the lifetime of the server, note that
626background decoders will not be stopped and restarted using changed
627configuration once they have been started.
628.TP
629.B queue_pad \fICOUNT\fR
630The target size of the queue.
631If random play is enabled then randomly picked tracks will be added until
632the queue is at least this big.
633The default is 10.
634.IP
635If this is reduced during the lifetime of the server, the queue won't be
636reduced in size to fit; it just won't start growing again until it is under the
637new value.
638However, if it is increased, new tracks will start being added immediately.
639.TP
640.B reminder_interval \fISECONDS\fR
641The minimum number of seconds that must elapse between password reminders.
642The default is 600, i.e. 10 minutes.
643.TP
644.B remote_userman yes\fR|\fBno
645User management over TCP connection is only allowed if this is set to
646\fByes\fR. By default it is set to \fBno\fR.
647.TP
648.B replay_min \fISECONDS\fR
649The minimum number of seconds that must elapse after a track has been played
650before it can be picked at random. The default is 8 hours. If this is set to
6510 then there is no limit, though current \fBdisorder-choose\fR will not pick
652anything currently listed in the recently-played list.
653.IP
654New values of this option may be picked up from the configuration file even
655without a reload.
656.TP
657.B rtp_mode \fIMODE\fR
658The network transmission mode for the \fBrtp\fR backend.
659Possible values are:
660.RS
661.TP
662.B unicast
663Unicast transmission to the address given by \fBbroadcast\fR.
664.TP
665.B broadcast
666Broadcast transmission to the address given by \fBbroadcast\fR.
667.TP
668.B multicast
669Multicast transmission to the address given by \fBbroadcast\fR.
670.TP
671.B request
672Unicast transmission to addresses requested by clients.
673.TP
674.B auto
675Choose one of the above based on the destination address.
676This is the default, for backwards compatibility reasons.
677.RE
678.TP
679.B sample_format \fIBITS\fB/\fIRATE\fB/\fICHANNELS
680Describes the sample format expected by the \fBspeaker_command\fR (below).
681The components of the format specification are as follows:
682.RS
683.TP 10
684.I BITS
685The number of bits per sample.
686Optionally, may be suffixed by \fBb\fR or \fBl\fR for big-endian and
687little-endian words.
688If neither is used the native byte order is assumed.
689.TP
690.I RATE
691The number of samples per second.
692.TP
693.I CHANNELS
694The number of channels.
695.PP
696The default is
697.BR 16/44100/2 .
698.PP
699With the
700.B rtp
701backend the sample format is forced to
702.B 16b/44100/2
703and with the
704.B coreaudio
705backend it is forced to
706.BR 16/44100/2 ,
707in both cases regardless of what is specified in the configuration file.
708.RE
709.TP
710.B signal \fINAME\fR
711Defines the signal to be sent to track player process groups when tracks are
712scratched.
713The default is \fBSIGKILL\fR.
714.IP
715Signals are specified by their full C name, i.e. \fBSIGINT\fR and not \fBINT\fR
716or \fBInterrupted\fR or whatever.
717.TP
718.B sox_generation \fB0\fR|\fB1
719Determines whether calls to \fBsox\fR(1) should use \fB\-b\fR, \fB\-x\fR, etc (if
720the generation is 0) or \fB\-\fIbits\fR, \fB\-L\fR etc (if it is 1).
721See the documentation for your installed copy of \fBsox\fR to determine
722which you need.
723The default is set according to the version of sox found when DisOrder was
724built.
725If you run on a system with a different version of sox, you will need to
726set this option.
727.TP
728.B speaker_backend \fINAME
729This is an alias for \fBapi\fR; see above.
730.TP
731.B speaker_command \fICOMMAND
732Causes the speaker subprocess to pipe audio data into shell command
733\fICOMMAND\fR, rather than writing to a local sound card.
734The sample format is determine by
735.B sample_format
736above.
737.IP
738Note that if the sample format is wrong then
739.BR sox (1)
740is invoked to translate it.
741If
742.B sox
743is not installed then this will not work.
744.TP
745.B scratch \fIPATH\fR
746Specifies a scratch.
747When a track is scratched, a scratch track is played at random.
748Scratches are played using the same logic as other tracks.
749.IP
750At least for the time being, path names of scratches must be encoded using
751UTF-8 (which means that ASCII will do).
752.IP
753If \fBscratch\fR is used without arguments then the list of scratches is
754cleared.
755.TP
756.B stopword \fIWORD\fR ...
757Specifies one or more stopwords that should not take part in searches
758over track names.
759.IP
760If \fBstopword\fR is used without arguments then the list of stopwords is
761cleared.
762.IP
763There is a default set of stopwords built in, but this option can be used to
764augment or replace that list.
765.IP
766This setting cannot be changed during the lifetime of the server.
767.TP
768.B tracklength \fIPATTERN\fR \fIMODULE\fR
769Specifies the module used to calculate the length of files matching
770\fIPATTERN\fR.
771\fIMODULE\fR specifies which plugin module to use.
772.IP
773If \fBtracklength\fR is used without arguments then the list of modules is
774cleared.
775.IP
776Track lengths are cached in the database, and changing this setting won't cause
777them to be regenerated.
778.TP
779.B user \fIUSERNAME\fR
780Specifies the user to run as.
781Only makes sense if invoked as root (or the target user).
782.IP
783This setting cannot be changed during the lifetime of the server
784(and if it is changed with a restart, you will need to adjust file permissions
785on the server's database).
786.SS "Client Configuration"
787These options would normally be used in \fI~\fRUSERNAME\fI/.disorder/passwd\fR
788or
789\fIpkgconfdir/config.\fRUSERNAME.
790.TP
791.B connect \fR[\fIFAMILY\fR] \fIHOST SERVICE\fR
792Connect to the address specified by \fIHOST\fR and port specified by
793\fISERVICE\fR.
794.IP
795\fIFAMILY\fR can be \fB-4\fR or \fB-6\fR to force IPv4 or IPv6, if this is not
796implied by \fIHOST\fR.
797Note that IPv6 is not currently well tested.
798.TP
799.B password \fIPASSWORD\fR
800Specify password.
801.TP
802.B username \fIUSERNAME\fR
803Specify username.
804The default is inferred from the current UID.
805.SS "Web Interface Configuration"
806.\" TODO this section is misnamed really...
807.TP
808.B mail_sender \fIADDRESS\fR
809The email address that appears in the From: field of any mail messages sent by
810the web interface.
811This must be set if you have online registration enabled.
812.TP
813.B refresh \fISECONDS\fR
814Specifies the maximum refresh period in seconds.
815The refresh period is the time after which the web interface's queue and manage
816pages will automatically reload themselves.
817Default 15.
818.TP
819.B refresh_min \fISECONDS\fR
820Specifies the minimum refresh period in seconds.
821Default 1.
822.TP
823.B sendmail \fIPATH\fR
824The path to the Sendmail executable.
825This must support the \fB-bs\fR option (Postfix, Exim and Sendmail should all
826work).
827The default is the sendmail executable found at compile time.
828.TP
829.B short_display \fICHARACTERS\fR
830Defines the maximum number of characters to include in a \fBshort\fR name
831part.
832Default 30.
833.TP
834.B smtp_server \fIHOSTNAME\fR
835The hostname (or address) of the SMTP server to use for sending mail.
836The default is 127.0.0.1.
837If \fBsendmail\fR is set then that is used instead.
838.TP
839.B transform \fITYPE\fR \fIREGEXP\fR \fISUBST\fR [\fICONTEXT\fR [\fIREFLAGS\fR]]
840Determines how names are sorted and displayed in track choice displays.
841.IP
842\fITYPE\fR is the type of transformation; usually \fBtrack\fR or
843\fBdir\fR but you can define your own.
844.IP
845\fICONTEXT\fR is a glob pattern matching the context.
846Standard contexts are \fBsort\fR (which determines how directory names
847are sorted) and \fBdisplay\fR (which determines how they are displayed).
848Again, you can define your own.
849.IP
850All the \fBtransform\fR directives are considered in order.
851If the \fITYPE\fR, \fIREGEXP\fR and the \fICONTEXT\fR match
852then a new track name is constructed from
853\fISUBST\fR according to the substitution rules below.
854If several match then each is executed in order.
855.IP
856If you supply no \fBtransform\fR directives at all then a default set will be
857supplied automatically.
858But if you supply even one then you must supply all of them.
859The defaults are:
860.PP
861.nf
862transform track "^.*/([0-9]+ *[-:] *)?([^/]+)\\.[a-zA-Z0-9]+$" $2 display
863transform track "^.*/([^/]+)\\.[a-zA-Z0-9]+$" $1 sort
864transform dir "^.*/([^/]+)$" $1 *
865transform dir "^(the) ([^/]*)" "$2 $1" sort i
866transform dir "[[:punct:]]" "" sort g
867.fi
868.TP
869.B url \fIURL\fR
870Specifies the URL of the web interface.
871This URL will be used in generated web pages.
872The default is inferred at runtime, so this option no
873longer needs to be specified.
874.IP
875This must be the full URL, e.g. \fBhttp://myhost/cgi-bin/jukebox\fR and not
876\fB/cgi-bin/jukebox\fR.
877.SH "REGEXP SUBSTITUTION RULES"
878Regexps are PCRE regexps, as defined in \fBpcrepattern\fR(3).
879The only option used is \fBPCRE_UTF8\fR.
880Remember that the configuration file syntax means you have to
881escape backslashes and quotes inside quoted strings.
882.PP
883In a \fISUBST\fR string the following sequences are interpreted
884specially:
885.TP
886.B $1 \fR... \fB$9
887These expand to the first to ninth bracketed subexpression.
888.TP
889.B $&
890This expands to the matched part of the subject string.
891.TP
892.B $$
893This expands to a single \fB$\fR symbol.
894.PP
895All other pairs starting with \fB$\fR are undefined (and might be used
896for something else in the future, so don't rely on the current
897behaviour.)
898.PP
899If \fBi\fR is present in \fIREFLAGS\fR then the match is case-independent.
900If \fBg\fR is present then all matches are replaced, otherwise only the first
901match is replaced.
902.SH "TRACK NAME PARTS"
903The traditional track name parts are \fBartist\fR, \fBalbum\fR and \fBtitle\fR,
904with the obvious intended meaning.
905These are controlled by configuration and by \fBtrackname_\fR preferences.
906.PP
907In addition there are two built-in parts, \fBpath\fR which is the whole path
908name and \fBext\fR which is the filename extension, including the initial dot
909(or the empty string if there is not extension).
910.SH "SEE ALSO"
911\fBdisorder\fR(1), \fBsox\fR(1), \fBdisorderd\fR(8), \fBdisorder\-dump\fR(8),
912\fBpcrepattern\fR(3), \fBdisorder_templates\fR(5), \fBdisorder_actions\fR(5),
913\fBdisorder.cgi\fR(8), \fBdisorder_preferences\fR(5)
914.\" Local Variables:
915.\" mode:nroff
916.\" fill-column:79
917.\" End: