Saturday, April 28, 2012

Ubuntu 11.10 amixer issue

I have previously used the amixer libraries in Ubuntu to programmatically control volume. I basically built a web UI for my media which has options to control volume. With the recent 11.10 (Oneiric) upgrade, the setup stopped working. There are known error cases where unmute does not work and the system does not support a global volume up and down functionality. Instead now you have to control both the Master and PCM to get the desired outcome. Below are the commands that I have ended up with. I have set hot keys that run each of these. The below is a generalized command that can be used with various options

ll={value};amixer set Master unmute;amixer set PCM unmute;amixer set PCM
$ll;amixer set Master 100;

value can be
mute - to mute the volume
numeric value - you can specify a number like 20 to set the volume to 20. On my box the max is set to 60