summaryrefslogtreecommitdiffstats
path: root/doc/artsbuilder/tools.docbook
blob: 417951dfc5db0001121f06559368e9a3e023d6eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
<!-- 
<?xml version="1.0" ?>
<!DOCTYPE chapter PUBLIC "-//KDE//DTD DocBook XML V4.2-Based Variant V1.1//EN" "dtd/kdex.dtd">

To validate or process this file as a standalone document, uncomment
this prolog. Be sure to comment it out again when you are done -->

<chapter id="arts-tools">
<title>&arts; Tools</title>

<para>
Included with &arts; is a number of utilities for controlling and
configuring its behavior. You need to have some familiarity with most of
these tools in order to use &arts; effectively. This section describes
each of the utilities and their command options.
</para>

<sect1 id="kde-control-center">
<title>&kcontrol;</title>

<para>
When running &arts; under &kde;, the &kcontrolcenter; provides a group
of control panel settings under the <guilabel>Sound</guilabel>
category. Some of these settings are used by &arts;. You can also
associate sounds with various window manager and &kde; events using the
<menuchoice><guilabel>Look &amp; Feel</guilabel><guilabel>System
Notifications</guilabel></menuchoice> panel. See the &kcontrol; manual
for information on using the panel settings.
</para>

</sect1>

<sect1 id="artsd">
<title>&artsd;</title>

<para>
Access to the sound hardware resources is controlled by &artsd;, the
&arts; daemon. This allows different applications to simultaneously send
requests to the server, where they can be mixed together and
played. Without a centralized sound server a single application using a
sound device would prevent other applications from using it.
</para>

<para>
To use &arts; there should be one and only one copy of &artsd;
running. It is typically run when &kde; starts up if it is enabled in
the &kcontrol; <guilabel>Sound Server</guilabel> panel.
</para>

<para>The program accepts the following arguments:</para>

<!-- LW: FIX THIS -->

<cmdsynopsis>
<command>artsd</command>
<group choice="opt">
<option>-n</option>
<option>-p</option>
<option>-N</option>
<option>-W <replaceable>n</replaceable></option>

</group>
<group choice="opt">
<option>-a <replaceable>audiomethod</replaceable></option>
<option>-r <replaceable>sampling rate</replaceable></option>
<option>-b <replaceable>bits</replaceable></option>
<option>-d</option>
<option>-D <replaceable>devicename</replaceable></option>
<option>-F <replaceable>fragments</replaceable></option>
<option>-S <replaceable>size</replaceable></option>
<option>-s <replaceable>seconds</replaceable></option>
<option>-m <replaceable>appName</replaceable></option>
</group>
<group choice="opt">
<option>-h</option>
<option>-A</option>
<option>-v</option>
<option>-l <replaceable>level</replaceable></option>
</group>
</cmdsynopsis>

<variablelist><varlistentry>
<term><option>-r <replaceable>sampling rate</replaceable></option></term>
<listitem>
<para>Set sampling rate to use.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><option>-h</option></term>
<listitem>
<para>Display command usage.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><option>-n</option></term>
<listitem>
<para>Enable network transparency.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><option>-p <replaceable>port</replaceable></option>
</term>
<listitem>
<para>Set <acronym>TCP</acronym> port to use (implies
<option>-n</option>).</para>
</listitem>
</varlistentry>

<varlistentry>
<term><option>-u</option></term>
<listitem>
<para>Public, no authentication (dangerous).</para>
</listitem>
</varlistentry>

<varlistentry>
<term><option>-d</option></term>
<listitem>
<para>Enable full duplex operation.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-D <replaceable>device name</replaceable></option></term>
<listitem>
<para>Specify audio device (usually <filename>/dev/dsp</filename>).</para>
</listitem>
</varlistentry>

<varlistentry>
<term><option>-F <replaceable>fragments</replaceable></option></term>
<listitem>
<para>Set number of fragments.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><option>-S <replaceable>size</replaceable></option></term>
<listitem>
<para>Set fragment size, in bytes.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><option>-s <replaceable>seconds</replaceable></option></term>
<listitem>
<para>Set server auto-suspend time, in seconds. A value of zero
disables auto-suspend.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><option>-m <replaceable>appName</replaceable></option></term>
<listitem>
<para>Specify the name of an application to be used to display error,
warning, and informational messages. If you are running KDE you can
use the <application>artsmessage</application> utility for this.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><option>-N</option></term>
<listitem>
<para>
Increase the size of network buffers to a value suitable for running over
a 10 mbps LAN. This is equivalent to using the -w 5 option (see below).
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-w <replaceable>n</replaceable></option></term>
<listitem>
<para>
When running <application>artsd</application> over a network connection
to another host you typically want to use a larger buffer size to
avoid dropouts. ARts provides applications with a suggested minimum
buffer size. Without this option the default size is based on the
fragment size * fragment count. Using this option you can increase
the size from the default by a factor of <replaceable>n</replaceable>.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term><option>-l <replaceable>level</replaceable></option></term>
<listitem>
<para>Set information level - 3 (quiet), 2 (warnings), 1 (info), 0
(debug).</para>
</listitem>
</varlistentry>

