Commit graph

305 commits

Author SHA1 Message Date
Peter Mattern
01aec46fb4 pacmd: Fix typo in set-default-* help
which was causing faulty output when running 'pacmd --help' on the shell
2015-10-30 18:47:16 +05:30
Deepak Srivastava
a3bf429efd Removed exclamation marks from user-visible messages.
<EP-E358F00C1D9A449EAE69225B9D2530F8>
According to rationale-"http://techbase.kde.org/Projects/Usability/HIG/Exclamation_points" as suggested in reported bug.
Component: misc

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=78563

Signed-off-by: Deepak Srivastava <srivastava.d@samsung.com>
2015-08-14 12:17:02 +03:00
Deepak Srivastava
c37698ddf8 patcl: Error msg from pactl not quite accurate for 'mute' commands
<EP-E358F00C1D9A449EAE69225B9D2530F8>
Updated the error string for mute commands in pactl. If someone forget to specify
the parameter on the commandline the resulting error message isn't quite right.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=90117

Signed-off-by: Deepak Srivastava <srivastava.d@samsung.com>
2015-08-12 15:20:46 +02:00
Manish Sogi
1d4715c43f pacmd: Placeholders describing command line options should not have spaces
<EP-F69A421D31544C56BDE97C590307C014>
Buglink: https://bugs.freedesktop.org/show_bug.cgi?id=78565

Signed-off-by: Manish Sogi <manish.sogi@samsung.com>
2015-08-12 12:02:13 +02:00
Deepak Srivastava
8b3b39c7d8 padsp: Avoid possible deadlock. Unlocked i->mainloop before returning from default case.
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=91184

Signed-off-by: Deepak Srivastava <srivastava.d@samsung.com>
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2015-07-21 16:44:26 +02:00
Peter Meerwald
6942e13a36 padsp: Fix wrong condition discovered by -Wlogical-not-parentheses warning
warnings emited by gcc 5.1:

