15

Sometimes I forget to enable mute before shutting down my laptop.

Can I set it up to be muted by default every time Ubuntu boots, before the login screen is displayed?


When I try DoR's suggestion of sudo alsactl store, the settings stored in /var/lib/alsa/asound.state are lost on the next reboot. Something is using this file to automatically save the current volume settings every time I reboot.

screenshot

ændrük
  • 76,794

3 Answers3

8

I think this needs two parts:

  1. To mute the sound in GDM, put:

    amixer sset Master 0
    amixer sset Master off
    

    in the file /etc/rc.local (make sure exit 0 is the last line in that file). This will set the volume level to 0 on the Master channel and mute it.

  2. To mute the sound in your session, add the above to the startup applications:

    System > Preferences > Startup Applications, then click on Add and create the new startup entry:

    • Name: Mute Sound
    • Command: /bin/bash -c "amixer sset Master 0 ; amixer sset Master off"
    • Comment: Set Master channel volume to 0 and mute it

    Click on Add and Close, and you should be done.

You can skip part one, if you turn off the login sound in System > Administration > Login Screen (untick the Play login sound checkbox).

ændrük
  • 76,794
htorque
  • 64,798
  • are you sure about the command given?

    It didn't seem to work for me.

    I went the long way round and made a script with the commands you mentioned and then pointed to it using the Browse button. Essentially the same thing...would it be because I'm using Netbook Edition?

    I'm having some weird and wonderful problems with UNE...

    –  Feb 26 '11 at 14:42
  • Not working in 14.04 – Marc Dec 10 '15 at 19:43
1

Mute the volume and then run the following command:

sudo alsactl store  

This will store your current sound settings, so from now on the sound will be muted on startup. I tested this out and it mutes both the GDM sound and the login sound.

Isaiah
  • 59,344
0

This need to be addressed in 'Upstart', which has taken over from using 'sudo alsactl store' or similar.

( I will report back, on what I find. )

david6
  • 14,499