LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-13-2007, 01:23 AM   #1
nicodoggie
LQ Newbie
 
Registered: Apr 2007
Location: San Mateo, Rizal, Philippines
Distribution: Fedora Core 6
Posts: 12

Rep: Reputation: 0
How do I reload sound drivers automatically?


When I first installed my FC6, my sound works perfectly, without any problems whatsoever. Then I shut down my computer. The next day, KDE gave me an error that says something like: Can't find sound card, device /dev/dsp does not exist, starting audio server using null output device. So I try to use the system-config-soundcard prog... My sound card was detected though:

Vendor: ALi Corporation
Model: M5455 PCI Ac-Link Controller Audio Device
Module: snd-intel8x0

but the PCM device drop-down was empty, and I coudln't hear the test sound, so I tried to reload the driver, then I tested it. It works! But then I have to do this manually every time I boot-up, how can I make Linux do this automatically?
 
Old 04-13-2007, 01:27 AM   #2
nadroj
Senior Member
 
Registered: Jan 2005
Location: Canada
Distribution: ubuntu
Posts: 2,539

Rep: Reputation: 59
not sure how FC6 is layed out, but in slackware there is a file (which you make executable: chmod +x <fileName>) '/etc/rc.d/rc.local' that is run each time when the system done booting. in here you add commands (one per line) that you want to be executed.
you will probably have to specify the full path to the command, though, ie: /sbin/modprobe snd-intel8x0

look for this file. if the file isnt there, but at least the folder is, then create the file and it should work. im sure FC6 has a different way of managing startup scripts, though... search around.

edit: check out this link:http://www.linux.com/article.pl?sid=06/01/03/1728227
Quote:
In the other distros (such as Fedora and Debian) you'll find that the scripts to be run are actually symbolic links to files in the directory /etc/init.d -- the central repository for all startup scripts. So all you have to do is to write your startup script, place it in /etc/init.d, and then create a symbolic link to it from the appropriate runlevel directory (or runlevel file, if that's what your system uses).
your script would be something like:
Code:
#!/bin/bash
/sbin/modprobe snd-intel8x0

Last edited by nadroj; 04-13-2007 at 01:30 AM.
 
Old 04-13-2007, 04:22 AM   #3
nicodoggie
LQ Newbie
 
Registered: Apr 2007
Location: San Mateo, Rizal, Philippines
Distribution: Fedora Core 6
Posts: 12

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by nadroj
not sure how FC6 is layed out, but in slackware there is a file (which you make executable: chmod +x <fileName>) '/etc/rc.d/rc.local' that is run each time when the system done booting. in here you add commands (one per line) that you want to be executed.
you will probably have to specify the full path to the command, though, ie: /sbin/modprobe snd-intel8x0

look for this file. if the file isnt there, but at least the folder is, then create the file and it should work. im sure FC6 has a different way of managing startup scripts, though... search around.

edit: check out this link:http://www.linux.com/article.pl?sid=06/01/03/1728227
your script would be something like:
Code:
#!/bin/bash
/sbin/modprobe snd-intel8x0
I found /etc/rc.d/rc.local and put in the script like you said, but then when I rebooted something happened... lots of speeding lines of unintelligible error codes, I think, came out... the only thing I can make out is

[<c0xxxxxx>] something something...

the x's are changing numbers and the text was constantly changing too... I had to run the rescue disk and take the line out of rc.local and it went back to normal... did I do something wrong?
 
Old 04-13-2007, 04:44 AM   #4
nicodoggie
LQ Newbie
 
Registered: Apr 2007
Location: San Mateo, Rizal, Philippines
Distribution: Fedora Core 6
Posts: 12

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by nadroj
not sure how FC6 is layed out, but in slackware there is a file (which you make executable: chmod +x <fileName>) '/etc/rc.d/rc.local' that is run each time when the system done booting. in here you add commands (one per line) that you want to be executed.
you will probably have to specify the full path to the command, though, ie: /sbin/modprobe snd-intel8x0

look for this file. if the file isnt there, but at least the folder is, then create the file and it should work. im sure FC6 has a different way of managing startup scripts, though... search around.

