Comment 68 for bug 25896

Revision history for this message
JLP (mandigueiro) wrote :

I have a solution that worked for me, but I am sure that it won't work for everyone, so take it or leave it.

I took the advice from Nitinn above and it worked for me. (Mute all of your audio channels before suspending.) You have to mute EVERY channel to get this to work. However, this can be automated.

First you make scripts to mute/unmute all of your channels automatically. Mine look like the following:
/usr/local/bin/mute-all.bash
---------------------------------
#!/bin/bash
amixer set Master mute
amixer set Headphone mute
amixer set PCM mute
amixer set CD mute
--------------------------------

/usr/local/bin/unmute-all.bash
------------------------------------
#!/bin/bash
amixer set Master unmute
amixer set Headphone unmute
amixer set PCM unmute
amixer set CD unmute
------------------------------------

Please note that ALL of my other channels are MUTED by default. You might need to run the command: "amixer scontrols" to get all of the channels for YOUR soundcard.

You can then put this at the bottom of /etc/hibernate/common.conf:
OnSuspend 99 /usr/local/bin/mute-all.bash
OnResume 99 /usr/local/bin/unmute-all.bash

This got the sound working for me. There is a default option to mute the audio before suspend/hibernation that is commented out in /etc/hibernate/common.conf however this didn't work for me because it only mutes the Master channel. Turns out that muting BOTH PCM and Master is enough to get the job done for me, but I include everything since it doesn't hurt.

I hope this info helps someone.