Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] Sound (alsa: snd-powermac) bad on resume from sleep
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC
View previous topic :: View next topic  
Author Message
theefer
n00b
n00b


Joined: 12 Jul 2003
Posts: 32

PostPosted: Mon Oct 24, 2005 4:24 pm    Post subject: [solved] Sound (alsa: snd-powermac) bad on resume from sleep Reply with quote

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:

Code:
[/etc/modules.d/alsa]
...snip...
alias snd-card-0 snd-powermac
...snip...


Then (might require a reboot, I am not sure) reloading the alsa modules after resuming from sleep restores a sane-sounding system:

Code:
/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:

Code:
[/etc/power/scripts.d/alsa]
#!/bin/sh

# example power management control script - skeleton

# name        : alsa
# author      : Sebastien Cevey <seb@cine7.net>
# description : Stops alsa (remove modules) on suspend, reload alsa on resume

PATH=/bin:/sbin:/usr/bin:/usr/sbin

# source configuration
. pmcs-config

case "$1" in
  suspend)
    /etc/init.d/alsasound stop
    ;;
  resume)
    /etc/init.d/alsasound start
    ;;
esac


And we symlink this file in the events.d directory so it is actually used:

Code:
# cd /etc/power/event.d/
# ln -s ../scripts.d/alsa
# ls -l
total 0
lrwxrwxrwx  1 root root 17 oct 24 18:09 alsa -> ../scripts.d/alsa
...snip...


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!
_________________
Theefer
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum