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.

While running XBMC, I can adjust the volume of the XBMC application itself. However, this volume is limited by the current system volume. For example, if the system volume is at 80% and XBMC is at 100%, I am effectively at 80% and cannot go higher. Or if the sound is too soft and needs a boost, I would normally increase the system volume beyond 100%.

XBMC takes over the whole screen, so the system volume is not accessible. Pressing the Super key brings up the dash and top menu, but clicking on it is difficult and inconsistent, and very quickly XBMC takes over the screen again.

How can I adjust the system volume without having to quit XBMC?

share|improve this question

5 Answers 5

I had the same problem, that's why I wrote a little script to start xbmc that first gets the current volume, then sets the system volume to 100%, starts xbmc, and after exiting, resets the volume to the original level. That way controlling the volume in xbmc is the same as controlling the system volume since the system volume is on max.
Here is the script:

device=1
volume=$(pacmd list-sinks | sed "1,/index: ${device}/d" | grep volume | head -1 | awk ' {print $3}')
mute=$(pacmd list-sinks | sed "1,/index: ${device}/d" | grep muted | awk ' {print $2}')
pactl set-sink-mute $device 0
pactl set-sink-volume   $device 100%
xbmc 
pactl set-sink-volume   $device $volume
if [[ $mute == "yes" ]]
then
pactl set-sink-mute $device 1
fi
exit;

The first line sets your audio device id. I have hdmi (device 0) and analog (device 1), you can check this with alsamixer or pacmd list-sinks. It also automatically unmutes your system, and when you exit xbmc it mutes it again if it was previously muted.

Note: you can also boost your volume to 150 instead if you find the volume too low, however you can also do this in xbmc in the audio osd settings.

share|improve this answer

You can assign shortcuts in you keyboard to control the system volume.

Go to System Settings -> Keyboard -> Sound and Media. There you can assign a key combination to increase or decrease the system volume.

enter image description here

share|improve this answer
    
thanks - this confirmed that my system shortcuts are already exactly as I want them, so the problem is that xbmc is using the same shortcuts, and I'll need find out how to change them –  d3vid Dec 12 '12 at 13:40
up vote 1 down vote accepted

From http://forum.xbmc.org/showthread.php?tid=148210

  • From within XBMC, install the XBMC Audio Mixer add-on.
  • Open the Audio Mixer.
  • Increase the Master volume to 100%. (Can't go beyond 100%, so if you want to boost the volume, you'll still need to do this before launching XBMC.)

(Though it would be nice to be able to map the appropriate keys to adjust the Master volume.)

share|improve this answer
    
doesn't work yet in Frodo RC –  Gerhard Burger Jan 7 '13 at 10:10

Switch to a different TTY and use aslamixer, e.g. ctrl-alt-f1 into TTY1, login, run alsamixer, adjust levels, logout and the ctrl-alt-f7 to go back to your X session running XBMC.

share|improve this answer

When searching for "XBMC change system volume" this question pops up as the first result. The current answers are not bad, but with the newer versions of XBMC it can be solved differently with script execution.

By editing the keyboard.xml file you can change the keybindings to execute scripts. Location of keyboard.xml on all systems

I created a new keyboard.xml file in /home/USER/.xbmc/userdata/keymaps/ with the following content:

<keymap>
  <global>
    <keyboard>
      <volume_mute>RunScript(/home/USER/Scripts/mute.py)</volume_mute>
      <volume_down>RunScript(/home/USER/Scripts/lower_volume.py)</volume_down>
      <volume_up>RunScript(/home/USER/Scripts/raise_volume.py)</volume_up>
    </keyboard>
  </global>
</keymap>

This overrides the default behaviour of changing the XBMC sound levels with executing a script. For Ubuntu, I created a directory with various scripts in my home directory (scripts).

Contents of the files:

mute.py

#!/usr/bin/python
import subprocess
subprocess.call( "amixer -D pulse set Master 1+ toggle", shell=True )

lower_volume.py

#!/usr/bin/python
import subprocess
subprocess.call( "amixer -D pulse sset Master 5%-", shell=True )

raise_volume.py

#!/usr/bin/python
import subprocess
subprocess.call( "amixer -D pulse sset Master 5%+", shell=True )

Then make the files executable with chmod +x Scripts/* . The minus and plus button on the numpad can still lower/raise the volume of XBMC, but those can also be disabled with changing the keyboard.xml.

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.