summaryrefslogtreecommitdiffstats
path: root/doc/cli.html.in
blob: 01c04cc9afff0c5f98a482c64247e4591287db85 (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
<?xml version="1.0" encoding="iso-8859-1"?> <!-- -*-html-helper-*- -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>polypaudio: Simple Command Line Language</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>

<body>
<h1>Simple Command Line Language</h1>

<p><tt>polypaudio</tt> provides a simple command line language used by
configuration scripts as well as the modules <tt>module-cli</tt>
and <tt>module-cli-protocol-{unix,tcp}</tt>. Empty lines and lines
beginning with a hashmark (<tt>#</tt>) are silently ignored. Several
commands are supported:</p>

<h2>Miscellaneous Commands</h2>

<h3><tt>help</tt></h3>

<p>Show a quick help on the commands available.</p>

<h3><tt>exit</tt></h3>

<p>Terminate the daemon. If you want to terminate a CLI connection
("log out") you might want to use <tt>C-d</tt>.</p>

<h2>Status Commands</h2>

<h3><tt>modules</tt></h3>

<p>Show all currently loaded modules with their arguments.</p>

<h3><tt>sinks/sources</tt></h3>

<p>Show all currently registered sinks (resp. sources).</p>

<h3><tt>clients</tt></h3>

<p>Show all currently active clients.</p>

<h3><tt>sink_inputs/sink_outputs</tt></h3>

<p>Show all currently active inputs to sinks (resp. outputs of sources).</p>

<h3><tt>stat</tt></h3>

<p>Show some simple statistics about the allocated memory blocks and
the space used by them.</p>

<h3><tt>info</tt></h3>

<p>A combination of all status commands described above. <tt>ls</tt>
and <tt>list</tt> are synonyms for <tt>info</tt>.</p>

<h2>Module Management</h2>

<h3><tt>load</tt></h3>

<p>Load a module specified by its name and arguments. For most modules
it is OK to be loaded more than once.</p>

<h3><tt>unload</tt></h3>

<p>Unload a module specified by its index in the module list as
returned by <tt>modules</tt>.</p>

<h2>Configuration Commands</h2>

<h3><tt>sink_volume</tt></h3>

<p>Set the volume of the specified sink. You may specify the sink either
by its index in the sink list or by its name. The volume should be an
integer value greater or equal than 0 (= muted). Volume 256
(<tt>0x100</tt>) is normal volume, values greater than this amplify
the audio signal with clipping.</p>

<h3><tt>sink_input_volume</tt></h3>

<p>Set the volume of a sink input specified by its index the the sink
input list. The same volume rules apply as with <tt>sink_volume</tt>.</p>

<h3><tt>sink_default/source_default</tt></h3>

<p>Make a sink (resp. source) the default. You may specify the sink
(resp. ssource) by its index in the sink (resp. source) list or by its
name.</p>

<h2>Sample Cache</h2>

<h3><tt>scache_list</tt></h3>

<p>Lists the contents of the sample cache.</p>

<h3><tt>scache_play</tt></h3>

<p>Play a sample cache entry to a sink. Expects the sample name and the sink name as arguments.</p>

<h3><tt>sache_remove</tt></h3>

<p>Remove an entry from the sample cache. Expects the sample name as argument.</p>

<h3><tt>sache_load</tt></h3>

<p>Load an audio file to the sample cache. Expects the file name to load and the desired sample name as arguments.</p>

<h2>Module Autoloading</h2>

<h3><tt>autoload_list</tt></h3>

<p>Lists all currently defined autoloading entries.</p>

<h3><tt>autoload_sink_add/autoload_source_add</tt></h3>

<p>Adds an autoloading entry for a sink (resp. source). Expects the sink name (resp. source name), the module name and the module arguments as arguments.</p>

<h3><tt>autoload_sink_remove/autoload_source_remove</tt></h3>

<p>Remove an autoloading entry. Expects the sink name (resp. source name) as argument.</p>

<h2>Miscellaneous Commands</h2>

<h3><tt>play_file</tt></h3>

<p>Play an audio file to a sink. Expects the file name and the sink name as argumens.</p>

<h2>Killing Clients/Streams</h2>

<h3><tt>kill_client</tt></h3>

<p>Remove a client forcibly from the server. There is no protection that
the client reconnects immediately.</p>

<h3><tt>kill_sink_input/kill_source_output</tt></h3>

<p>Remove a sink input (resp. source output) forcibly from the
server. This will not remove the owning client or any other streams
opened by the client from the server.</p>

<h2>Meta Commands</h2>

<p>In addition the the commands described above there a few meta
directives supported by the command line interpreter:</p>

<h3><tt>.include</tt></h3>

<p>Executes the commands from the specified script file.</p>

<h3><tt>.fail/.nofail</tt></h3>

<p>Enable (resp. disable) that following failing commands will cancel
the execution of the current script file. This is a ignored when used
on the interactive command line.</p>

<h3><tt>.verbose/.noverbose</tt></h3>
<p>Enable (resp. disable) extra verbosity.</p>

<h2>Example Configuration Script</h2>

<p>Mark the following script as executable (<tt>chmod +x</tt>) and run it for a sensible polypaudio configuration.</p>

<pre>
#!/usr/bin/polaudio -F

# Create autoload entries for the device drivers
autoload_sink_add output module-alsa-sink device=plughw:0,0 rate=48000 sink_name=output
autoload_source_add input load module-alsa-source device=hw:1,0 source_name=input

# Load several protocols
load module-esound-protocol-tcp
load module-simple-protocol-tcp
load module-native-protocol-unix
load module-cli-protocol-unix

# Load the CLI module (This is similar to passing "-C" on the command line of polypaudio)
load module-cli

# Make some devices default
sink_default output
source_default input

# Don't fail if the audio files referred to below don't exist
.nofail

# Load an audio to the sample cache for usage with module-x11-bell
scache_load /usr/share/sounds/KDE_Notify.wav x11-bell
load module-x11-bell

# Play a welcome sound
play_file /usr/share/sounds/startup3.wav output
</pre>

<hr/>
<address class="grey">Lennart Poettering &lt;@PACKAGE_BUGREPORT@&gt;, August 2004</address>
<div class="grey"><i>$Id$</i></div>
</body> </html>