Modified Background Music Script with added overlays!
-
I edited the background music script posted here: https://retropie.org.uk/forum/topic/347/background-music-continued-from-help-support
With this edited script, songs that are being played will be displayed within ES and updated as the music changes.
EXAMPLE PICTURES HERE
I used imagemagick to generate pictures of song titles and then used pngview to display the generated .png files on top of the linux framebuffer.
I also added some code to adjust the image size/location depending on what output resolution is being used.
There is a section to adjust things such as font, text/background color, size, location, etc.I made a shell script to make installing this way easier!
https://github.com/madmodder123/retropie_music_overlay/blob/master/BGM_Install.sh
Just download that file, move it to your Pi, mark it as executable, and then run it.
"sudo chmod +x BGM_Install.sh" to make it executable.
Make sure you DO NOT RUN THE SCRIPT AS ROOT OR IT WILL FAIL. Use: "./BGM_Install.sh"You will still have to set up the script to run automatically when the Pi boots!:
Run "sudo nano /etc/rc.local"
Near the bottom, on the line above "exit 0", put the following codesu pi -c 'python ~/BGM.py &'
Press Control+X, Y, and Enter to save changes.
Example rc.local fileEDIT: I updated the script so it creates a menu entry to disable/enable the music !
EDIT 2: I updated the script so you can choose how long you want the overlay to be displayed! (set to 8 seconds by default!)
EDIT 3: I updated the script so you can choose if you would like the corners of the overlay to be rounded
EDIT : Updated to NOT USE ROOT and changed "/home/pi/" to "~/" for other systems (such as ODROID) -
Thank you for inspiration
This is my mod emulationstation with BGM and popup title -
@gleam2003 What build/settings do you have to control the background music from a menu?
-
@triquick said in Modified Background Music Script with added overlays!:
@gleam2003 What build/settings do you have to control the background music from a menu?
I also would like to know how to do this
-
@gleam2003 It is funny, a guy on reddit gave me the idea for this so i made it a script, and then my script gave you the idea to edit ES to add it. It is cool how ideas change forms
-
I edit the emulationstation source code and add bgm as module.
I'm developing it for my distro made for orangepi devices but I can port all to RetroPie for Raspberry.
My distro for OrangePi is available at www.nintendont.it
At this time I have no lot of time but if you are patients I will share with you when find time. -
@gleam2003 IMHO if you're distributing modifications of ES you should also distribute the sources, since ES is under GPL. Is the https://github.com/nintendontit/EmulationStation repository the one with the modifications you made ?
-
First: wrong es isn't gpl, RetroPie have gpl license, emulationstation don't appear to have gpl license but mit license.
Second: all emulationstation modification have be realise as patch files, but only for what I have already released.
-
@gleam2003 said in Modified Background Music Script with added overlays!:
First: wrong es isn't gpl, RetroPie have gpl license, emulationstation don't appear to have gpl license but mit license
Yes, you're correct, only the RetroPie setup has the GPL license, ES seems to be under the MIT License.
-
@mitu said in Modified Background Music Script with added overlays!:
ES seems to be under the MIT License
That doesn't include ES themes which all have licences of their own (not to mention the funny idea that compilations of others logos could constitute ones own "copyright") Most of which being derived from simple which has non commercial clauses. But anyways...
-
@gleam2003 Please can you really make a pull request to the ES master (dev) branch to give us your music player on ES ?
It can be really cool <3 -
@madmodder123 Hi
Today i have try to test your script but i have a problem.apt-get install imagemagick git clone https://github.com/AndrewFromMelbourne/raspidmx.git cd pngview/ make
pi@retropie:~/src/raspidmx/pngview $ make cc -Wall -g -O3 -I../common -I/usr/include/libpng12 -I/opt/vc/include/ -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux -g -c pngview.c -o pngview.o -Wno-deprecated-declarations cc -o pngview -Wl,--whole-archive pngview.o -L/opt/vc/lib/ -lbcm_host -lm -lpng12 -L../lib -lraspidmx -Wl,--no-whole-archive -rdynamic /usr/bin/ld: ne peut trouver -lraspidmx collect2: error: ld returned 1 exit status Makefile:16: recipe for target 'pngview' failed make: *** [pngview] Error 1
Must we install all the package ?
Thanks -
@darknior said in Modified Background Music Script with added overlays!:
@madmodder123 Hi
Today i have try to test your script but i have a problem.apt-get install imagemagick git clone https://github.com/AndrewFromMelbourne/raspidmx.git cd pngview/ make
pi@retropie:~/src/raspidmx/pngview $ make cc -Wall -g -O3 -I../common -I/usr/include/libpng12 -I/opt/vc/include/ -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux -g -c pngview.c -o pngview.o -Wno-deprecated-declarations cc -o pngview -Wl,--whole-archive pngview.o -L/opt/vc/lib/ -lbcm_host -lm -lpng12 -L../lib -lraspidmx -Wl,--no-whole-archive -rdynamic /usr/bin/ld: ne peut trouver -lraspidmx collect2: error: ld returned 1 exit status Makefile:16: recipe for target 'pngview' failed make: *** [pngview] Error 1
Must we install all the package ?
ThanksHere's how I handled it, starting inside the git clone of that repo:
cd lib
make
cp libraspidmx.so* /usr/local/bin
nano /etc/ld.so.conf
(type /usr/local/lib into a new line alone, save and quit nano
ldconfig
cd ../pngview
make
cp pngview /usr/local/bin/
ldd /usr/local/bin/pngview (if you did everything right here, you should see all required libraries are present and accounted for) -
@madmodder123 It's probably a better idea to actually have the song_title.png be output to somewhere like /dev/shm which is a tmpfs kept in RAM so that you don't keep writing this file to the SD card.
-
@zerojay Great idea! Thanks for letting me know i'll adjust the code! I'm glad you told me about that folder, you learn something new with linux every day :)
-
Hey @madmodder123 thanks for working on such a nice addition to my retropie build, however, I would like to pick your brain a bit since I'm having. Issues with it.
I followed adding your script to the PyScripts folder and switched the previous music script I had with your updated one, despite this fact, there's no song_title.png being created ever and I can't seem to find out what the problem is, would you mind help me figuring it out?
Music plays fine so I'm sure I did THAT right at least.
Best regards
EDIT: Found out why it wasn't working, the script point to /usr/bin/pngview where as @zerojay mentioned at a previous comment the following:
Here's how I handled it, starting inside the git clone of that repo:cd lib
make
cp libraspidmx.so* /usr/local/bin
nano /etc/ld.so.conf
(type /usr/local/lib into a new line alone, save and quit nano
ldconfig
cd ../pngview
make
cp pngview /usr/local/bin/
ldd /usr/local/bin/pngview (if you did everything right here, you should see all required libraries are present and accounted for)As you can see within these instructions pngview points at /usr/local/bin
-
I'm having a similar problem, I get the background music but I never get the overlay or images created, I double checked and pngview is in /usr/local/bin and the command is executable with out error from the terminal. How can I troubleshoot this script?
-
@war3zlod3r
I wrote a script that gets everything all set up for ya!
https://github.com/madmodder123/retropie_music_overlay/blob/master/BGM_Install.sh
Just download that, make it executable and then run it and it should work just fine, I just tested it on a fresh install :) -
I updated the main post with the script and more instructions :)
-
I updated the script so it makes a menu item that lets you instantly enable/disable the BGM :)
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.