Blue_Alien
Posts: 6
Joined: Fri Jan 10, 2014 5:09 am

MP3 will not play from python script run at boot

Tue May 27, 2014 5:14 am

I am working on a doorbell system. A raspberry pi receives a command from another pi to play a mp3 of a doorbell using python. The python script works if I ssh into the pi and start it manually. But when I set the script to run at boot, the mp3 will not play. I have checked that the script is being run, but for some reason the sound wont work.

User avatar
DougieLawson
Posts: 38882
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: MP3 will not play from python script run at boot

Tue May 27, 2014 7:07 am

How are you getting it to run at boot?

Have you checked the PATH variable is set to include the right directories?
Have you fully qualified the name of the script (/home/pi/foo.py rather than foo.py)?
Are the ownership and permission bits set correctly?
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

User avatar
DeeJay
Posts: 2027
Joined: Tue Jan 01, 2013 9:33 pm
Location: East Midlands, UK

Re: MP3 will not play from python script run at boot

Tue May 27, 2014 8:45 am

Some more questions along the lines of those already posed...

If you know the script is being run at boot time, are you certain that the script has access to both the audio-player and the mp3 file to be played?

Where do you expect the audio to be generated? Has the routing to that audio output been configured at the time you try to play the mp3?
How To Ask Questions The Smart Way: http://www.catb.org/~esr/faqs/smart-questions.html
How to Report Bugs Effectively: http://www.chiark.greenend.org.uk/~sgtatham/bugs.html

Blue_Alien
Posts: 6
Joined: Fri Jan 10, 2014 5:09 am

Re: MP3 will not play from python script run at boot

Tue May 27, 2014 3:19 pm

I have searched around and all I can find is making sure the snd-bcm2835 is put in /etc/modules. I am not sure if the script has access to the audio player. The mp3 is a file in the same directory as the python script.

sony8943
Posts: 8
Joined: Mon Apr 16, 2018 12:30 pm

Re: MP3 will not play from python script run at boot

Tue May 15, 2018 4:17 am

Hello someone find how to run mp3 audio python script on boot

Return to “Troubleshooting”