edit: check out this link:http://www.linux.com/article.pl?sid=06/01/03/1728227
your script would be something like:
Code:
#!/bin/bash
/sbin/modprobe snd-intel8x0
I found /etc/rc.d/rc.local and put in the script like you said, but then when I rebooted something happened... lots of speeding lines of unintelligible error codes, I think, came out... the only thing I can make out is

[<c0xxxxxx>] something something...

the x's are changing numbers and the text was constantly changing too... I had to run the rescue disk and take the line out of rc.local and it went back to normal... did I do something wrong?
 
Old 04-13-2007, 06:09 AM   #5
AwesomeMachine
Senior Member
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora
Posts: 1,829

Rep: Reputation: 257Reputation: 257Reputation: 257
There is a run level editor in FC6 just for this type of thing. It's in the main menu somewhere, near the top. Sound should be in there. Just enable it. It should stay. You might also try switching sound to ALSA. The other things is, sometimes the sound is not on DSP, and it will work even if the device isn't there.
 
Old 04-13-2007, 06:39 AM   #6
nicodoggie
LQ Newbie
 
Registered: Apr 2007
Location: San Mateo, Rizal, Philippines
Distribution: Fedora Core 6
Posts: 12

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by AwesomeMachine
There is a run level editor in FC6 just for this type of thing. It's in the main menu somewhere, near the top. Sound should be in there. Just enable it. It should stay.
You mean the Service Configuration thing? No, there isn't anything about sound there, there's this thing--nasd--I checked it out, it said Network Audio System server, it's enabled though.

Quote:
Originally Posted by AwesomeMachine
You might also try switching sound to ALSA. The other things is, sometimes the sound is not on DSP, and it will work even if the device isn't there.
My sound is on Autodetect right now, I'll try switching it to ALSA.

Thanks for the help guys
 
Old 04-14-2007, 12:44 AM   #7
nicodoggie
LQ Newbie
 
Registered: Apr 2007
Location: San Mateo, Rizal, Philippines
Distribution: Fedora Core 6
Posts: 12

Original Poster
Rep: Reputation: 0
Post Finally made it work!!

I used nadroj's advice and created a script and linked it to /etc/rc.d/rc.local, since I couldn't find anything in systemconf to do it automatically. What I did wrong the first time is that before I reload the drivers in system-config-soundcard is that the drivers were already loaded. so what I did first was to find out which drivers exactly are reloaded:

