Joined: 12 Jul 2003
|Posted: Mon Oct 24, 2005 4:24 pm Post subject: [solved] Sound (alsa: snd-powermac) bad on resume from sleep
|This problem on my AlBook (1GHz 15") has bottered me for several months, but I only just managed to fix it, very easily at that.
When resuming from sleep (e.g. closing the lid with pbbuttonsd configured to trigger suspend-to-ram), the sound was bad, sounding metallic or low-bitrate.
The first step was to correctly specify the soundcard driver in the alsa config:
alias snd-card-0 snd-powermac
Then (might require a reboot, I am not sure) reloading the alsa modules after resuming from sleep restores a sane-sounding system:
|/etc/init.d/alsasound restart |
But then, let's make it automatic! We can use scripts in /etc/power so that pbbuttonsd does all that stuff for us:
# example power management control script - skeleton
# name : alsa
# author : Sebastien Cevey <firstname.lastname@example.org>
# description : Stops alsa (remove modules) on suspend, reload alsa on resume
# source configuration
case "$1" in
And we symlink this file in the events.d directory so it is actually used:
|# cd /etc/power/event.d/
# ln -s ../scripts.d/alsa
# ls -l
lrwxrwxrwx 1 root root 17 oct 24 18:09 alsa -> ../scripts.d/alsa
Done! When you suspend the alsa modules are unloaded, and when you resume, they are reloaded. Works as a charm for me.
Hope you will find this useful!