Modified Background Music Script with added overlays!
-
@madmodder123 , okay il give it another bash thank you.
-
the error i get now when i launch a game
is /usr/local/bin/png view: no process found
also editing the rc.local file is stiil not working on boot.
bare in mind, emulation station i have the launch screen disabled, so it boots into the main front end.
is there another file i could add the boot text to get the script to launch.
-
@madmodder123 Ok, i've installed on a clean build. The retropie menu looks fine, however the music does not play and I get the following error when trying to turn on/off the music.
Traceback (most recent call last):
File "/home/pi/BGM.py", line 66, in <module>
from pygame import mixer # import PyGame's music mixer
ImportError: No module named pygameAny ideas?
-
@mochajoesfavor said in Modified Background Music Script with added overlays!:
Any ideas?
Did you run the install script - as explained in the 1st post ?
-
@mitu yes I did.
-
@madmodder123 I looks like pygame and imagemagick were failing to install, so i ran "sudo apt-get update". After that they both installed and the music started working.
Everything seems to be OK now. Thanks again!!
-
@legacy make sure your rc.local file looks like this example one: https://pastebin.com/67BnuB17
Also can you run the python script from SSH and tell me what it outputs? -
The command works with no problems. Also my RC file data looks ok. I'll upload it for you soon. Also i am using dev version of emulation station.
Thank you.
#!/bin/sh -e
rc.local
This script is executed at the end of each multiuser runlevel.
Make sure that the script will "exit 0" on success or any other
value on error.
In order to enable or disable this script just change the execution
bits.
By default this script does nothing.
Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
printf "My IP address is %s\n" "$_IP"
fi
(sudo python /home/pi/BGM.py) &
exit 0 -
I know this is a very stupid noob question but here goes anyhow: when you say in the instructions to “move” the shell script file to the pi, what directory do you move it to- or is it outside of any of the default directories by itself? I would use samba to move it over on windows to the pi and want to make sure I move it to the right place before following the directions above. Thank you! Looking forward to trying this!
-
@bjretro Move it anywhere on the Pi, it doesn't matter what directory. But "/home/pi" is the easiest.
If you move it somewhere else then you would have to run "cd /home/pi/whateverdirectory/" before running the next commands :)
Then "sudo chmod +x BGM_Install.sh" to make it executable.
Make sure you run the script as root using "sudo ./BGM_Install.sh"If imagemagick or pygame aren't installing run "sudo apt-get update" (ALWAYS MAKE A BACKUP OF YOUR IMAGE BEFORE ANY UPDATES!) and then run the script again :)
-
Thank you I will give it a try!
-
Can anyone test the script on the dev version of emulation station.
For some reason on my build the script will not run at boot and im not prepared to rebuild my retropie image as it take ages and works perfect. Clean install may fix the issue.
As ive said I have no loading screens on boot and the emulation station logo disabled so it boots straight into the front end, mainly for an arcade cabinet, no text no nothing.
Something is blocking the RC.local file from running. So it would be a shame to abandon this script for now.
update error:
Warning: rc.local.service changed on disk. Run 'systemctl daemon-reload' to relo ad units.
Job for rc-local.service failed because the control process exited with error co de.
See "systemctl status rc-local.service" and "journalctl -xe" for details. -
@legacy said in Modified Background Music Script with added overlays!:
Warning: rc.local.service changed on disk.
I wonder why everyone wants to edit these poor creatures rc.local. There is an explicite
autostart.sh
(edit with:nano /opt/retropie/configs/all/autostart.sh
) and then writesudo python /home/pi/BGM.py &
BEFORE starting EmulationStation ;)@madmodder123 Do we really need sudo command? For rc.local it is obsolete anyway....
-
@cyperghost , you have hit the nail on the head.
Its working fine, only issue i have is the
/usr/local/bin/pngview : no process found.
any idea on how to fix this. Thank you
-
@legacy type
ls /usr/local/bin/pngview
is the file available?
If yes typesudo chmod +x /usr/local/bin/pngview
If no type
cd /usr/local/bin
then typesudo wget "http://raw.githubusercontent.com/madmodder/retropie_music_overlay/master/pngview"; sudo chmod +x pngview
-
@cyberghost,
awesome work. Its working now. Thank you.
I have one small problem and maybe you can help.
Im using video loading screens, so the music fades out and then when the loading screen ends the music kicks back in for 1 second then stops and loads my game. Can this be fixed. It must be in the BGM.py file
Update:
on reboot: /usr/local/bin/pngview: process error returns
-
On video loading screens, the volume fades, then at the end of the screen, the music plays again and fades and then loads the game.
-
I click a game, the video loading screen kicks in and the music fades out.
Black screen appears to load the game, but the music kicks in for 1 second and fades out, then the game loads.is there a fix for this. Thank you
-
Hello madmodder123, your script is great, love how music fades when snap video audio starts, and overlays are ace, however there's a fix to prevent them to show on terminal or Retropie dos-like menu (Retropie setup for example) ? It may interfere with text.
-
@DarishZone for my part i launch it with autostart.sh
And i addpython /home/pi/scripts/BGM.py 2>&1 1>/dev/null &
The printf are not writing in console, but some time like you it write on some setup menu i don't know why :(
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.