I have a hard time unloading a module (that is it's more stubborn than an aging leprechaun) that is being reported as not being used by lsmod:
Code: Select all
root@groot:~# modprobe -vr saa7134_alsa
modprobe: FATAL: Module saa7134_alsa is in use.
root@groot:~# lsmod | grep saa
saa7134_alsa 17686 0
saa7134 174878 1 saa7134_alsa
tveeprom 20593 1 saa7134
videobuf2_dma_sg 12655 1 saa7134
videobuf2_core 47787 1 saa7134
rc_core 22404 1 saa7134
v4l2_common 12995 3 tuner,saa7134,videobuf2_core
videodev 126451 4 tuner,saa7134,v4l2_common,videobuf2_core
snd_pcm 88662 7 snd_soc_rt5640,snd_soc_core,snd_hda_codec_hdmi,snd_hda_codec,snd_hda_intel,snd_hda_controller,saa7134_alsa
snd 65244 23 snd_hda_codec_realtek,snd_soc_core,snd_hwdep,snd_timer,snd_hda_codec_hdmi,snd_pcm,snd_hda_codec_generic,snd_hda_codec,snd_hda_intel,snd_compress,saa7134_alsa
i2c_core 46012 12 drm,snd_soc_rt5640,i2c_hid,tuner,i2c_designware_platform,saa7134,regmap_i2c,nvidia,v4l2_common,tveeprom,tuner_simple,videodev
Code: Select all
#/bin/sh
MAXCARD=150
for m in $(seq 0 $MAXCARD);
do
MAXTUNER=69
for i in $(seq 0 $MAXTUNER);
do
modprobe -vb saa7134 card=$m tuner=$i
echo "Actual card is:" $m "tuner is:" $i
lsmod | grep saa
sleep 1 # this is to make sure /dev/video is registered when tvtime starts
tvtime
rmmod saa7134_alsa
rmmod saa7134
done
done