RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login

    Modified Background Music Script with added overlays!

    Scheduled Pinned Locked Moved Ideas and Development
    bgmoverlaymusicsongscript
    114 Posts 22 Posters 40.1k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • L
      legacy @madmodder123
      last edited by

      @madmodder123 ,

      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

      madmodder123M 1 Reply Last reply Reply Quote 0
      • M
        MochaJoesFavor
        last edited by

        @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!

        1 Reply Last reply Reply Quote 0
        • madmodder123M
          madmodder123 @legacy
          last edited by

          @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!

          L M 2 Replies Last reply Reply Quote 2
          • L
            legacy @madmodder123
            last edited by

            @madmodder123 , okay il give it another bash thank you.

            1 Reply Last reply Reply Quote 0
            • L
              legacy
              last edited by legacy

              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.

              madmodder123M 1 Reply Last reply Reply Quote 0
              • M
                MochaJoesFavor @madmodder123
                last edited by

                @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 pygame

                Any ideas?

                mituM M 2 Replies Last reply Reply Quote 0
                • mituM
                  mitu Global Moderator @MochaJoesFavor
                  last edited by

                  @mochajoesfavor said in Modified Background Music Script with added overlays!:

                  Any ideas?

                  Did you run the install script - as explained in the 1st post ?

                  M 1 Reply Last reply Reply Quote 0
                  • M
                    MochaJoesFavor @mitu
                    last edited by

                    @mitu yes I did.

                    1 Reply Last reply Reply Quote 0
                    • M
                      MochaJoesFavor @MochaJoesFavor
                      last edited by

                      @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!!

                      1 Reply Last reply Reply Quote 0
                      • madmodder123M
                        madmodder123 @legacy
                        last edited by

                        @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?

                        L 1 Reply Last reply Reply Quote 0
                        • L
                          legacy @madmodder123
                          last edited by legacy

                          @madmodder123

                          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

                          1 Reply Last reply Reply Quote 0
                          • B
                            BJRetro
                            last edited by

                            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!

                            madmodder123M 1 Reply Last reply Reply Quote 0
                            • madmodder123M
                              madmodder123 @BJRetro
                              last edited by

                              @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 :)

                              1 Reply Last reply Reply Quote 0
                              • B
                                BJRetro
                                last edited by

                                Thank you I will give it a try!

                                L 1 Reply Last reply Reply Quote 0
                                • L
                                  legacy @BJRetro
                                  last edited by legacy

                                  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.

                                  cyperghostC 1 Reply Last reply Reply Quote 0
                                  • cyperghostC
                                    cyperghost @legacy
                                    last edited by

                                    @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 write sudo python /home/pi/BGM.py & BEFORE starting EmulationStation ;)

                                    @madmodder123 Do we really need sudo command? For rc.local it is obsolete anyway....

                                    L 1 Reply Last reply Reply Quote 0
                                    • L
                                      legacy @cyperghost
                                      last edited by legacy

                                      @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

                                      cyperghostC 1 Reply Last reply Reply Quote 0
                                      • cyperghostC
                                        cyperghost @legacy
                                        last edited by

                                        @legacy type ls /usr/local/bin/pngview is the file available?
                                        If yes type sudo chmod +x /usr/local/bin/pngview

                                        If no type cd /usr/local/bin
                                        then type sudo wget "http://raw.githubusercontent.com/madmodder/retropie_music_overlay/master/pngview"; sudo chmod +x pngview

                                        L 1 Reply Last reply Reply Quote 0
                                        • L
                                          legacy @cyperghost
                                          last edited by legacy

                                          @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

                                          L 1 Reply Last reply Reply Quote 0
                                          • L
                                            legacy @legacy
                                            last edited by legacy

                                            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.

                                            L 1 Reply Last reply Reply Quote -1
                                            • First post
                                              Last post

                                            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.