Turn off sound at startup

I am just wondering how to turn off sound at startup? I searched the web, and found a couple of solutions like:

  1. Write "amixer sset Master off" in /etc/rc.local
  2. Use sudo alsactl store

But neither works.

EDIT: I now realize why the amixer command in rc.local doesn't work. This is because the command executes before the alsa driver is loaded. So one solution is to use (sleep 1; amixer sset Master off) in rc.local.


Solution 1:

One way of doing so is using the Ubuntu Tweak tool. To install it, if you don't have it installed, just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the commands below:

sudo add-apt-repository ppa:tualatrix/ppa 
sudo apt-get update && sudo apt-get install ubuntu-tweak

Once it done, type tweak in Dash, and click on the icon.

enter image description here

When it opens, click on the Tweaks tab, and then Login Settings.

enter image description here

When that window opens, click on Unlock, and then turn Play Login sound off.

enter image description here