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

    Background Music [Continued from Help/Support]

    Scheduled Pinned Locked Moved General Discussion and Gaming
    musicbgm
    343 Posts 109 Posters 328.4k 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.
    • X
      x5PUDx
      last edited by

      I had to make an edit to rc.local for my PS3 controller to work and my BGM has stopped working, just wondering if someone could give this a once over and point me in the right direction.

      if [ "$_IP" ]; then
        printf "My IP address is %s\n" "$_IP"
      fi
      (sudo python /home/pi/RetroPie/roms/music/script/retropie_bgm.py) &
      sixad --start &
      exit 0
      ExarKunIvE 1 Reply Last reply Reply Quote 0
      • ExarKunIvE
        ExarKunIv @x5PUDx
        last edited by ExarKunIv

        @x5PUDx

        try moving sixad to be before your music script

        like this

        if [ "$_IP" ]; then
          printf "My IP address is %s\n" "$_IP"
        fi
        
        sixad --start &
        
        (sudo python /home/pi/RetroPie/roms/music/script/retropie_bgm.py) &
        
        exit 0
        

        thats all i got, i dont use a ps3 controller so i cant try it out

        RPi3B+ / 200GB/ RetroPie v4.5.14, RPi4 Model B 4gb / 256gb / RetroPie 4.8.2
        RPi5 4gb / 512gb / RetroPie 4.8.9 -Basic
        Maintainer of RetroPie-Extra .

        1 Reply Last reply Reply Quote 0
        • M
          Muddyhardcore
          last edited by

          Went through this entire thread and not a single person simply answered the question of how to get Music to STOP playing when launching something from Ports or in my case Launching Kodi from its own system menu. Could anyone just give simple instructions on what lines to add to where?

          Pi 3, Retropie 4.2.7, 128GB SanDisk SD , CanaKit 5.1v Power Supply, 8bitdo NES30,

          1 Reply Last reply Reply Quote 0
          • M
            Muddyhardcore
            last edited by

            Where on the system is Music.py located?

            Pi 3, Retropie 4.2.7, 128GB SanDisk SD , CanaKit 5.1v Power Supply, 8bitdo NES30,

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

              @vinnyl69
              Did you ever get an answer on the how add an emulator (in my case Kodi as it's own system) to stop the background music when it's launched?

              Pi 3, Retropie 4.2.7, 128GB SanDisk SD , CanaKit 5.1v Power Supply, 8bitdo NES30,

              1 Reply Last reply Reply Quote 0
              • ExarKunIvE
                ExarKunIv
                last edited by

                @Muddyhardcore

                to get kodi to stop it is a two part thing. one you need to make sure that it is added to the list of systems that the music script is looking for, that is if you are useing the way that @Livewire made.

                that list is on line 25 of the script.

                and if you followed the steps to make kodi its own system you need to change one thing.

                when you make the kodi.sh you need to change this

                #!/bin/bash
                sudo Kodi
                

                to this

                #!/bin/bash
                "/opt/retropie/supplementary/runcommand/runcommand.sh" 0 _PORT_ "kodi" ""
                

                once that is done it will music will stop

                RPi3B+ / 200GB/ RetroPie v4.5.14, RPi4 Model B 4gb / 256gb / RetroPie 4.8.2
                RPi5 4gb / 512gb / RetroPie 4.8.9 -Basic
                Maintainer of RetroPie-Extra .

                M 1 Reply Last reply Reply Quote 1
                • M
                  Muddyhardcore @ExarKunIv
                  last edited by

                  @ExarKunIv

                  Thanks I'll try the second part. Unfortunately I can't find the "list" you mention anywhere. I used WinSCP' search function and it did not find music.py anywhere. Where is this supposed to be located?

                  Pi 3, Retropie 4.2.7, 128GB SanDisk SD , CanaKit 5.1v Power Supply, 8bitdo NES30,

                  B 1 Reply Last reply Reply Quote 0
                  • B
                    backstander @Muddyhardcore
                    last edited by backstander

                    @Muddyhardcore

                    I used WinSCP' search function and it did not find music.py anywhere. Where is this supposed to be located?

                    RetroPie doesn't come with the music.py script, you put that script on your Raspberry Pi when following the directions on the first post. @Livewire actually calls it Test1.py but you can give it any name you want (like music.py for example).

                    Execute the command `sudo nano /home/pi/PyScripts/Test1.py` replacing `Test1.py` with the (hopefully better) name you've saved the script as. At the top is a small section labeled "CONFIG".
                    

                    https://retropie.org.uk/forum/topic/347/background-music-continued-from-help-support

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

                      Ok so if I followed this video, which I did, and my folder containing my mp3 is located in /home/pi/bgm

                      What file name and where is it located that contains the script which has the list I need to edit so that the music stops when I launch kodi?

                      @tmak said in Background Music [Continued from Help/Support]:

                      I installed background music on retropie 4.2 pi3 per drew talks youtube video:

                      Pi 3, Retropie 4.2.7, 128GB SanDisk SD , CanaKit 5.1v Power Supply, 8bitdo NES30,

                      ExarKunIvE 1 Reply Last reply Reply Quote 0
                      • ExarKunIvE
                        ExarKunIv @Muddyhardcore
                        last edited by

                        @Muddyhardcore

                        if you followed the vid word for word. then the script should be in a folder called scripts inside the music folder

                        RPi3B+ / 200GB/ RetroPie v4.5.14, RPi4 Model B 4gb / 256gb / RetroPie 4.8.2
                        RPi5 4gb / 512gb / RetroPie 4.8.9 -Basic
                        Maintainer of RetroPie-Extra .

                        M 1 Reply Last reply Reply Quote 1
                        • M
                          Muddyhardcore @ExarKunIv
                          last edited by

                          @ExarKunIv
                          Wow I feel like a jerk. I must have done something wrong or followed another guide. I don't have a music folder in the roms directory. I only have a "bgm" folder in /home/pi and I can't remember the directory they're in but I do have runcommand-onend & runcommand-onstart. I'm sorry for wasting everyone's time.

                          Pi 3, Retropie 4.2.7, 128GB SanDisk SD , CanaKit 5.1v Power Supply, 8bitdo NES30,

                          ExarKunIvE 1 Reply Last reply Reply Quote 0
                          • ExarKunIvE
                            ExarKunIv @Muddyhardcore
                            last edited by

                            @Muddyhardcore

                            its cool

                            you followed this guide then here
                            if you only have a bgm folder

                            but i think you changing the kodi script should work, if not we can figure something out

                            RPi3B+ / 200GB/ RetroPie v4.5.14, RPi4 Model B 4gb / 256gb / RetroPie 4.8.2
                            RPi5 4gb / 512gb / RetroPie 4.8.9 -Basic
                            Maintainer of RetroPie-Extra .

                            M 2 Replies Last reply Reply Quote 0
                            • M
                              Muddyhardcore @ExarKunIv
                              last edited by Muddyhardcore

                              @ExarKunIv
                              My kodi.sh file looks like this

                              Kodi-standalone

                              I set it up using this
                              Kodi Wiki

                              Pi 3, Retropie 4.2.7, 128GB SanDisk SD , CanaKit 5.1v Power Supply, 8bitdo NES30,

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

                                @ExarKunIv
                                I tried to edit the current kodi.sh and it said access denied. I renamed it to kodi.sh.bak and just created a new kodi.sh using the code you provided and now the music stops when I launch Kodi. Thanks for the help and patience.

                                Pi 3, Retropie 4.2.7, 128GB SanDisk SD , CanaKit 5.1v Power Supply, 8bitdo NES30,

                                ExarKunIvE 1 Reply Last reply Reply Quote 1
                                • ExarKunIvE
                                  ExarKunIv @Muddyhardcore
                                  last edited by

                                  @Muddyhardcore

                                  im glad that it worked for you.
                                  :)

                                  RPi3B+ / 200GB/ RetroPie v4.5.14, RPi4 Model B 4gb / 256gb / RetroPie 4.8.2
                                  RPi5 4gb / 512gb / RetroPie 4.8.9 -Basic
                                  Maintainer of RetroPie-Extra .

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

                                    Is there a way to modify this script to play an .m3u music stream from the internet?
                                    It would be even more awesome to allow it to play the local files if no internet is connected.
                                    To top it off I would like to make an entry in the Retropie to manage the background music (Play from internet, play local files, or no background music).

                                    I was able to successfully play a .m3u but I am not sure how I would go about editing the script
                                    Example:

                                    wget -O - `wget -O - http://dir.xiph.org/listen/1677870/listen.m3u` | mpg123 -
                                    

                                    If anyone could point me in the right direction I would be extremely grateful

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

                                      Does anyone else get audio static when resuming/restarting the music after exiting an emulator?
                                      EDIT: It seems to fix itself when I select "Restart Emulation Station" from the menu
                                      This is with audio playing through the 3.5mm jack.

                                      B 1 Reply Last reply Reply Quote 0
                                      • B
                                        backstander @madmodder123
                                        last edited by

                                        @madmodder123

                                        Does anyone else get audio static when resuming/restarting the music after exiting an emulator?

                                        I'm not sure if this is related to your static issues but you can try adding disable_audio_dither=1 to /boot/config.txt
                                        If that doesn't help, you can also try adding audio_pwm_mode=2 to /boot/config.txt

                                        More information here:
                                        https://retropie.org.uk/docs/Sound-Issues/#white-noise-fix

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

                                          @synack Genious hack my friend!
                                          I love tracked music btw. :D
                                          Now my BGM is .....


                                          Would be nice if someone can create a theme for this ;)

                                          1 Reply Last reply Reply Quote 1
                                          • C
                                            ChelMaster04
                                            last edited by

                                            Hi,
                                            I just searched about if theres anything like this, with which you can add bgm to your Retropie system.. thing... sorry, my English isnt very good.

                                            But anyways: I fount this post, instantly tried it and it worked perfectly :)

                                            But now i have a Problem...
                                            I added the NDS Emulator DraStic from the experimental packages to my ES an of course your code isnt programmed to work with drastic, so the music continued playing after i launched a game in it.

                                            so to fix it, i added "drastic" to the list of emulatornames, following the example of the other emulators, that were written down in it.

                                            But it didn't work...

                                            I then changed the entry to "DraStic" and launched a game again and this time it worked, although the fading was to slow for my taste, so i went on increasing the volumefadespeed variable.

                                            Now it doesn't work again, even after returning the volumefadespeed to 0.02

                                            do you have any idea whats going on and how to fix this?

                                            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.