I recently upgraded my Dell E6510 laptop to 12.04 (Ubuntu with Unity). I've noticed that after every reboot, the volume always resets itself to a maximum level.
While I try to work out whether this is a bug, I'd like to know if there is something I can do at login or startup that will mute (or perhaps just reduce) the system volume.
After checking reverendj1's answer, I tried pacmd set-sink-volume 0 0
and then sudo alsactl store
, after the first command failed to work.
I also did a right-click on the volume indicator and went to Sound Settings..." -- from there, I selected Built-in Audio Analog Output on the Output tab (it was my only choice, but it wasn't highlighted for some reason).
During this troubleshooting process, I rebooted a few times. I'm not 100% sure whether any of the Analog Output settings had ever been altered from the install defaults, but I'm documenting the setting for posterity, in case someone else runs into this:
To mute the sounds you could use this command:
The first 0 is the sink, and the second one is the volume you want to set it to. The volume ranges from 0 to 65536, so to set it to half-volume, you could simply use this:
Here is a link to more information on using the PulseAudio CLI (pacmd)
Download and extract ponymix from https://github.com/falconindy/ponymix
test if it is working
make startup-script
add this to the file /usr/bin/load-sound:
activate logon script (load-sound) open “startup applications” click add name: Load pulseaudio volume command: load-sound
make logoff script (save-sound):
add this to the file /usr/bin/save-sound:
activate logoff script (will be run as root):
add this to the file /etc/lightdm/lightdm.conf:
Reboot.
I have had this issue with my audio volume resetting to 100% after reboot ever since I started using Linux two years ago.
Basically the advice given above by GigabyteProductions is leading me to the right place, and it should really be working, but it isn't working on my system. So I had to look a little further, and I have learnt a great deal, albeit not without pain.
Referring to the bug report https://bugs.launchpad.net/ubuntu/+source/alsa-utils/+bug/449783 I found some useful clues to my problem. In the default /etc/pulse/default.pa you will find these entries:
### Automatically restore the volume of streams and devices load-module module-device-restore load-module module-stream-restore load-module module-card-restore
In the above mentioned bug report in comment#13 the user mentions that by adding
load-module module-volume-restore
to default.pa, had sorted out the issue for him, although in comment #16 it points out that pulseaudio started from the command line warns of the module being deprecated, and that module-stream-restore be used instead. Pulseaudio tries to load module-stream-restore twice, which then causes it to crash. At reboot pulseaudio doesn't initiate and the last ALSA master volumes are restored automatically. This isn't a good idea for various reasons. A better option would be to remove PulseAudio altogether, if the object is to only have the alsa volumes restored after reboot, or startup generally, rather than to have pulseaudio hanging/ crashing due to a deprecated module.I ended up disgruntled and I actually removed PulseAudio, thinking that I could live without it, since I have a fairly basic sound setup, but it only took me a short while to discover the drawbacks, and I installed it again. Back at square one, I went through every available on-line resource to get the volumes restored with PulseAudio server simultaniously running. Nothing worked...
The ALSA volume settings are saved with the command:
# alsactl store
Volume settings are saved to
/var/lib/alsa/asound.state
by default. To save these settings, and to retrieve them with# alsactl restore
you need root.I set up a startup script in /etc/init.d (and updated update-rc.d) but it proved ineffective. The script would run correctly, but the result gets cancelled shortly after login by PulseAudio and you end up with volumes set to 100% again. I figured that the only way to get ahead of PulseAudio would be to kill the server, start it again and then restore the settings while the server is running, after login in, to restore the alsa settings.
Another approach is to instruct alsactl to store the volume setting to the home folder so you can run a script calling it without root. I created the directory
/home/<user>/.config/alsa/
and I entered:alsactl -f /home/<user>/.config/alsa/asound.state store
I added a new entry in my Settings -->Session-and-Startup menu by entering the name "alsa-restore" and the command
alsactl restore -f /home/<user>/.config/alsa/asound.state
and rebooted. Once again I had no luck, and I was getting close to running out of options, and patience.But then, I saw the light! I wrote a shell script, named it
sound-restore.sh
and placed it in a folder in my home directory called/home/<user>/scripts/
containing these lines:#! /bin/sh pulseaudio -k #just in case pulseaudio is already running pulseaudio -D alsactl -f /home/<user>/.config/alsa/asound.state restore
I made the file executable with
sudo chmod+x
and I went back to the Session and Startup dialog and changed the command in my autostart item tosh /home/<user>/scripts/sound-restore.sh
. Make sure that the preset startup item named "PulseAudio Sound System" is unchecked. After the next reboot the volume settings were restored to the previous settings at last! I've been testing it for a while and it works perfectly fine, and with the pulseaudio daemon running happily in the background.System:
Linux Mint 17.1 XFCE
hardware:
AthlonXP +2600
PCI soundcard: ESS Technology ES1938 Solo-1
I know this is a really old question, but this may still help users in the future with this problem.
You need make sure that you have these two commands present at the beginning of your
/etc/pulse/default.pa
file:These deal with saving the volumes of virtual pulseaudio cards and physical cards and restoring them when they come back onto the system.
I have many more modules in my default.pa to make pulseaudio act the way you'd want it to, so if anybody wants to see what default.pa usually looks like on a newly installed Ubuntu 14.04 system, here it is:
If you want to have a modified
default.pa
for your login account, you save it into~/.config/pulse/default.pa
. That one will be loaded instead of the master/etc/pulse/default.pa
(so remember to put everything that's in the master one for card detecting and such).But, since Linux and a lot of its distributions have made a lot of progress since when this question was posted, everyone's system should come with a correctly set-up
/etc/pulse/default.pa
.Sorry to labour the point, but I've gone through my answer and found it full of gaps. I have written a full tutorial on the linux mint forum, to which I would like to refer anyone looking for this particular answer. So, here is the link.
[Solved] Fix for ALSA Volume reset to 100% at boot/ reboot