LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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


Reply
  Search this Thread
Old 12-14-2006, 03:14 PM   #1
DJ Shaji
Member
 
Registered: Dec 2004
Location: Yo Momma's house
Distribution: Fedora Rawhide, ArchLinux
Posts: 518
Blog Entries: 15

Rep: Reputation: 106Reputation: 106
Play audio during bootup ?


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?).

So, can it be done?
 
Old 12-14-2006, 03:34 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
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.
 
Old 12-14-2006, 03:35 PM   #3
johnson_steve
Senior Member
 
Registered: Apr 2005
Location: BrewCity, USA (Milwaukee, WI)
Distribution: Xubuntu 9.10, Gentoo 2.6.27 (AMD64), Darwin 9.0.0 (arm)
Posts: 1,152

Rep: Reputation: 46
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.
 
Old 12-17-2006, 02:02 PM   #4
DJ Shaji
Member
 
Registered: Dec 2004
Location: Yo Momma's house
Distribution: Fedora Rawhide, ArchLinux
Posts: 518

Original Poster
Blog Entries: 15

Rep: Reputation: 106Reputation: 106
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!
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
can't play audio CD DBabo Linux - Software 12 09-05-2006 09:26 PM
Audio::Play/Audio::Data DanTaylor Programming 0 02-07-2006 06:37 PM
Audio KDE Bootup Maurice Arthur Linux - Software 0 10-11-2003 10:00 PM
DVD plays but no audio (can play audio cd's though)? guitarnix Linux - Newbie 2 10-05-2003 07:52 AM
USB Audio at bootup stops soundcard from loading. Meros Linux - Hardware 0 08-25-2002 03:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:32 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
Open Source Consulting | Domain Registration