Modified Background Music Script with added overlays!
-
Please post your /etc/rc.local file.
Also the gamelist.xml issue sounds unrelated to this script -
The gamelist issue happens every time I install the script. I have a backup image, which I have just restored and is working fine. I have tried this about 6 times now and I have decided to sack it off.
I managed to sort the gamelist issue by copying the file back.
My RC local file is also fine. I think there maybe a problem with my build as I have stripped it back.
Thanks for your time. I may come back to this music mod later down the line
-
@madmodder123 Wow this script is great!! I've got it running with over 20 songs and it does a great job of randomizing everything. I was wondering if there is a way to hide the text that shows on the left side when you launch or quit a rom. This text states that the music is stopping or starting back up. Thanks again for doing this!
-
@legacy @MochaJoesFavor
I fixed the gamelist issue and the console output issue guys :)
Just took the time to make the script smarter and then tried it out on a fresh install :D
Just make sure you run the script as root ("sudo ./BGM_Install.sh")
Let me know if you find any more issues! -
@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
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.