Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 170907 - media-sound/alsa-utils - alsasound initscript tries to unload modules in wrong order
Summary: media-sound/alsa-utils - alsasound initscript tries to unload modules in wron...
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: PPC Linux
: High normal (vote)
Assignee: Gentoo ALSA team
URL:
Whiteboard:
Keywords:
: 199642 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-03-14 17:24 UTC by Stefan de Konink
Modified: 2009-04-22 03:11 UTC (History)
7 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
new module unloading routine for kernel 2.6 in /etc/init.d/alsasound (alsasound.diff,1.23 KB, patch)
2009-04-22 02:22 UTC, georg.lippold
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan de Konink 2007-03-14 17:24:23 UTC
I have an iBook G4 with a snd_aoa_codec_tas as Alsa driver. The unloading of this driver prevents my shutdown to finish. I tracked it down by issueing the command myself. /sbin/rmmod --wait snd_aoa_codec_tas seems to be the 'bugger'.

No I don't see why the driver should be removed anyway, but this is probably a bug in Alsa.

Reproducible: Always

Steps to Reproduce:
1. shutdown / restart the system
2. 'hangs'

1. /etc/init.d/alsasound stop
2. waits for the rmmod

Actual Results:  
rmmod fails.

Expected Results:  
Report an error, or ignore it.
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2007-03-14 17:27:56 UTC
What's your media-sound/alsa-utils version? Try with media-sound/alsa-utils-1.0.14_rc2-r2 if you don't have installed that already.
Comment 2 Stefan de Konink 2007-03-14 17:36:04 UTC
That version is installed. But I use the in kernel (vanilla 2.6.20.1) alsadrivers. I'll upgrade to 2.6.20.2 and check if with the alsa-driver package the problem returns.
Comment 3 Stefan de Konink 2007-03-14 21:06:10 UTC
I finally managed to use the lastest alsa-drivers. Same problem for snd_aoa_codec_tas.
Comment 4 Luca Barbato gentoo-dev 2007-03-25 20:15:53 UTC
check .21

      [ALSA] alsa core: add struct device pointer to struct snd_pcm
      [ALSA] aoa: set device pointer in pcms
      [ALSA] aoa: fix up i2sbus_attach_codec
      [ALSA] alsa core: convert to list_for_each_entry*
      [ALSA] snd-aoa: fix onyx resume
      [ALSA] aoa: remove suspend/resume printks

Probably those fixes should be backported on .20..
Comment 5 Stefan de Konink 2007-03-25 20:19:49 UTC
(In reply to comment #4)
> check .21

I'll give it a shot. I hope they fixed the endian problems in OSS emulation too. I think that sucks even more in the last versions.

Comment 6 Daniel Drake (RETIRED) gentoo-dev 2007-03-28 01:09:26 UTC
On IRC, Luca deduced that this appears to be a problem with the alsasound init script unloading modules in the wrong order. We need to revisit how that should work.
Comment 7 Stefan de Konink 2007-03-28 05:44:59 UTC
(In reply to comment #6)
> On IRC, Luca deduced that this appears to be a problem with the alsasound init
> script unloading modules in the wrong order. We need to revisit how that should
> work.

Is this a question to test in which sequence I can cleanly modprobe -r the alsa modules? Or are you able to reproduce the problem yourself?
Comment 8 Magnus Rosenbaum 2007-07-31 21:31:27 UTC
You have to rmmod snd_aoa_fabric_layout first, then also snd_aoa_codec_tas can be removed.

The problem seems to be, that the function unload_modules_recursive() in /etc/init.d/alsasound assumes, that all dependent modules are listed in the output of lsmod. But in this case, there are no dependent modules listed:

magnum@ibookx ~ $ lsmod | grep ^snd
snd_pcm_oss            49472  0
snd_mixer_oss          18464  1 snd_pcm_oss
snd_aoa_codec_tas      13632  2
snd_aoa_fabric_layout    12552  0
snd_aoa                17664  2 snd_aoa_codec_tas,snd_aoa_fabric_layout
snd_aoa_i2sbus         21476  1
snd_pcm                85444  2 snd_pcm_oss,snd_aoa_i2sbus
snd_timer              22372  1 snd_pcm
snd_page_alloc          8936  1 snd_pcm
snd                    60916  8 snd_pcm_oss,snd_mixer_oss,snd_aoa_codec_tas,snd_aoa_fabric_layout,snd_aoa,snd_aoa_i2sbus,snd_pcm,snd_timer
snd_aoa_soundbus        6276  2 snd_aoa_fabric_layout,snd_aoa_i2sbus

snd_aoa_codec_tas is listed without dependent modules here. 

In /proc/modules the line looks like this: "snd_aoa_codec_tas 13632 2 - Live 0xf2452000". I don't know what the "Live ..." means.
Comment 9 Jakub Moc (RETIRED) gentoo-dev 2007-11-19 10:12:57 UTC
*** Bug 199642 has been marked as a duplicate of this bug. ***
Comment 10 Jakub Moc (RETIRED) gentoo-dev 2007-11-19 10:14:49 UTC
Changing summary to something more generic... plus btw, not really sure what's the point of trying to unload the modules at all.
Comment 11 Jakub Moc (RETIRED) gentoo-dev 2007-12-04 10:57:10 UTC
*** Bug 201109 has been marked as a duplicate of this bug. ***
Comment 12 Tony Vroon (RETIRED) gentoo-dev 2008-01-31 14:52:11 UTC
In alsa-utils-1.0.16-rc1 you will now be able to specify UNLOAD_ON_STOP="no" in /etc/conf.d/alsa
Comment 13 Tony Vroon (RETIRED) gentoo-dev 2008-03-12 15:00:55 UTC
Please confirm that this fixes the bug you reported.
Comment 14 namely_void 2008-04-22 11:27:34 UTC
I reported one of the duplicates for this bug and would like to comment that no, preventing unloading does definitely not solve the bug. It solves one of the most annoying symptoms (machine locking on shutdown), but doesn't really solve the problem there. For instance, someone in the forums noticed that "/etc/init.d/alsa reload" doesn't do what it should when the modules aren't really unloaded.
Comment 15 Rosen Tihomirov 2009-04-08 07:48:16 UTC
(In reply to comment #13)
> Please confirm that this fixes the bug you reported.
> 

setting UNLOAD_ON_STOP="no" in /etc/conf.d/alsa works for me
Comment 16 georg.lippold 2009-04-22 02:20:44 UTC
I have a fixed /etc/init.d/alsasound for this (diff against media-sound/alsa-utils). With the fix, all modules are unloaded properly as long as there are modules from sound that have 0 dependencies left.
Comment 17 georg.lippold 2009-04-22 02:22:41 UTC
Created attachment 189127 [details, diff]
new module unloading routine for kernel 2.6 in /etc/init.d/alsasound

Bug should be reopened and this should be used as a fix. Simply not unloading modules is not the expected behavior as previous posters already noticed.