[pulseaudio-commits] 5 commits - man/pactl.1.xml.in src/pulsecore src/utils
Colin Guthrie
colin at kemper.freedesktop.org
Wed Aug 10 01:21:18 PDT 2011
man/pactl.1.xml.in | 136 ++++++++++++++++++++++++++++++++++++----------------
src/pulsecore/log.c | 4 -
src/utils/pactl.c | 62 +++++++++++------------
3 files changed, 126 insertions(+), 76 deletions(-)
New commits:
commit 8ace9185aaeeca8166ff2ac2efb9184be724a549
Author: Colin Guthrie <colin at mageia.org>
Date: Tue Aug 9 16:29:30 2011 +0200
pactl: Make stat backwards compatible with previous versions.
This is not ideal but in order to aid people using it in scripts
etc, we will maintain backwards compatibiliy here.
Also add a 'short' mode and mention in the man page that this
will ultimately become the default at some point in the future.
diff --git a/man/pactl.1.xml.in b/man/pactl.1.xml.in
index bb366ea..3a70fb6 100644
--- a/man/pactl.1.xml.in
+++ b/man/pactl.1.xml.in
@@ -66,8 +66,11 @@ USA.
<section name="Commands">
<option>
- <p><opt>stat</opt></p>
- <optdesc><p>Dump a few statistics about the memory usage of the PulseAudio daemon.</p></optdesc>
+ <p><opt>stat</opt> [short]</p>
+ <optdesc><p>Dump a few statistics about the memory usage of the PulseAudio daemon. (Note: for backwards
+ compatibility, we also show the output of the <arg>info</arg> command. In order to only show
+ statistics, use the optional <arg>short</arg> argument. In a future version of PA we will
+ make this the default)</p></optdesc>
</option>
<option>
diff --git a/src/utils/pactl.c b/src/utils/pactl.c
index 83547a5..c95a38c 100644
--- a/src/utils/pactl.c
+++ b/src/utils/pactl.c
@@ -1001,7 +1001,9 @@ static void context_state_callback(pa_context *c, void *userdata) {
switch (action) {
case STAT:
pa_operation_unref(pa_context_stat(c, stat_callback, NULL));
- break;
+ if (short_list_format)
+ break;
+ actions++;
case INFO:
pa_operation_unref(pa_context_get_server_info(c, get_server_info_callback, NULL));
@@ -1251,9 +1253,9 @@ static int parse_volume(const char *vol_spec, pa_volume_t *vol, enum volume_flag
static void help(const char *argv0) {
- printf("%s %s %s\n", argv0, _("[options]"), "stat");
+ printf("%s %s %s\n", argv0, _("[options]"), "stat [short]");
printf("%s %s %s\n", argv0, _("[options]"), "info");
- printf("%s %s %s %s\n", argv0, _("[options]"), "list", _("[short] [TYPE]"));
+ printf("%s %s %s %s\n", argv0, _("[options]"), "list [short]", _("[TYPE]"));
printf("%s %s %s\n", argv0, _("[options]"), "exit");
printf("%s %s %s %s\n", argv0, _("[options]"), "upload-sample", _("FILENAME [NAME]"));
printf("%s %s %s %s\n", argv0, _("[options]"), "play-sample ", _("NAME [SINK]"));
@@ -1344,10 +1346,13 @@ int main(int argc, char *argv[]) {
}
if (optind < argc) {
- if (pa_streq(argv[optind], "stat"))
+ if (pa_streq(argv[optind], "stat")) {
action = STAT;
+ short_list_format = FALSE;
+ if (optind+1 < argc && pa_streq(argv[optind+1], "short"))
+ short_list_format = TRUE;
- else if (pa_streq(argv[optind], "info"))
+ } else if (pa_streq(argv[optind], "info"))
action = INFO;
else if (pa_streq(argv[optind], "exit"))
commit 49c20b3e3d6929d93342d5d836189592c9ca7a03
Author: Maarten Bosmans <mkbosmans at gmail.com>
Date: Sat Aug 6 12:29:53 2011 +0200
pactl: Split help string up in shorter pieces for easier translation
diff --git a/src/utils/pactl.c b/src/utils/pactl.c
index 8ebcabf..83547a5 100644
--- a/src/utils/pactl.c
+++ b/src/utils/pactl.c
@@ -1251,32 +1251,30 @@ static int parse_volume(const char *vol_spec, pa_volume_t *vol, enum volume_flag
static void help(const char *argv0) {
- printf(_("%s [options] stat\n"
- "%s [options] info\n"
- "%s [options] list [short] [TYPE]\n"
- "%s [options] exit\n"
- "%s [options] upload-sample FILENAME [NAME]\n"
- "%s [options] play-sample NAME [SINK]\n"
- "%s [options] remove-sample NAME\n"
- "%s [options] load-module NAME [ARGS ...]\n"
- "%s [options] unload-module #N\n"
- "%s [options] move-(sink-input|source-output) #N SINK|SOURCE\n"
- "%s [options] suspend-(sink|source) NAME|#N 1|0\n"
- "%s [options] set-card-profile CARD PROFILE\n"
- "%s [options] set-(sink|source)-port NAME|#N PORT\n"
- "%s [options] set-(sink|source)-volume NAME|#N VOLUME\n"
- "%s [options] set-(sink-input|source-output)-volume #N VOLUME\n"
- "%s [options] set-(sink|source)-mute NAME|#N 1|0\n"
- "%s [options] set-sink-input-mute #N 1|0\n"
- "%s [options] subscribe\n\n"
+ printf("%s %s %s\n", argv0, _("[options]"), "stat");
+ printf("%s %s %s\n", argv0, _("[options]"), "info");
+ printf("%s %s %s %s\n", argv0, _("[options]"), "list", _("[short] [TYPE]"));
+ printf("%s %s %s\n", argv0, _("[options]"), "exit");
+ printf("%s %s %s %s\n", argv0, _("[options]"), "upload-sample", _("FILENAME [NAME]"));
+ printf("%s %s %s %s\n", argv0, _("[options]"), "play-sample ", _("NAME [SINK]"));
+ printf("%s %s %s %s\n", argv0, _("[options]"), "remove-sample ", _("NAME"));
+ printf("%s %s %s %s\n", argv0, _("[options]"), "load-module ", _("NAME [ARGS ...]"));
+ printf("%s %s %s %s\n", argv0, _("[options]"), "unload-module ", _("#N"));
+ printf("%s %s %s %s\n", argv0, _("[options]"), "move-(sink-input|source-output)", _("#N SINK|SOURCE"));
+ printf("%s %s %s %s\n", argv0, _("[options]"), "suspend-(sink|source)", _("NAME|#N 1|0"));
+ printf("%s %s %s %s\n", argv0, _("[options]"), "set-card-profile ", _("CARD PROFILE"));
+ printf("%s %s %s %s\n", argv0, _("[options]"), "set-(sink|source)-port", _("NAME|#N PORT"));
+ printf("%s %s %s %s\n", argv0, _("[options]"), "set-(sink|source)-volume", _("NAME|#N VOLUME"));
+ printf("%s %s %s %s\n", argv0, _("[options]"), "set-(sink-input|source-output)-volume", _("#N VOLUME"));
+ printf("%s %s %s %s\n", argv0, _("[options]"), "set-(sink|source)-mute", _("NAME|#N 1|0"));
+ printf("%s %s %s %s\n", argv0, _("[options]"), "set-sink-input-mute", _("#N 1|0"));
+ printf("%s %s %s\n", argv0, _("[options]"), "subscribe");
+
+ printf(_("\n"
" -h, --help Show this help\n"
" --version Show version\n\n"
" -s, --server=SERVER The name of the server to connect to\n"
- " -n, --client-name=NAME How to call this client on the server\n"),
- argv0, argv0, argv0, argv0, argv0,
- argv0, argv0, argv0, argv0, argv0,
- argv0, argv0, argv0, argv0, argv0,
- argv0, argv0, argv0);
+ " -n, --client-name=NAME How to call this client on the server\n"));
}
enum {
commit 3e14019c44f85414a0955c3cbd56d8f41dd78e47
Author: Maarten Bosmans <mkbosmans at gmail.com>
Date: Sat Aug 6 12:29:52 2011 +0200
pactl: Short --help output a bit by consolidating sink/source commands
diff --git a/src/utils/pactl.c b/src/utils/pactl.c
index e6f9c17..8ebcabf 100644
--- a/src/utils/pactl.c
+++ b/src/utils/pactl.c
@@ -1258,22 +1258,16 @@ static void help(const char *argv0) {
"%s [options] upload-sample FILENAME [NAME]\n"
"%s [options] play-sample NAME [SINK]\n"
"%s [options] remove-sample NAME\n"
- "%s [options] move-sink-input SINKINPUT SINK\n"
- "%s [options] move-source-output SOURCEOUTPUT SOURCE\n"
"%s [options] load-module NAME [ARGS ...]\n"
- "%s [options] unload-module MODULE\n"
- "%s [options] suspend-sink SINK 1|0\n"
- "%s [options] suspend-source SOURCE 1|0\n"
+ "%s [options] unload-module #N\n"
+ "%s [options] move-(sink-input|source-output) #N SINK|SOURCE\n"
+ "%s [options] suspend-(sink|source) NAME|#N 1|0\n"
"%s [options] set-card-profile CARD PROFILE\n"
- "%s [options] set-sink-port SINK PORT\n"
- "%s [options] set-source-port SOURCE PORT\n"
- "%s [options] set-sink-volume SINK VOLUME\n"
- "%s [options] set-source-volume SOURCE VOLUME\n"
- "%s [options] set-sink-input-volume SINKINPUT VOLUME\n"
- "%s [options] set-source-output-volume SOURCEOUTPUT VOLUME\n"
- "%s [options] set-sink-mute SINK 1|0\n"
- "%s [options] set-source-mute SOURCE 1|0\n"
- "%s [options] set-sink-input-mute SINKINPUT 1|0\n"
+ "%s [options] set-(sink|source)-port NAME|#N PORT\n"
+ "%s [options] set-(sink|source)-volume NAME|#N VOLUME\n"
+ "%s [options] set-(sink-input|source-output)-volume #N VOLUME\n"
+ "%s [options] set-(sink|source)-mute NAME|#N 1|0\n"
+ "%s [options] set-sink-input-mute #N 1|0\n"
"%s [options] subscribe\n\n"
" -h, --help Show this help\n"
" --version Show version\n\n"
@@ -1282,8 +1276,7 @@ static void help(const char *argv0) {
argv0, argv0, argv0, argv0, argv0,
argv0, argv0, argv0, argv0, argv0,
argv0, argv0, argv0, argv0, argv0,
- argv0, argv0, argv0, argv0, argv0,
- argv0, argv0, argv0, argv0);
+ argv0, argv0, argv0);
}
enum {
commit d36a899062c27cf4a189801abb15515e3d56bf13
Author: Maarten Bosmans <mkbosmans at gmail.com>
Date: Sat Aug 6 12:29:51 2011 +0200
pactl: Update manpage
diff --git a/man/pactl.1.xml.in b/man/pactl.1.xml.in
index 7ba768a..bb366ea 100644
--- a/man/pactl.1.xml.in
+++ b/man/pactl.1.xml.in
@@ -24,18 +24,7 @@ USA.
<manpage name="pactl" section="1" desc="Control a running PulseAudio sound server">
<synopsis>
- <cmd>pactl [<arg>options</arg>] stat</cmd>
- <cmd>pactl [<arg>options</arg>] list</cmd>
- <cmd>pactl [<arg>options</arg>] exit</cmd>
- <cmd>pactl [<arg>options</arg>] upload-sample <arg>FILENAME</arg> [<arg>NAME</arg>]</cmd>
- <cmd>pactl [<arg>options</arg>] play-sample <arg>NAME</arg> [<arg>SINK</arg>]</cmd>
- <cmd>pactl [<arg>options</arg>] remove-sample <arg>NAME</arg></cmd>
- <cmd>pactl [<arg>options</arg>] move-sink-input <arg>ID</arg> <arg>SINK</arg></cmd>
- <cmd>pactl [<arg>options</arg>] move-source-input <arg>ID</arg> <arg>SOURCE</arg></cmd>
- <cmd>pactl [<arg>options</arg>] load-module <arg>NAME</arg> [<arg>ARGUMENTS ...</arg>]</cmd>
- <cmd>pactl [<arg>options</arg>] unload-module <arg>ID</arg></cmd>
- <cmd>pactl [<arg>options</arg>] suspend-sink [<arg>SINK</arg>] <arg>1|0</arg></cmd>
- <cmd>pactl [<arg>options</arg>] suspend-source [<arg>SOURCE</arg>] <arg>1|0</arg></cmd>
+ <cmd>pactl [<arg>options</arg>] <arg>COMMAND</arg> [<arg>ARGS ...</arg>]</cmd>
<cmd>pactl <opt>--help</opt></cmd>
<cmd>pactl <opt>--version</opt></cmd>
</synopsis>
@@ -72,79 +61,77 @@ USA.
<optdesc><p>Specify the client name <file>pactl</file> shall pass to the server when connecting.</p></optdesc>
</option>
+ </options>
+
+ <section name="Commands">
+
<option>
<p><opt>stat</opt></p>
-
- <optdesc><p>Dump a few statistics about the PulseAudio daemon.</p></optdesc>
+ <optdesc><p>Dump a few statistics about the memory usage of the PulseAudio daemon.</p></optdesc>
</option>
<option>
- <p><opt>list</opt></p>
+ <p><opt>info</opt></p>
+ <optdesc><p>Dump some info about the PulseAudio daemon.</p></optdesc>
+ </option>
- <optdesc><p>Dump all currently loaded modules, available sinks, sources, streams and clients.</p></optdesc>
+ <option>
+ <p><opt>list</opt> [short] [<arg>TYPE</arg>]</p>
+ <optdesc><p>Dump all currently loaded modules, available sinks, sources, streams, etc. <arg>TYPE</arg> must be one of:
+ modules, sinks, sources, sink-inputs, source-outputs, clients, samples, cards. If not specified, all info is listed. If
+ short is given, output is in a tabular format, for easy parsing by scripts.</p></optdesc>
</option>
<option>
<p><opt>exit</opt></p>
-
<optdesc><p>Asks the PulseAudio server to terminate.</p></optdesc>
</option>
-
<option>
<p><opt>upload-sample</opt> <arg>FILENAME</arg> [<arg>NAME</arg>]</p>
-
<optdesc><p>Upload a sound from the specified audio file into
the sample cache. The file types supported are those understood
by <file>libsndfile</file>. The sample in the cache is named
after the audio file, unless the name is explicitly
specified.</p></optdesc>
-
</option>
<option>
<p><opt>play-sample</opt> <arg>NAME</arg> [<arg>SINK</arg>]</p>
-
<optdesc><p>Play the specified sample from the sample cache. It
is played on the default sink, unless the symbolic name or the
numerical index of the sink to play it on is
specified.</p></optdesc>
-
</option>
<option>
<p><opt>remove-sample</opt> <arg>NAME</arg></p>
-
<optdesc><p>Remove the specified sample from the sample cache.</p></optdesc>
</option>
<option>
- <p><opt>move-sink-input</opt> <arg>ID</arg> <arg>SINK</arg></p>
-
- <optdesc><p>Move the specified playback stream (identified by its numerical index) to the specified sink (identified by its symbolic name or numerical index).</p></optdesc>
+ <p><opt>load-module</opt> <arg>NAME</arg> [<arg>ARGUMENTS ...</arg>]</p>
+ <optdesc><p>Load the specified module with the specified arguments into the running sound server.
+ Prints the numeric index of the module just loaded to STDOUT. You can use it to unload the module later.</p></optdesc>
</option>
<option>
- <p><opt>move-source-output</opt> <arg>ID</arg> <arg>SOURCE</arg></p>
-
- <optdesc><p>Move the specified recording stream (identified by its numerical index) to the specified source (identified by its symbolic name or numerical index).</p></optdesc>
+ <p><opt>unload-module</opt> <arg>ID</arg></p>
+ <optdesc><p>Unload the module instance identified by the specified numeric index.</p></optdesc>
</option>
<option>
- <p><opt>load-module</opt> <arg>NAME</arg> [<arg>ARGUMENTS ...</arg>]</p>
-
- <optdesc><p>Load the specified module with the specified arguments into the running sound server. Prints the numeric index of the module just loaded to STDOUT. You can use it to unload the module later.</p></optdesc>
+ <p><opt>move-sink-input</opt> <arg>ID</arg> <arg>SINK</arg></p>
+ <optdesc><p>Move the specified playback stream (identified by its numerical index) to the specified sink (identified by its symbolic name or numerical index).</p></optdesc>
</option>
<option>
- <p><opt>unload-module</opt> <arg>ID</arg></p>
-
- <optdesc><p>Unload the module instance identified by the specified numeric index.</p></optdesc>
+ <p><opt>move-source-output</opt> <arg>ID</arg> <arg>SOURCE</arg></p>
+ <optdesc><p>Move the specified recording stream (identified by its numerical index) to the specified source (identified by its symbolic name or numerical index).</p></optdesc>
</option>
<option>
<p><opt>suspend-sink</opt> <arg>SINK</arg> <arg>1|0</arg></p>
-
<optdesc><p>Suspend or resume the specified sink (which my be
specified either by its symbolic name, or by its numeric index),
depending whether 1 (suspend) or 0 (resume) is passed as last
@@ -157,7 +144,6 @@ USA.
<option>
<p><opt>suspend-source</opt> <arg>SOURCE</arg> <arg>1|0</arg></p>
-
<optdesc><p>Suspend or resume the specified source (which my be
specified either by its symbolic name, or by its numeric index),
depending whether 1 (suspend) or 0 (resume) is passed as last
@@ -168,16 +154,81 @@ USA.
behaviour depends on the module.</p></optdesc>
</option>
- </options>
+ <option>
+ <p><opt>set-card-profile</opt> <arg>CARD</arg> <arg>PROFILE</arg></p>
+ <optdesc><p>Set the specified card (identified by its symbolic name or numerical index) to the specified profile (identified by its symbolic name).</p></optdesc>
+ </option>
+
+ <option>
+ <p><opt>set-sink-port</opt> <arg>SINK</arg> <arg>PORT</arg></p>
+ <optdesc><p>Set the specified sink (identified by its symbolic name or numerical index) to the specified port (identified by its symbolic name).</p></optdesc>
+ </option>
+
+ <option>
+ <p><opt>set-source-port</opt> <arg>SOURCE</arg> <arg>PORT</arg></p>
+ <optdesc><p>Set the specified source (identified by its symbolic name or numerical index) to the specified port (identified by its symbolic name).</p></optdesc>
+ </option>
+
+ <option>
+ <p><opt>set-sink-volume</opt> <arg>SINK</arg> <arg>VOLUME</arg></p>
+ <optdesc><p>Set the volume of the specified sink (identified by its symbolic name or numerical index).
+ <arg>VOLUME</arg> can be specified as an integer (e.g. 2000, 16384), a linear factor (e.g. 0.4, 1.100), a percentage
+ (e.g. 10%, 100%) or a decibel value (e.g. 0dB, 20dB). If the volume specification start with a + or - the volume
+ adjustment will be relative to the current sink volume.</p></optdesc>
+ </option>
+
+ <option>
+ <p><opt>set-source-volume</opt> <arg>SOURCE</arg> <arg>VOLUME</arg></p>
+ <optdesc><p>Set the volume of the specified source (identified by its symbolic name or numerical index).
+ <arg>VOLUME</arg> can be specified as an integer (e.g. 2000, 16384), a linear factor (e.g. 0.4, 1.100), a percentage
+ (e.g. 10%, 100%) or a decibel value (e.g. 0dB, 20dB). If the volume specification start with a + or - the volume
+ adjustment will be relative to the current source volume.</p></optdesc> </option>
+
+ <option>
+ <p><opt>set-sink-input-volume</opt> <arg>INPUT</arg> <arg>VOLUME</arg></p>
+ <optdesc><p>Set the volume of the specified sink input (identified by its numerical index).
+ <arg>VOLUME</arg> can be specified as an integer (e.g. 2000, 16384), a linear factor (e.g. 0.4, 1.100), a percentage
+ (e.g. 10%, 100%) or a decibel value (e.g. 0dB, 20dB). If the volume specification start with a + or - the volume
+ adjustment will be relative to the current sink input volume.</p></optdesc> </option>
+
+ <option>
+ <p><opt>set-source-output-volume</opt> <arg>OUTPUT</arg> <arg>VOLUME</arg></p>
+ <optdesc><p>Set the volume of the specified source output (identified by its numerical index).
+ <arg>VOLUME</arg> can be specified as an integer (e.g. 2000, 16384), a linear factor (e.g. 0.4, 1.100), a percentage
+ (e.g. 10%, 100%) or a decibel value (e.g. 0dB, 20dB). If the volume specification start with a + or - the volume
+ adjustment will be relative to the current source output volume.</p></optdesc>
+ </option>
+
+ <option>
+ <p><opt>set-sink-mute</opt> <arg>SINK</arg> <arg>1|0</arg></p>
+ <optdesc><p>Set the mute status of the specified sink (identified by its symbolic name or numerical index).</p></optdesc>
+ </option>
+
+ <option>
+ <p><opt>set-source-mute</opt> <arg>SOURCE</arg> <arg>1|0</arg></p>
+ <optdesc><p>Set the mute status of the specified source (identified by its symbolic name or numerical index).</p></optdesc>
+ </option>
+
+ <option>
+ <p><opt>set-sink-input-mute</opt> <arg>INPUT</arg> <arg>1|0</arg></p>
+ <optdesc><p>Set the mute status of the specified sink input (identified by its numerical index).</p></optdesc>
+ </option>
+
+ <option>
+ <p><opt>subscribe</opt></p>
+ <optdesc><p>Subscribe to events, pactl does not exit by itself, but keeps waiting for new events.</p></optdesc>
+ </option>
+
+ </section>
<section name="Authors">
<p>The PulseAudio Developers <@PACKAGE_BUGREPORT@>; PulseAudio is available from <url href="@PACKAGE_URL@"/></p>
</section>
- <section name="See also">
+ <seealso>
<p>
<manref name="pulseaudio" section="1"/>, <manref name="pacmd" section="1"/>
</p>
- </section>
+ </seealso>
</manpage>
commit 6a03af769a14b1d1a07f6d819574957c216ecc2e
Author: Lu Guanqun <guanqun.lu at intel.com>
Date: Mon Aug 8 10:24:13 2011 +0800
log: add thread name
This patch displays thread name in the log, that would be more descriptive.
It improves Xingchao (xingchao.wang at intel.com)'s patch which shows thread id.
Signed-off-by: Lu Guanqun <guanqun.lu at intel.com>
diff --git a/src/pulsecore/log.c b/src/pulsecore/log.c
index 1303814..e2721ac 100644
--- a/src/pulsecore/log.c
+++ b/src/pulsecore/log.c
@@ -302,9 +302,9 @@ void pa_log_levelv_meta(
pa_vsnprintf(text, sizeof(text), format, ap);
if ((_flags & PA_LOG_PRINT_META) && file && line > 0 && func)
- pa_snprintf(location, sizeof(location), "[%s:%i %s()] ", file, line, func);
+ pa_snprintf(location, sizeof(location), "[%s][%s:%i %s()] ", pa_thread_get_name(pa_thread_self()), file, line, func);
else if ((_flags & (PA_LOG_PRINT_META|PA_LOG_PRINT_FILE)) && file)
- pa_snprintf(location, sizeof(location), "%s: ", pa_path_get_filename(file));
+ pa_snprintf(location, sizeof(location), "[%s] %s: ", pa_thread_get_name(pa_thread_self()), pa_path_get_filename(file));
else
location[0] = 0;
More information about the pulseaudio-commits
mailing list