Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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 ?

share|improve this question

9 Answers 9

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%

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.

If not works, 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
share|improve this answer

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".

share|improve this answer
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 '11 at 1:22

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.

share|improve this answer
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. –  Christopher Kyle Horton Jun 29 '11 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. –  Christopher Kyle Horton Jun 30 '11 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 '11 at 13:56

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.

share|improve this answer
    
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 '12 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 –  Kesavan Muthuvel Feb 21 '12 at 16:21

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)

share|improve this answer

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
share|improve this answer

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
share|improve this answer

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.

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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