Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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:

Analog Output Settings

share|improve this question
2  
i'm really tired of this issue, pulse just does not save volume (tried 2 soundcards and 1 usb headset, tried ubuntu, xubuntu, lubuntu). Does pulse work at all? I would try ponymix as a last resort. –  kemsky Mar 13 '13 at 23:10
add comment

2 Answers

up vote 3 down vote accepted

To mute the sounds you could use this command:

pacmd set-sink-volume 0 0

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:

pacmd set-sink-volume 0 32768

Here is a link to more information on using the PulseAudio CLI (pacmd)

share|improve this answer
1  
Also, here is some information on how to create a boot script if you do not know: http://en.kioskea.net/faq/3348-ubuntu-executing-a-script-at-startup-and-shutdow‌​n –  reverendj1 May 14 '12 at 14:29
    
My understanding is that a sink is a sound card, but you can have virtual sinks too. 0 should be your default. You can list them with this command: pacmd list-sinks –  reverendj1 May 14 '12 at 14:34
    
Argh -- the command seems to work (sets volume to 0), but I still have sound coming from the laptop speakers. Doesn't seem right.... –  belacqua May 15 '12 at 21:58
    
When you say that you have sound coming through the speakers, do you mean the login sound or something, and then it mutes after? Or do you meant that it just SHOWS that the sound is muted, and sound still plays? I just saw that alsa actually calls PulseAudio on startup. I was under the impression that PulseAudio replaced alsa. Alsa is supposed to save the current volume at shutdown, and restore it on boot. I think this is not happening for you. Try this, set your volume to a low volume, then use the following command: sudo alsactl store –  reverendj1 May 16 '12 at 14:59
    
Sound was from an embedded web video (youtube, I think). Yes, it does show the sound at zero (not marked muted, however), but isn't really muted or at zero. Trying the alsactl store workaround. –  belacqua May 16 '12 at 17:49
show 3 more comments

Download and extract ponymix from https://github.com/falconindy/ponymix

sudo apt-get install libpulse-dev
sudo make
sudo cp ponymix /usr/bin/ponymix
sudo chmod +x /usr/bin/ponymix

test if it is working

ponymix get-volume

make startup-script

sudo gedit /usr/bin/load-sound

add this to the file /usr/bin/load-sound:

#! /bin/sh
cat /opt/pulse-volume | xargs /usr/bin/ponymix set-volume
exit 0

activate logon script (load-sound) open “startup applications” click add name: Load pulseaudio volume command: load-sound

make logoff script (save-sound):

sudo gedit /usr/bin/save-sound

add this to the file /usr/bin/save-sound:

#! /bin/sh
su -c "/usr/bin/ponymix get-volume > /opt/pulse-volume" YOUR_CURRENT_USERNAME
exit 0

activate logoff script (will be run as root):

sudo gedit /etc/lightdm/lightdm.conf

add this to the file /etc/lightdm/lightdm.conf:

[SeatDefaults]
session-cleanup-script=/usr/bin/save-sound

Reboot.

share|improve this answer
    
Thanks, I'll give this a shot. Hadn't heard of ponymix - apparently was previously 'pulsemix' -- bbs.archlinux.org/viewtopic.php?id=141324 . –  belacqua Oct 26 '12 at 15:43
    
You can run ponymix locally without using sudo, just to let you know. This also works on later versions of Ubuntu, presumably from 12.04 all the way up to 14.04 (which is what I'm using). –  Shurane Mar 25 at 15:00
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.