amixer toggle mutes but does not unmute
Posted by Admin • Monday, July 22. 2013 • Category: Linux
It seems that the common approach to mute the audio in Ubuntu 13.04 is amixer -q sset Master toggle ... which works great when muting, but fails to unmute. This command is, for example, the default for openbox's handling of XF86AudioPlay shortcut.
The problem, it would appear, is that muting the Master channel causes other channels (eg Headphone and Front on my machine) to be muted as well. I have no idea why this works this way and why it doesn't undo what it did... and, frankly, I don't really care that much. It's much easier to code around this, see the following workaround script:
It simply checks whether the Master channel is [on] or [off], and then either mutes or unmutes the preconfigured list of Channels. To see your list, try "amixer scontents", and look for everything that's [off] when muted.
Update: other people have had this issue.
The problem, it would appear, is that muting the Master channel causes other channels (eg Headphone and Front on my machine) to be muted as well. I have no idea why this works this way and why it doesn't undo what it did... and, frankly, I don't really care that much. It's much easier to code around this, see the following workaround script:
Now, instead of amixer -q sset Master toggle I just run /usr/local/bin/my-mute-script.sh
#!/bin/bash
LIST="Master Headphone Front"
if amixer sget Master | grep '\[off\]' > /dev/null ; then
CMD=unmute
else
CMD=mute
fi
for CONTROL in $LIST ; do
amixer -q sset $CONTROL $CMD
done
It simply checks whether the Master channel is [on] or [off], and then either mutes or unmutes the preconfigured list of Channels. To see your list, try "amixer scontents", and look for everything that's [off] when muted.
Update: other people have had this issue.
0 Comments
Add Comment