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 329.3k 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.
    • ExarKunIvE
      ExarKunIv @johnboyw
      last edited by

      @johnboyw

      we need a little more info to help. do you have the commands in /rc.local correct if you are useing the op way

      and for mpg123 do you have all the commands for runcommand-onstart.sh and runcommand-onend.sh correct

      also where is your 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 .

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

        @johnboyw
        If you're using HDMI cable sound, try forcing HDMI audio out by adding hdmi_drive=2 to your /boot/config.txt then restart your RPi.

        Here's some more sound troubleshooting:
        https://github.com/RetroPie/RetroPie-Setup/wiki/Sound-Issues

        johnboywJ 1 Reply Last reply Reply Quote 0
        • johnboywJ
          johnboyw @ExarKunIv
          last edited by johnboyw

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

          @johnboyw

          we need a little more info to help. do you have the commands in /rc.local correct if you are useing the op way

          and for mpg123 do you have all the commands for runcommand-onstart.sh and runcommand-onend.sh correct

          also where is your musIc folder

          0_1490291515518_IMG_0510.JPG

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

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

            @johnboyw
            If you're using HDMI cable sound, try forcing HDMI audio out by adding hdmi_drive=2 to your /boot/config.txt then restart your RPi.

            Here's some more sound troubleshooting:
            https://github.com/RetroPie/RetroPie-Setup/wiki/Sound-Issues

            I have sound just no music playing.

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

              @johnboyw

              did you edit the music.py at all?

              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 .

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

                @johnboyw
                Unless you have already edited your music.py script, you should move just your Music files to /home/pi/RetroPie/roms/music

                Or if you don't want to move your Music files, you could just edit your /home/pi/RetroPie/roms/music/Script/music.py script to point to the actual music directory you are using like this:

                musicdir = '/home/pi/RetroPie/roms/music/Script'
                
                johnboywJ 1 Reply Last reply Reply Quote 0
                • johnboywJ
                  johnboyw @backstander
                  last edited by

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

                  @johnboyw
                  Unless you have already edited your music.py script, you should move just your Music files to /home/pi/RetroPie/roms/music

                  Or if you don't want to move your Music files, you could just edit your music.py script to point to the actual music directory you are using like this:

                  musicdir = '/home/pi/RetroPie/roms/music/Script'
                  

                  I've already tried it in that folder. That didn't work either.

                  1 Reply Last reply Reply Quote 0
                  • johnboywJ
                    johnboyw @ExarKunIv
                    last edited by

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

                    @johnboyw

                    did you edit the music.py at all?

                    All I did was follow the instructions at the top by the op. That didn't work so I then tried the second one. That didn't work so I then saw another version in a different forum that I tried. Hence the reason why my music is in that script folder now.

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

                      @johnboyw

                      im sure that it will not do anything but put a enter after the &

                      (sudo python /home/pi/BGmusic.py) &
                      
                      exit 0
                      

                      this is from my rc.local so thats why its different

                      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
                      • johnboywJ
                        johnboyw
                        last edited by

                        Thanks for all the help. I'm very new to all this. I've only just bought my pi. I usually just mess with phone ROMs. I've no idea when it comes to coding etc. But I'm prepared to learn.
                        I'll try the things mentioned when I get home.
                        Thank you.

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

                          @johnboyw

                          not a problem. im still kinda new myself.
                          just keep asking and we'll keep trying to help

                          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
                          • johnboywJ
                            johnboyw
                            last edited by

                            I'm also trying to get videos to show in the emulators. But that's another story 😂

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

                              @johnboyw

                              that i have not tried yet. so good luck :P

                              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
                              • *
                                **Scannigan** @backstander
                                last edited by **Scannigan**

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

                                @madmodder123
                                You might try just putting mpg123 -q <dial-up-modem>.mp3 & at the very bottom of /etc/rc.local just above the last line exit 0. This should only play that dial up modem sound when you boot your RPi. Then you could still play other random MP3s by using /home/pi/.bashrc.

                                If that isn't soon enough, you might experiment with putting that mpg123 line up higher in /etc/rc.local but make sure to make a back up of that file just in case!

                                I have an even better solution for you. Problem with rc.local is that it's one of the last things to be called in the boot process, so the best thing would be to create a system service in systemd.

                                Apologies I haven't yet worked out that pretty code embed system :) so this is probably not appropriate forum etiquette

                                It's very likely that you have sound set up just fine, so I'm going to skip a few steps, in command line

                                #at command type

                                sudo modprobe snd-bcm2835

                                #Create a new file

                                Sudo nano /etc/modules-load.d/snd-bcm2835.conf

                                #and in this put just:
                                snd-bcm2835

                                #Ctrl + O, enter Y and Ctrl-X to save

                                #At command type
                                sudo alsactl store

                                #Find whatever sound you want to use, ideally a .wav name it boot-sound.wav and put it in /boot (you'll obviously need to do #this as sudo, so if using WinSCP just change the shell settings under advanced options before you connect.

                                #Now create a service file

                                sudo nano /etc/systemd/system/bootsound.service

                                #Contents of the above should be:

                                [Unit]
                                Description=Boot Sound
                                Wants=sound.target
                                After=sound.target

                                [Service]
                                Type=oneshot
                                RemainAfterExit=no
                                ExecStart=/usr/bin/aplay /boot/boot-sound.wav 2>&1 >/dev/null &

                                [Install]
                                WantedBy=multi-user.target

                                #Ctrl + O, enter Y and Ctrl-X to save

                                #In command line type:

                                sudo chmod +x /etc/systemd/system/bootsound.service

                                #then
                                systemctl enable bootsound

                                sudo reboot

                                johnboywJ 1 Reply Last reply Reply Quote 0
                                • *
                                  **Scannigan** @backstander
                                  last edited by

                                  This post is deleted!
                                  1 Reply Last reply Reply Quote 0
                                  • johnboywJ
                                    johnboyw @**Scannigan**
                                    last edited by

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

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

                                    @madmodder123
                                    You might try just putting mpg123 -q <dial-up-modem>.mp3 & at the very bottom of /etc/rc.local just above the last line exit 0. This should only play that dial up modem sound when you boot your RPi. Then you could still play other random MP3s by using /home/pi/.bashrc.

                                    If that isn't soon enough, you might experiment with putting that mpg123 line up higher in /etc/rc.local but make sure to make a back up of that file just in case!

                                    I have an even better solution for you. Problem with rc.local is that it's one of the last things to be called in the boot process, so the best thing would be to create a system service in systemd.

                                    Apologies I haven't yet worked out that pretty code embed system :) so this is probably not appropriate forum etiquette

                                    It's very likely that you have sound set up just fine, so I'm going to skip a few steps, in command line

                                    #at command type

                                    sudo modprobe snd-bcm2835

                                    #Create a new file

                                    Sudo nano /etc/modules-load.d/snd-bcm2835.conf

                                    #and in this put just:
                                    snd-bcm2835

                                    #Ctrl + O, enter Y and Ctrl-X to save

                                    #At command type
                                    sudo alsactl store

                                    #Find whatever sound you want to use, ideally a .wav name it boot-sound.wav and put it in /boot (you'll obviously need to do #this as sudo, so if using WinSCP just change the shell settings under advanced options before you connect.

                                    #Now create a service file

                                    sudo nano /etc/systemd/system/bootsound.service

                                    #Contents of the above should be:

                                    [Unit]
                                    Description=Boot Sound
                                    Wants=sound.target
                                    After=sound.target

                                    [Service]
                                    Type=oneshot
                                    RemainAfterExit=no
                                    ExecStart=/usr/bin/aplay /boot/boot-sound.wav 2>&1 >/dev/null &

                                    [Install]
                                    WantedBy=multi-user.target

                                    #Ctrl + O, enter Y and Ctrl-X to save

                                    #In command line type:

                                    sudo chmod +x /etc/systemd/system/bootsound.service

                                    #then
                                    systemctl enable bootsound

                                    sudo reboot

                                    Wow. How the hell do people know this s**t.
                                    I'm definitely a beginner at this. Half of that I don't understand! Christ I've a lot to learn.
                                    I will try it tonight. Thank you so much for taking time to help me.

                                    1 Reply Last reply Reply Quote 0
                                    • G
                                      gazzhally
                                      last edited by

                                      I can't seem to get the music to stop whenever I run vice. I've checked the code and its listed in there. Any ideas?

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

                                        @gazzhally

                                        which music player are you using. the one written by @Livewire or @synack .

                                        knowing this will help, get the help you need

                                        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 .

                                        G 1 Reply Last reply Reply Quote 0
                                        • G
                                          gazzhally @ExarKunIv
                                          last edited by

                                          @ExarKunIv Sorry, should have mentioned that bit lol

                                          Am using @Livewire 's player

                                          ExarKunIvE 1 Reply Last reply Reply Quote 0
                                          • E
                                            eliex
                                            last edited by

                                            I am using Livewire script. Thanks to all for all the hard work.
                                            I had a image (Nacho's 64GB) on my SD card.
                                            My Raspberry is 3 model b. The issue I am having is that on my image the livewire script was already installed. I copied the script to a friend of mines SD card. I works great, the only problem is that the volume is super low. I have tried adjusting the volume via script (maxvolume) but it stays the same. What I found out is that any mp3 that I physically had on my computer and passed to either SD card the volume would be lower than the original music on the image. Does anyone know if by transferring from the computer onto the SD card (copy/paste) I am somehow messing the volume of the mp3's?

                                            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.