LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-14-2004, 09:45 PM   #1
webvandals
Member
 
Registered: Aug 2003
Posts: 105

Rep: Reputation: 15
How to STOP a kernel module from loading?


I thought I had fixed my ALSA problems, but after a reboot, they're back :-(

I think the trouble is that I've got these conflicting sound related modules that get loaded on reboot and I can't figure out how to remove them. Here are the facts:

1) Using 2.6.7 kernel with ALSA (Debian 686)

2) Alsa fails to start *I think* because it finds these 2 loaded modules:
- es1371
- ac97_codec

3) I can't remove either of those modules because they're "in use" (even --force fails)

4) /etc/modules contains only the following:
apm
soundcore
snd-ens1371
nvidia

So my question is... how in the heck does my system know to load all of my modules when only those 4 are listed in /etc/modules?

Where I can I find the file that lists all of the *other* modules that get loaded at boot time?

Thanks!
 
Old 08-14-2004, 10:13 PM   #2
edman007
Member
 
Registered: Sep 2003
Distribution: slackware-current
Posts: 173

Rep: Reputation: 30
look in the files in /etc/rc.d/, specifically /etc/rc.d/rc.modules, thats the file (at least in slackware) that does all the modprobe commands on boot
 
Old 08-14-2004, 10:43 PM   #3
qwijibow
LQ Guru
 
Registered: Apr 2003
Location: nottingham england
Distribution: Gentoo
Posts: 2,672

Rep: Reputation: 47
shutdown all programs using sound before you attempt to rmmod the drivers.
 
Old 08-15-2004, 12:18 AM   #4
webvandals
Member
 
Registered: Aug 2003
Posts: 105

Original Poster
Rep: Reputation: 15
Yarg! This ALSA crap has been driving me nuts for *months* now!

I can't kill es1371 or ac97_codec no matter what I try. Please help!

Here's my lsmod:

Code:
Module                  Size  Used by
agpgart                34152  0
nvidia               2075112  12
ipt_MASQUERADE          3840  1
ipt_state               2080  11
ipt_REJECT              6912  5
ipt_LOG                 6592  13
ipt_limit               2528  15
iptable_mangle          2880  0
ip_nat_ftp              5008  0
iptable_nat            25100  3 ipt_MASQUERADE,ip_nat_ftp
ip_conntrack_ftp       72276  1 ip_nat_ftp
ip_conntrack           35392  5 ipt_MASQUERADE,ipt_state,ip_nat_ftp,iptable_nat,ip_conntrack_ftp
iptable_filter          2880  1
ip_tables              18432  8 ipt_MASQUERADE,ipt_state,ipt_REJECT,ipt_LOG,ipt_limit,iptable_mangle,iptable_nat,iptable_filter
vmnet                  30448  12
parport_pc             35008  1
vmmon                  49464  0
ipv6                  255488  8
lp                     11204  0
parport                41832  2 parport_pc,lp
af_packet              22376  0
ds                     18532  0
yenta_socket           21440  0
pcmcia_core            68132  2 ds,yenta_socket
dm_mod                 44960  0
genrtc                  9608  0
nls_cp437               5696  0
e100                   32608  0
mii                     5120  1 e100
es1371                 37376  1
soundcore              10336  2 es1371
gameport                4704  1 es1371
ac97_codec             18956  1 es1371
natsemi                24960  0
crc32                   4320  1 natsemi
thermal                12656  0
tsdev                   7328  0
processor              17264  1 thermal
mousedev               10444  1
usblp                  13024  0
joydev                  9888  0
evdev                   9568  0
fan                     3980  0
button                  6296  0
battery                 9388  0
ac                      4812  0
usbhid                 32768  0
floppy                 61204  0
uhci_hcd               32880  0
ohci_hcd               21796  0
usbcore               114784  6 usblp,usbhid,uhci_hcd,ohci_hcd
udf                    94308  0
ntfs                   93292  0
reiserfs              245424  0
romfs                   8932  0
isofs                  35416  0
vfat                   14656  0
msdos                   9696  0
fat                    46688  2 vfat,msdos
ext2                   72392  0
ext3                  127144  2
jbd                    62264  1 ext3
mbcache                 9348  2 ext2,ext3
ide_disk               19264  5
ide_generic             1408  0
piix                   13440  1
ide_core              142808  3 ide_disk,ide_generic,piix
unix                   28624  460
fbcon                  27460  72
font                    8320  1 fbcon
vesafb                  6656  1
cfbcopyarea             3840  1 vesafb
cfbimgblt               3040  1 vesafb
cfbfillrect