utils/padsp.c: In function 'dsp_trigger':
utils/padsp.c:1902:39: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
     while (!pa_operation_get_state(o) != PA_OPERATION_DONE) {
                                       ^
utils/padsp.c: In function 'dsp_cork':
utils/padsp.c:1937:39: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
     while (!pa_operation_get_state(o) != PA_OPERATION_DONE) {
                                       ^
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2015-05-27 19:16:38 +02:00
David Henningsson
17e939dc15 core-util, pactl: Make one localised and one non-localised version of pa_yes_no
We currently use pa_yes_no to write module arguments, so they can not be
localised. Instead add a new pa_yes_no_localised function and use it in pactl
(and thus, revert all other places to use the non-localised version).

BugLink: https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/1445358
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-04-20 17:36:53 +02:00
Tanu Kaskinen
9860bc30ac pactl: Fix relative volume parsing
The recent change to reject leading '+' in pa_atod() broke the
relative volume parsing in pactl. This fixes that.
2015-04-10 11:19:18 +03:00
Peter Meerwald
ebee1a6306 pacat: Fix comment wording
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2015-02-26 23:30:25 +01:00
Peter Meerwald
8a08e7e38a pacat: State purpose of program depending how it was invoked
see https://bugs.freedesktop.org/show_bug.cgi?id=68135

state purpose of paplay/parec/pamon/parecord/pacat when invoked with -h

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2015-02-12 20:36:58 +01:00
Ondrej Holecek
5effc83479 update FSF addresses to FSF web page
FSF addresses used in PA sources are no longer valid and rpmlint
generates numerous warnings during packaging because of this.
This patch changes all FSF addresses to FSF web page according to
the GPL how-to: https://www.gnu.org/licenses/gpl-howto.en.html

Done automatically by sed-ing through sources.
2015-01-14 22:20:40 +02:00
Boris Egorov
f5c001af5f pacmd: add missing 'else' keyword
See code above for proper behavior.

Issue detected by PVS Studio
2015-01-13 11:27:47 +01:00
Felipe Sateler
4edc15346b pactl: fix getopt indexing for set-*-volume
When pactl is invoked with any options or the -- specifier, optind will
be > 1. Therefore using a static 3 value is wrong. Use optind+2 as both
offset and count difference.

Bug-Debian: http://bugs.debian.org/774810
2015-01-08 13:25:02 +01:00
Peter Meerwald
6d1fd4d1aa pactl: Remove deprecated 'stat' behaviour
the stat command should only output statistics, not info

behaviour was deprecated anno 2011 in 8ace9185 "pactl: Make stat backwards
compatible" -- fix this now

v2: (thanks Tanu Kaskinen):
* adjust shell completion

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-11-04 22:22:19 +01:00
Tanu Kaskinen
71ead4989a authkey: Rename pa_authkey_load_auto() to pa_authkey_load()
pa_authkey_load() was removed earlier, so the _auto suffix isn't
necessary any more.
2014-06-24 13:15:11 +03:00
Tanu Kaskinen
5141188ca8 client-conf: Move x11 and env loading to pa_client_conf_load()
This simplifies the code a bit.
2014-06-24 13:13:50 +03:00
Tanu Kaskinen
067e61cb66 client-conf: Don't report failure from pa_client_conf_load()
pa_context already ignored the return value of pa_client_conf_load(),
so the only places where the return value was not ignored were the
D-Bus server lookup thing and pax11publish. I don't think those cases
are negatively affected if they ignore errors in opening or parsing
client.conf.

pa_client_conf_env() never failed anyway, so returning int was
obviously redundant.
2014-06-24 13:13:04 +03:00
Peter Meerwald
f975aad1d3 pacat: Mention source in addition to sink where applicable in help
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-04-27 22:04:22 +02:00
Peter Meerwald
36f775482f pactl: Clean up checking for VOL_RELATIVE flag
VOL_RELATIVE if a bit flag (1 << 4), hence we can simply do
    if (vol_flags & VOL_RELATIVE) ...
instead of
    if ((vol_flags & VOL_RELATIVE) == VOL_RELATIVE) ...

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-04-16 00:02:14 +02:00
Peter Meerwald
edaa028290 pactl: Document ability to specify channel volumes individually
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-04-16 00:02:02 +02:00
Peter Meerwald
930159d4c5 pactl: Check consistency of volumes specified
Must use one way to specify volumes consistently, e.g.
+3dB +3dB, mixing different ways is not allowed, such as
40% 1000

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-04-16 00:01:47 +02:00
Parin Porecha
fc9fdfaf7b pactl: Allow to set volume of each channel independently (Bug #39190)
Example: pactl set-sink-volume "sink_name" 32000 40000
If the number of volumes provided is different than the number of channels
(excluding the case where a single volume is provided), an error message
is displayed explaining why the volumes could not be set.

patch proposed by Parin Porecha
code refactoring and commit message slightly edited by Peter Meerwald
2014-04-16 00:01:37 +02:00
Peter Meerwald
997e369691 pactl: Stop parsing option when the first non-option is encountered
fix bug
https://bugs.freedesktop.org/show_bug.cgi?id=77108

see getopt(3):
""By default, getopt() permutes the contents of argv as it scans, so that
  eventually all the nonoptions are at the end.  Two other modes are also
  implemented.   If  the first character of optstring is '+' or the envi‐
  ronment variable POSIXLY_CORRECT is set, then option  processing  stops
  as soon as a nonoption argument is encountered.  If the first character
  of optstring is '-', then each nonoption argv-element is handled as  if
  it were the argument of an option with character code 1.  (This is used
  by programs that were written to expect options and other argv-elements
  in any order and that care about the ordering of the two.)  The special
  argument "--" forces an end of option-scanning regardless of the  scan‐
  ning mode.""

prepend optstring with '+' to use POSIXLY_CORRECT mode

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2014-04-15 23:53:13 +02:00
Tanu Kaskinen
0a583fe0c3 client-conf: Remove redundant function parameters 2014-03-28 14:58:14 +02:00
Tanu Kaskinen
e1440395d1 pactl: Fix crash with older servers
Servers older than 0.9.15 don't know anything about cards, and card
operations will return a NULL pa_operation object when connected to
that old server. We must check the pa_operation pointer before passing
it to pa_operation_unref(), otherwise a NULL operation will result in
a crash.
2014-03-28 14:49:07 +02:00
Tanu Kaskinen
568702f44e pacat: Fix partially translated message
The word "not" was not translated.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=76529
2014-03-24 09:22:20 +02:00
Tanu Kaskinen
85891571f4 pactl: Fix a copy-paster error 2014-03-10 12:50:19 +02:00
Luiz Augusto von Dentz
85e7fbc196 introspect: Fix ABI break introduced by b98a2e1
The size of pa_card_profile_info cannot change even if it just a field
appended to end because each entry is appended to a contiguous memory
and accessed by offset this may lead clients to access invalid data.

To fix a new struct called pa_card_profile_info2 is introduced and shall
be used for now on while pa_card_profile_info shall be considered
deprecated but it is still mantained for backward compatibility.

A new field called profiles2 is introduced to pa_card_info, this new field
is an array of pointers to pa_card_profile_info2 so it should be possible
to append new fields to the end of the pa_card_profile_info2 without
breaking binary compatibility as the entries are not accessed by offset.
2013-11-05 21:26:34 +02:00
Magnus Ekhall
49f93eb2b0 pacat: Added support for recording from one specific sink input
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=66326
2013-08-14 16:09:54 +03:00
Peter Meerwald
193bf997c1 pacmd: Discriminate between interactive and non-interactive mode
interactive sessions are initiated with a hello message in order to
receive a welcome message from the PA daemon and a command prompt

interactive sessions have a terminal connected to stdin

non-interactive sessions execute commands given on the command line
or received via stdin; non-interactive sessions have neither welcome
message nor command prompt

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2013-08-02 16:25:27 +02:00
Luiz Augusto von Dentz
16886bbf87 pactl: Print available flag of card profiles 2013-07-15 19:51:45 +03:00
Tanu Kaskinen
ee5e245afa Use pa_(c)volume_snprint_verbose() everywhere
All pa_cvolume_snprint(), pa_volume_snprint(),
pa_sw_cvolume_snprint_dB() and pa_sw_volume_snprint_dB() calls have
been replaced with pa_cvolume_snprint_verbose() and
pa_volume_snprint_verbose() calls, making the log output more
informative and the code sometimes simpler.
2013-07-09 17:37:04 +03:00
poljar (Damir Jelić)
d806b19714 Remove pa_bool_t and replace it with bool.
commands used for this (executed from the pulseaudio/src directory):
    find . -regex '\(.*\.[hc]\|.*\.cc\|.*\.m4\)' -not -name 'macro.h' \
        -a -not -name 'reserve.[ch]' -a -not -name 'reserve-monitor.[ch]' \
        -a -not -name 'glib-mainloop.c' -a -not -name 'gkt-test.c' \
        -a -not -name 'glib-mainloop.c' -a -not -name 'gkt-test.c' \
        -a -not -name 'poll-win32.c' -a -not -name 'thread-win32.c' \
        -a -not -name 'dllmain.c' -a -not -name 'gconf-helper.c' \
        -exec sed -i -e 's/\bpa_bool_t\b/bool/g' \
        -e 's/\bTRUE\b/true/g' -e 's/\bFALSE\b/false/g' {} \;

and:
    sed -i -e '181,194!s/\bpa_bool_t\b/bool/' \
        -e '181,194!s/\bTRUE\b/true/' -e \
        '181,194!s/\bFALSE\b/false/' pulsecore/macro.h
2013-07-04 12:25:30 +03:00
poljar (Damir Jelić)
97da92d894 Whitespace cleanup: Remove all multiple newlines
This patch removes all occurrences of double and triple
newlines.

Command used for this:
find .  -type d \( -name ffmpeg \) -prune -o \
        -regex '\(.*\.[hc]\|.*\.cc\)' \
        -a -not -name 'adrian-aec.*' -a -not \
        -name reserve.c -a -not -name 'rtkit.*' \
        -exec sed -i -e '/^$/{N;s/^\n$//}' {} \;

Two passes were needed to remove triple newlines.
The excluded files are mirrored files from external sources.
2013-06-24 16:56:24 +03:00
poljar (Damir Jelić)
e95d054e40 Style fix: Remove new lines from opening brackets
This patch replaces every occurrence of ')\n{' with ') {'.

Command used for this:
    find .  -type d \( -name ffmpeg \) -prune -o \
        -regex '\(.*\.[hc]\|.*\.cc\)' \
        -a -not -name core-util.c -a -not \
        -name adrian-aec.c -a -not -name g711.c \
        -exec sed -i -e '/)$/{N;s/)\n{$/) {/}' {} \;

The excluded files are mirrored files from external sources.
2013-06-24 16:56:24 +03:00
poljar (Damir Jelić)
cbd274676d Style fix: Add a space between the closing/opening bracket
This patch replaces every occurrence of '){' with ') {'.
The ffmpeg source tree was excluded since it will disappear anyways.

Command used for this:
    find . -type d \( -name ffmpeg \) -prune -o \
        -regex '\(.*\.[hc]\|.*\.cc\)' \
        -exec sed -i -e 's/){/) {/' {} \;
2013-06-24 16:56:24 +03:00
Peter Meerwald
83c3cf0a65 pactl: Use colon to separate priority in profiles output
for example:
  Profiles:
	input:analog-stereo: Analog Stereo Input (sinks: 0, sources: 1, priority. 60)
	output:analog-stereo: Analog Stereo Output (sinks: 1, sources: 0, priority. 6000)

it should be "priority: xxx", not "priority. xxx"

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
2013-06-04 00:38:43 +05:30
Nikolay Amiantov
8cc4e7786f pactl: Flush stdout buffer when printing subscribe events.
"pactl subscribe" is running continuously, and without flushing its output is
not usable for "process-on-arrival" per-line tasks, such as grepping. This
patch should fix this. For example, now:
pactl subscribe | grep 'server'
should print only server events as they arrive.
2013-06-04 00:38:41 +05:30
Tanu Kaskinen
5237bab36e pasuspender: Resume before exiting in case of SIGINT or fork() failure.
Pressing Ctrl-C in a terminal while pasuspender is running
causes the sinks and sources to stay suspended after
pasuspender has exited, which is very annoying. This patch
fixes that problem, and also a similar problem with fork()
failures.
2013-06-04 00:38:40 +05:30
Yuri Chornoivan
168751dc66 Fix various typos in messages and comments 2013-04-16 12:42:50 +02:00
Tanu Kaskinen
a560cf3b67 pacat: Fix mode detection for parecord
Due to the missing "else", parecord was interpreted as parec, causing
the raw flag to be set when it shouldn't have been set.
2013-03-21 12:35:07 +02:00
Tanu Kaskinen
8cb34c6960 pacat: Handle holes in recording streams.
pa_silence_memory() pulls sample-util as a dependency, so it had to
be moved from libpulsecore to libpulsecommon. sample-util in turn
pulls some more stuff.
2013-02-04 12:07:39 +02:00
Tanu Kaskinen
94ac039b87 padsp: Handle holes in recording streams. 2013-02-04 12:07:36 +02:00
David Henningsson
596d9aa740 pactl: Document @DEFAULT_SINK@, @DEFAULT_SOURCE@ and @DEFAULT_MONITOR@
I went to implement the possibility to use the default sink/source
but found that it was already working. So I figured I'd update
the help text instead.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-02-04 10:01:57 +01:00
poljar (Damir Jelić)
831cae16d4 pactl: Add a command for setting the default sink/source.
This adds two new commands to pactl:
    set-default-sink
    set-default-source

This command has been part of the native protocol for a long time,
no reason not to expose it in pactl.
2013-02-01 07:16:20 +02:00
poljar (Damir Jelić)
9779aa4985 pactl: Add the ability to toggle mute state.
This patch adds the ability to toggle mute for sink/sources and
sink-inputs and source outputs.

All mute commands now accept 1|0|toggle as an argument.
2013-01-27 18:11:54 +02:00
Tanu Kaskinen
19c058dd08 Fix pa_parse_boolean() return value checking.
pa_parse_boolean() return value shouldn't be stored in
pa_bool_t, because 1 and -1 need to be distinguished.
2012-12-19 12:31:50 +02:00
Tanu Kaskinen
188d037150 pasuspender: Check pa_context_connect() return value. 2012-12-19 12:31:49 +02:00
Matěj Laitl
f36148a82e qpaeq: Try to load equalizer module before failing, better error messages
This fixes bug 38728 [1]. When equalizer features are unavailable in running
pulseaudio daemon, try to load relevant module. If this fails, following error
is printed on stderr instead of a confusing traceback:

It seems that running pulseaudio does not support equalizer features and
loading module-equalizer-sink module failed. Exiting...

[1] https://bugs.freedesktop.org/show_bug.cgi?id=38728

Signed-off-by: Matěj Laitl <matej@laitl.cz>
2012-12-19 12:31:49 +02:00
Thomas Martitz
b342daded9 pacat: Replace read(), write() with pa_* equivalent.
Calling pa_read() and pa_write() seems more appropriate since they deal better
with platform specific issues. This doesn't actually fix any open issue since
only stdio is affected but it seems more future proof.
2012-10-23 12:12:37 +05:30