<varlistentry>
<term><option>-v</option></term>
<listitem>
<para>Display version level.</para>
</listitem>
</varlistentry>

</variablelist>

<para>
In most cases simply running &artsd; will suffice.
</para>
</sect1>

<sect1 id="artswrapper">
<title>&artswrapper;</title>

<para>
To provide good real-time response, &artsd; is usually run as a
real-time process (on platforms where real-time priorities are
supported). This requires <systemitem class="username">root</systemitem>
permissions, so to minimize the security implications, &artsd; can be
started using the small wrapper program &artswrapper; which simply sets
real-time priority (running as <systemitem
class="username">root</systemitem>) and then executes &artsd; as a
non-<systemitem class="username">root</systemitem> user.
</para>

<para>If you make artswrapper SUID <systemitem
class="username">root</systemitem>, it will likely improve the quality
of your audio playback by reducing gaps in the music.  However, it
also increases the risk that a bug in the code or a malicious user can
crash or otherwise harm your machine.  In addition, on multi-user
machines, prioritizing high-quality audio may result in deteriorated
performance for the users who are trying to make
<quote>productive</quote> use of the machine.</para>

</sect1>

<sect1 id="artsshell">
<title>&artsshell;</title>

<para>
The &artsshell; command is intended as a utility to perform
miscellaneous functions related to the sound server. It is expected that
the utility will be extended with new commands in the future (see the
comments in the source code for some ideas).
</para>

<para>
The command accepts the following format:
</para>

<!-- LW: FIX THIS -->

<cmdsynopsis>
<command>artsshell</command>
<group>
<arg>suspend</arg><arg>status</arg>
<arg>terminate</arg>
<arg>autosuspend <replaceable>secs</replaceable></arg>
<arg>networkbuffers <replaceable>n</replaceable></arg>
<arg>volume [<replaceable>volume</replaceable>]</arg>
<arg>stereoeffect <replaceable>options</replaceable></arg>
</group>
<group>
<option>-h</option>
<option>-q</option>
</group>
</cmdsynopsis>

<para>artsshell [options] <replaceable>command</replaceable> [<replaceable>command-options</replaceable>] </para>

<para>
The following options are supported:
</para>

<variablelist>

<varlistentry>
<term><option>-q</option></term>
<listitem>
<para>Suppress all output.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><option>-h</option></term>
<listitem>
<para>Display command usage.</para>
</listitem>
</varlistentry>

</variablelist>

<para>The following commands are supported:</para>

<variablelist>

<varlistentry>
<term><option>suspend</option></term>
<listitem>
<para>
Suspend the sound server.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term><option>status</option></term>
<listitem>
<para>Display sound server status information.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><option>terminate</option></term>
<listitem>
<para>
Terminate the sound server. This may confuse and/or crash any
applications that are currently using it.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term><option>autosuspend</option> <parameter>seconds</parameter></term>
<listitem>
<para>
Set the autosuspend time to the specified number of seconds. The sound
server will suspend itself if idle for that period of time. A value of
zero disables auto-suspend.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term><option>networkbuffers</option> <parameter>n</parameter></term>
<listitem>
<para>
Set the size of the network buffers to be a factor of
<parameter>n</parameter> times the default size.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term><option>volume</option> [<replaceable>volume</replaceable>]</term>
<listitem>
<para>
Sets volume scaling for sound server audio output. The
<replaceable>volume</replaceable> argument is a floating point
value. With no argument the current volume is displayed.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term><option>stereoeffect list</option></term>
<listitem>
<para>List all of the available stereo effect modules.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><option>stereoeffect insert [top|bottom]</option> <replaceable>name</replaceable></term>
<listitem>
<para>Insert a stereo effect into the stereo effect stack. Returns
an identifier that can be used for later removing it. It can be
installed at the top or the bottom (the default).</para>
</listitem>
</varlistentry>