And here's an ls -l /etc/rc3.d


Code:
lrwxrwxrwx  1 root root 17 2004-06-09 03:37 K11anacron -> ../init.d/anacron
lrwxrwxrwx  1 root root 18 2004-06-09 03:37 S10sysklogd -> ../init.d/sysklogd
lrwxrwxrwx  1 root root 15 2004-06-09 03:37 S11klogd -> ../init.d/klogd
lrwxrwxrwx  1 root root 13 2004-06-09 03:37 S14ppp -> ../init.d/ppp
lrwxrwxrwx  1 root root 17 2004-06-09 03:37 S18portmap -> ../init.d/portmap
lrwxrwxrwx  1 root root 14 2004-06-09 03:37 S20alsa -> ../init.d/alsa
lrwxrwxrwx  1 root root 14 2004-06-09 03:37 S20apmd -> ../init.d/apmd
lrwxrwxrwx  1 root root 15 2004-06-09 22:51 S20canna -> ../init.d/canna
lrwxrwxrwx  1 root root 16 2004-06-09 03:37 S20cupsys -> ../init.d/cupsys
lrwxrwxrwx  1 root root 16 2004-06-09 03:37 S20dbus-1 -> ../init.d/dbus-1
lrwxrwxrwx  1 root root 13 2004-07-31 21:42 S20fam -> ../init.d/fam
lrwxrwxrwx  1 root root 15 2004-06-09 03:37 S20inetd -> ../init.d/inetd
lrwxrwxrwx  1 root root 17 2004-06-09 03:37 S20makedev -> ../init.d/makedev
lrwxrwxrwx  1 root root 15 2004-06-09 03:37 S20rsync -> ../init.d/rsync
lrwxrwxrwx  1 root root 15 2004-06-09 03:37 S20samba -> ../init.d/samba
lrwxrwxrwx  1 root root 18 2004-07-04 09:20 S20timidity -> ../init.d/timidity
lrwxrwxrwx  1 root root 13 2004-06-09 03:37 S20xfs -> ../init.d/xfs
lrwxrwxrwx  1 root root 16 2004-08-15 10:51 S20xprint -> ../init.d/xprint
lrwxrwxrwx  1 root root 15 2004-06-09 03:37 S21aumix -> ../init.d/aumix
lrwxrwxrwx  1 root root 17 2004-06-09 03:37 S40hotplug -> ../init.d/hotplug
lrwxrwxrwx  1 root root 17 2004-07-03 10:19 S50proftpd -> ../init.d/proftpd
lrwxrwxrwx  1 root root 17 2004-06-09 03:37 S89anacron -> ../init.d/anacron
lrwxrwxrwx  1 root root 14 2004-06-09 03:37 S89cron -> ../init.d/cron
lrwxrwxrwx  1 root root 19 2004-06-09 03:37 S99rmnologin -> ../init.d/rmnologin
lrwxrwxrwx  1 root root 23 2004-06-09 03:37 S99stop-bootlogd -> ../init.d/stop-bootlogd
lrwxrwxrwx  1 root root 13 2004-08-15 10:51 S99xdm -> ../init.d/xdm

And here's an ls -l /etc/rc5.d


