Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Alsa restart or shutdown hangs my PPC-based MacMini
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
Mark Knecht
n00b
n00b


Joined: 16 Sep 2003
Posts: 63

PostPosted: Mon Apr 21, 2008 8:25 pm    Post subject: Alsa restart or shutdown hangs my PPC-based MacMini Reply with quote

I've just brought up an older Power PC- based Mac Mini running Gentoo. Alsa is working but when I execute a shutdown -h now the machine hangs at 'Unloading Alsa modules...' and never proceeds. The only way out at this point seems to be the power switch.

The same problem is seen trying to restart Alsa from a terminal:

login as: root
root@192.168.1.61's password:
Last login: Fri Apr 18 15:24:14 2008 from 192.168.1.57
MacMini ~ # uname -a
Linux MacMini 2.6.24-gentoo-r3 #3 SMP Fri Apr 18 10:23:01 PDT 2008 ppc 7447A, altivec supported PowerMac10,2 GNU/Linux
MacMini ~ # /etc/init.d/alsasound restart
* Storing ALSA Mixer Levels ... [ ok ]
* Killing processes using ALSA ... [ ok ]
* Unloading ALSA modules ...

I understand from a more experienced user on the gentoo-ppp-user list that there is a one line change to /etc/init.d/alsasound that fixed the problem on his machine but he doesn't have the fix anymore as an update overwrote it. I'm hoping someone reading here might know of the fix so we could file a bug report.

Thanks in advance,
Mark
Back to top
View user's profile Send private message
Sadako
Advocate
Advocate


Joined: 05 Aug 2004
Posts: 3753
Location: sleeping in the bathtub

PostPosted: Mon Apr 21, 2008 8:41 pm    Post subject: Reply with quote

Just looking at the script, if you set UNLOAD_ON_STOP="no" in /etc/conf.d/alsasound then the unload_modules_26() function should never be called, and that seems to be where the problem lies.
_________________
"You have to invite me in"
Back to top
View user's profile Send private message
Mark Knecht
n00b
n00b


Joined: 16 Sep 2003
Posts: 63

PostPosted: Mon Apr 21, 2008 9:19 pm    Post subject: Reply with quote

Thanks. Indeed. if I set that to no the machine will reboot/shutdow so that's a help. However when I try to execute a restart I *think* it doesn't really reset Alsa so I figure there really is a problem there somewhere. I'll leave it as a no for now so that I can at least shutdown.

Is there any reason to think this is a problem with the Gentoo scripts as opposed to a real Alsa problem? I submitted a bug report a few days ago at the Alsa site. I don't want to waste their time if it's really a Gentoo issue.

Thanks!
Back to top
View user's profile Send private message
Sadako
Advocate
Advocate


Joined: 05 Aug 2004
Posts: 3753
Location: sleeping in the bathtub

PostPosted: Mon Apr 21, 2008 9:36 pm    Post subject: Reply with quote

If you don't mind your box locking up, it shouldn't be too difficult to figure out where it's freezing. ;)

These are the functions where the problem seems to occur (this is with alsa-utils-1.0.16, yours could be a little different);
Code:
unload_modules_26() {
        # First of all, remove the snd module and all the modules depending
        # on it, this should remove already most of ALSA modules.
        lsmod | grep -q "^snd[[:space:]]" && unload_modules_recursive snd

        # Then find the remaining ones, and handle them too.
        for module in $(lsmod | sed -n -e 's/^\(snd[^ ]*\) .*/\1/p'); do
                unload_modules_recursive "${module}"
        done

        lsmod | grep -vq "^snd"
}

unload_modules_recursive() {
        local revdeps="$(lsmod | sed -n -e "s/,/ /g" -e "s/^$1 *[0-9]* *[0-9]* \(.*\)/\1/p")"

        for module in ${revdeps} ; do
                unload_modules_recursive "${module}"
        done

        vebegin "Unloading: $1"
        rmmod --wait "$1"
        veend $?
}


You could run through the commands one by one in a terminal to see which one actually causes the problem, taking note of the output (if any) in each case.

Code:
lsmod | grep -q "^snd[[:space:]]"
echo $?
lsmod | sed -n -e "s/,/ /g" -e "s/^$1 *[0-9]* *[0-9]* \(.*\)/\1/p"


At this point, you should manually try `rmmod --wait module` for each modules listed by the previous `lsmod | sed` statement.

You should probably do this after a normal `/etc/init.d/alsasound stop`.
_________________
"You have to invite me in"
Back to top
View user's profile Send private message
Ato
n00b
n00b


Joined: 22 Dec 2007
Posts: 66
Location: Duisburg, Germany

PostPosted: Mon Apr 28, 2008 5:06 am    Post subject: Re: Alsa restart or shutdown hangs my PPC-based MacMini Reply with quote

Hi Mark,

Mark Knecht wrote:
I've just brought up an older Power PC- based Mac Mini running Gentoo. Alsa is working but when I execute a shutdown -h now the machine hangs at 'Unloading Alsa modules...' and never proceeds. The only way out at this point seems to be the power switch.

Mark


same here on my Mac Mini G4. The reason is that the removal of a single ALSA kernel module for the Mini failes due to a dependency, i.e. the Linux kernel thinks that the to be removed module is still in use by another module. Since the script uses the --wait option for the rmmod command rmmod waits forever for the other kernel module to release the one in question. Long story made short: remove the --wait option from the rmmod command and you're fine.

Cheers,
Thomas
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