fredfs
Posts: 58
Joined: Sun Jun 07, 2015 12:22 am

Boot Sound

Fri Jan 22, 2016 12:01 pm

I am trying to have a boot sound on my pi robot.
So when the power in on, something comes out from speakers connected to the analog audio output.
So far I have all these lines on the very first rc boot script (rcS)
/usr/bin/omxplayer -o local /home/bootsound.wav
and
/usr/bin/aplay /home/bootsound.wav
and also
/opt/vc/src/pi/hello_audio/hello_audio.bin.
But no audio.
If I try then at rc.local, it works, but then that is too late. It is a monitor-less robot project, we need some boot sound.
WHat am I missing? Maybe I should force the load of the sound module at the very first stage? But I am clueless how to do it.
Any help is very welcome.

Malman35
Posts: 425
Joined: Sun Nov 30, 2014 4:51 am

Re: Boot Sound

Tue Jan 26, 2016 10:06 am

Hmm I have thought about trying to do something like this but i don' know how either. Sorry. :roll:

User avatar
piglet
Posts: 931
Joined: Sat Aug 27, 2011 1:16 pm

Re: Boot Sound

Tue Jan 26, 2016 11:04 am

I'm in the same boat - except that I want to ensure that there is no sound output until the boot is done and I am ready to output the sounds I want to hear.

What I see is that while the pi is booting static/buzzing audio is generated both to the audio jack and on the USB sound card. I'd like it to be silent as it boots. I have sound amplified to speakers and it's not great that you get noise as you boot.

Any help to prevent this (or to play a sound of "silence") would be appreciated.

fredfs
Posts: 58
Joined: Sun Jun 07, 2015 12:22 am

Re: Boot Sound

Tue Jan 26, 2016 2:53 pm

Maybe your only help would be using a DAC, like Hifyberry, that does not suffer electric interference?

User avatar
piglet
Posts: 931
Joined: Sat Aug 27, 2011 1:16 pm

Re: Boot Sound

Tue Jan 26, 2016 4:17 pm

That wouldn't help as those things grab a shedload of GPIOs which I want to use for other things :)

User avatar
r3d4
Posts: 991
Joined: Sat Jul 30, 2011 8:21 am
Location: ./

Re: Boot Sound

Tue Jan 26, 2016 6:02 pm

fredfs wrote:So when the power in on, something comes out from speakers connected to the analog audio output.
What kind of speakers ?

+"Analog audio problems? post comments here!" : viewtopic.php?f=28&t=95612

fredfs
Posts: 58
Joined: Sun Jun 07, 2015 12:22 am

Re: Boot Sound

Fri Feb 26, 2016 12:15 pm

Desktop speakers...

Does it really matter?

tvjon
Posts: 810
Joined: Mon Jan 07, 2013 9:11 am

Re: Boot Sound

Tue Mar 01, 2016 7:05 pm

When testing some setups, I use a similar idea, although often a video (no sound) but audio works fine too.

Using omxplayer is a good idea, as it doesn't depend on the state of alsa. Alsa often goes into sulk mode on me & I get the silent treatment.

So, in a terminal window, type:

crontab -e

Scroll past all the comment lines that pop up in the terminal edit window, & make a new line thus:


@reboot cd /home/pi/music && /usr/bin/omxplayer -o local Clannad.mp3

Hopefully obvious, change the paths to your file.

Now save the file, & exit back to the terminal prompt.

To ensure that you really did type in that line, type:

crontab -l

& hopefully you'll see what you just entered, & can check you've put in the right path for your sound file, along with omxplayer's path.


Let us know if that is good enough for what you need.

fredfs
Posts: 58
Joined: Sun Jun 07, 2015 12:22 am

Re: Boot Sound

Mon Mar 07, 2016 2:50 pm

Thats is too late, I was looking for something as soon as the initial boot stage. Maybe using hello_audio code?
tvjon wrote:When testing some setups, I use a similar idea, although often a video (no sound) but audio works fine too.

Using omxplayer is a good idea, as it doesn't depend on the state of alsa. Alsa often goes into sulk mode on me & I get the silent treatment.

So, in a terminal window, type:

crontab -e

Scroll past all the comment lines that pop up in the terminal edit window, & make a new line thus:


@reboot cd /home/pi/music && /usr/bin/omxplayer -o local Clannad.mp3

Hopefully obvious, change the paths to your file.

Now save the file, & exit back to the terminal prompt.

To ensure that you really did type in that line, type:

crontab -l

& hopefully you'll see what you just entered, & can check you've put in the right path for your sound file, along with omxplayer's path.


Let us know if that is good enough for what you need.

Return to “Graphics, sound and multimedia”