Code:
lrwxrwxrwx  1 root root 17 2004-06-09 03:37 K11anacron -> ../init.d/anacron
lrwxrwxrwx  1 root root 18 2004-06-09 03:37 S10sysklogd -> ../init.d/sysklogd
lrwxrwxrwx  1 root root 15 2004-06-09 03:37 S11klogd -> ../init.d/klogd
lrwxrwxrwx  1 root root 17 2004-06-09 03:37 S18portmap -> ../init.d/portmap
lrwxrwxrwx  1 root root 14 2004-06-09 03:37 S20alsa -> ../init.d/alsa
lrwxrwxrwx  1 root root 16 2004-06-09 03:45 S20apache -> ../init.d/apache
lrwxrwxrwx  1 root root 14 2004-06-09 03:37 S20apmd -> ../init.d/apmd
lrwxrwxrwx  1 root root 15 2004-06-09 22:51 S20canna -> ../init.d/canna
lrwxrwxrwx  1 root root 16 2004-06-09 03:37 S20cupsys -> ../init.d/cupsys
lrwxrwxrwx  1 root root 16 2004-06-09 03:37 S20dbus-1 -> ../init.d/dbus-1
lrwxrwxrwx  1 root root 13 2004-07-31 21:42 S20fam -> ../init.d/fam
lrwxrwxrwx  1 root root 15 2004-06-09 03:37 S20inetd -> ../init.d/inetd
lrwxrwxrwx  1 root root 17 2004-06-09 03:37 S20makedev -> ../init.d/makedev
lrwxrwxrwx  1 root root 15 2004-06-09 03:45 S20mysql -> ../init.d/mysql
lrwxrwxrwx  1 root root 15 2004-06-09 03:37 S20rsync -> ../init.d/rsync
lrwxrwxrwx  1 root root 15 2004-06-09 03:37 S20samba -> ../init.d/samba
lrwxrwxrwx  1 root root 13 2004-06-09 03:45 S20ssh -> ../init.d/ssh
lrwxrwxrwx  1 root root 18 2004-07-04 09:20 S20timidity -> ../init.d/timidity
lrwxrwxrwx  1 root root 16 2004-06-09 03:45 S20vsftpd -> ../init.d/vsftpd
lrwxrwxrwx  1 root root 13 2004-06-09 03:37 S20xfs -> ../init.d/xfs
lrwxrwxrwx  1 root root 16 2004-08-15 10:51 S20xprint -> ../init.d/xprint
lrwxrwxrwx  1 root root 15 2004-06-09 03:37 S21aumix -> ../init.d/aumix
lrwxrwxrwx  1 root root 17 2004-07-03 10:19 S50proftpd -> ../init.d/proftpd
lrwxrwxrwx  1 root root 17 2004-06-09 03:37 S89anacron -> ../init.d/anacron
lrwxrwxrwx  1 root root 14 2004-06-09 03:37 S89cron -> ../init.d/cron
lrwxrwxrwx  1 root root 18 2004-07-11 14:09 S90vmware -> /etc/init.d/vmware
lrwxrwxrwx  1 root root 13 2004-06-09 03:37 S99kdm -> ../init.d/kdm
lrwxrwxrwx  1 root root 19 2004-06-09 03:37 S99rmnologin -> ../init.d/rmnologin
lrwxrwxrwx  1 root root 23 2004-06-09 03:37 S99stop-bootlogd -> ../init.d/stop-bootlogd
lrwxrwxrwx  1 root root 13 2004-08-15 10:51 S99xdm -> ../init.d/xdm
A bit more info:

After failing and failing to get my i810 integrated sound card to cooperate with ALSA, I went out and but an ens1371 based PCI sound card -- so now I have 2 sound cards but only want to use the ens1371. Which means I somehow need to remove that ac97_codec module. HOW?!
 
Old 08-15-2004, 03:00 AM   #5
ilnli
Member
 
Registered: Jul 2004
Location: Pakistan
Distribution: Slackware 10.0, SUSE 9.1, RH 7, 7.3, 8, 9, FC2
Posts: 413

Rep: Reputation: 32
or do
modprobe -r module_name

thats all
 
Old 08-15-2004, 03:08 AM   #6
webvandals
Member
 
Registered: Aug 2003
Posts: 105

Original Poster
Rep: Reputation: 15
If only it were that simple, I never would've posted this thread ;-)

Look:

root@0[~]# modprobe -r es1371
FATAL: Module es1371 is in use.
root@0[~]# modprobe -r ac97_codec
FATAL: Module ac97_codec is in use.
root@0[~]#

