I have a sound source connected via line-in to my computer. But when I change the master volume, only the volume of sounds being played on the computer (e.g. media, alerts, etc.) changes; the output volume of the line-in source does not change. How do I control that?


To clarify, I don't just want to control the line-in output volume, I want to control the normal "output volume" from one control only, and I want that to affect also the line in output volume. Something like a "master volume" that would affect everything that comes out of the sound card output.

The "master volume" I see when running the command "alsamixer" only affects the sound that comes from the main pc, not from the line in.

3 Answers 3


I came up with a solution to be able to control the volume of both your "Master" and "Line" using only your keyboard's "Media Keys".

First step is to disable your default volume controls by going into System → Preferences → Keyboard Shortcuts, clicking the "Shortcuts" tab and setting Volume Up & Volume Down to "Disabled" on the "Sound and Media" page.

Secondly, you will need to assign your "Volume Keys" to custom commands on the "Custom Shortcuts" page. To do that, click on the "+" at the bottom to add a shortcut. Name the first command Volume Up and have it execute a scripts: ./path-to-scripts/VolumeUp.sh. Repeat this process for a second command and have it execute your VolumeDown.sh script instead. Next, click on the command where it says "Disabled" and assign your key to it (repeat for both).

Finally, create your 2 scripts referred by the custom shortcuts and copy paste the following into them:


amixer -c0 -sq <<-EOF
set Master 10%+
set Line 10%+


amixer -c0 -sq <<-EOF
set Master 10%-
set Line 10%-

Don't forget to set your scripts as "Allow executing file as program" in the file properties or chmod it to allow execution. You might also need to read up on amixer to know how much to modify the volume by (10% is just used as default).

If you open gnome-alsamixer, you should now see both "Master" and "Line" go up and down as you press your "Volume Keys". Only downside is the key, must be pressed and can't be held down to change the volume.


I've followed the Jason B's answer and it worked. But i also added code for it to show the volume notification, as it's the default behaviour in ubuntu 14.04.

Here's what's to add at the end of the files:

tmp1=$(amixer get Master | grep dB | sed 's/\(^[a-z0-9 :]\+\[\|\[\|\]\)//gi')
tmp2=(${tmp1//\ / })
tmp3=(${tmp2//\%/ })
notify-send hi -i notification-audio-volume-high -h int:value:$tmp3 -h string:synchronous:volume

have you tried the line-in-control already ? Press Alt+F2 and type 'gnome-alsamixer'. You should get a window with a lot of controls, called mixer, in which you can adjust every single sound source.

P.S.: In notebooks, but also in PCs with sound-on-board the line-in is realized using a second sound device quite often, so it is possible you will have to choose another tab in the mixer (if there are more displayed) first.

  • Yes that works, I can use alsamixer from console. But I have the line in from the old to the new pc to "unify" all the sound into the 2x 2.1 speakers (i use to have one 2.1 on each pc), so I want to control ALL the volume from one control only. Because for example, the phone rings, I usually use my keyboard to lower the volume, but if something is playing from the second pc I would have to lower the volume of the main pc, and run a console to lower the volume of line-in. That's not very practical. Now i see the question doesn't explain that well, I just edited it.
    – ithusx
    Jul 16, 2012 at 16:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.