<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Priority</th>
<td>medium
</td>
</tr>
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - pactl parse_volume() cannot read negatives"
href="https://bugs.freedesktop.org/show_bug.cgi?id=77108">77108</a>
</td>
</tr>
<tr>
<th>CC</th>
<td>lennart@poettering.net
</td>
</tr>
<tr>
<th>Assignee</th>
<td>pulseaudio-bugs@lists.freedesktop.org
</td>
</tr>
<tr>
<th>Summary</th>
<td>pactl parse_volume() cannot read negatives
</td>
</tr>
<tr>
<th>QA Contact</th>
<td>pulseaudio-bugs@lists.freedesktop.org
</td>
</tr>
<tr>
<th>Severity</th>
<td>blocker
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux (All)
</td>
</tr>
<tr>
<th>Reporter</th>
<td>nguenthe+freedesktopbugzilla@uwaterloo.ca
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Component</th>
<td>tools
</td>
</tr>
<tr>
<th>Product</th>
<td>PulseAudio
</td>
</tr></table>
<p>
<div>
<pre>I cannot find a way with pulse to reduce the volume from the command line. I
found that the manpage claims
<span class="quote">> If the volume specification start with a + or -
> the volume adjustment will be relative to the current sink volume.</span >
But it does not work:
[me@galleon ~]$ pactl set-sink-volume 0 -10%
pactl: invalid option -- '1'
However this is fine:
[me@galleon ~]$ pactl set-sink-volume 0 +10%
parse_volume() should work, afterall
<a href="http://cgit.freedesktop.org/pulseaudio/pulseaudio/tree/src/utils/pactl.c#n1476">http://cgit.freedesktop.org/pulseaudio/pulseaudio/tree/src/utils/pactl.c#n1476</a>
says
<span class="quote">> *vol_flags = (pa_startswith(vs, "+") || pa_startswith(vs, "-")) ? VOL_RELATIVE : VOL_ABSOLUTE;</span >
I believe the problem is this line
<a href="http://cgit.freedesktop.org/pulseaudio/pulseaudio/tree/src/utils/pactl.c#n1599">http://cgit.freedesktop.org/pulseaudio/pulseaudio/tree/src/utils/pactl.c#n1599</a>:
getopt is parsing (and choking) on the - before parse_volume() ever gets it.
I have the most recent PA; this is my PA version info:
[kousu@galleon ~]$ pacman -Qi pulseaudio
Name : pulseaudio
Version : 5.0-1
Description : A featureful, general-purpose sound server
Architecture : x86_64
URL : <a href="http://www.freedesktop.org/wiki/Software/PulseAudio">http://www.freedesktop.org/wiki/Software/PulseAudio</a>
Licenses : LGPL AGPL3
Groups : None
Provides : None
Depends On : libpulse=5.0-1 rtkit libltdl speex tdb fftw orc
libsamplerate webrtc-audio-processing sbc
Optional Deps : pulseaudio-alsa: ALSA configuration (recommended) [installed]
avahi: zeroconf publishing and discovery [installed]
bluez: Bluetooth [installed]
bluez-libs: Bluetooth [installed]
gconf: paprefs configuration [installed]
jack2-dbus: JACK support
lirc-utils: IR control [installed]
openssl: RAOP (AirPlay) output [installed]
python-pyqt4: Equalizer GUI (qpaeq) [installed]
xenstore: Xen paravirtual output
Required By : gnome-settings-daemon projectm-pulseaudio pulseaudio-alsa
Optional For : fluidsynth google-talkplugin lmms phonon-qt4
speech-dispatcher
Conflicts With : None
Replaces : None
Installed Size : 5247.00 KiB
Packager : Jan Alexander Steffens (heftig) <<a href="mailto:jan.steffens@gmail.com">jan.steffens@gmail.com</a>>
Build Date : Mon 03 Mar 2014 03:31:31 PM EST
Install Date : Sun 30 Mar 2014 05:15:54 PM EDT
Install Reason : Installed as a dependency for another package
Install Script : No
Validated By : Signature</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the QA Contact for the bug.</li>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>