And no sound apps are running :-(
 
Old 08-15-2004, 07:37 AM   #7
SBing
Member
 
Registered: Mar 2004
Posts: 519

Rep: Reputation: 35
Are these modules being loaded by hotplug? Do they stop loading when you add them to /etc/hotplug/blacklist ?
 
Old 08-15-2004, 09:12 AM   #8
qwijibow
LQ Guru
 
Registered: Apr 2003
Location: nottingham england
Distribution: Gentoo
Posts: 2,672

Rep: Reputation: 47
Quote:
After failing and failing to get my i810 integrated sound card to cooperate with ALSA, I went out and but an ens1371 based PCI sound card -- so now I have 2 sound cards but only want to use the ens1371. Which means I somehow need to remove that ac97_codec module. HOW?!
turn it off in the bios !

look... use the "USED BY" output of lsmod to determine what order you have to rmmod the modules.

but insteads of removing them AFTER they load, you should just NOT LOAD THEM !

find where they are being modprobed i the init scripts, and comment them out.

i think you are not experianced anouth woth computers to attempt what you are attempting.
 
Old 08-15-2004, 07:48 PM   #9
webvandals
Member
 
Registered: Aug 2003
Posts: 105

Original Poster
Rep: Reputation: 15
Quote:
Are these modules being loaded by hotplug?
I was really hopeful about this, but alas... no joy. I added the lines "es1371" and "ac97_codec" to the blaclist, but both modules still cheerfully load-up on reboot.

Quote:
turn it off in the bios !
It's gonna sound bizarre (or impossible), but believe it or not, even after disabling the onboard ac97 sound and ac97 modem in the bios, the evil zombie modules still load up and refuse to die.

Quote:
look... use the "USED BY" output of lsmod
My lsmod is posted above. As you can see, there is no used by output for es1371

Quote:
insteads of removing them AFTER they load, you should just NOT LOAD THEM !
Hey what a great idea! (please see the title of this thread)

Quote:
find where they are being modprobed i the init scripts, and comment them out.
I would *really* like to do that. From looking at my init scripts above, can you see anything that you think I should comment out?

Quote:
i think you are not experianced anouth woth computers to attempt what you are attempting.
Umm, thanks. That's really helpful.

Any other ideas on how to kill these evil bastard modules?
 
Old 08-15-2004, 08:37 PM   #10
buffed317
Member
 
Registered: Jun 2004
Location: New Jersey, USA
Distribution: Slackware 11
Posts: 191

Rep: Reputation: 31
recompile the kernel to exclude them?
 
Old 08-15-2004, 08:40 PM   #11
qwijibow
LQ Guru
 
Registered: Apr 2003
Location: nottingham england
Distribution: Gentoo
Posts: 2,672

Rep: Reputation: 47
god knows.......

if i were him, i would compile the laetes kernel with NO sound support.(.. then compile alsa-driver from ALSA's website.


a bit overkill, nut guaranteed to work...
but for a newb, a kernel compile may generate more problems.
 
Old 08-15-2004, 08:50 PM   #12
webvandals
Member
 
Registered: Aug 2003
Posts: 105

Original Poster
Rep: Reputation: 15
Quote:
i would compile the laetes kernel with NO sound support
Hmm.. that might be a pretty good idea actually. Surely, there must be an easier way -- *something* is causing those kernel modules to load, but I just can't figure out what.

Quote:
but for a newb, a kernel compile may generate more problems.
I'm not afraid of recompiling the kernel, especially on Debian which is a piece of cake. Just because I can't solve this (and neither can anyone else so far) doesn't mean I'm a total newb
 
Old 08-15-2004, 11:29 PM   #13
qwijibow
LQ Guru
 
Registered: Apr 2003
Location: nottingham england
Distribution: Gentoo
Posts: 2,672

Rep: Reputation: 47
Quote:
Hmm.. that might be a pretty good idea actually. Surely, there must be an easier way -- *something* is causing those kernel modules to load, but I just can't figure out what.
the init scripts are loading the sound modules !
remove the friver loading lines from the init scripts, and they will not be loaded.

then, when booted, you can modprobe the modules you require. then write them back into the init scripts.
 
Old 08-15-2004, 11:35 PM   #14
webvandals
Member
 
Registered: Aug 2003
Posts: 105

Original Poster
Rep: Reputation: 15
Quote:
the init scripts are loading the sound modules !
remove the friver loading lines from the init scripts, and they will not be loaded.
I understand the concept. I just don't know which lines to remove from which files. Which init files should I be looking at?
 
Old 08-15-2004, 11:47 PM   #15
Genesee
Member
 
Registered: Dec 2002
Distribution: Slackware
Posts: 927

Rep: Reputation: 30
I don't remember the setup on debian, but did you try grepping the entire dir (where the startup scripts are) for the module name? cd to dir, then something like

grep module_name *

man grep for flags, usage, etc. also, iirc, debian's /etc/alternatives caused me some confusion, but not sure if that would apply here.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
rivafb module- how do i stop it from loading? Atnot Mandriva 6 06-17-2005 04:50 AM
How do i stop a kernel module loading? The_JinJ Linux - Newbie 1 03-13-2005 03:33 PM
how to stop module from loading greg108 Debian 7 08-26-2004 08:11 PM
how to tell to kernel to stop trying installing a specific module? zeppelin Slackware 4 08-21-2003 05:50 AM
Stop module loading Looking_Lost Slackware 4 07-08-2003 11:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:58 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration