[SATLUG] rmmod and insmod commands

Jeremy Mann jeremymann at gmail.com
Sat May 23 14:20:28 CDT 2009


On Sat, May 23, 2009 at 12:59 PM, Michael <mmorse757 at gmail.com> wrote:
>>> Jeremy Mann wrote:
>>>
>>>> Michael, that is a soundcard module not a video card, but to remove
>>>> them you need to find what other modules are using that device. Since
>>>> it is a soundcard, I'd start with the snd-* modules and work your way
>>>> down.
>>>>
>>> But that doesn't answer my question.  ;-)
>>>
>>> How to I stop and restart the modules once I find them?
>>>
>
>> I am trying to install a video card that is not being automatically
>> detected.  Following some directions I googled, after making changes to
>> my /etc/modprobe.d/options file, I am supposed to issue the following
>> commands:
>>
>> rmmod saa7134-alsa       < - - - - -  gives me a "module in use" error.
>> rmmod saa7134            < - - - - -  gives me a "module in use" error.
>> insmod saa7134.ko card=<card number>  {where <card number is an actual
>>  number, 1 - 125.}
>> insmod saa7134-also.ko
>>
>> This is supposed to be instead of rebooting the computer.  However, I
>> get a "module in use error" when I try to issue the rmmode command.  I
>> also tried the command modeprobe -r but I get the same "module in use
>> error."
>>
>> So, I guess me question is, I do I stop and restart the module
>
>
> Here is my original post.  I know what the commands are.  I am getting
> an error message "module in use" when I execute either rmmod or modprobe
> with the -r option.
>
> I am not knowledgeable about modules.  Are they similar to what Windows
> calls processes or Linux services that can be stopped and restarted?
> The reason I ask this is the verbage of the error, "module in use" makes
> it sound as if it can be stopped/restarted.  In any case, how do I avoid
> the "module in use" error?

Not to be a pain here, but it was asked and answered. A more
simplified answer is below.

For example, this is the output of "lsmod |grep snd". This displays
all ALSA sound modules:

snd_seq_dummy           6788  0
snd_seq_oss            32896  0
snd_seq_midi_event     10112  1 snd_seq_oss
snd_seq                50640  5 snd_seq_dummy,snd_seq_oss,snd_seq_midi_event
snd_pcm_oss            42784  0
snd_mixer_oss          18048  1 snd_pcm_oss
snd_usb_audio          78176  0
snd_usb_lib            17792  1 snd_usb_audio
snd_rawmidi            22560  1 snd_usb_lib
snd_seq_device         10508  4 snd_seq_dummy,snd_seq_oss,snd_seq,snd_rawmidi
snd_hwdep              10628  1 snd_usb_audio
snd_intel8x0           32412  0
snd_ac97_codec         98980  1 snd_intel8x0
ac97_bus                6016  1 snd_ac97_codec
snd_pcm                72068  4
snd_pcm_oss,snd_usb_audio,snd_intel8x0,snd_ac97_codec
snd_timer              22532  2 snd_seq,snd_pcm
snd                    47204  12
snd_seq_oss,snd_seq,snd_pcm_oss,snd_mixer_oss,snd_usb_audio,snd_rawmidi,snd_seq_device,snd_hwdep,snd_intel8x0,snd_ac97_codec,snd_pcm,snd_timer
soundcore               9824  1 snd
snd_page_alloc         11528  2 snd_intel8x0,snd_pcm

Notice the 3rd and 4th columns.  "0" means its not in use, any other
number will display what is using that module. So like I said before,
you need to see which modules are using that saa7134 device and remove
them FIRST.

For example, take "snd_pcm", its being used by 4 other modules. In
order to remove snd_pcm, I first need to remove the modules its using.

Another thing to take into consideration, is since this is an audio
module you may need to kill all mixer programs and audio programs. The
safest way would be to completely get out of X with "init 3" then
unload the modules.


-- 
Jeremy Mann
jeremy at biochem.uthscsa.edu

University of Texas Health Science Center
Bioinformatics Core Facility
http://www.bioinformatics.uthscsa.edu
Phone: (210) 567-2672


More information about the SATLUG mailing list