Code:
[nico@localhost ~]$ /sbin/lsmod
Module                  Size  Used by
snd_intel8x0           35677  2
snd_ac97_codec         93413  1 snd_intel8x0
ac97_bus                6465  1 snd_ac97_codec
snd_seq_dummy           7877  0
snd_seq_oss            33601  0
snd_seq_midi_event     11201  1 snd_seq_oss
snd_seq                51249  5 snd_seq_dummy,snd_seq_oss,snd_seq_midi_event
snd_seq_device         11853  3 snd_seq_dummy,snd_seq_oss,snd_seq
snd_pcm_oss            43617  0
snd_mixer_oss          19393  1 snd_pcm_oss
snd_pcm                75205  4 snd_intel8x0,snd_ac97_codec,snd_pcm_oss
snd_timer              25157  3 snd_seq,snd_pcm
snd                    53829  11 snd_intel8x0,snd_ac97_codec,snd_seq_oss,snd_seq,
snd_seq_device,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_timer
soundcore              11681  1 snd
snd_page_alloc         13769  2 snd_intel8x0,snd_pcm
ppp_deflate             9793  0
zlib_deflate           21977  1 ppp_deflate
ppp_async              15937  1
crc_ccitt               6337  1 ppp_async
ppp_generic            31445  6 ppp_deflate,ppp_async
slhc                   10177  1 ppp_generic
autofs4                24261  2
hidp                   23617  0
rfcomm                 43865  0
l2cap                  30656  4 hidp,rfcomm
bluetooth              57893  5 hidp,rfcomm,l2cap
sunrpc                153469  1
nf_conntrack_netbios_ns     7105  0
ipt_REJECT              8641  1
nf_conntrack_ipv4      15049  2
iptable_filter          7105  1
ip_tables              16389  1 iptable_filter
nf_conntrack_ipv6      23965  2
xt_state                6593  4
nf_conntrack           60745  4 nf_conntrack_netbios_ns,nf_conntrack_ipv4,nf_con
ntrack_ipv6,xt_state
nfnetlink              10841  3 nf_conntrack_ipv4,nf_conntrack_ipv6,nf_conntrack
xt_tcpudp               7233  8
ip6table_filter         6849  1
ip6_tables             17541  1 ip6table_filter
x_tables               18757  5 ipt_REJECT,ip_tables,xt_state,xt_tcpudp,ip6_tabl
es
vfat                   16193  1
fat                    53469  1 vfat
dm_multipath           21833  0
video                  19909  0
sbs                    19073  0
i2c_ec                  9025  1 sbs
dock                   13977  0
button                 11857  0
battery                13893  0
asus_acpi              20445  0
backlight              10177  1 asus_acpi
ac                      9157  0
radeon                116065  3
drm                    78421  4 radeon
ipv6                  275329  19 nf_conntrack_ipv6
parport_pc             30053  1
lp                     16265  0
parport                38537  2 parport_pc,lp
sg                     37213  0
floppy                 58789  0
pcspkr                  7233  0
hsfpcibasic2           71192  2
hsfserial              28100  4 hsfpcibasic2
k8_edac                18433  0
hsfengine            1310220  2 hsfpcibasic2,hsfserial
serio_raw              10821  0
edac_mc                25673  1 k8_edac
hsfosspec             109672  6 hsfpcibasic2,hsfserial,hsfengine
i2c_ali1563            11077  0
k8temp                  9537  0
hsfsoar                90376  1 hsfpcibasic2
uli526x                19925  0
i2c_ali15x3            11717  0
hwmon                   7493  1 k8temp
ide_cd                 40673  0
i2c_ali1535            10949  0
i2c_core               24897  4 i2c_ec,i2c_ali1563,i2c_ali15x3,i2c_ali1535
cdrom                  37345  1 ide_cd
dm_snapshot            20849  0
dm_zero                 6209  0
dm_mirror              25301  0
dm_mod                 58253  9 dm_multipath,dm_snapshot,dm_zero,dm_mirror
sata_uli               12101  1
libata                104665  1 sata_uli
sd_mod                 24129  2
scsi_mod              138221  3 sg,libata,sd_mod
ext3                  126025  2
jbd                    60777  1 ext3
ehci_hcd               34389  0
ohci_hcd               24281  0
uhci_hcd               26705  0
So I wrote a script to unload these modules first then reload them again:

Code:
#!/bin/bash
NAME="snd_page_alloc,soundcore,snd,snd_timer,snd_pcm,snd_mixer_oss,snd_pcm_oss,snd_seq_device,snd_seq,snd_seq_midi_event,snd_seq_oss,snd_seq_dummy,ac97_bus,snd_ac97_codec,snd_intel8x0"
IFS=","
for ARF in $NAME; do
    modprobe -ir "$ARF" &> /dev/null
done
for ARD in $NAME; do
    modprobe -i "$ARF" &> /dev/null
done
and then added the script in /etc/rc.d/rc.local.

Finally, I don't have to do any of that crappy manual reloading...
Hope this helps!

Thanks again!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to automatically reload a driver or module during boot up jeb083079 Linux - Kernel 1 08-23-2006 05:04 AM
Tomcat reload servlet is very slow, but reload jsp is fast and good? gsbarry Programming 2 04-28-2006 10:34 PM
Automatically load ittv drivers at startup cdhgee Linux - Software 3 12-29-2005 01:59 PM
must remove drivers and then reload them for soundcard jdblick SUSE / openSUSE 0 11-05-2004 11:09 PM
sound works, sorta, must modprobe -r then reload. jdblick Linux - Newbie 1 09-21-2004 02:23 PM


All times are GMT -5. The time now is 10:37 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration