Wednesday, June 4, 2014

Getting audio volume go beyond 100% in Ubuntu Gnome

In some videos I find the audio volume to be too low, even after the I turn the volume up to 100%. However, from gnome's sound control, I can see that I can use the mouse to make the volume go beyond 100% so that the audio becomes louder.

So, I was looking for a command line that would do that for me, so that I can assign that to a keyboard shortcut so that every time I needed louder sound, I would not have to use my mouse to reach out for the gnome sound control.

I turned out that the pactl command (from pulseaudio-utils package in Ubuntu) can be used for this purpose.

To make the volume go up by 10%, the command would be:

 pactl set-sink-volume 0 +10%  

And to make the volume go down by the same amount, the command would be:

 pactl set-sink-volume 0 -- -10%  

(The '--' in the command above is necessary otherwise it is interpreted as a command line option and I get an error. The '--' basically stops the shell from option parsing from that point onward)

This command allows me go beyond 100%

Now I have assigned this command to a shortcut key in Gnome and my problem is solved :-)

BTW, if there are more audio devices, the index may need to be changed from 0 (I have only one, so the index is 0 in my case). More details are available in the 'pactl' and 'pacmd' manual pages.

No comments: