54

sometimes the sound of videos isn't enough for me. so i reach the sound indicator , over sound preferences and change it to a level higher than 100%. the question is how can i do it from the keyboard? now i can control the volume from the keyboard but it's maximum is 100%. is there a way to do that?

EDIT 1: how to use amixer and scripts to do it? (as Lyrositor suggested)

EDIT2: the closest answer , as Jo-erland, suggested is to set a hotkey to bring up the gnome-volume-control, and then to use left and right arrows to change volume also beyond the 100% mark.

any other suggestions, to make this 1 step only? is it possible to set a hotkey to do a sequence of commands ?

14 Answers 14

49

try running these commands (via alt+f2 or terminal):

volume to 150%:

pactl set-sink-volume 0 150%

to return the volume to 100% simply:

pactl set-sink-volume 0 100%

(video demonstration of those commands here)


Note that the argument after set-sink-volume specifies your sound device. If you have hdmi you will likely have 2 devices and you need to check for your device id using alsamixer or pacmd list-sinks or even pactl list sinks.

If it doesn't work, try this script.

If it works, manually set a keyboard shortcut for these commands through the application 'keyboard shortcuts' (on ubuntu 11.04: key 'super' -> type 'keyboard shortcuts' -> button 'add').

The command pactl belongs to the package "pulseaudio-utils' to install it use the command:

sudo apt-get install pulseaudio-utils
5
  • Is there any limit to how high the volume can be set through pactl?
    – anukul
    Apr 20, 2016 at 14:53
  • @anukul nope! 400% works, but you start hearing very clear distortion in the sound
    – 842Mono
    Mar 1, 2018 at 15:52
  • Joel Ostblom's answer should probably supercede this one.
    – detly
    Mar 12, 2018 at 5:22
  • @Wagner Pinheiro works, fantastic! you made by day, thank you very much! Jan 10, 2019 at 17:08
  • "@DEFAULT_SINK@" can be used to select the current default audio output device (so I now bind the volume up key to "pactl set-sink-volume @DEFAULT_SINK@ +20%"). That way you don't need to consider anything like HDMI, headphones, etc. and can always use the same command. That information should probably be integrated into the answer. I don't do it myself, because I don't know if removing the entire paragraph about audio devices is a good idea or if it's maybe still used for something else. Jan 2, 2020 at 2:43
17

IMO pactl set-sink-volume 0 +10% is a good choice too if you want key that slowly adds volume beyond 100% limit (I use Ctrl + VolumeUp for that).

2
  • thanks, this really helped. I reassigned the volume up and down buttons on the keyboard to this and it works great Nov 8, 2017 at 5:45
  • This is great. Thank you
    – AshotN
    Oct 13, 2021 at 0:43
8

I figured that answers (currently all other answers) that suggest pactl set-sink-volume 0 ... don't work (or stop working) on systems with more than one audio devices, e.g. as soon as you connect to a hdmi monitor. we should use @DEFAULT_SINK@ instead of 0 to refer to active audio device.

so here is my setup on ubuntu 14.04 with gnome 3.10 and should work on unity too:

sudo apt-get install pulseaudio-utils

go to keyboard shortcuts which is under System → Preferences → Shortcuts → Custom Shortcuts → +

Name: VolPlus10P Command: pactl set-sink-volume @DEFAULT_SINK@ +10%

Assign Ctrl + Volume Up (if you have dedicated volume key on your keyboard or use your own combination ) this will increase your volume 10% to unlimited

Name: VolSet150P Command: pactl set-sink-volume @DEFAULT_SINK@ 150%

Assign Super + Volume Up (if you have dedicated volume key on your keyboard or use your own combination ) this will set your volume to 150%

2
  • 1
    Thank you, yah my device was 1 but your solution is optimal. I just wish the standard volume keys could be changed to this command. LOL I had a really low youtube video set it to 500% and could actually hear it. Thanks Oct 5, 2017 at 17:49
  • Thank you! Confirmed to work on MX Linux (Debian) Oct-2020 release with Xfce. The nice thing about your solution is that it allows the volume to keep rising even past the 100% maximum. With Xfce it's possible to assign hotkeys directly pointing to these commands, currently I'm using <Shift>+Keypad8 for volume up, this allows me to press the hotkey with only one hand, very practical. Thanks again!
    – Winampah
    Mar 14, 2021 at 18:40
6

I simply add the following piece of code in my start up script & add that script in my start up application by Menu >> Applications >> Other >> Startup Applications.

For this first you need to install pulseaudio-utils by sudo apt-get install pulseaudio-utils

#!/bin/bash
# start.sh - commands to run when OS starts

#Increase Audio 
pacmd set-sink-volume 0 102400

Let me know , if this solves your question.

2
  • i did create the file, gave it permission, add it to startup applications. but nothing changed. with keyboard i cannot reach above 100%. pulseaudio-utils is installed.
    – suli8
    Jan 8, 2012 at 23:29
  • 1) goto bash terminal 2) enter the following command pacmd set-sink-volume 0 102400 3) check that your volume increases or not Feb 21, 2012 at 16:21
4

In the audio preferences dialog (Gnome volume control), you can press to increase volume beyond 100% (or less intuitively, ). So the question becomes: how do you get to that dialog using the keyboard. There are several ways:

  1. Press F10 to move focus to application menus, then left arrow until you get to the volume indicator. Press the up arrow once to get to the lowest menu item, which is audio settings.

  2. That dialog is actually called gnome-volume-control so you might want to add a keyboard shortcut/hotkey to it: How to use a hotkey shortcut to run a launcher?

  3. Press super and begin to type "gnome-volume-control" until it suggests it.

  4. Press alt+f2 and type "gnome-volume-control".

1
  • 1
    thanks for the useful information. this is pretty close actually. i can set the hotkey Fn+ up/down (which is my default volume control) to bring the volume control, and then with left/right arrows to adjust it also beyond 100%. now i get it. it is a 2 step thing, we are getting closer. anyway it could be just one step? say to set a hotkey to a sequence of commands?
    – suli8
    Jun 30, 2011 at 1:22
4

If you are on Gnome, you can install Volume Mixer. Enable Use Volume Boost in the extension's settings. That's it! Your default keyboard shortcuts now increases the volume past 100% (and as a bonus, you get a quick change audio output menu in the notification area).

4

Warning: I'm using Linux Mint, which is similar to but different from Ubuntu. I believe Ubuntu has an equivalent keyboard shortcuts dialog, but it might look or work slightly differently from how I describe below.

Wow, lots of answers here, but not the simplest one! You can solve everything with just the built-in (GUI) Keyboard Shortcuts dialog.

For the full explanation see https://superuser.com/questions/1277724/how-to-change-the-binding-of-keyboard-volume-dial-linux-mint-mate, but here's the quick version:

  1. Go to Keyboard Shortcuts through the menu
  2. Add a new shortcut
  3. Name it and set the action to pactl set-sink-volume @DEFAULT_SINK@ +10% (or - for the "turn down the volume" action)
  4. Click apply to save it, then click on the "Shortcut Column" for its row. Type whatever key you want to bind the action to (I have a volume knob on my keyboard so I bound the actions to that, but you could use any key combo you want)
  5. Repeat the above for turning the volume down

Congratulations: with a few seconds at a friendly system dialog you just configured volume "up to 150%" for any key combination you want!

0
2

No, at least not to my knowledge, there is no way by default to raise the volume with the keyboard beyond 100%. It frustrates me too. However, maybe it's possible to create a key combination that will launch a script to raise the volume; I'm not a Ubuntu programmer, so I can't really help you.

3
  • 1
    From this Ubuntu Forums post, you can use amixer in a script to control volume. I would try reading through its man page to see exactly what you can do with it. Jun 29, 2011 at 18:42
  • 1
    Actually, after a bit of AskUbuntu browsing, I saw an answer to another question with a link to a PulseAudio volume control script. That might be worth taking a look at. Jun 30, 2011 at 1:52
  • thanks again! but i'm not sure what the script does and how to use it in my advantage... i'm totally not a programmer...
    – suli8
    Jun 30, 2011 at 13:56
1

Based on this question, i created a script that you can call with a shortcut that actually shows OSD notifications.

#!/bin/bash
usage="usage: $0 -c {up|down|mute} [-i increment] [-m mixer]"
SINK_NAME="alsa_output.pci-0000_00_1b.0.analog-stereo"
command=
increment=7
mixer=Master

while getopts c:i:m:h o
do case "$o" in
    c) command=$OPTARG;;
    i) increment=$OPTARG;;
    m) mixer=$OPTARG;;
    h) echo "$usage"; exit 0;;
    ?) echo "$usage"; exit 0;;
esac
done

if [ "$command" = "" ]; then
    shift $(($OPTIND - 1))
    command=$1
    exit 0;
fi

if [ "$command" = "" ]; then
    echo "usage: $0 {up|down|mute} [increment]"
    exit 0;
fi

display_volume=0

if [ "$command" = "up" ]; then
    display_volume_hex=(`pacmd dump | grep -P "^set-sink-volume $SINK_NAME\s+" | perl -p -i -e 's/.+\s(.x.+)$/$1/'`)
    display_volume_152=`echo $(($display_volume_hex*0x64/0x10000))`
    if [ "$display_volume_152" -ge "`echo $((152-$increment))`" ]; then
        display_volume_152=153
    else
        display_volume_152=$(($display_volume_152+$increment))
    fi
    pactl set-sink-volume 0 $display_volume_152%
    display_volume_hex=(`pacmd dump | grep -P "^set-sink-volume $SINK_NAME\s+" | perl -p -i -e 's/.+\s(.x.+)$/$1/'`)
    display_volume_100=`echo $(($display_volume_hex*0x64/0x18675))`