<varlistentry>
<term><option>stereoeffect remove</option> <replaceable>id</replaceable></term>
<listitem>
<para>Removes the stereo effect with identifier
<replaceable>id</replaceable> from the effects stack.</para>
</listitem>
</varlistentry>

</variablelist>

</sect1>

<sect1 id="artsplay">
<title><application>artsplay</application></title>

<para>The <application>artsplay</application> command is a simple utility to
play a sound file. It accepts a single argument corresponding to the name of a
sound file which is sent to the sound server to be played. The sound
file can be any common sound file type such as <literal
role="extension">wav</literal> or <literal
role="extension">au</literal>. This utility is good for testing that the
sound server is working. By running two commands in parallel or in rapid
succession you can demonstrate how the sound servers mixes more than one
sound source.</para>

</sect1>

<sect1 id="artsdsp">
<title><application>artsdsp</application></title>

<para>
The sound server only supports applications that are &arts;-aware.  Many
legacy applications want to access the sound device directly.  The
&artsdsp; command provides an interim solution that
allows most of these applications to run unchanged.
</para>

<para>
When an application is run under &artsdsp; all accesses to the <filename
class="devicefile">/dev/dsp</filename> audio device are intercepted and
mapped into &arts; <acronym>API</acronym> calls. While the device
emulation is not perfect, most applications work this way, albeit with
some degradation in performance and latency.
</para>

<para>The &artsdsp; command follows the format:
</para>

<!-- LW: FIX THIS -->
<para>
artsdsp [<replaceable>options</replaceable>] <replaceable>application arguments</replaceable>
</para>

<para>
The following options are recognized:
</para>

<variablelist>

<varlistentry>
<term><option>-h</option>,  <option>--help</option></term>
<listitem>
<para>Show brief help.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-n</option> <option>--name</option> = <replaceable>name</replaceable></term>
<listitem>
<para>Use <replaceable>name</replaceable> to identify player to <command>artsd</command>.</para>

</listitem>
</varlistentry>

<varlistentry>
<term><option>-m</option> <option>--mmap</option></term>
<listitem>
<para>Emulate memory mapping (&eg; for <application>Quake</application>).</para>
</listitem>
</varlistentry>

<varlistentry>
<term><option>-v</option> <option>--verbose</option></term>
<listitem>
<para>Show parameters.</para>
</listitem>
</varlistentry>

</variablelist>

<para>
A typical invocation is:
</para>

<para>
<userinput><command>artsdsp</command> <option>-v</option> <option>-m</option> <parameter>realplay <replaceable>song.mp3</replaceable></parameter></userinput>
</para>

<para>
Some applications work better with the <option>--mmap</option>
option. Not all features of the sound device are fully emulated, but
most applications should work. If you find one that does not, submit a
detailed bug report and the developers may be able to fix it. Again,
remember this is an interim solution and something of an ugly hack; the
best solution is to add native &arts; support to the applications.  If
your favorite sound application does not have &arts; support, ask the
developer to provide it.
</para>

</sect1>

<sect1 id="artscat">
<title><application>artscat</application></title>

<para>
This is a simple utility to send raw audio data to the sound server.
You need to specify the data format (sampling rate, sample size, and
number of channels). This is probably not a utility that you will use
often, but it can be handy for testing purposes. The command syntax is:
</para>

<!-- LW: FIX THIS -->
 
<para>
artscat [ <replaceable>options</replaceable> ] [ <replaceable>filename</replaceable> ]
</para>

<para>
If no file name is specified, it reads standard input. The following
options are supported:
</para>

<variablelist>
<varlistentry>
<term><option>-r</option> <parameter>sampling
rate</parameter></term>
<listitem>
<para>
Set the sampling rate to use.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term><option>-b</option> <parameter>bits</parameter></term>
<listitem>
<para>
Set sample size to use (8 or 16).
</para>
</listitem>
</varlistentry>

<varlistentry>
<term><option>-c</option> <parameter>channels</parameter></term>
<listitem>
<para>
Set number of channels (1 or 2).
</para>
</listitem>
</varlistentry>

<varlistentry>
<term><option>-h</option></term>
<listitem>
<para>
Display command usage and exit.
</para>
</listitem>
</varlistentry>

</variablelist>
</sect1>

<sect1 id="artscontrol">
<title>&artscontrol;</title>

<para>
This is a graphical utility for performing a number of tasks related to
the sound server. The default window displays two volume level
indicators and a slider to control overall output volume. From the
<guimenu>View</guimenu> menu you can select other functions:
</para>

