]> kaliko git repositories - mpd-sima.git/blob - data/man/mpd_sima.cfg.5
Document new offline autoqueue plugin based on file tags only
[mpd-sima.git] / data / man / mpd_sima.cfg.5
1 '\" t
2 .\"     Title: mpd_sima.cfg
3 .\"    Author: kaliko <kaliko@azylum.org>
4 .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
5 .\"      Date: 12/14/2020
6 .\"    Manual: mpd-sima 0.16.0 User Manual
7 .\"    Source: mpd-sima
8 .\"  Language: English
9 .\"
10 .TH "MPD_SIMA\&.CFG" "5" "12/14/2020" "mpd-sima" "mpd-sima 0.16.0 User Manual"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18 .ie \n(.g .ds Aq \(aq
19 .el       .ds Aq '
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
24 .nh
25 .\" disable justification (adjust text to left margin only)
26 .ad l
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
30 .SH "NAME"
31 mpd_sima.cfg \- mpd\-sima will try to maintain some titles ahead in the queue following different policies\&. This manual document the configuration file for mpd\-sima\&.
32 .SH "DESCRIPTION"
33 .PP
34 This manual page documents briefly
35 \fBmpd\-sima\fR
36 configuration options available in user configuration file (see
37 the section called \(lqFILES\(rq)\&.
38 .SH "EXAMPLES"
39 .SS "File tags queue mode (offline mode)\&."
40 .PP
41 Here is an example of autoqueue using file tags only\&.
42 .sp
43 .if n \{\
44 .RS 4
45 .\}
46 .nf
47 [MPD]
48 host=example\&.org
49 port=6601
50
51 [sima]
52 # Setup internal plugins
53 internal = Tags, Crop
54 history_duration=48  # 2 days
55 queue_length=2
56
57 [tags]
58 # Look for files with tagged with genre "electonica" OR "IDM" OR "glitch"
59 genre = electonica, IDM, glitch
60
61 [crop]
62 # keep 30 played tracks in playlist
63 consume=30
64
65             
66 .fi
67 .if n \{\
68 .RE
69 .\}
70 .SS "Album queue mode using last\&.fm recommendations (online mode)\&."
71 .PP
72 Here is an example of album queue configuration using online recommendations system\&.
73 .sp
74 .if n \{\
75 .RS 4
76 .\}
77 .nf
78 [MPD]
79 host=example\&.org
80 port=8000
81
82 [sima]
83 history_duration=48  # 2 days
84 queue_length=5
85
86 [lastfm]
87 queue_mode=album
88 album_to_add=2
89
90 [crop]
91 # keep 30 played tracks in playlist
92 consume=30
93
94             
95 .fi
96 .if n \{\
97 .RE
98 .\}
99 .SH "CONFIGURATION FILE"
100 .PP
101 The configuration file consists of sections, led by a
102 \fB[section]\fR
103 header and followed by
104 \fBname:\ \&value\fR
105 entries, with continuations in the style of RFC 822 (see section 3\&.1\&.1, \(lqLONG HEADER FIELDS\(rq);
106 \fBname=value\fR
107 is also accepted\&. Lines beginning with
108 \fI\*(Aq#\*(Aq\fR
109 or
110 \fI\*(Aq;\*(Aq\fR
111 are ignored and may be used to provide comments (\fINota Bene:\fR
112 inline comment are possible using
113 \fI\*(Aq#\*(Aq\fR)\&.
114 .PP
115 The default values are used in the options lists below\&.
116 .SS "MPD section"
117 .PP
118 This section is meant to configure MPD access, MPD host address / port and password if necessary\&.
119 .PP
120 \fB[MPD]\fR
121 .RS 4
122 .RE
123 .PP
124 \fBhost=\fR\fIlocalhost\fR
125 .RS 4
126 Set MPD host\&. Use IP or FQDN\&.
127 .RE
128 .PP
129 \fBport=\fR\fI6600\fR
130 .RS 4
131 Set host port to access MPD to\&.
132 .RE
133 .PP
134 \fBpassword=\fR\fIs3cr3t\fR
135 .RS 4
136 Set MPD password to use\&. Do not use this option if you don\*(Aqt have enabled password protected access on your MPD server\&.
137 .RE
138 .SS "log section"
139 .PP
140 Configure logging\&.
141 .PP
142 \fB[log]\fR
143 .RS 4
144 .RE
145 .PP
146 \fBlogfile=\fR
147 .RS 4
148 File to log to, usually in d\(aemon mode\&.
149 .br
150 Default (empty or unset) is to log to stdin/stdout\&.
151 .RE
152 .PP
153 \fBverbosity=\fR\fIinfo\fR
154 .RS 4
155 Logging verbosity among
156 \fIdebug\fR,
157 \fIinfo\fR,
158 \fIwarning\fR,
159 \fIerror\fR\&.
160 .RE
161 .SS "Process daemonization"
162 .PP
163 Configure process daemon\&.
164 .PP
165 \fB[daemon]\fR
166 .RS 4
167 .RE
168 .PP
169 \fBdaemon=false\fR
170 .RS 4
171 whether to daemonize process or not\&.
172 .RE
173 .PP
174 \fBpidfile=\fR
175 .RS 4
176 Where to store process ID\&.
177 .RE
178 .SS "sima section"
179 .PP
180 Core mpd_sima\&.cfg configuration\&.
181 .PP
182 \fB[sima]\fR
183 .RS 4
184 .RE
185 .PP
186 \fBcontrib=\fR
187 .RS 4
188 .RE
189 .PP
190 \fBinternal=\fR\fILastfm, Random, Crop\fR
191 .RS 4
192 mpd\-sima\*(Aqs plugin management for internal source plugin and contrib (ie\&. external plugins)\&.
193 .br
194
195 Plugins list is a comma separated string list\&.
196 .br
197
198 Optional plugin\*(Aqs configuration lays in its own section\&.
199 .br
200 For instance a "AwesomePlugin" declared here gets its configuration from the corresponding section "[awesomeplugin]"\&.
201 .sp
202 The default list of plugins to load at startup:
203 \fBLastfm\fR,\fBRandom\fR,\fBCrop\fR\&.
204 .br
205
206 \fBCrop\fR
207 is an utility plugin, it does not queue any tracks (cf\&. below)\&.
208 .br
209
210 \fBRandom\fR
211 will queue a track at random if other plugins did not return any tracks\&.
212 .br
213
214 .sp
215 You can add, combine here as many plugins you want\&.
216 .br
217
218 The priority may be used to order them\&.
219 .RE
220 .PP
221 \fBhistory_duration=\fR\fI8\fR
222 .RS 4
223 How far to look back in history to avoid to play twice the same track/title (duration in hours)\&.
224 .br
225
226 The
227 \fBhistory_duration\fR
228 is also used to give priority to not recently played artists\&.
229 .RE
230 .PP
231 \fBqueue_length=\fR\fI2\fR
232 .RS 4
233 Threshold value triggering queue process\&.
234 .RE
235 .PP
236 \fBmusicbrainzid=\fR\fItrue\fR
237 .RS 4
238 Use MusicBrainzIdentifier to search music (mainly for artists)\&. Default is True, switch to False if you don\*(Aqt have MusicBrainzIdentifier set for at least 80% of you music library\&.
239 .br
240
241 Consider using these metadata as it enhances a lot artist/album/tracks identification\&. Use Picard to tag your file:
242 \m[blue]\fB\%https://picard.musicbrainz.org/\fR\m[]\&.
243 .RE
244 .PP
245 \fBrepeat_disable_queue=\fR\fItrue\fR
246 .RS 4
247 Prevent disabling queuing in repeat play mode\&.
248 .RE
249 .PP
250 \fBsingle_disable_queue=\fR\fItrue\fR
251 .RS 4
252 Prevent disabling queuing in single play mode\&.
253 .RE
254 .SS "Crop section"
255 .PP
256 crop plugin\*(Aqs configuration:
257 .PP
258 \fB[crop]\fR
259 .RS 4
260 .RE
261 .PP
262 \fBconsume=\fR\fI10\fR
263 .RS 4
264 How many played tracks to keep in the queue\&. Allows you to maintain a fixed length queue\&. Set to some negative integer to keep all played tracks\&.
265 .RE
266 .PP
267 \fBpriority=\fR\fI10\fR
268 .RS 4
269 Plugin priority
270 .RE
271 .SS "Random section"
272 .PP
273 Random plugin\*(Aqs configuration:
274 .PP
275 \fB[random]\fR
276 .RS 4
277 .RE
278 .PP
279 \fBflavour=\fR\fIsensible\fR
280 .RS 4
281 When no similar tracks are found, falling back to random queuing\&. Different mode, aka random flavour, are available:
282 \fIpure\fR,
283 \fIsensible\fR,
284 \fIgenre\fR\&.
285 .sp
286 .RS 4
287 .ie n \{\
288 \h'-04'\(bu\h'+03'\c
289 .\}
290 .el \{\
291 .sp -1
292 .IP \(bu 2.3
293 .\}
294 \fIpure\fR, pure random choice, even among recently played track\&.
295 .RE
296 .sp
297 .RS 4
298 .ie n \{\
299 \h'-04'\(bu\h'+03'\c
300 .\}
301 .el \{\
302 .sp -1
303 .IP \(bu 2.3
304 .\}
305 \fIsensible\fR, use play history to filter chosen tracks\&.
306 .RE
307 .sp
308 .RS 4
309 .ie n \{\
310 \h'-04'\(bu\h'+03'\c
311 .\}
312 .el \{\
313 .sp -1
314 .IP \(bu 2.3
315 .\}
316 \fIgenre\fR, Not implemented yet\&.
317 .RE
318 .sp
319 .RE
320 .PP
321 \fBpriority=\fR\fI50\fR
322 .RS 4
323 Plugin priority
324 .RE
325 .SS "LastFm section"
326 .PP
327 LastFM plugin\*(Aqs configuration\&.
328 .PP
329 \fB[lastfm]\fR
330 .RS 4
331 .RE
332 .PP
333 \fBqueue_mode=\fR\fItrack\fR
334 .RS 4
335 Queue mode to use among
336 \fItrack\fR,
337 \fItop\fR
338 and
339 \fIalbum\fR
340 (see
341 the section called \(lqQUEUE MODES\(rq
342 for info about queue modes)\&.
343 .RE
344 .PP
345 \fBmax_art=\fR\fI10\fR
346 .RS 4
347 Maximum number of similar artist to retrieve from local media library\&.
348 .br
349 When set to something superior to zero, it tries to get as much similar artists from media library\&.
350 .RE
351 .PP
352 \fBdepth=\fR\fI1\fR
353 .RS 4
354 How many artists to base on similar artists search\&.
355 .br
356
357 The first is the last played artist and so on back in the history\&. Highter depth generates wider suggestions, it might help to reduce looping over same artists\&.
358 .RE
359 .PP
360 \fBsingle_album=\fR\fIfalse\fR
361 .RS 4
362 Prevent from queueing a track from the same album (it often happens with OST)\&.
363 .br
364
365 Only relevant in "track" queue mode\&.
366 .RE
367 .PP
368 \fBtrack_to_add=\fR\fI1\fR
369 .RS 4
370 How many track(s) to add\&. Only relevant in
371 \fBtop\fR
372 and
373 \fBtrack\fR
374 queue modes\&. This is actually an upper limit, min(\fBmax_art\fR,
375 \fBtrack_to_add\fR) will be used\&.
376 .RE
377 .PP
378 \fBalbum_to_add=\fR\fI1\fR
379 .RS 4
380 How many album(s) to add\&. Only relevant in
381 \fBalbum\fR
382 queue modes\&.
383 .RE
384 .PP
385 \fBtrack_to_add_from_album=\fR\fI0\fR
386 .RS 4
387 How many track(s) to add from each selected albums\&. Only relevant in
388 \fBalbum\fR
389 queue modes\&. When set to 0 or lower the whole album is queued\&.
390 .RE
391 .PP
392 \fBcache=\fR\fITrue\fR
393 .RS 4
394 Whether or not to use on\-disk persistent http cache\&.
395 .br
396 When set to "true", sima will use a persistent cache for its http client\&. The cache is written along with the dbfile in:
397 .br
398
399 $XDG_CONFIG_HOME/mpd_sima/http/WEB_SERVICE\&.
400 .br
401
402 If set to "false", caching is still done but in memory\&.
403 .RE
404 .PP
405 \fBpriority=\fR\fI100\fR
406 .RS 4
407 Plugin priority
408 .RE
409 .SS "Tags section"
410 .PP
411 Tags plugin\*(Aqs configuration\&. There is no default configuration for this plugin, it does not work out of the box\&.
412 .PP
413 This plugin permits offline autoqueuing based on files tags only\&. Supported tags are
414 \fB\*(Aqcomment\*(Aq\fR,
415 \fB\*(Aqdate\*(Aq\fR,
416 \fB\*(Aqgenre\*(Aq\fR,
417 \fB\*(Aqlabel\*(Aq\fR
418 and
419 \fB\*(Aqoriginaldate\*(Aq\fR\&. It currently supports single track queuing only, no album mode for this plugin\&.
420 .PP
421 In addition to supported tags above you can use an MPD filter\&. Please refer to MPD protocol documentation for more\&.
422 .PP
423 All entries in this section are ANDed as a single MPD filter to look for titles in the library\&. Moreover, with tags, comma separated values are also ANDed\&.
424 .br
425
426 For instance setting "\fBgenre=rock\fR" and "\fBdate=1982,1983,1984,1985,1986,1987,1988,1989\fR" will end up looking for track tagged with genre
427 \fBrock\fR
428 and date within 1985 through 1990\&.
429 .br
430
431 Using an MPD filter to replace
432 \fBdate\fR
433 you can achieve the same with the following setting: "\fBgenre=rock\fR" and "\fBfilter=(date =~ \*(Aq198[2\-9]\*(Aq)\fR" (provided your MPD server was compiled with libpcre)\&.
434 .PP
435 \fB[tags]\fR
436 .RS 4
437 .RE
438 .PP
439 \fBfilter=\fR
440 .RS 4
441 You can use here any valid MPD filter as defined in MPD protocol documentation\&.
442 .RE
443 .PP
444 \fBcomment=\fR
445 .RS 4
446 .RE
447 .PP
448 \fBdate=\fR
449 .RS 4
450 .RE
451 .PP
452 \fBgenre=\fR
453 .RS 4
454 .RE
455 .PP
456 \fBlabel=\fR
457 .RS 4
458 .RE
459 .PP
460 \fBpriority=\fR\fI80\fR
461 .RS 4
462 Plugin priority
463 .RE
464 .SH "QUEUE MODES"
465 .PP
466 mpd\-sima offers different queue modes with lastfm plugin\&. All of them pick up tracks from artists similar to the last track in the queue\&.
467 .PP
468 mpd\-sima tries preferably to chose among unplayed artists or at least not recently played artist\&. Concerning track and album queue modes titles are chosen purely at random among unplayed tracks\&.
469 .PP
470 \fBtrack\fR
471 .RS 4
472 Queue a similar track chosen at random from a similar artist\&.
473 .RE
474 .PP
475 \fBtop\fR
476 .RS 4
477 Queue a track from a similar artist, chosen among "top tracks" according to last\&.fm data mining\&.
478 .RE
479 .PP
480 \fBalbum\fR
481 .RS 4
482 Queue a whole album chosen at random from a similar artist\&.
483 .sp
484 \fINota Bene:\fR
485 .br
486
487 Due to the track point of view of database build upon tracks tags an album lookup for a specific artist will return albums as soon as this artist appears in a single track of the album\&.
488 .br
489
490 For instance looking for album from "The Velvet Underground" will fetch "Last Days" and "Juno" OSTs because the band appears on the soundtrack of these two movies\&.
491 .br
492
493 A solution is for you to set AlbumArtists tag to something different than the actual artist of the track\&. For compilations, OSTs etc\&. a strong convention is to use "Various Artists" for this tag\&.
494 .sp
495 mpd\-sima is currently looking for AlbumArtists tags and avoid album where this tag is set with "Various Artists"\&. If a single track within an album is found with AlbumArtists:"Various Artists" the complete album is skipped and won\*(Aqt be queued\&.
496 .RE
497 .SH "FILES"
498 .PP
499 ${XDG_CONFIG_HOME}/mpd_sima/mpd_sima\&.cfg
500 .RS 4
501 Configuration file\&.
502 .RE
503 .PP
504 ${XDG_DATA_HOME}/mpd_sima/sima\&.db
505 .RS 4
506 SQLite DB file\&.
507 .RE
508 .PP
509 ${XDG_DATA_HOME}/mpd_sima/WEB_SERVICE/
510 .RS 4
511 Persistent http cache\&.
512 .RE
513 .PP
514 Usually
515 \fBXDG_DATA_HOME\fR
516 is set to
517 ${HOME}/\&.local/share
518 and
519 \fBXDG_CONFIG_HOME\fR
520 to
521 ${HOME}/\&.config\&.
522 .br
523 You may override them using command line option
524 \fB\-\-var\-dir\fR
525 and
526 \fB\-\-config\fR
527 (cf\&.
528 \fBmpd-sima\fR(1))
529 .SH "FEEDBACK/BUGS"
530 .PP
531 The maintainer would be more than happy to ear from you, don\*(Aqt hesitate to send feedback,
532 \m[blue]\fB\%https://kaliko.me/contact/\fR\m[]\&.
533 .PP
534 XMPP
535 users are welcome to join the dedicated chat room at
536 \m[blue]\fBkaliko\&.me@conf\&.azylum\&.org\fR\m[]\&.
537 .SH "SEE ALSO"
538 .PP
539 \fBmpc\fR(1),
540 \fBmpd\fR(1)
541 .PP
542 /usr/share/doc/mpd\-sima/
543 .SH "AUTHOR"
544 .PP
545 \fBkaliko\fR <\&kaliko@azylum\&.org\&>
546 .RS 4
547 Wrote this man page and is currently leading MPD_sima project\&.
548 .RE
549 .SH "COPYRIGHT"
550 .br
551 Copyright \(co 2009-2020 kaliko
552 .br
553 .PP
554 This manual page was written for the Debian system (and may be used by others)\&.
555 .PP
556 Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 3 published by the Free Software Foundation\&.
557 .PP
558 On Debian systems, the complete text of the GNU General Public License can be found in
559 /usr/share/common\-licenses/GPL\&.
560 .sp