I have seen many questions throughout online, but I could only set the volumes of input and output audio devices that are selected as default in the sound settings of Ubuntu system.

These commands are as below:

amixer -D pulse sset Master mute
amixer -D pulse sset Master unmute
amixer -D pulse sset Master x%
amixer -D pulse sset Capture x%

No other command works at all. For example, using this instruction, I tried the command:

amixer -c 3 -- set Master playback -20dB

only to get replied:

amixer: Unable to find simple control 'Master',0

I have several input and output devices connected to my ubuntu system and I want to control the volume of all the devices from command line. Is that possible? How is it possible from command line to set the volume of the devices that are not selected as the default in the ubuntu audio settings?

  • 1
    Have you tried ponymix?
    – earthmeLon
    Mar 8, 2016 at 17:40
  • The alsamixer command is also useful.
    – muru
    Mar 8, 2016 at 17:49
  • @earthmeLon Thanks for the advice. It's proving useful, seems like a good tool.
    – the_naive
    Mar 9, 2016 at 13:41

3 Answers 3


I solved the problem using pacmd.

For example, the following command produces the list of devices that work as audio inputs:

pacmd list-sources|awk '/index:/ {print $0}; /name:/ {print $0};'

The output for the command in my system is a below:

    index: 0
    name: <alsa_output.pci-0000_01_00.1.hdmi-stereo.monitor>
    index: 1
    name: <alsa_output.pci-0000_00_1b.0.analog-stereo.monitor>
  * index: 2
    name: <alsa_input.pci-0000_00_1b.0.analog-stereo>

The * indicates that this input device is used as the default currently.

The following command changes the volume of the device alsa_input.pci-0000_00_1b.0.analog-stereo.

pacmd set-source-volume alsa_input.pci-0000_00_1b.0.analog-stereo 50000

You can also put the index number instead of the device name as the following one:

pacmd set-source-volume 2 50000

Here I used 50000 as the volume value because normally 100000 is maximum value.

Please look at the pacmd manual for more command related information.

  • Can you share HOW you solved the problem?
    – Marc
    Feb 3, 2017 at 4:51
  • @Marc Hi, sorry for the delay. I have updated my answer. Hope it helps you.
    – the_naive
    Feb 8, 2017 at 12:47

Try alsamixer. In alsamixer, you can individually set the volumes for the different input and output devices.

  • Unfortunately, alsamixer has an ncurses interface. It's not X11, so you might not call it a GUI. But it does not satisfy the OP's requirement "from command line".
    – Quigi
    Mar 15 at 12:00

To change a PulseAudio mixer control, you need to use -D pulse.

To change an ALSA mixer control, you need to use -c x, where x is the card number or ID. (The ID is shown in square brackets in /proc/asound/cards.)

To see a list of controls, use amixer -c x scontrols.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .