Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Is it possible to play an audio file when the system is starting up? Maybe I'm just bieng too silly, but it sure sounds fun!
Theory # 1 : After the system has entered the non-interactive startup, the system-logger is started and then stays started. This means that daemons (or programs, perhaps) run in a sequence, and then keep running until they are finished (when the system is shut down, for example).
Theory # 2 : During start-up, the GPM mouse thingy is loaded. This means that the drivers for the PS2 mouse have had to be loaded before that. Which, in turn means that the kernel loads drivers before starting user-space stuff.
What I'm thinking is, maybe we could write an init script that could run an audio player (play?)which could play a small audio file during bootup (and shutdown?).
well yeah it's pretty trivial to just play a sound. just add a command to /etc/rc.local etc....
if you're actually asking about say, each service saying what it's name is then sure that's doable, but you'd need to edit the init scripts, or more like edit /etc/init.d/functions to cover all services which utilize the standard service functions. you know you could go nuts and use festival convert the name of the service to speech automatically i expect, obviously not until alsa has completed loading, but it's a pretty basic service, so can start as easrly as you want really.
Distribution: Xubuntu 9.10, Gentoo 2.6.27 (AMD64), Darwin 9.0.0 (arm)
Posts: 1,152
Rep:
If you want something like a mac how it chimes right away when you power it on get out your soldering iron because they have special hardware that does this. this sound plays before anything loads. if you just want to play sound as soon as you can yes this is very possible. the drivers are part of the kernel (either in the kernel or as modules) so yes they can load before anything else. modules however are loaded into the kernel when they are needed so possibly later. I have the alsa drivers compiled into my kernel so if I put aplay and a sound file in an initrd I could play a startup sound before it even mounts any filesystems. I'll help you set this up if you want but, personally I am satisfied with the little chime I get as soon as I push the on button because mine is a mac (with linux of course)
Edit:
Acid's idea will work too and is simpler then mine but will start much later in the boot process. I love the festival idea though I've got to give that a try.
Last edited by johnson_steve; 12-14-2006 at 03:45 PM.
So, then, I have a i686 (!), and because I'm me, I've figured it out!
Well, at least according to my plan, all I've have to do is do add the following script to my /etc/rc.d/init.d/ directory (I'm using Fedora 4) :
Code:
#!/bin/sh
#
# chkconfig: 2345 02 02
# description: Plays a song when system is booting up.
. /etc/rc.d/init.d/functions
song=/usr/share/sounds/somesong.wav
song2=/usr/share/sounds/somesong.au
song3=/usr/share/sounds/someaudio.wav
song4=/usr/share/sounds/shutdown1.wav
case "$1" in
start)
echo Love the NT Shaji, man !
play $song < /dev/null &
;;
stop)
echo Still love the NT Shaji !
play $song2 < /dev/null &
;;
restart)
echo Always love the NT Shaji !
play $song < /dev/null &
;;
status)
I Love the NT Shaji !
play $song < /dev/null &
;;
*)
exit 1
esac
exit 0
chmod +x it to make it executable and then do /sbin/chkconfig to make it start whenever you start your system!
And, the best part, I figured all this out on my own!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.