chiark / gitweb /
lib/configuration.c, lib/home.c: Introduce environment variables.
[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
202Or
203.BR $DISORDER_CONFIG ,
204if that's set; overridden by
205.B \-c
206.RB ( \-\-config )
207command line option, except in
208.BR disrder-playrtp (1),
209which uses
210.BR \-C .
211.TP
212.I pkgconfdir/config.private
213Or
214.BR $DISORDER_PRIVCONFIG ,
215if that's set, else
216.BR $DISORDER_CONFIG.private .
217Should be readable only by the jukebox group.
218Not really useful any more and will be abolished in future.
219.TP
220.I ~\fRUSERNAME\fI/.disorder/passwd
221Or
222.BR $DISORDER_USERCONFIG ,
223if that's set; else
224.BR $DISORDER_HOME/passwd .
225Per-user client configuration.
226Optional but if it exists must be readable only by the relevant user.
227Would normally contain a \fBpassword\fR directive.
228.TP
229.I pkgconfdir/config.\fRUSERNAME
230(Or
231.BR $DISORDER_USERCONFIG_SYS ,
232if that's set; else
233.BR $DISORDER_CONFIG.\fIUSERNAME .)
234Per-user system-controlled client configuration.
235Optional but if it exists must be readable only by the relevant user.
236Would normally contain a \fBpassword\fR directive.
237.IP
238The prefererred location for per-user passwords is \fI~/.disorder/passwd\fR and
239\fBdisorder authorize\fR writes there now.
240.SS "Global Configuration"
241.TP
242.B home \fIDIRECTORY\fR
243The home directory for state files.
244Defaults to
245.IR pkgstatedir .
246The server will create this directory on startup if it does not exist.
247.IP
248This setting cannot be changed during the lifetime of the server.
249.TP
250.B plugins \fIPATH\fR
251Adds a directory to the plugin path.
252(This is also used by the web interface.)
253.IP
254Plugins are opened the first time they are required and never after,
255so after changing a plugin you must restart the server before it is
256guaranteed to take effect.
257.IP
258If
259.B plugins
260is used without arguments the plugin path is cleared.
261.SS "Server Configuration"
262.TP
263.B alias \fIPATTERN\fR
264Defines the pattern use construct virtual filenames from \fBtrackname_\fR
265preferences.
266.IP
267Most characters stand for themselves, the exception being \fB{\fR which is used
268to insert a track name part in the form \fB{\fIname\fB}\fR or
269\fB{/\fIname\fB}\fR.
270.IP
271The difference is that the first form just inserts the name part while the
272second prefixes it with a \fB/\fR if it is nonempty.
273.IP
274The pattern should not attempt to include the collection root, which is
275automatically included, but should include the proper extension.
276.IP
277The default is \fB{/artist}{/album}{/title}{ext}\fR.
278.IP
279This setting cannot be changed during the lifetime of the server.
280.TP
281.B api \fINAME\fR
282Selects the backend used to play sound and to set the volume.
283The following options are available:
284.RS
285.TP
286.B alsa
287Use the ALSA API.
288This is only available on Linux systems, on which it is the default.
289.TP
290.B coreaudio
291Use Apple Core Audio.
292This only available on OS X systems, on which it is the default.
293.TP
294.B oss
295Use the OSS (/dev/dsp) API.
296Not available on all platforms.
297.TP
298.B command
299Execute a command.
300This is the default if
301.B speaker_command
302is specified, or if no native is available.
303.IP
304You might want to set
305.B pause_mode
306with this backend.
307.TP
308.B rtp
309Transmit audio over the network.
310This is the default if \fBbroadcast\fR is specified.
311You can use
312.BR disorder-playrtp (1)
313to receive and play the resulting stream on Linux and OS X.
314.B network
315is a deprecated synonym for this API.
316.RE
317.TP
318.B authorization_algorithm \fIALGORITHM\fR
319Defines the algorithm used to authenticate clients.
320The valid options are sha1 (the default), sha256, sha384 and sha512.
321See
322.BR disorder_protocol (5)
323for more details.
324.TP
325.B broadcast \fR[\fIFAMILY\fR] \fIADDRESS\fR \fIPORT\fR
326Transmit sound data to \fIADDRESS\fR using UDP port \fIPORT\fR.
327This implies \fBapi rtp\fR.
328.IP
329\fIFAMILY\fR can be \fB-4\fR or \fB-6\fR to force IPv4 or IPv6, if this is not
330implied by \fIADDRESS\fR.
331Note that IPv6 is not currently well tested.
332.IP
333See also \fBmulticast_loop\fR and \fBmulticast_ttl\fR.
334.TP
335.B broadcast_from \fR[\fIFAMILY\fR] \fIADDRESS\fR \fIPORT\fR
336Sets the (local) source address used by \fBbroadcast\fR.
337.IP
338\fIFAMILY\fR can be \fB-4\fR or \fB-6\fR to force IPv4 or IPv6, if this is not
339implied by \fIADDRESS\fR.
340Note that IPv6 is not currently well tested.
341.TP
342.B channel \fICHANNEL\fR
343The mixer channel that the volume control should use.
344.IP
345For \fBapi oss\fR the possible values are:
346.RS
347.TP 8
348.B pcm
349Output level for the audio device.
350This is probably what you want and is the default.
351.TP
352.B speaker
353Output level for the PC speaker, if that is connected to the sound card.
354.TP
355.B pcm2
356Output level for alternative codec device.
357.TP
358.B vol
359Master output level.
360The OSS documentation recommends against using this, as it affects all
361output devices.
362.RE
363.IP
364You can also specify channels by number, if you know the right value.
365.IP
366For \fBapi alsa\fR, this is the name of the mixer control to use.
367The default is \fBPCM\fR.
368Use \fBamixer scontrols\fR or similar to get a full list.
369.IP
370For \fBapi coreaudio\fR, volume setting is not currently supported.
371.TP
372.B collection \fIMODULE\fR \fIENCODING\fR \fIROOT\fR
373.TP
374.B collection \fIMODULE\fR \fIROOT\fR
375.TP
376.B collection \fIROOT\fR
377Define a collection of tracks.
378.IP
379\fIMODULE\fR defines which plugin module should be used for this
380collection.
381Use the supplied \fBfs\fR module for tracks that exist as ordinary
382files in the filesystem.
383If no \fIMODULE\fR is specified then \fBfs\fR is assumed.
384.IP
385\fIENCODING\fR defines the encoding of filenames in this collection.
386For \fBfs\fR this would be the encoding you use for filenames.
387Examples might be \fBiso\-8859\-1\fR or \fButf\-8\fR.
388If no encoding is specified then the current locale's character encoding
389is used.
390.IP
391NB that this default depends on the locale the server runs in, which is not
392necessarily the same as that of ordinary users, depending how the system is
393configured.
394It's best to explicitly specify it to be certain.
395.IP
396\fIROOT\fR is the root in the filesystem of the filenames and is
397passed to the plugin module.
398It must be an absolute path and should not end with a "/".
399.TP
400.B cookie_key_lifetime \fISECONDS\fR
401Lifetime of the signing key used in constructing cookies. The default is one
402week.
403.IP
404If this is changed during the lifetime of the server, the current key doesn't
405hvave its lifetime retroactively changed.
406.TP
407.B cookie_login_lifetime \fISECONDS\fR
408Lifetime of a cookie enforced by the server. When the cookie expires the user
409will have to log in again even if their browser has remembered the cookie that
410long. The default is one day.
411.IP
412If this is changed during the lifetime of the server, cookies that have already
413een generated don't hvave their lifetime retroactively changed.
414.TP
415.B default_rights \fIRIGHTS\fR
416Defines the set of rights given to new users.
417The argument is a comma-separated list of rights.
418For the possible values see
419.B "Users And Access Control"
420above.
421.IP
422The default is to allow everything except \fBadmin\fR and \fBregister\fR.
423.TP
424.B device \fINAME\fR
425Sound output device.
426.IP
427For \fBapi oss\fR this is the path to the device to use.
428If it is set to \fBdefault\fR then \fI/dev/dsp\fR and \fI/dev/audio\fR
429will be tried.
430.IP
431For \fBapi alsa\fR this is the device name to use.
432.IP
433For \fBapi coreaudio\fR this can be either the UID or the human-readable
434name of the desired device.
435For a list of names, visit System Preferences -> Sound and look at the Type column.
436For example, you might use "Built-in Output" for the built-in speaker
437or "Built-in Line Output" if you have connected external speakers.
438Remember to quote the name.
439.IP
440The default is \fBdefault\fR, which is intended to map to whatever the system's
441default is.
442.TP
443.B history \fIINTEGER\fR
444Specifies the number of recently played tracks to remember (including
445failed tracks and scratches).
446.IP
447If this is changed during the lifetime of the server, it won't actually reduce
448the size of the list until it is next modified.
449.TP
450.B listen \fR[\fIFAMILY\fR] \fR[\fIHOST\fR] \fISERVICE\fR
451Listen for connections on the address specified by \fIHOST\fR and port
452specified by \fISERVICE\fR.
453If \fIHOST\fR is omitted, or is \fB*\fR, then listens on all local addresses.
454.IP
455\fIFAMILY\fR can be \fB-4\fR or \fB-6\fR to force IPv4 or IPv6, if this is not
456implied by \fIHOST\fR.
457Note that IPv6 is not currently well tested.
458.IP
459Normally the server only listens on a UNIX domain socket.
460.TP
461.B mixer \fIDEVICE\fR
462The mixer device name, if it needs to be specified separately from
463\fBdevice\fR.
464.IP
465For \fBapi oss\fR this should be the path to the mixer device and the default
466is \fI/dev/mixer\fR.
467.IP
468For \fBapi alsa\fR, this is the index of the mixer control to use.
469The default is 0.
470.IP
471For \fBapi coreaudio\fR, volume setting is not currently supported.
472.TP
473.B mount_rescan yes\fR|\fBno
474Determines whether mounts and unmounts will cause an automatic rescan.
475The default is \fByes\fR.
476.TP
477.B multicast_loop yes\fR|\fBno
478Determines whether multicast packets are loop backed to the sending host.
479The default is \fByes\fR.
480This only applies if \fBapi\fR is set to \fBrtp\fR and \fBbroadcast\fR
481is actually a multicast address.
482.TP
483.B multicast_ttl \fIHOPS\fR
484Set the maximum number of hops to send multicast packets.
485This only applies if \fBapi\fR is set to \fBrtp\fR and
486\fBbroadcast\fR is actually a multicast address.
487The default is 1.
488.TP
489.B namepart \fIPART\fR \fIREGEXP\fR \fISUBST\fR [\fICONTEXT\fR [\fIREFLAGS\fR]]
490Determines how to extract trackname part \fIPART\fR from a
491track name (with the collection root part removed).
492Used in \fB@recent@\fR, \fB@playing@\fR and \fB@search@\fR.
493.IP
494Track names can be different in different contexts.
495For instance the sort string might include an initial track number,
496but this would be stripped for the display string.
497\fICONTEXT\fR should be a glob pattern matching the
498contexts in which this directive will be used.
499.IP
500Valid contexts are \fBsort\fR and \fBdisplay\fR.
501.IP
502All the \fBnamepart\fR directives are considered in order.
503The first directive for the right part, that matches the desired context,
504and with a \fIREGEXP\fR that
505matches the track is used, and the value chosen is constructed from
506\fISUBST\fR according to the substitution rules below.
507.IP
508Note that searches use the raw track name and \fBtrackname_\fR preferences but
509not (currently) the results of \fBnamepart\fR, so generating words via this option
510that aren't in the original track name will lead to confusing results.
511.IP
512If you supply no \fBnamepart\fR directives at all then a default set will be
513supplied automatically.
514But if you supply even one then you must supply all of them.
515The defaults are equivalent to:
516.PP
517.nf
518namepart title "/([0-9]+ *[-:] *)?([^/]+)\\.[a-zA-Z0-9]+$" $2 display
519namepart title "/([^/]+)\\.[a-zA-Z0-9]+$" $1 sort
520namepart album "/([^/]+)/[^/]+$" $1 *
521namepart artist "/([^/]+)/[^/]+/[^/]+$" $1 *
522namepart ext "(\\.[a-zA-Z0-9]+)$" $1 *
523.fi
524.IP
525This setting cannot be changed during the lifetime of the server.
526.TP
527.B new_bias \fIWEIGHT\fR
528The weight for new tracks.
529The default is 450000, i.e. recently added tracks are a fifty times as likely
530to be picked as normal.
531.IP
532New values of this option may be picked up from the configuration file even
533without a reload.
534.TP
535.B new_bias_age \fISECONDS\fR
536The maximum age of tracks that \fBnew_bias\fR applies to, in seconds.
537The default is one week.
538.IP
539New values of this option may be picked up from the configuration file even
540without a reload.
541.TP
542.B new_max \fIMAX\fR
543The maximum number of tracks to list when reporting newly noticed tracks.
544The default is 100.
545.TP
546.B nice_rescan \fIPRIORITY\fR
547Set the recan subprocess priority.
548The default is 10.
549.IP
550(Note that higher values mean the process gets less CPU time; UNIX priority
551values are backwards.)
552.TP
553.B nice_server \fIPRIORITY\fR
554Set the server priority.
555This is applied to the server at startup time (and not when you reload
556configuration).
557The server does not use much CPU itself but this value is inherited
558by programs it executes.
559If you have limited CPU then it might help to set this to a small
560negative value.
561The default is 0.
562.IP
563Changes to this value during the lifetime of the server are ignored.
564.TP
565.B nice_speaker \fIPRIORITY\fR
566Set the speaker process priority.
567This is applied to the speaker process at startup time (and not when
568you reload the configuration).
569The speaker process is not massively CPU intensive by today's
570standards but depends on reasonably timely scheduling.
571If you have limited CPU then it might help to set this to a small
572negative value.
573The default is 0.
574.IP
575Changes to this value during the lifetime of the server are ignored.
576.TP
577.B noticed_history
578The maximum days that a track can survive in the database of newly added
579tracks.
580The default is 31.
581.TP
582.B pause_mode \fIMODE
583Sets the pause mode for the \fBcommand\fR backend.
584The possible values are:
585.RS
586.TP
587.B silence
588Send silent (0-value) samples when paused.
589This is the default.
590.TP
591.B suspend
592Stop writing when paused.
593.RE
594.TP
595.B player \fIPATTERN\fR \fIMODULE\fR [\fIOPTIONS.. [\fB\-\-\fR]] \fIARGS\fR...
596Specifies the player for files matching the glob \fIPATTERN\fR.
597\fIMODULE\fR specifies which plugin module to use.
598.IP
599The following options are supported:
600.RS
601.TP
602.B \-\-
603Defines the end of the list of options.
604Needed if the first argument to the plugin starts with a "\-".
605.RE
606.IP
607The following are the standard modules:
608.RS
609.TP
610.B exec \fICOMMAND\fR \fIARGS\fR...
611The command is executed via \fBexecvp\fR(3), not via the shell.
612The \fBPATH\fR environment variable is searched for the executable if it is not
613an absolute path.
614The command is expected to know how to open its own sound device.
615.TP
616.B execraw \fICOMMAND\fR \fIARGS\fR...
617Identical to the \fBexec\fR except that the player is expected to use the
618DisOrder raw player protocol.
619.BR disorder-decode (8)
620can decode several common audio file formats to this format.
621.TP
622.B shell \fR[\fISHELL\fR] \fICOMMAND\fR
623The command is executed using the shell.
624If \fISHELL\fR is specified then that is used, otherwise \fBsh\fR will be used.
625In either case the \fBPATH\fR environment variable is searched for the shell
626executable if it is not an absolute path.
627The track name is stored in the environment variable
628\fBTRACK\fR.
629.IP
630Be careful of the interaction between the configuration file quoting rules and
631the shell quoting rules.
632.RE
633.IP
634If multiple player commands match a track then the first match is used.
635.IP
636For the server to be able to calculate track lengths, there should be a
637.B tracklength
638command corresponding to each
639.B player
640command.
641.IP
642If
643.B player
644is used without arguments, the list of players is cleared.
645.IP
646Although players can be changed during the lifetime of the server, note that
647background decoders will not be stopped and restarted using changed
648configuration once they have been started.
649.TP
650.B queue_pad \fICOUNT\fR
651The target size of the queue.
652If random play is enabled then randomly picked tracks will be added until
653the queue is at least this big.
654The default is 10.
655.IP
656If this is reduced during the lifetime of the server, the queue won't be
657reduced in size to fit; it just won't start growing again until it is under the
658new value.
659However, if it is increased, new tracks will start being added immediately.
660.TP
661.B reminder_interval \fISECONDS\fR
662The minimum number of seconds that must elapse between password reminders.
663The default is 600, i.e. 10 minutes.
664.TP
665.B remote_userman yes\fR|\fBno
666User management over TCP connection is only allowed if this is set to
667\fByes\fR. By default it is set to \fBno\fR.
668.TP
669.B replay_min \fISECONDS\fR
670The minimum number of seconds that must elapse after a track has been played
671before it can be picked at random. The default is 8 hours. If this is set to
6720 then there is no limit, though current \fBdisorder-choose\fR will not pick
673anything currently listed in the recently-played list.
674.IP
675New values of this option may be picked up from the configuration file even
676without a reload.
677.TP
678.B rtp_always_request yes\fR|\fBno
679If
680.B yes
681then
682.BR disorder-playrtp (1)
683will always request a dedicated RTP stream,
684rather than contacting the server to discover
685a broadcast or multicast address.
686(This behaviour can be overridden by
687setting a suitable address on the command-line.)
688The default is
689.BR no .
690.IP
691This option is experimental,
692and may change or be removed in a future release.
693.TP
694.B rtp_maxbuffer \fIFRAMES\fR
695Set
696.BR disorder-playrtp (1)'s
697buffer size to the given number of
698.IR FRAMES .
699If this is zero, then
700.B disorder-playrtp
701will select a default buffer size.
702(This setting can be overridden by passing
703a suitable command-line option.)
704The default value is
705.BR 0 .
706.IP
707This option is experimental,
708and may change or be removed in a future release.
709.TP
710.B rtp_max_payload \fBYTES\fR
711Don't send RTP packets with a UDP payload larger than
712.I BYTES
713(including the 12-byte RTP header). If you know that you will be transmitting
714RTP over networks with an unusually low MTU size, then it is probably useful to
715set this option.
716.IP
717This option is experimental,
718and may change or be removed in a future release.
719.TP
720.B rtp_minbuffer \fIFRAMES\fR
721Set
722.BR disorder-playrtp (1)'s
723buffer low-water-mark to the given number of
724.IR FRAMES .
725If this is zero, then
726.B disorder-playrtp
727will select a default low-water-mark.
728(This setting can be overridden by passing
729a suitable command-line option.)
730.IP
731This option is experimental,
732and may change or be removed in a future release.
733The default value is
734.BR 0 .
735.IP
736This option is experimental, and may change or be removed in a future release.
737.TP
738.B rtp_mode \fIMODE\fR
739The network transmission mode for the \fBrtp\fR backend.
740Possible values are:
741.RS
742.TP
743.B unicast
744Unicast transmission to the address given by \fBbroadcast\fR.
745.TP
746.B broadcast
747Broadcast transmission to the address given by \fBbroadcast\fR.
748.TP
749.B multicast
750Multicast transmission to the address given by \fBbroadcast\fR.
751.TP
752.B request
753Unicast transmission to addresses requested by clients.
754.TP
755.B auto
756Choose one of the above based on the destination address.
757This is the default, for backwards compatibility reasons.
758.RE
759.TP
760.B rtp_mtu_discovery \fIOPTION\fR
761Control whether the system attemps path-MTU discovery using RTP packets
762transmitted over IPv4. (This is not configurable in IPv6.) Possible values
763are:
764.RS
765.TP
766.B default
767Do whatever the kernel usually does with UDP packets. This is, err, the
768default.
769.TP
770.B yes
771Force path-MTU disocvery. The `don't fragment' bit is set on outgoing packets
772and we assume that the kernel will handle ICMP `fragmentation needed' errors
773coming back and fragment accordingly.
774.TP
775.B no
776Disable path-MTU discovery. Packets will be sent without the `don't fragment'
777bit, and routers will be expected to fragment packets as necessary.
778.RE
779.IP
780This option is experimental, and may change or be removed in a future release.
781.TP
782.B rtp_rcvbuf \fISIZE\fR
783Set
784.BR disorder-playrtp (1)'s
785socket receive buffer to at least
786.IB SIZE .
787(This setting can be overridden by passing
788a suitable command-line option.)
789The default value is
790.BR 0 .
791.IP
792This option is experimental,
793and may change or be removed in a future release.
794.TP
795.B rtp_request_address \fR[\fIFAMILY\fR] \fR[\fIHOST\fR] \fISERVICE\fR
796If
797.BR disorder-playrtp (1)
798is to request a unicast RTP stream,
799then it should establish its receiving socket
800to listen on the given address.
801The
802.I FAMILY
803and
804.I HOST
805may be omitted, in which case
806.B disorder-playrtp
807uses heuristics to determine suitable values.
808The
809.I PORT
810may be omitted, in which case
811.B disorder-playrtp
812uses a kernel-allocated port.
813(This setting can be overridden by passing
814a suitable address on the command line.)
815The default is
816.RB ` "\- 0" ',
817which uses a heuristically-chosen address and a kernel-allocated port.
818.IP
819This option is experimental,
820and may change or be removed in a future release.
821.TP
822.B sample_format \fIBITS\fB/\fIRATE\fB/\fICHANNELS
823Describes the sample format expected by the \fBspeaker_command\fR (below).
824The components of the format specification are as follows:
825.RS
826.TP 10
827.I BITS
828The number of bits per sample.
829Optionally, may be suffixed by \fBb\fR or \fBl\fR for big-endian and
830little-endian words.
831If neither is used the native byte order is assumed.
832.TP
833.I RATE
834The number of samples per second.
835.TP
836.I CHANNELS
837The number of channels.
838.PP
839The default is
840.BR 16/44100/2 .
841.PP
842With the
843.B rtp
844backend the sample format is forced to
845.B 16b/44100/2
846and with the
847.B coreaudio
848backend it is forced to
849.BR 16/44100/2 ,
850in both cases regardless of what is specified in the configuration file.
851.RE
852.TP
853.B signal \fINAME\fR
854Defines the signal to be sent to track player process groups when tracks are
855scratched.
856The default is \fBSIGKILL\fR.
857.IP
858Signals are specified by their full C name, i.e. \fBSIGINT\fR and not \fBINT\fR
859or \fBInterrupted\fR or whatever.
860.TP
861.B sox_generation \fB0\fR|\fB1
862Determines whether calls to \fBsox\fR(1) should use \fB\-b\fR, \fB\-x\fR, etc (if
863the generation is 0) or \fB\-\fIbits\fR, \fB\-L\fR etc (if it is 1).
864See the documentation for your installed copy of \fBsox\fR to determine
865which you need.
866The default is set according to the version of sox found when DisOrder was
867built.
868If you run on a system with a different version of sox, you will need to
869set this option.
870.TP
871.B speaker_backend \fINAME
872This is an alias for \fBapi\fR; see above.
873.TP
874.B speaker_command \fICOMMAND
875Causes the speaker subprocess to pipe audio data into shell command
876\fICOMMAND\fR, rather than writing to a local sound card.
877The sample format is determine by
878.B sample_format
879above.
880.IP
881Note that if the sample format is wrong then
882.BR sox (1)
883is invoked to translate it.
884If
885.B sox
886is not installed then this will not work.
887.TP
888.B scratch \fIPATH\fR
889Specifies a scratch.
890When a track is scratched, a scratch track is played at random.
891Scratches are played using the same logic as other tracks.
892.IP
893At least for the time being, path names of scratches must be encoded using
894UTF-8 (which means that ASCII will do).
895.IP
896If \fBscratch\fR is used without arguments then the list of scratches is
897cleared.
898.TP
899.B stopword \fIWORD\fR ...
900Specifies one or more stopwords that should not take part in searches
901over track names.
902.IP
903If \fBstopword\fR is used without arguments then the list of stopwords is
904cleared.
905.IP
906There is a default set of stopwords built in, but this option can be used to
907augment or replace that list.
908.IP
909This setting cannot be changed during the lifetime of the server.
910.TP
911.B tracklength \fIPATTERN\fR \fIMODULE\fR
912Specifies the module used to calculate the length of files matching
913\fIPATTERN\fR.
914\fIMODULE\fR specifies which plugin module to use.
915.IP
916If \fBtracklength\fR is used without arguments then the list of modules is
917cleared.
918.IP
919Track lengths are cached in the database, and changing this setting won't cause
920them to be regenerated.
921.TP
922.B user \fIUSERNAME\fR
923Specifies the user to run as.
924Only makes sense if invoked as root (or the target user).
925.IP
926This setting cannot be changed during the lifetime of the server
927(and if it is changed with a restart, you will need to adjust file permissions
928on the server's database).
929.SS "Client Configuration"
930These options would normally be used in \fI~\fRUSERNAME\fI/.disorder/passwd\fR
931or
932\fIpkgconfdir/config.\fRUSERNAME.
933.TP
934.B connect \fR[\fIFAMILY\fR] \fIHOST SERVICE\fR
935Connect to the address specified by \fIHOST\fR and port specified by
936\fISERVICE\fR.
937.IP
938\fIFAMILY\fR can be \fB-4\fR or \fB-6\fR to force IPv4 or IPv6, if this is not
939implied by \fIHOST\fR.
940Note that IPv6 is not currently well tested.
941.TP
942.B password \fIPASSWORD\fR
943Specify password.
944.TP
945.B username \fIUSERNAME\fR
946Specify username.
947The default is inferred from the current UID.
948.SS "Web Interface Configuration"
949.\" TODO this section is misnamed really...
950.TP
951.B mail_sender \fIADDRESS\fR
952The email address that appears in the From: field of any mail messages sent by
953the web interface.
954This must be set if you have online registration enabled.
955.TP
956.B refresh \fISECONDS\fR
957Specifies the maximum refresh period in seconds.
958The refresh period is the time after which the web interface's queue and manage
959pages will automatically reload themselves.
960Default 15.
961.TP
962.B refresh_min \fISECONDS\fR
963Specifies the minimum refresh period in seconds.
964Default 1.
965.TP
966.B sendmail \fIPATH\fR
967The path to the Sendmail executable.
968This must support the \fB-bs\fR option (Postfix, Exim and Sendmail should all
969work).
970The default is the sendmail executable found at compile time.
971.TP
972.B short_display \fICHARACTERS\fR
973Defines the maximum number of characters to include in a \fBshort\fR name
974part.
975Default 30.
976.TP
977.B smtp_server \fIHOSTNAME\fR
978The hostname (or address) of the SMTP server to use for sending mail.
979The default is 127.0.0.1.
980If \fBsendmail\fR is set then that is used instead.
981.TP
982.B transform \fITYPE\fR \fIREGEXP\fR \fISUBST\fR [\fICONTEXT\fR [\fIREFLAGS\fR]]
983Determines how names are sorted and displayed in track choice displays.
984.IP
985\fITYPE\fR is the type of transformation; usually \fBtrack\fR or
986\fBdir\fR but you can define your own.
987.IP
988\fICONTEXT\fR is a glob pattern matching the context.
989Standard contexts are \fBsort\fR (which determines how directory names
990are sorted) and \fBdisplay\fR (which determines how they are displayed).
991Again, you can define your own.
992.IP
993All the \fBtransform\fR directives are considered in order.
994If the \fITYPE\fR, \fIREGEXP\fR and the \fICONTEXT\fR match
995then a new track name is constructed from
996\fISUBST\fR according to the substitution rules below.
997If several match then each is executed in order.
998.IP
999If you supply no \fBtransform\fR directives at all then a default set will be
1000supplied automatically.
1001But if you supply even one then you must supply all of them.
1002The defaults are:
1003.PP
1004.nf
1005transform track "^.*/([0-9]+ *[-:] *)?([^/]+)\\.[a-zA-Z0-9]+$" $2 display
1006transform track "^.*/([^/]+)\\.[a-zA-Z0-9]+$" $1 sort
1007transform dir "^.*/([^/]+)$" $1 *
1008transform dir "^(the) ([^/]*)" "$2 $1" sort i
1009transform dir "[[:punct:]]" "" sort g
1010.fi
1011.TP
1012.B url \fIURL\fR
1013Specifies the URL of the web interface.
1014This URL will be used in generated web pages.
1015The default is inferred at runtime, so this option no
1016longer needs to be specified.
1017.IP
1018This must be the full URL, e.g. \fBhttp://myhost/cgi-bin/jukebox\fR and not
1019\fB/cgi-bin/jukebox\fR.
1020.SH "REGEXP SUBSTITUTION RULES"
1021Regexps are PCRE regexps, as defined in \fBpcrepattern\fR(3).
1022The only option used is \fBPCRE_UTF8\fR.
1023Remember that the configuration file syntax means you have to
1024escape backslashes and quotes inside quoted strings.
1025.PP
1026In a \fISUBST\fR string the following sequences are interpreted
1027specially:
1028.TP
1029.B $1 \fR... \fB$9
1030These expand to the first to ninth bracketed subexpression.
1031.TP
1032.B $&
1033This expands to the matched part of the subject string.
1034.TP
1035.B $$
1036This expands to a single \fB$\fR symbol.
1037.PP
1038All other pairs starting with \fB$\fR are undefined (and might be used
1039for something else in the future, so don't rely on the current
1040behaviour.)
1041.PP
1042If \fBi\fR is present in \fIREFLAGS\fR then the match is case-independent.
1043If \fBg\fR is present then all matches are replaced, otherwise only the first
1044match is replaced.
1045.SH "TRACK NAME PARTS"
1046The traditional track name parts are \fBartist\fR, \fBalbum\fR and \fBtitle\fR,
1047with the obvious intended meaning.
1048These are controlled by configuration and by \fBtrackname_\fR preferences.
1049.PP
1050In addition there are two built-in parts, \fBpath\fR which is the whole path
1051name and \fBext\fR which is the filename extension, including the initial dot
1052(or the empty string if there is not extension).
1053.SH "SEE ALSO"
1054\fBdisorder\fR(1), \fBsox\fR(1), \fBdisorderd\fR(8), \fBdisorder\-dump\fR(8),
1055\fBpcrepattern\fR(3), \fBdisorder_templates\fR(5), \fBdisorder_actions\fR(5),
1056\fBdisorder.cgi\fR(8), \fBdisorder_preferences\fR(5)
1057.\" Local Variables:
1058.\" mode:nroff
1059.\" fill-column:79
1060.\" End: