After upgrading Ubuntu 12.04 (Precise Pangolin) to 12.10 (Quantal Quetzal), the computer started playing sound through both the internal built-in speaker and external jacked in speakers. To mute the internal speaker, run:
[shell]/usr/bin/amixer -c 0 sset ‘Auto-Mute Mode’ ‘Line Out+Speaker'[/shell]
Just make sure “Auto-Mute Mode” is not set to “Disabled”.