Mute key mutes Alsa and PulseAudio, but unmutes only Alsa

When I press the mute key on my keyboard, both the Alsa master channel and the PulseAudio master channel get muted, pressing it again only unmutes the alsa master channel, the pulseaudio master channel keeps muted. Result: no sound. How do I fix that?


it is much simplier though.

amixer -D pulse set Master Playback Switch toggle

set this as a hotkey to "Mute\Unmute". volume controls can be left as they are.

Mint 15 Mate - figured it out by myself, works fine for me.


Run this command:

amixer -D pulse set Master 1+ unmute

I had the same problem running MATE desktop on a Linux Mint Debian Edition (201204).

"Volume up" action was not able to unmute the volume. I realised that the problem was with Pulseaudio, but the package mate-media-gstreamer and mate-settings-daemon-gstreamer where installed by default. By installing mate-media-pulse and mate-settings-daemon-pulse (that uninstalled mate-media-gstreamer and mate-settings-daemon-gstreamer) and tadam... "Volume up" action was able to unmute the volume again !

I hope this will also work for you!


It is a problem with pulseaudio,the commands for alsa or amixer will not properly send unmute to pulse. When alsa commands send a mute signal it is a toggle command(send the same command to mute/unmute).

Now in pulseaudio they have separate mute and unmute code! Many report that un-installing pulseaudio will solve the problem, but for some that is not really an acceptable answer (like me, because pulse is useful for many apps).

So to solve this we need to make a script,

1- Make a new empty doccument in a text editor like gedit or mousepad,

2- Paste this code in the doccument, Soruce of code:2

#!/bin/bash
#### Create ~/.pulse/mute if not exists
ls ~/.pulse/mute &> /dev/null
if [[ $? != 0 ]]
then
    echo "false" > ~/.pulse/mute
fi

####Create ~/.pulse/volume if not exists
ls ~/.pulse/volume &> /dev/null
if [[ $? != 0 ]]
then
    echo "65536" > ~/.pulse/volume
fi

CURVOL=`cat ~/.pulse/volume`     #Reads in the current volume
MUTE=`cat ~/.pulse/mute`          #Reads mute state

if [[ $1 == "increase" ]]
then
    CURVOL=$(($CURVOL + 3277)) #3277 is 5% of the total volume, you can change this to suit your needs.
    if [[ $CURVOL -ge 65536 ]]
    then
        CURVOL=65536        
    fi
elif [[ $1 == "decrease" ]]
then
    CURVOL=$(($CURVOL - 3277))
    if [[ $CURVOL -le 0 ]]
    then
        CURVOL=0        
    fi
elif [[ $1 == "mute" ]]
then
    if [[ $MUTE == "false" ]]
    then
        pactl set-sink-mute 0 1
        echo "true" > ~/.pulse/mute
    exit    
    else
        pactl set-sink-mute 0 0
        echo "false" > ~/.pulse/mute    
    exit
    fi
fi

pactl set-sink-volume 0 $CURVOL
echo $CURVOL > ~/.pulse/volume # Write the new volume to disk to be read the next time the script is run.

3- Name the file "volume" (no extension needed) put it somewhere you can find and won't delete it like your home folder

4- Make the file executable by Right-clicking on the file, go to Properties, then the Permissions tab, and use the check box to mark it executable, this will allow the script to be run. mark-file-as-executible-gui

5- Next we need to link the commands to the keyboard, the commands for the code are increase, decrease, and mute.

So go to the keyboard settings - how-do-i-change-my-keyboard-shortcuts-in-xubuntu, In the keyboard shortcuts area, click add, then open, Open the "volume" file we created, then add the command for the code after volume, reading volume increase, or volume mute ect. but with the location of where the code file is before it like "/home/username/volume mute"

Then assign it to the keyboard by pressing the key it, or if the key is already used,
~ Most likely the case ~ find them and replace the command.

The key shortcuts are likely called XF86AudioRaiseVolume, XF86AudioLowerVolume, XF86AudioMute. Since only the mute is broken concentrate your efforts on changing that out first.

Bug: 1


See:

https://bugs.launchpad.net/xfce4-volumed/+bug/883485/comments/3

xfce4-mixer has a setting for active-card, that must be set to Pulseaudio, otherwise it will be using Alsa.