diff options
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/guix.texi | 174 |
1 files changed, 170 insertions, 4 deletions
diff --git a/doc/guix.texi b/doc/guix.texi index 555fd082471..39544d9acff 100644 --- a/doc/guix.texi +++ b/doc/guix.texi | |||
| @@ -456,7 +456,7 @@ Services | |||
| 456 | * Samba Services:: Samba services. | 456 | * Samba Services:: Samba services. |
| 457 | * Continuous Integration:: Cuirass and Laminar services. | 457 | * Continuous Integration:: Cuirass and Laminar services. |
| 458 | * Power Management Services:: Extending battery life, etc. | 458 | * Power Management Services:: Extending battery life, etc. |
| 459 | * Audio Services:: The MPD. | 459 | * Audio Services:: The MPD and Snapcast. |
| 460 | * Virtualization Services:: Virtualization services. | 460 | * Virtualization Services:: Virtualization services. |
| 461 | * Version Control Services:: Software version control servers. | 461 | * Version Control Services:: Software version control servers. |
| 462 | * Game Services:: Game servers. | 462 | * Game Services:: Game servers. |
| @@ -20622,7 +20622,7 @@ declaration. | |||
| 20622 | * Samba Services:: Samba services. | 20622 | * Samba Services:: Samba services. |
| 20623 | * Continuous Integration:: Cuirass and Laminar services. | 20623 | * Continuous Integration:: Cuirass and Laminar services. |
| 20624 | * Power Management Services:: Extending battery life, etc. | 20624 | * Power Management Services:: Extending battery life, etc. |
| 20625 | * Audio Services:: The MPD. | 20625 | * Audio Services:: The MPD and Snapcast. |
| 20626 | * Virtualization Services:: Virtualization services. | 20626 | * Virtualization Services:: Virtualization services. |
| 20627 | * Version Control Services:: Software version control servers. | 20627 | * Version Control Services:: Software version control servers. |
| 20628 | * Game Services:: Game servers. | 20628 | * Game Services:: Game servers. |
| @@ -41763,8 +41763,9 @@ The handler for the battattach event. | |||
| 41763 | @node Audio Services | 41763 | @node Audio Services |
| 41764 | @subsection Audio Services | 41764 | @subsection Audio Services |
| 41765 | 41765 | ||
| 41766 | The @code{(gnu services audio)} module provides a service to start MPD | 41766 | The @code{(gnu services audio)} module provides services to start MPD |
| 41767 | (the Music Player Daemon). | 41767 | (the Music Player Daemon) and Snapcast, a multi-room audio streaming |
| 41768 | system. | ||
| 41768 | 41769 | ||
| 41769 | @cindex mpd | 41770 | @cindex mpd |
| 41770 | @subsubheading Music Player Daemon | 41771 | @subsubheading Music Player Daemon |
| @@ -42167,6 +42168,171 @@ Disallowed IP addresses. | |||
| 42167 | @end deftp | 42168 | @end deftp |
| 42168 | @c %end of fragment | 42169 | @c %end of fragment |
| 42169 | 42170 | ||
| 42171 | @subsubheading Snapcast | ||
| 42172 | |||
| 42173 | @cindex Snapcast | ||
| 42174 | @cindex multi-room audio | ||
| 42175 | |||
| 42176 | @uref{https://github.com/badaix/snapcast, Snapcast} is a multi-room | ||
| 42177 | audio streaming system: @command{snapserver} receives audio from one or | ||
| 42178 | more sources and streams it to @command{snapclient} instances, which | ||
| 42179 | play it back in sync. | ||
| 42180 | |||
| 42181 | The following example runs @command{snapserver} with a single named pipe | ||
| 42182 | as its audio source, in addition to the default HTTP interface on port | ||
| 42183 | 1780 and the client-facing streaming interface on port 1704. | ||
| 42184 | |||
| 42185 | @lisp | ||
| 42186 | (service snapserver-service-type | ||
| 42187 | (snapserver-configuration | ||
| 42188 | (streams (list (snapserver-stream | ||
| 42189 | (name "mpd") | ||
| 42190 | (location "/run/snapserver/mpd")))))) | ||
| 42191 | @end lisp | ||
| 42192 | |||
| 42193 | @command{snapserver} creates the named pipes of its @code{pipe} sources | ||
| 42194 | when it starts, as the @samp{snapserver} user; make sure the program | ||
| 42195 | feeding such a pipe---the @code{fifo} output of MPD, for instance---is | ||
| 42196 | allowed to write to it. | ||
| 42197 | |||
| 42198 | @defvar snapserver-service-type | ||
| 42199 | The service type for @command{snapserver}. | ||
| 42200 | @end defvar | ||
| 42201 | |||
| 42202 | @c %start of fragment | ||
| 42203 | @deftp {Data Type} snapserver-configuration | ||
| 42204 | Available @code{snapserver-configuration} fields are: | ||
| 42205 | |||
| 42206 | @table @asis | ||
| 42207 | @item @code{package} (default: @code{snapcast}) (type: file-like) | ||
| 42208 | The Snapcast package to use. | ||
| 42209 | |||
| 42210 | @item @code{user} (default: @code{%snapserver-user}) (type: user-account) | ||
| 42211 | Owner of the @command{snapserver} process. | ||
| 42212 | |||
| 42213 | @item @code{group} (default: @code{%snapserver-group}) (type: user-group) | ||
| 42214 | Owner group of the @command{snapserver} process. | ||
| 42215 | |||
| 42216 | @item @code{shepherd-requirement} (default: @code{'()}) (type: list-of-symbols) | ||
| 42217 | This is a list of symbols naming Shepherd services that this service | ||
| 42218 | will depend on. | ||
| 42219 | |||
| 42220 | @item @code{log-file} (default: @code{"/var/log/snapserver.log"}) (type: string) | ||
| 42221 | File where @command{snapserver} writes its log. | ||
| 42222 | |||
| 42223 | @item @code{log-filter} (default: @code{"*:info"}) (type: string) | ||
| 42224 | Log filter, given as @code{@var{tag}:@var{level}} pairs separated by | ||
| 42225 | commas, where @var{tag} is @code{*} or a log tag and @var{level} is one | ||
| 42226 | of @code{trace}, @code{debug}, @code{info}, @code{notice}, | ||
| 42227 | @code{warning}, @code{error} or @code{fatal}. | ||
| 42228 | |||
| 42229 | @item @code{data-directory} (default: @code{"/var/lib/snapserver"}) (type: string) | ||
| 42230 | Directory where @command{snapserver} stores persistent data, such as | ||
| 42231 | client settings. | ||
| 42232 | |||
| 42233 | @item @code{mdns?} (default: @code{#t}) (type: boolean) | ||
| 42234 | Whether to publish the Snapcast services over mDNS. This requires | ||
| 42235 | @code{avahi-service-type} (@pxref{Networking Services}). | ||
| 42236 | |||
| 42237 | @item @code{http?} (default: @code{#t}) (type: boolean) | ||
| 42238 | Whether to enable the HTTP JSON-RPC interface, which also serves the | ||
| 42239 | Snapweb web interface. | ||
| 42240 | |||
| 42241 | @item @code{http-port} (default: @code{1780}) (type: integer) | ||
| 42242 | Port the HTTP server listens on. | ||
| 42243 | |||
| 42244 | @item @code{http-bind-address} (default: @code{"::"}) (type: string) | ||
| 42245 | Address the HTTP server listens on. | ||
| 42246 | |||
| 42247 | @item @code{doc-root} (type: maybe-file-like) | ||
| 42248 | Directory served by the HTTP server. It defaults to the Snapweb web | ||
| 42249 | interface bundled with the @code{package} field. | ||
| 42250 | |||
| 42251 | @item @code{tcp-control?} (default: @code{#t}) (type: boolean) | ||
| 42252 | Whether to enable the TCP JSON-RPC control interface. | ||
| 42253 | |||
| 42254 | @item @code{tcp-control-port} (default: @code{1705}) (type: integer) | ||
| 42255 | Port the TCP control interface listens on. | ||
| 42256 | |||
| 42257 | @item @code{tcp-streaming?} (default: @code{#t}) (type: boolean) | ||
| 42258 | Whether to enable TCP streaming, which is what Snapcast clients connect | ||
| 42259 | to. | ||
| 42260 | |||
| 42261 | @item @code{tcp-streaming-port} (default: @code{1704}) (type: integer) | ||
| 42262 | Port the TCP streaming interface listens on. | ||
| 42263 | |||
| 42264 | @item @code{streams} (type: list-of-snapserver-stream) | ||
| 42265 | List of @code{snapserver-stream} records describing the audio sources | ||
| 42266 | @command{snapserver} reads from. | ||
| 42267 | |||
| 42268 | @item @code{codec} (default: @code{"flac"}) (type: string) | ||
| 42269 | Default codec used to send audio to clients, given as | ||
| 42270 | @code{@var{codec}[:@var{options}]} where @var{codec} is one of | ||
| 42271 | @code{flac}, @code{ogg}, @code{opus} or @code{pcm}. | ||
| 42272 | |||
| 42273 | @item @code{sampleformat} (default: @code{"48000:16:2"}) (type: string) | ||
| 42274 | Default sample format of the streams, given as | ||
| 42275 | @code{@var{rate}:@var{bits}:@var{channels}}. | ||
| 42276 | |||
| 42277 | @item @code{buffer-ms} (default: @code{1000}) (type: integer) | ||
| 42278 | End-to-end latency, in milliseconds. | ||
| 42279 | |||
| 42280 | @item @code{chunk-ms} (default: @code{20}) (type: integer) | ||
| 42281 | Default duration, in milliseconds, of the audio chunks read from the | ||
| 42282 | sources. | ||
| 42283 | |||
| 42284 | @item @code{send-to-muted?} (default: @code{#f}) (type: boolean) | ||
| 42285 | Whether to send audio to muted clients. | ||
| 42286 | |||
| 42287 | @item @code{extra-content} (type: maybe-string) | ||
| 42288 | Content appended verbatim to @file{snapserver.conf}, for options that | ||
| 42289 | are not covered by the fields above, such as the @code{[ssl]} and | ||
| 42290 | @code{[authorization]} sections. | ||
| 42291 | |||
| 42292 | @end table | ||
| 42293 | @end deftp | ||
| 42294 | @c %end of fragment | ||
| 42295 | |||
| 42296 | @c %start of fragment | ||
| 42297 | @deftp {Data Type} snapserver-stream | ||
| 42298 | Available @code{snapserver-stream} fields are: | ||
| 42299 | |||
| 42300 | @table @asis | ||
| 42301 | @item @code{name} (default: @code{"default"}) (type: string) | ||
| 42302 | Name of the stream, as shown by Snapcast clients. | ||
| 42303 | |||
| 42304 | @item @code{type} (default: @code{pipe}) (type: snapserver-stream-type) | ||
| 42305 | Type of the stream source: one of @code{pipe}, @code{file}, | ||
| 42306 | @code{process}, @code{librespot}, @code{airplay}, @code{tcp}, | ||
| 42307 | @code{alsa} or @code{meta}. | ||
| 42308 | |||
| 42309 | @item @code{location} (default: @code{"/run/snapserver/snapfifo"}) (type: string) | ||
| 42310 | Location of the stream source: a file name for @code{pipe}, @code{file} | ||
| 42311 | and @code{process} streams, a host name for @code{tcp} streams, a device | ||
| 42312 | name for @code{alsa} streams, and a slash-separated list of stream names | ||
| 42313 | for @code{meta} streams. | ||
| 42314 | |||
| 42315 | @item @code{codec} (type: maybe-string) | ||
| 42316 | Codec to use for this stream, overriding the @code{codec} field of | ||
| 42317 | @code{snapserver-configuration}. | ||
| 42318 | |||
| 42319 | @item @code{sampleformat} (type: maybe-string) | ||
| 42320 | Sample format of this stream, given as | ||
| 42321 | @code{@var{rate}:@var{bits}:@var{channels}}, overriding the | ||
| 42322 | @code{sampleformat} field of @code{snapserver-configuration}. | ||
| 42323 | |||
| 42324 | @item @code{chunk-ms} (type: maybe-integer) | ||
| 42325 | Duration, in milliseconds, of the audio chunks read from this source, | ||
| 42326 | overriding the @code{chunk-ms} field of @code{snapserver-configuration}. | ||
| 42327 | |||
| 42328 | @item @code{parameters} (default: @code{'()}) (type: alist) | ||
| 42329 | Additional source parameters, given as an association list, for example | ||
| 42330 | @code{'(("controlscript" . "meta_mpd.py"))}. | ||
| 42331 | |||
| 42332 | @end table | ||
| 42333 | @end deftp | ||
| 42334 | @c %end of fragment | ||
| 42335 | |||
| 42170 | @node Virtualization Services | 42336 | @node Virtualization Services |
| 42171 | @subsection Virtualization Services | 42337 | @subsection Virtualization Services |
| 42172 | 42338 | ||
