• Recent
  • Tags
  • Popular
  • Home
  • Docs
  • Register
  • Login
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 39.0k 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.
  • M
    MochaJoesFavor @mitu
    last edited by 26 Sept 2018, 19:54

    @mitu yes I did.

    1 Reply Last reply Reply Quote 0
    • M
      MochaJoesFavor @MochaJoesFavor
      last edited by 26 Sept 2018, 20:16

      @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
      • M
        madmodder123 @legacy
        last edited by 26 Sept 2018, 23:23

        @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 27 Sept 2018, 01:21 Reply Quote 0
        • L
          legacy @madmodder123
          last edited by legacy 27 Sept 2018, 01:21

          @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 27 Sept 2018, 13:24

            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!

            M 1 Reply Last reply 27 Sept 2018, 21:36 Reply Quote 0
            • M
              madmodder123 @BJRetro
              last edited by 27 Sept 2018, 21:36

              @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 28 Sept 2018, 01:22

                Thank you I will give it a try!

                L 1 Reply Last reply 28 Sept 2018, 05:50 Reply Quote 0
                • L
                  legacy @BJRetro
                  last edited by legacy 28 Sept 2018, 05:50

                  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.

                  C 1 Reply Last reply 28 Sept 2018, 13:48 Reply Quote 0
                  • C
                    cyperghost @legacy
                    last edited by 28 Sept 2018, 13:48

                    @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 28 Sept 2018, 15:24 Reply Quote 0
                    • L
                      legacy @cyperghost
                      last edited by legacy 28 Sept 2018, 15:24

                      @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

                      C 1 Reply Last reply 28 Sept 2018, 16:15 Reply Quote 0
                      • C
                        cyperghost @legacy
                        last edited by 28 Sept 2018, 16:15

                        @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 28 Sept 2018, 16:31 Reply Quote 0
                        • L
                          legacy @cyperghost
                          last edited by legacy 28 Sept 2018, 16:31

                          @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 28 Sept 2018, 21:04 Reply Quote 0
                          • L
                            legacy @legacy
                            last edited by legacy 28 Sept 2018, 21:04

                            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 29 Sept 2018, 09:09 Reply Quote -1
                            • L
                              legacy @legacy
                              last edited by 29 Sept 2018, 09:09

                              @madmodder123,

                              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

                              1 Reply Last reply Reply Quote -1
                              • D
                                DarishZone Banned
                                last edited by 24 Oct 2018, 21:34

                                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.

                                darkniorD 1 Reply Last reply 24 Oct 2018, 22:26 Reply Quote 1
                                • darkniorD
                                  darknior @DarishZone
                                  last edited by 24 Oct 2018, 22:26

                                  @DarishZone for my part i launch it with autostart.sh
                                  And i add python /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 :(

                                  Life is game, just play it !

                                  D 1 Reply Last reply 24 Oct 2018, 22:46 Reply Quote 0
                                  • D
                                    DarishZone Banned @darknior
                                    last edited by DarishZone 24 Oct 2018, 22:46

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

                                    @DarishZone for my part i launch it with autostart.sh
                                    And i add python /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 :(

                                    I will try this! In that case i have to remove the line added on rc.local file?
                                    I also wonder if there's a way to move track names overlays to upper right screen instead of left, seems a more convenient position.

                                    darkniorD 1 Reply Last reply 24 Oct 2018, 23:01 Reply Quote 0
                                    • darkniorD
                                      darknior @DarishZone
                                      last edited by 24 Oct 2018, 23:01

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

                                      I will try this! In that case i have to remove the line added on rc.local file?

                                      Yes you are, it is explained. You can't use the two files.

                                      I also wonder if there's a way to move track names overlays to upper right screen instead of left, seems a more convenient position.

                                      Not for me, but all of this is on the script, you must modify it by yourself. It is explain on git.

                                      Life is game, just play it !

                                      1 Reply Last reply Reply Quote 0
                                      • D
                                        DarishZone Banned
                                        last edited by DarishZone 24 Oct 2018, 23:07

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

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

                                        I will try this! In that case i have to remove the line added on rc.local file?

                                        Yes you are, it is explained. You can't use the two files.

                                        I also wonder if there's a way to move track names overlays to upper right screen instead of left, seems a more convenient position.

                                        Not for me, but all of this is on the script, you must modify it by yourself. It is explain on git.

                                        Thank you, but not seems to work for me, can you show me excatly the complete line on autostart.sh?

                                        Edit: managed to move overlay, but now terminal report me an error (?)
                                        /usr/local/bin/pngview: no process found

                                        Is that normal? I'm afraid it was always there and overlay covered it.

                                        Edit 2: I've found edit autostart.sh to run script instead of rc.local trigger that message

                                        1 Reply Last reply Reply Quote 0
                                        • D
                                          DarishZone Banned
                                          last edited by DarishZone 11 Jan 2018, 23:22 1 Nov 2018, 23:21

                                          Even with local edit, systemlog often report /usr/local/bin/pngview: no process found, and also terminal triggered it if i disable bgm music, also on terminal i can see some strange icons like "[["
                                          Also, it's rare but could happen system hangs at boot, before splashscreen starts, it left with only blinking cursor on top left of screen, not sure if that one is related to my setting (probably)
                                          Any advice?

                                          1 Reply Last reply Reply Quote 0
                                          • 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.

                                            This community forum collects and processes your personal information.
                                            consent.not_received