[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ALSA on PowerBook Pismo WAS: Re: Newbie (to ppc), but glad to be here.



[Jesus, I send you this message too, this may be useful to add this
 tips for all those that want to switch to ALSA, I hope to find some
 time to send you the remaining tips]

OoO En ce début d'après-midi ensoleillé du lundi 11 août 2003, vers
15:59, Marshal Wong <marshal@h9.dion.ne.jp> disait:

[ALSA does not support sleep]

> Has anyone else experienced this?

Same here. But the ibook is crashing at sleep, not at wake up. And
when it is locked, it warms very fast, so it was really annoying when
you did not notice it.

> So what I gather needs to be done is to force uninstall the modules on
> sleep.  ALSA does support an option for this, but it only works with
> APMD, which is of no use to PMUD.  I tried hacking the PMUD scripts
> but obiviously, my shell-scripting sucks, otherwise, I would have been
> able to give a fix.

The big problem is that if you have a running application somewhere
(for example xmms) and that this application is just controlling the
mixer (not playing sound), if you unload ALSA (forcibly or not), the
access to the mixer will just reload ALSA and you will encounter a
fine lock.

Here is what I put in my /etc/alsa/modutils/0.9 to avoid this (do not
forget to erase the first line to avoid debconf backing out the
changes) :

alias snd-card-000 snd-powermac

So, instead of snd-card-0, I put snd-card-000. This fixes mysterious
hangs which happen when ALSA was reloaded because xmms has read the
current values of the mixer (I think). This change is also useful if
ALSA is not able to initialize correctly the mixer. You can add the
following lines at the end of the file :

pre-install snd-powermac modprobe dmasound_pmac ; rmmod dmasound_pmac dmasound_core
post-remove dmasound_pmac rmmod dmasound_pcore

Now, you can unload alsa using "/etc/init.d/alsa force-stop". I am not
using pmud any more (but pbbuttonsd instead), but this is a relatively
trivial change to your pwrctl-local file.

I have also modified /etc/init.d/alsa to put "|| true" after the two
"kill" lines :

                    printf "(terminating processes) "
                    kill $procs_using_sound || true
                    sleep 2
                    kill -9 $procs_using_sound || true

But, it was when I was searching how could I put this damn ibook to
sleep without crashing the whole system and I am not sure any more
this was useful. However, I don't want to try without them (in any
other script, I would say this is absolutely not useful, but this can
add some magic in this one ;-) ).

With these changes, my ibook successfully goes to sleep every
time. Sometimes, xmms is killed (when it was querying the mixer) and
sometimes not. But this is a light side effect.
-- 
panic ("No CPUs found.  System halted.\n");
        2.4.3 linux/arch/parisc/kernel/setup.c



Reply to: