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 337.9k 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.
    • Y
      yfresh59 @ExarKunIv
      last edited by

      @ExarKunIv
      Thank you!
      I managed to figure it out this morning while exploring through Retropie files via ssh. My music folder (with the .py script) was still on my sd card. But I was curious about using the mpg123 for music. So I installed it and ran into the same problem. So I simply moved the bgm file from my sd card to my usb stick. I also changed the path in the config file for mpg123 via putty to match the new location on my usb stick. Now it works great!
      Sound I uninstall the python script? Mpg123 and python doesn't seem to be interfering with each other.

      I find weird that since using a usb stick, my custom splash screen videos and rom launcher splash screen pictures are all working just fine with or without the usb stick inserted. But the music folder had to be moved manually to the usb stick.

      Now, my setup is almost complete, just having trouble with scrapping data for roms, but I'll request help for that in the appropriate thread. This Pi has turned out to be a fun little project! I'm still a brand new to the Pi, but I'm loving it so far. Thank you for the help

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

        @yfresh59

        glad that you got it cleared up

        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
        • T
          time2purge
          last edited by

          got a question. i got the python script working a few days ago and it's awesome but today when i turned on the pie, there was no music. it was like the script just diapered. try restarting the ES, nothing,restarted the system, nothing. i checked the files and the command and everything still there. so is there away to get the script back working or do i have to undo and redo everything.

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

            @time2purge

            its hard to say what you have to do. we need to find out what is going on first.

            i would say that we need to see if the script will work or not. so you will need to SSH in to you pie and put this command down

            sudo python /home/pi/PyScripts/Test1.py of course change what you need. this will force the script to start to work, if its going to.

            if the music plays then the script is working. you just need to look into why it will not start

            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 .

            T 1 Reply Last reply Reply Quote 0
            • Y
              yfresh59
              last edited by

              Hey I was just thinking.... Right now I'm currently very pleased with using background music, "scraped images" from UXS and switching to different ES themes to change the "mood." This is a quick and easy way to get retropie setup just the way I like!

              But I think it is becoming easier these days to add videos instead of using images in retropie. Currently using mpg123 for my background music. I want to add videos, but either have the videos' audio "muted" by editing a command line or something (seems like the hard way); or when prior to taking videos of my gameplay to use as retropie preview video snaps, I could just mute the emulators audio and record the video only (seems like the easier way).

              So, if I use my own video snaps WITHOUT audio and with video ONLY (I think recording videos with audio muted seems easier), will my background music still play while the video snaps are playing at the same time? Even though the videos audio will be muted prior to recording it, will the video snaps in emulation station overwrite my background music? That would be my ideal setup! My own music playlist in the background with video snaps (recorded video only) for each game.

              Also, with mpg123, can the music be shuffled? Or at least play a different song after exiting a game? It Currently continues from the same song from where it left off. I have my gbm folder on my usb drive so I can have lots of music.

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

                @ExarKunIv i'll have to give it a try and let ya know the outcome thanks for the reply .

                1 Reply Last reply Reply Quote 0
                • T
                  time2purge
                  last edited by

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

                  @ExarKunIv i try what you said it came back as Errno 3 No such file or directory..but here's something really messed up, changed out the music file and it started back up..so maybe changing the file fixed it.

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

                    @time2purge

                    glad that it seemed to get fixed. now what and why i cant say, and sometimes its better to leave it at that

                    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 1
                    • ExarKunIvE
                      ExarKunIv @yfresh59
                      last edited by

                      @yfresh59

                      look starting hereit says something about shuffling

                      and for the vid, cant help. i dont use vid so i cant 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 .

                      Y 1 Reply Last reply Reply Quote 0
                      • Y
                        yfresh59 @ExarKunIv
                        last edited by

                        @ExarKunIv yea that looks like exactly what I need. Thank you! I'll try that out

                        1 Reply Last reply Reply Quote 0
                        • D
                          DrakeyPie
                          last edited by

                          New to RetroPie, managed to get this working perfectly.
                          However I have noticed that when I launch the desktop environment the music continues to play, has anyone else encountered this problem?

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

                            @drakeypie

                            its happening due to the music script not knowing what too look for so it knows when to stop.

                            if you are using the setup from the very beginning of this post. then you will need to edit the music script and add what the desktop it called when it starts to the list.

                            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
                            • S
                              saddys @Concat
                              last edited by

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

                              Hmmm terminal is spitting out "ALSA lib pcm.c:7843:(snd_pcm_recover) underrun occurred" now.

                              did u have find a solution for this problem? i have it too and the sound every X minute stop for 1/2 seconds and freeze the entire station . thanks

                              1 Reply Last reply Reply Quote 0
                              • E
                                ejeebs @synack
                                last edited by

                                @synack

                                This works great!

                                Unfortunately, ever since I did this, my ES doesn't start loading until after my splash video ends, when before it used to be up and running by the time the video was over.

                                Is it possible that mpg123 is waiting to run until after the video ends, thus also delaying the startup of ES?

                                1 Reply Last reply Reply Quote 0
                                • theWinterDojerT
                                  theWinterDojer
                                  last edited by

                                  Using @synack 's method, does anyone know of a way to play songs in order, like a playlist, instead of randomly?

                                  1 Reply Last reply Reply Quote 0
                                  • CheatKodeC
                                    CheatKode
                                    last edited by CheatKode

                                    Hi, I recently made a modification to Livewire's python script to support pausing music when video playback starts in a window or screensaver, if you have this feature is enabled on an es theme. Essentially, it will now detect the omxplayer video process and pause accordingly. I have also tested timers to ensure music stays paused when loading between videos to ensure music does not go on and off as you browse through games.

                                    I hope this proves helpful, CK

                                    Pastebin link - Kode's retropie_music.py

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

                                      @cheatkode

                                      nice work.

                                      i dont have any vids yet, but it is nice to know that i will not have over lapping sound.

                                      thx for this

                                      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
                                      • V
                                        Vinc3Has3
                                        last edited by Vinc3Has3

                                        @synack I love the simplicity. It worked instantly!

                                        After tinkering for a bit, my preference was to have a new piece of music start when returning from a game, instead of picking up the previous song where it left off. I changed the (runcommand-onstart) to simply kill mpg123, instead of pausing, and the (runcommand-onend) to re-open mpg123 with the same parameters you used in the autostart. Now, when I exit a game a new random piece of game music begins (I downloaded a slew of game music rips). The transition seems smooth (I was afraid that re-starting the player might throw me out of the Emulationstation screen for a moment, but it's a clean return to the game list.

                                        Hopefully, I did it right - no smoke emanated from my Pi... =)

                                        EDIT - Of course, after looking at the thread again - you already mentioned how to do that earlier in the thread (duh). But, I suppose tinkering on my own is the way to learn, right?

                                        theWinterDojerT 1 Reply Last reply Reply Quote 2
                                        • theWinterDojerT
                                          theWinterDojer @Vinc3Has3
                                          last edited by theWinterDojer

                                          @vinc3has3

                                          Someone suggested that earlier and he did provide an update somewhere for that, it's a very long thread. Maybe with your tinkering powers you can help me!

                                          Do you have any idea as how to play songs in order, like a playlist, as opposed to a randomly chosen song?

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

                                            Hi,

                                            This works all fine! Thx!
                                            But i have a question.

                                            I have many songs in the rome file.
                                            Also i set a startsong for the first boot from ES.
                                            This all works great.
                                            Song play at start and than random music.

                                            But i wanna have a second "startsong" who plays if i leave the game /emulator.

                                            for example:

                                            RPI3 boot -> ES Starts -> Startsong "A" plays -> after song, random music starts -> Start game -> exit game -> Startsong "B" plays -> after song, random music starts

                                            can someone help me?

                                            System:

                                            RPI3
                                            Retropie 4.2.16
                                            
                                            theWinterDojerT 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.