# -*- sh -*- # vim:ft=sh:ts=4:sw=4:noet # Written by Konstantin S. Ivanov ksiv AT yandex D_O_T ru # Based on # Written by dotCOMmie. With Special thanks to eworm. # Based on DirkHusemann's kded script. # This script is to automate an alsa hibernate workaround # Look for more info: # https://bugs.launchpad.net/ubuntu/+source/linux-source-2.6.17/+bug/25896 # How it works: # On hibernate this unloads alsa service # On resume it restarts it # Installation: # Put script into your scriptlets.d dir (/etc/hibernate/scriptlets.d/) # add "EnableALSAHack 1" to common.conf AddConfigHandler ALSAOptions AddConfigHelp "EnableIALSAHack " "Brings sounds back" ALSAResume() { [ x"$ALSA_ENABLED" = "x1" ] || return 0 return 0 } ALSASuspend(){ [ x"$ALSA_ENABLED" = "x1" ] || return 0 /etc/init.d/alsa unload return 0 } ALSAOptions() { case $1 in enablealsahack) BoolIsOn "$1" "$2" && ALSA_ENABLED=1 || return 0 ;; *) return 1 esac if [ -z "$ALSA_HOOKED" ] ; then AddSuspendHook 01 ALSASuspend AddResumeHook 01 ALSAResume ALSA_HOOKED=1 fi return 0 }