Quick and easy guide for adding music to Emulatonstation on RetroPie. Noob friendly!
-
@cool_iron YES and NO
I created two bash files that Continous or Disable Background music by using USER MENU from runcommand. If you launch a ROM then the grey box apperas... Press a button and you enter the runcommand menu list. Now you can enable/disable Background music by using User Menu item.
Take a look here and add aexit 2
as last line!The way I descripe is not 100% the method you asked here - it's a small workaround. Of course it is possible to add music for a specific ROM.... You can modify this code and add to runcommand-onstart.sh
-
i have done all commands on the rp3 direct
my big problem is where is the folder that i was created , when i type in mkdir /home/pi/bgm it say to me the folder already exists. But i cannot find the Folder on my PC or USB ... -
@cyperghost I did not quite get it past the user menu step.
What should I do next? Can you explain this more please?
Maybe you could add some pictures? -
@cool_iron
Add 2 bashfiles to dedicated folder descriped in the Wiki: runcommand functions
One withpkill mpg123 -STOP
and the other withpkill mpg123 -CONT
to User Menu. One file is calledStop BGM.SH
the other is calledContinue BGM.sh
Then you select one oft these files in User Menu and can manually enable or disable music. If you follow the link that I gave you to the bash script then you can automate the process by using a custom collection as trigger event.
But this needs some coding skill...Feel free to ask ;)
-
@cyperghost Oh, sorry, I didn't read the topic of this discussion :P
The problem is that I am using different method for background music. Is it possible to make this two .sh scripts woking with this method? -
This is a very good tutorial I have quiet a few tutorials to so check them out :)
[TUTORIAL]How to add draStic ds emulator and configure it and add ROMS with RetroPie-Manager
https://retropie.org.uk/forum/post/90803[TUTORIAL]How to install kodi and add to main menu
https://retropie.org.uk/forum/post/90609[TUTORIAL]How to install and use RetroPi-Manager
https://retropie.org.uk/forum/post/90596 -
@retroprogrammer please don't spam. The official docs are there for a reason
-
@cool_iron I think there is no problem to install mpg123 as background player just for in game music. This would be the easiest solution.... And if there are occouring problems you can easily remove it.
As you use the python method the python code checks for process PID of a running emulator in background so it seems to be impossible without altering python code. But that's out of my class.
EDIT:
Maybe you can act like this!
I think about a code like this ...Enable ingame BGM.sh
#!/bin/bash # PSEUDOCODE! # DISABLE python check for running processes of emulators by pausing the python script!!!! # OMXPlayer will still run in background and will play music! pkill -STOP "python backgroundplayer"
and by editing
runcommand-onend.sh
you always set the-CONT
condition.
But why don't you give the mpg123 no chance? Imho it is the easiest method for BGM but keep in mind that mpg123 is just a small player with a small bunch of command line arguments...
@retroprogrammer Before spamming this thread you can ask @meleu if he want's to add your tuts into his Useful topics thread
-
sorry for spamming guys just wanted to say that their are some other tutorials other sorry :(
-
Having some issues after getting music playing in the background via this tutorial. On launch of any ROM I am getting an audiomanger error stating the device or resource is in use. Once the game loads I have no game audio.
-
Created an alternative guide for using vgmplay instead of mpg123 to play directly emulated audio rips from game consoles and arcade machines. Much smaller file sizes than mp3s.
-
@zerojay How much room does it save? For example a track I use is 1:39 and 2.4MB. Would this really save a significant amount of space?
-
@jonnykesh Well, put it this way, if you have a full NES game's soundtrack, let's say 20 songs in mp3 for about 3MB each song, that's 60MB. The emulated version is going to be a small part of the actual NES game's size so there's pretty much no NES game soundtrack in VGM format that will be bigger than 1MB total. Most NES games are about 200-300K for their full soundtrack in this format. Look around for VGM rips as they are a better indicator than anything I can say.
-
Could somebody tell me which file I have to edit (and what kind of text) to set a startsong which plays everytime when you boot up the Pi?
-
Great guide! Anyway to choose what track plays first if we have many mp3's in the folder?
-
@bobharris Since the command line using
mpg321
plays the songs at random, there's no configuration involved.
You could try replacingmpg321 -Z
withmpg321 -l 0
(lowecase L, then zero) in the playing script and the playorder should be alphabetical - so you can place a0_start.mpg3
to be always played first. -
@mitu Ok thanks. This is not an option for me, as I prefer a randomized playlist after the first song.
So I will just use the Python script instead (http://www.pretendo.online/2017/01/25/adding-background-music-to-emulation-station/).. so far it seems to work great (and it allows you to set a startsong). It has other perks too, like fade out (after starting a game) and it plays a new song after exiting a game, instead of resuming the previous song.
I wasn't sure which method to use as I read some people were having issues with the Python script. (Songs playing at half speed for example.)(There is a workaround for anyone who uses mpg123 and wants the same song/sound at the start and a random playlist: Turn your song into an mp4 video file and set it as your splash screen.)
-
@mitu
amazing! thanks alot! -
So, now with "mpg321 -l 0" I am able to arrange the songs in the order I want. Tha's great! However, isn't the playlist supposed to loop infinite times after it ends? Or am I missing a part?
-
@coldnpale Err', I guess it only loops through the 1st song, right ? So my suggestion doesn't work right off the bat :(.
I don't have the RPI at hand at the moment, but you could create a.m3u
with the files you want, in the specific order you need, then try to runmpg321 -l -0 playlist.m3u
so it loops continuously. I'm sure there's a one liner to make the
m3u
on the fly, but just need a command line on the PI to have it right.
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.