EmulationStation
EmulationStation copied to clipboard
[Feature Request] Add background music to ES
Well I was wondering if it's possible to adopt this commit to the RetroPie fork of ES?
https://github.com/recalbox/recalbox-emulationstation/commit/f149f34430c86158372d4e2d85ae4f0485ac49ab "added ogg and mp3 bg music support with sdlmixer"
It would be nice if we could set some sort of bgm while browsing the games.
Isn't BGM already supported on RetroPie now or no?
I don't use RetroPie but the ES fork. I thought if the screensaver can play some music the normal game browser could do this as well
the only way to invoke BGM is to have a standalone application installed to do so like mpg123 and then invoke it via code that you write. for example modifying the autostart.sh script used with RetroPie. one of the issues with this is that you can install RetroPie or ES on various platforms and the different platforms might need a different audio application to be able to execute the process. There are a couple of popular ways that it is being done on Linux which is a manual install/configuration of code and then there is a python script package that someone devised. My suggest is you YouTube Floob and watch his video on how to add it the "old fashioned" way so that you get a better understanding and could possibly do it for your own personal build.
Well thats not what I mean. Since ES has meanwhile a "full" featured audio section and plays background music while showing some screensaver pictures IMHO it should be possible to play some music too while browsing the games without any additional script. Of course it would make sense to add mpg123 support or ogg or flac to play some compressed music files too.
I don't think about some crazy music player options just chose one file and play it in the background.
I have a patch for this fully programmed in a new build that I'm writing for the rock64 / rockbox. The code should work on any platform, as nothing in it is specific to that platform. It uses sdl2mixer.
The master branch has an error that kills ES anytime the user tries to exit the audio settings menu so I can't properly test the new music volume slider, so I've re-written my patch to apply to the stable branch instead. Everything works really well. If someone fixes the master branch I'll actually be able to submit a pull request for it.
I've embedded all the new features directly into AudioManager, rather than introducing new files. It pauses the music and releases the resources when games start and then resumes playback where it left off when the games are exited. I've got a default path for mp3s in the code but have added the ability to override the path in the settings file or pull it from the theme's xml as well.
@mrfixit2001
I had the same problem -> it crashed when no AudioCard was set. After setting it to default it worked for me. Of course it does not fix the underlaying problem.
https://github.com/5schatten/LibreELEC.tv/commit/d70b1700c4e7999ade67e883c76b3b8e7e7c891c
@5schatten - thanks for that! I hope it helps the devs over here at emulationstation get to the bottom of what's happening. Hopefully one of them comments back on this thread that it's fixed so I can submit a proper pull request. For now, my build is happy with the stable branch + background music :) I also changed it so the system volume and music volume are saved to es_settings so the user doesn't need to keep resetting them after a reset.
@mrfixit2001 Do you have a branch where we could have a look at your PR? Or can you rebase it for upstream code?
Absolutely, I will work thru a rebase on this particular patch against master branch and submit a pull request when I have some time. I've got other fixes and enhancements in my environment as well, such as making the menu loop (hitting up on the top menu option goes to the bottom and vice versa) so I don't want to accidentally end up with any of those other changes in the background music PR.
Looping would be pretty neat too! It's annoying to scroll up & down every time :)
@mrfixit2001 Any progress about adding your features to upstream code? :-)
Please have it tested with PowerSaver modes. If you are using ES's mixer elements then PowerSaver modes will cause the music to halt. Set PS mode to disabled if music is enabled.
On the board I've written the patch for, it doesn't currently suspend/resume (yet), so I can't test that. I am using SDL2Mixer, which I've had to add to cmake, and I've updated the way SDL audio is initialized. I can at least confirm that when sitting idle, the default screensaver dims the display and the music continues. I have not yet had a chance to rebase against master. When will we be expecting an update to the stable branch?