fi

if [ "$command" = "down" ]; then
    display_volume_hex=(`pacmd dump | grep -P "^set-sink-volume $SINK_NAME\s+" | perl -p -i -e 's/.+\s(.x.+)$/$1/'`)
    display_volume_152=`echo $(($display_volume_hex*0x64/0x10000-$increment))`
    if [ "$display_volume_152" -le "$increment" ]; then
        display_volume_152=0
    else
        display_volume_152=$(($display_volume_152))
    fi
    pactl set-sink-volume 0 $display_volume_152%
    display_volume_hex=(`pacmd dump | grep -P "^set-sink-volume $SINK_NAME\s+" | perl -p -i -e 's/.+\s(.x.+)$/$1/'`)
    display_volume_100=`echo $(($display_volume_hex*0x64/0x18675))`
fi

icon_name=""

if [ "$command" = "mute" ]; then
    if amixer get Master | grep "\[on\]"; then
        display_volume=0
        icon_name="notification-audio-volume-muted"
        amixer set $mixer mute
    else
        display_volume=$(amixer set $mixer unmute | grep -m 1 "%]" | cut -d "[" -f2|cut -d "%" -f1)
    fi
fi

if [ "$icon_name" = "" ]; then
    if [ "$display_volume" = "0" ]; then
        icon_name="notification-audio-volume-off"
    else
        if [ "$display_volume" -lt "33" ]; then
            icon_name="notification-audio-volume-low"
        else
            if [ "$display_volume" -lt "67" ]; then
                icon_name="notification-audio-volume-medium"
            else
                icon_name="notification-audio-volume-high"
            fi
        fi
    fi
fi
notify-send " " -i $icon_name -h int:value:$display_volume_100 -h string:synchronous:volume
0

All you need to do is add a keyboard shortcut with the command:

pacmd set-sink-volume 0 100000

and choose the shortcut you find suitable. I used Fn+Alt+Volume Up.

This will make the volume 150% (if the volume is currently under 100% it will make it 100%, press again to make it 150%) then you could lower the volume with your keyboard normally to reach the exact volume wanted.

To do this you need to go to keyboard shortcuts which is under SystemPreferencesKeyboard Shortcuts (I use 10.10) and click Add Shortcut with the command above and then assign the desired shortcut you want to use.

You could also add a panel button by right-clicking on a panel (I use 10.10) then choose Add to panel then create a new launcher and add the same line as before

pacmd set-sink-volume 0 100000

This will add a button on the panel, that when pressed will make a 150% volume.

I hope I was clear enough. If it doesn't work, try installing the package pulseaudio-utils using

sudo apt-get install pulseaudio-utils
0

As a 13.04 user, I have used Adham's answer. It works very fine for me because although it is said that it increases the volume up to 150%, it is increasing to 200% which I was trying to do.

I just added a shortcut for the command pacmd set-sink-volume 0 100000 with the Fn + CTRL + Volume Up keys. When I press this combination, volume is increasing to 200% and then I am adjusting with the Fn + Volume Down combination.

0

My approach (not on Ubuntu though):

First create two scripts ~/bin/volume-up.sh and ~/bin/volume-down.sh:

$ mkdir -p ~/bin/
$ echo "#!/bin/bash" > ~/bin/volume-up.sh
$ echo "pactl set-sink-volume 0 +10%" >> ~/bin/volume-up.sh
$ chmod +x bin/volume-up.sh
$ echo "#!/bin/bash" > ~/bin/volume-down.sh
$ echo "pactl -- set-sink-volume 0 -10%" >> ~/bin/volume-down.sh
$ chmod +x bin/volume-down.sh

Then, in the keyboard options (gnome-control-center -> Keyboard) find the Shortcuts section. In there remove the shortcuts for volume up/down and add two custom shortcuts using those keys. The commands for these two custom shortcuts are ~/bin/volume-up.sh and ~/bin/volume-down.sh.

Now I do not have the indicator anymore (showing me the volume), but I can get more than 100% just by using the volume keys on my notebook.

0

On my Lenovo Ideapad I can press FN+ to increase up to 100%. I can press ctrl+ to increase above 100%.

0

UI SOLUTION Ubuntu 20.04 LTS and above

you can simply open Settings and after that search for "sound" or just click on the Sound tab on the left side of the Settings panel. After that press "Over-Amplification" and change your max sound volume to more than 100%

You must log in to answer this question.

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