When i press mute button on keyboard, it works. But when i press it second times, sound not unmute. How to repair it ?
This key on xubuntu 14.04 works good. Hardware is samsung 550p5c.
When i press mute button on keyboard, it works. But when i press it second times, sound not unmute. How to repair it ?
This key on xubuntu 14.04 works good. Hardware is samsung 550p5c.
I also had the same problem. Author has provided a link in the comments with a forum post where it has been solved, but for completeness, if somebody else runs into this post, here is a solution.
The problem with unmuting is that pressing the button unmutes only the master channel but not Pulsaudio channels. To correct this one has to modify the keybinding for XF86AudioMute
button which on Lubuntu is defined in file ~/.config/openbox/lubuntu-rc.xml
. Open the file with a text editor and find <keybind key="XF86AudioMute">
, and in <command>
section put the following command: amixer -D pulse set Master Playback Switch toggle
.
This question has been discussed at askubuntu as well, but that one is actually difficult to find if you do not know that Alsa is the problem, which can easily happen to an Ubuntu newbie.
At the end run openbox --reconfigure
to set the configuration.
amixer -D pulse set Master toggle
. The one you have also works though.
The trick is to make the speaker or headphone state follow the state of the master channel depending on if you have the headphones plugged in or not. This script does it for me on my ancient Dell Latitude laptop:
#!/bin/bash
amixer -q sset Master toggle
MASTER_STATE=`amixer get Master | awk -F"dB] " 'NR == 5 {print $2;}'`
HEADPHONES_PLUGGED=`amixer contents | grep -A 2 Headphone\ Jack | awk -F"=" 'NR == 3 {print $2;}'`
if [[ $HEADPHONES_PLUGGED == 'on' ]]; then
SLAVE="Headphone"
else
SLAVE="Speaker+LO"
fi
if [[ $MASTER_STATE == '[on]' ]]; then
amixer -q sset $SLAVE unmute
else
amixer -q sset $SLAVE mute
fi
You may need to check your channels with amixer on your computer and change the SLAVE definitions accordingly. Also the "Headphone\ Jack" grep string in the HEADPHONES_PLUGGED definition might need to be something else.
To hook into the toggle button you should make the above script available through your ~/.config/openbox/lubuntu-rc.xml
configuration file.
<keybind key="XF86AudioMute">
<action name="Execute">
<!--command>amixer -q sset Master toggle</command-->
<command>/usr/local/bin/amixer-toggle.sh</command>
</action>
</keybind>