Alsa Boot Script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Alsa Boot Script
# 1  
Old 11-17-2013
Alsa Boot Script

Due to a bug in Debian Sid I'm currently having to run "alsactl init" at the command-line to start my sound card. This wasn't a big issue, but I though automating this simple task at boot would be more efficient. I made the following script in /etc/init.d/ and ran chmod +x on it:

Code:
root@me:/etc/init.d# cat atboot.sh 
#!/bin/bash

alsactl init
echo "All your base belong to us..."

We my system boots up I see the test string being echoed "All your base belong to us...". However, the sound does not start and I have to run "alsactl init" again from the command-line to start sound. Does anyone know anything I may be missing?
# 2  
Old 11-17-2013
It may depend on other modules. Try running it towards the end of the boot process. And, include some error checking + output.
# 3  
Old 11-17-2013
Ok, I know how to send stderr to a file with this but how would one make a script execute toward the end of the boot process? Not sure how to specify that.
# 4  
Old 11-17-2013
You mentioned you're on Debian? Check /etc/init.d/README and the references therein.
# 5  
Old 11-19-2013
Hi Azrael...

I have been doing a bit of lateral thinking here and came up with an idea...

You say that you enable alsa at the command line so I assume a terminal rather than
a console.

Maybe your script to enable alsa requires a small delay inside a terminal to do its job.
(I once had a similar problem with Caldera 7 and had to use a batch file from a Windows
boot to enable the sound card before LinLoad.)

Why not try this idea out, assuming you have xterm:-
Code:
#!/bin/bash --posix
> /tmp/alsaboot.sh
chmod 755 /tmp/alsaboot.sh
echo "#!/bin/bash" >> /tmp/alsaboot.sh
echo "echo alsactl init" >> /tmp/alsaboot.sh
echo "echo 'All your base belong to us...'" >> /tmp/alsaboot.sh
echo "sleep 5" >> /tmp/alsaboot.sh
xterm -e /tmp/alsaboot.sh &

You WILL have to edit this script at line 5 to remove the second echo to use but just check
that this idea works first before removing it.

It does work on the OSX 10.7.5, default bash terminal...

Just an idea that reminded me of my traumas with Caldera 7.
# 6  
Old 01-04-2014
Whoa... Sorry about the late reply. You're example did work for me after some tweaking. Thank you Wisecracker! Much appreciated!
Login or Register to Ask a Question

Previous Thread | Next Thread

1 More Discussions You Might Find Interesting

1. Slackware

HD-Audio: ALSA settings not persistent across reboots.

Hi: The OS is Slackware 14.0. When, after 14.0 install I first ran alsamixer, I got an error message and it quit. After some googling, I created /etc/modprobe.d/alsa.conf with these lines: alias snd-card-0 snd_hda_intel alias sound-slot-0 snd_hda_intel options snd_hda_intel... (0 Replies)
Discussion started by: stf92
0 Replies
Login or Register to Ask a Question