Play music playlist on emulationstation (when idle)
-
Hi guys, I would like to know if there is a way to start and launch a music playlist with a list of commands inside the emulationstation when i don't play any emulators (like some sort of easter egg like the konami code in kiosk mode) or should I exit the emulationstation and start it from the terminal? I would like to make all in emulationstation, is more cool :D thanks anyway
-
@hyuma There are a few topics for background music playing in Emulationstation in the forums, here are some of the popular ones
-
thanks, the second one seems very interesting, i will test that!
-
I made a bash script with the command taken from your second link:
mpg123 -Z /home/pi/bgm/*.mp3 &
to load in backround random mp3 inside bgm folder... I want to load and stop this script using some combo with joystick or buttons... is possible?
-
@hyuma There's no mechanism to bind a script to a button press in Emulationstation. However, what you can do is add a script to toggle the music and add it in the
RetroPie
system. It will appear as a menu item and you can just 'start' it to call your music toggle script. -
oh what a pity :/ i called the script "hadoken" and I would have loved to activate it with an "hadoken" combo :D
-
@mitu said in Play music playlist on emulationstation (when idle):
@hyuma There's no mechanism to bind a script to a button press in Emulationstation. However, what you can do is add a script to toggle the music and add it in the
RetroPie
system. It will appear as a menu item and you can just 'start' it to call your music toggle script.That's not actually true. Here's a script that you can adopt to do it: https://www.reddit.com/r/RetroPie/comments/777ylv/how_to_map_a_controller_to_soft_reboot_your_system/
Here's also a way of using emulated music rips directly from the games as your background music: https://retropie.org.uk/forum/post/120089
I have a script that allows you to use both mp3s and these emulated music rips in the same playlist that could be further extended to other formats as well. I haven't released it quite yet though.
-
@zerojay I nearly forget the sort shuf command. That is a good way to create playlist with shuffle option on mpg123
-
@cyperghost said in Play music playlist on emulationstation (when idle):
@zerojay I nearly forget the sort shuf command. That is a good way to create playlist with shuffle option on mpg123
Yep, that's exactly what I've done, but not just for mp3s.
-
@zerojay Yes but mpg123 gots a native shuffle command it is the -Z parameter. Disadvantage is that you do not see which track is played next. So use find command with shuffle and create a playlist to volatile path \dev\shm is an option to be considered
-
I have implemented it on my RetroPie, but when I'm at the command line and the music loops, it just messes up the display with all the data about the MP3 its playing.
Is there a way to just make it loop "silently" (i.e. not send any data to the console)?
Cheers
-
@nightshadowpt said in Play music playlist on emulationstation (when idle):
Is there a way to just make it loop "silently" (i.e. not send any data to the console)?
Yes, it's described in the original topic at https://retropie.org.uk/forum/topic/9133/quick-and-easy-guide-for-adding-music-to-emulatonstation-on-retropie-noob-friendly. Look at how
mpg123
is started and add the necessary arguments. -
@zerojay thanks for links, i will study that!
-
@mitu Thanks! I'll look into it...
-
The magic of silent working in background is here
mpg123 -Z /home/pi/bgm/*.mp3 >/dev/null 2>&1 &
Mpg123 is command
-Z is endless shuffle of dir /home/pu/bgmNow the magic of > means
Send all messages from stderr = 2
To stdout = 1
Send stdout to nirvanaAt last the last &
Means send the whole process to background -
Thanks for the in depth explanation... it's always good to understand what I am typing :)
Anyway, I found a mistake on my initial typing. Instead of this:
mpg123 -Z /home/pi/bgm/*.mp3 >/dev/null 2>&1 &I had this (note the missing > after the 2):
mpg123 -Z /home/pi/bgm/*.mp3 >/dev/null 2&1 &So that should be the culprit.
After fixing it, every time I exit to the console I get a message saying "/opt/retropie/configs/all/autostart.sh: line 2: 935 Terminated" and the music is turned off.
Not sure if this is the intended behavior, but it works for me. :)
-
@zerojay reading that reddit topic has to be interensting, but i have some question... how can I adapt a combination of jstest reading in a .sh script? As the hadoken is something similar to:
I have to read down, down right, right, punch, right? and after that the script must be running forever in emulationstation idle time.. so when i do that move the playlist start.. is this thinking correct?
-
@nightshadowpt the 2>&1 is mandatory to hide error messages from output, too
Your direction points standard output to nirvana but error messages are still displayed.
-
Ok I've tested jslisten but only accept 4 button pressed at once and seems no button sequence working...
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.