3

Ubuntu 15.04.
I have multiple audio outputs, all correctly recognised and shown by Pulseaudio.

Through pavucontrol GUI I can individually change the volumes of all the outputs.

The volume shortcuts only change the volume of the primary (internal) output.

I usually redirect Music on Bluetooth and I would like to have different schortcuts to change its volume.

Does anyone know which (terminal?) command should I use to do it?

Thanks in advance, Davide

PS: This question addresses many questions, and one of them is similar. Though it is not exactly the same (I would like to not have to raise Rhythmbox every time that I want to change the volume), it was for a very old version of Ubuntu/Pulseaudio and it was not answered, so I believe that this is not a duplicate of that.

dadexix86
  • 6,616

1 Answers1

3

The command line tools for pulseaudio allow adjusting the volume of a defined sink:

pactl set-sink-volume <name|index> <volume>

To find the sinks in use for their <name> or <index> (any of both will work), and to display the present volume we can issue:

pactl list sinks

The <volume> can take any value from 0 % (or 0) to 100% (or 65536).

Even higher values are accepted for volumes above the maximum but this may lead to heavy distortions from clipping.

Any of these commands can be attached as is to a keyboard shortcut but in case we need a step-wise increase/decrease volume key combination we'd have to use the following syntax:

pactl -- set-sink-volume <name|index> <+|-fraction>

e.g.

pactl -- set-sink-volume 0 +10% ## increases volume of sink 0 by 10%
pactl -- set-sink-volume 0 -10% ## decreases volume of sink 0 by 10%

Note that by increasing the volume this way nothing stops us to increase above 100%. Decreasing will stop at 0.

Takkat
  • 142,284
  • 1
    Thank you very much!! It works! :D Do you know if there is a way to make it go up just to 100% and no more? – dadexix86 Jul 31 '15 at 13:22