<variablelist>

<varlistentry>
<term><guimenuitem>FFT Scope</guimenuitem></term>
<listitem>
<para>
Opens a window which shows a real-time spectrum analyzer style display.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term><guimenuitem>Audio Manager</guimenuitem></term>
<listitem>
<para>
Displays active sound sources and allows you to connect them to any of
the available busses.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term><guimenuitem>aRts Status</guimenuitem></term>
<listitem>
<para>
Shows if the sound server is running and if scheduling is
real-time. Indicates when server will autosuspend and allows you to
suspend it immediately.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term><guimenuitem>Midi Manager</guimenuitem></term>
<listitem>
<para>
Shows active &MIDI; inputs and outputs and allows you to make connections
[TODO: Does this work yet? Need more detail]. 
</para>
</listitem>
</varlistentry>

<varlistentry>
<term><guimenuitem>FreeVerb</guimenuitem></term>
<listitem>
<para>
Connects a FreeVerb reverb effect to the stack of &arts; output effects
and allows you to control the effect parameters graphically.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term><guimenuitem>Leds-like volume display</guimenuitem></term>
<listitem>
<para>
Changes the volume indicators in the main window to use a colored
<acronym>LED</acronym> display format instead of progress bars.
</para>
</listitem>
</varlistentry>

</variablelist>

</sect1>

<sect1 id="artsc-config">
<title><application>artsc-config</application></title>

<para>
This is a utility to assist developers using the &arts; C
<acronym>API</acronym>. It outputs the appropriate compiler and linker
options needed when compiling and linking code with &arts;. It is
intended to be used within make files to assist in portability. The
command accepts three options:
</para>

<variablelist>
<varlistentry>
<term><option>--cflags</option></term>
<listitem>
<para>
Displays the compiler flags needed when compiling with the &arts; C
<acronym>API</acronym>.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term><option>--libs</option></term>
<listitem>
<para>
Displays the linker flags needed when linking with the &arts; C
<acronym>API</acronym>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><acronym>--version</acronym></term>
<listitem>
<para>
Displays the version of the <command>artsc-config</command> command.
</para>
</listitem>
</varlistentry>
</variablelist>

<para>Typical output from the command is shown below:</para>

<screen width="40">
<prompt>%</prompt> <userinput><command>artsc-config</command> <option>--cflags</option></userinput>
<computeroutput>-I/usr/local/kde2/include/artsc</computeroutput>
<prompt>%</prompt> <userinput><command>artsc-config</command> <option>--libs</option></userinput>
<computeroutput>-L/usr/local/kde2/lib -ldl -lartsc -DPIC -fPIC -lpthread</computeroutput>
<prompt>%</prompt> <userinput><command>artsc-config</command> <option>--version</option></userinput>
<computeroutput>0.9.5</computeroutput>
</screen>

<para>
You could use this utility in a make file using a rule such as:
</para>

<programlisting>
artsc: artsc.c
        gcc `artsc-config --cflags` -o artsc artsc.c `artsc-config --libs`
</programlisting>

</sect1>

<sect1 id="mcopidl">
<title>&mcopidl;</title>

<para>
The &mcopidl; command is the &IDL; file compiler for &MCOP;, the
Multimedia Communication Protocol used by &arts;. Interfaces in &arts;
are defined in &IDL;, a language independent Interface Definition
Language. The &mcopidl; utility accepts an &IDL; file as input and
generates C++ header and source files for a class implementing the
interface. The command accepts the following syntax:
</para>

<!-- LW: FIX THIS -->

<para>mcopidl [ <replaceable>options</replaceable> ] <replaceable>filename</replaceable>
</para>

<para>The valid options are:</para>
<variablelist>
<varlistentry>
<term><option>-I</option> <parameter>directory</parameter></term>
<listitem>
<para>
Search in <parameter>directory</parameter> for includes.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term><option>-e</option> <parameter>name</parameter></term>
<listitem>
<para>
Exclude a struct, interface, or enum type <parameter>name</parameter>
from code generation.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term><option>-t</option></term>
<listitem>
<para>
Also create <literal role="extension">.mcoptype</literal>/<literal 
role="extension">.mcopclass</literal> files containing type information
for the &IDL; file.
</para>
</listitem>
</varlistentry>
</variablelist>

<para>
More information about &MCOP; and &IDL; is covered in the section <link
linkend="interfaces">Interfaces and &IDL;</link>.
</para>

</sect1>

</chapter>