Integrated Music Player for RetroPie [IMP] 2021.10 (Background Music for RetroPie and More)
-
@RapidEdwin08 First off, thank you for IMP, I have been trying to get a BGM working on my setup for weeks, then I found this and minutes later I have the biggest smile on my face! I appreciate the work you put in, its fantastic. It works as advertised and I have even been able to add my own tunes!
I have a query I hope its easy enough for you to point me in the right direction.
I cannot get the BGM music to start automatically, if I go into the menu and select Start BGM, it works perfectly. But following a reboot it does not start. Where can I look to see that it is correctly configured to start post boot?I have Rpi4, latest build of RetroPie & I am using a hifiberry-amp hat. I can confirm that all the other features work, in game sounds work fine etc.
I'm fairly adept at scripting, and have been playing with Pi's for years :)
#cat /opt/retropie/configs/imp/settings/music-startup.flag 1 -rw-r--r-- 1 pi pi 2 Feb 14 18:40 music-startup.flag
Thanks in advance!
-
@hopwon said in Integrated Music Player for RetroPie [IMP] 2021.10 (Background Music for RetroPie and More):
I cannot get the BGM music to start automatically, if I go into the menu and select Start BGM, it works perfectly. But following a reboot it does not start. Where can I look to see that it is correctly configured to start post boot?
Thanks for the feedback...
From your screenshot it looks like you already have BGM A Enabled, so it should be working, and playing only A-Side at boot.
I believe I found and fixed this issue about a week ago, but I could be wrong.
You might have installed before I made the changes Here.
You can try to uninstall, re-download ~/imp setup, and re-install.
I recommend fresh install as I made a few other changes/fixes since the release as well.Or if you want, you can check the [boot .sh], and just #Comment# the bad lines out.
[/opt/retropie/configs/imp/boot.sh] Lines 83-86:
# Replace rpMenu/music Path with roms/Music Path in Playlist files - No Longer Required - No Longer Works #sed -i s+$ESCmusicDIR+$ESCmusicROMS+ /dev/shm/abc #sed -i s+$ESCmusicDIR+$ESCmusicROMS+ /dev/shm/shuffle #sed -i s+$ESCmusicDIR+$ESCmusicROMS+ /dev/shm/init
I also wanted to elaborate on the BGM Settings VS Randomizer at B00T while the topic is relevant.
BGM A-Side Enabled: Plays ONLY BGM A-Side at B00T overriding any previous playlist
BGM B-Side Enabled: Plays ONLY BGM B-Side at B00T overriding any previous playlist
BOTH A-Side/B-Side Enabled: Plays BOTH A/B Side together as single playlist at B00TRandomizer Mode ON: Supersedes BGM at B00T
Randomizer ALL: Respects BGM A/B Settings allowing you to Include OR Exclude BGM from Randomizer playlist at B00T
Randomizer BGM: Plays 0nly EITHER BGM A-Side OR BGM B-Side at B00T overriding any previous playlist
Randomizer PLS: Plays only Random Playlist Files .PLS/.M3UAlso, a quick reminder about Music Over Games and RetroArch Audio Driver Here
-
-
@RapidEdwin08 Thanks for getting back so soon. I did the fresh re-install and can confirm the hashed out lines above are indeed there.
The results are the same, no background music at startup.One other thing I saw flash up when starting a game (I have FADE on) is a message stating "unable to get current volume" is this a symptom of this issue or something else?
I just wanted to reiterate that I have disabled onboard audio and am using (successfully) an audio hat. So in game sounds work, IMP works fine apart from the no music at startup. Just in case :)Checked the mp3 files, they are consistently named i.e. all lowercase .mp3
Nothing in syslog or dmesg to indicate any issues either.Where can I look now?
-
@hopwon You can check the IMP Output log file right after a Reboot before you Press anything IMP Related in ES.
/dev/shm/current-playlist
You can also check the actual Playlist Files to confirm the Path to MP3s is correct.
(NOTE: the current-track Log file in this Location is only used when LITE Mode is DISABLED)/opt/retropie/configs/imp/playlist
Are you able to get Music playing at B00T at all?
Tried any other Settings with BGM Disabled?
Do you hear the startup.mp3 Play at B00T?
Trying to determine if the issue isolated to BGM settings, Audio device, or the Music Files themselves...Are you sure ALL the songs in the BGM Folder play?
One known issue is that any File with a Double-Space will not play with mpg123 Issue#4
Another known issue is with Files that have no metadata mentioned Here.The "unable to get current volume" is an issue with IMP Not being able to detect the audio device properly at FADE.
You can Disable FADE for now to get rid of the message
May be related to the audio hat in use, as I personally do not own or ever tested, but we can definitely troubleshoot that later as well if you're up for it.Edit* Another thought regarding the audio hat, try increasing the Delay of IMP at B00T...
I'm guessing the audio hat has additional drivers/scripts being loaded at startup?
I wonder if IMP is starting playback before the audio hat is loaded.
Can you check the status of the # Current Playlist # after a Reboot?
If it's playing, you can try increasing the Delay. -
-
@RapidEdwin08 There is no startup.mp3 plays which makes me think delaying the start is a top suggestion.
It's a vanilla install and copied a few mp3 into the default folder as I did think that might have been an issue, but no.
Will dig into the issue tomorrow and feed back.
Thanks again! -
@RapidEdwin08 said in Integrated Music Player for RetroPie [IMP] 2021.10 (Background Music for RetroPie and More):
@hopwon You can check the IMP Output log file right after a Reboot before you Press anything IMP Related in ES.
/dev/shm/current-playlist
You can also check the actual Playlist Files to confirm the Path to MP3s is correct.
(NOTE: the current-track Log file in this Location is only used when LITE Mode is DISABLED)/opt/retropie/configs/imp/playlist
Are you able to get Music playing at B00T at all?
Tried any other Settings with BGM Disabled?
Do you hear the startup.mp3 Play at B00T?
Trying to determine if the issue isolated to BGM settings, Audio device, or the Music Files themselves...Are you sure ALL the songs in the BGM Folder play?
One known issue is that any File with a Double-Space will not play with mpg123 Issue#4
Another known issue is with Files that have no metadata mentioned Here.The "unable to get current volume" is an issue with IMP Not being able to detect the audio device properly at FADE.
You can Disable FADE for now to get rid of the message
May be related to the audio hat in use, as I personally do not own or ever tested, but we can definitely troubleshoot that later as well if you're up for it.Edit* Another thought regarding the audio hat, try increasing the Delay of IMP at B00T...
I'm guessing the audio hat has additional drivers/scripts being loaded at startup?
I wonder if IMP is starting playback before the audio hat is loaded.
Can you check the status of the # Current Playlist # after a Reboot?
If it's playing, you can try increasing the Delay.@RapidEdwin08 Check the following:
IMP Output post boot:
pi@SpaceInvader:~ $ uptime 10:33:13 up 0 min, 2 users, load average: 1.01, 0.35, 0.12 pi@SpaceInvader:~ $ cat /dev/shm/current-playlist cat: /dev/shm/current-playlist: No such file or directory
Red Flag?
pi@SpaceInvader:/opt/retropie/configs/imp/playlist $ cat current-track High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3 version 1.25.10; written and copyright by Michael Hipp and others free software (LGPL) without any warranty but with best wishes Decoder: generic Trying output module: alsa, device: <nil> Directory: /home/pi/RetroPie/retropiemenu/imp/music/bgm/A-SIDE/ Playing MPEG stream 1 of 1: 08 - Confusion [Alternate Version] [Instrumental].mp3 ... MPEG 1.0 L III cbr320 44100 stereo Title: Confusion [Alternate Version] [Instrumental] Artist: New Order Comment: Album: Power, Corruption & Lies [Collector's Edition] Disc 2 Year: 2008 Genre: Alternative > 04864+12622 02:07.05+05:29.72 --- 005=005 320 kb/s 1045 B acc 0 clip p+0.000 > 0000+0000 00:00. > 0000+0000 00:00.
No music playing at boot at all. I did put a 30 second delay in but no change
Listing of music directory:
pi@SpaceInvader:~/RetroPie/retropiemenu/imp/music/bgm/A-SIDE $ ls -l total 253420 -rw-r--r-- 1 pi pi 12623967 Feb 14 18:36 '01 - Age of Consent.mp3' -rw-r--r-- 1 pi pi 18104457 Feb 14 18:36 '01 - Blue Monday.mp3' -rw-r--r-- 1 pi pi 16461878 Feb 14 18:37 '01 - Crystal.mp3' ...... loads more
Lets forget the fade issue for now.
Regarding drivers for the hat, its included in the /boot/config.txt:# Enable audio (loads snd_bcm2835) #dtparam=audio=on dtparam=audio=off dtoverlay=hifiberry-amp
This is the correct config for this device, as I mentioned everything works as expected.
Current settings:
,-------------------------------------------------------. | Music @Boot: ON Delay: 030 | LITE Mode: OFF | | startup.mp3: ON @quit: ON | INFINITE Mode: ON | | BGM A~SIDE: ON B~SIDE: ON | Music OVER Game: OFF | | Shuffle Playlist @Boot: ON | FADE Volume Out/In: x5 | | 0MXM0N:OFF RANDOMIZER: BGM | DELAY @Game End: OFF | | Volume%40 @Screensaver: VID | Stop IMP @Sleep: ON | `-------------------------------------------------------' http.server: [OFF] [http://192.168.1.85:8080] [STOPPED] Music: /home/pi/RetroPie/retropiemenu/imp/music
My guess at this stage is that the audio driver is not loaded at startup, even with the 30 second delay.
More than happy to help troubleshoot/assist in making this work with you -
-
@RapidEdwin08 Bit more info:
Running these from the cmd line:
bash /opt/retropie/configs/imp/boot.sh
Waits 30 seconds then starts playing music beautifully ,then gives me this error output:
sed: -e expression #1, char 0: no previous regular expression sed: -e expression #1, char 0: no previous regular expression sed: -e expression #1, char 0: no previous regular expression pi@SpaceInvader:/opt/retropie/configs/all $
pi@SpaceInvader:/opt/retropie/configs/all $ cat autostart.sh #while pgrep omxplayer >/dev/null; do sleep 1; done emulationstation --no-splash#auto bash /opt/retropie/configs/imp/boot.sh > /dev/null 2>&1 & #auto emulationstation #auto
Two ES entries, is this by design?
-
@RapidEdwin08
Manually changed autostart.sh to#while pgrep omxplayer >/dev/null; do sleep 1; done bash /opt/retropie/configs/imp/boot.sh > /dev/null 2>&1 & #auto emulationstation --no-splash#auto
And lo and behold it works! BGM happiness :)
-
@hopwon said in Integrated Music Player for RetroPie [IMP] 2021.10 (Background Music for RetroPie and More):
Two ES entries, is this by design?
No, I'm pretty sure IMP added the Extra emulationstation #auto entry by mistake due to the installer not taking into account the emulationstation --no-splash#auto entry.
Basically the autostart was loading Emulationstation Twice, and IMP was only set to start before the 2nd entry.
In this state, if you were to Quit ES, it would have reloaded a 2nd time, this time with IMP playing.
Glad you found this.There should be a backup named autostart.sh.b4imp
Can you confirm the content of the Backup autostart.sh before IMP?
I will try to update the installer to accommodate.cat /opt/retropie/configs/all/autostart.sh.b4imp
Thanks for the Feedback
-
@RapidEdwin08 said in Integrated Music Player for RetroPie [IMP] 2021.10 (Background Music for RetroPie and More):
@hopwon said in Integrated Music Player for RetroPie [IMP] 2021.10 (Background Music for RetroPie and More):
Two ES entries, is this by design?
No, I'm pretty sure IMP added the Extra emulationstation #auto entry by mistake due to the installer not taking into account the emulationstation --no-splash#auto entry.
Basically the autostart was loading Emulationstation Twice, and IMP was only set to start before the 2nd entry.
In this state, if you were to Quit ES, it would have reloaded a 2nd time, this time with IMP playing.
Glad you found this.There should be a backup named autostart.sh.b4imp
Can you confirm the content of the Backup autostart.sh before IMP?
I will try to update the installer to accommodate.cat /opt/retropie/configs/all/autostart.sh.b4imp
Thanks for the Feedback
Here you go:
pi@SpaceInvader:/opt/retropie/configs/all $ cat autostart.sh.b4imp #while pgrep omxplayer >/dev/null; do sleep 1; done emulationstation --no-splash#auto pi@SpaceInvader:/opt/retropie/configs/all $
You are correct, I put the second ES line back in and tried what you suggested and indeed, when I quit ES, it restarted with BGM!
-
@hopwon For the Fade issue...
Are you able to Adjust/Retain Volume in ES Sound Settings?
Or does the Volume setting get lost when you try to adjust from ES.
If Volume does not retain, try to find the correct Combination of AudioDevice/AudioCard, then you can try to Enable Fade again in IMP and Test.If Volume is working fine and AudioDevice/AudioCard Settings are correct, can you confirm the output of these commands:
cat /opt/retropie/configs/all/emulationstation/es_settings.cfg | grep "AudioCard" cat /opt/retropie/configs/all/emulationstation/es_settings.cfg | grep "AudioDevice" amixer | grep "Simple mixer control" | grep -v 'Capture'
-
@RapidEdwin08 Took me a few days to get this tested. I ended up using the method from ~/imp/imp_setup.sh - selecting Add quit song option from the [PC/0ther] Utilities. And it did work!
But before that, when I entered:
cat /etc/systemd/system/impquit.service
I did get this message returned:
[Unit] Description=IMP Stop + Quit Song DefaultDependencies=no Conflicts=reboot.target power off.target halt.target shutdown.target After=network.target [Service] Type=oneshot RemainAfterExit=yes ExecStart=/bin/true ExecStop=/opt/retropie/configs/imp/impquit.sh [Install] WantedBy=multi-user.target
I don't know enough to figure out what was going on from there, but if that's helpful, thought I'd pass it along.
-
@RapidEdwin08 said in Integrated Music Player for RetroPie [IMP] 2021.10 (Background Music for RetroPie and More):
@hopwon For the Fade issue...
Are you able to Adjust/Retain Volume in ES Sound Settings?
Or does the Volume setting get lost when you try to adjust from ES.
If Volume does not retain, try to find the correct Combination of AudioDevice/AudioCard, then you can try to Enable Fade again in IMP and Test.If Volume is working fine and AudioDevice/AudioCard Settings are correct, can you confirm the output of these commands:
cat /opt/retropie/configs/all/emulationstation/es_settings.cfg | grep "AudioCard" cat /opt/retropie/configs/all/emulationstation/es_settings.cfg | grep "AudioDevice" amixer | grep "Simple mixer control" | grep -v 'Capture'
Hi, been away for a few days.
The fade issue fixed itself once we worked out that that IMP was not starting due to the duplicate entries in autostart.sh.
Everything is working perfectly now :)
Massive thanks again for your time. -
@RapidEdwin08 reading @hopwon 's responses and despite me pretty much getting things to work, you mention a few things that might solve my problem.. Previously I was copying a lot of old configs from backups of RetroPie 4.7.x for fresh installs onto a new card, which probably impacted my RetroPie 4.8.3 setup. I pulled up some of the log files and I was getting some error messages that made sense- I wouldn't be surprised if some of that stuff might have been interfering with IMP in certain ways.
Working on a fresh install with a fresh card- been careful to sort through the configs I'll need only, from my old backup, and we'll see what happens. Thanks- I'll report back.
-
@hopwon said in Integrated Music Player for RetroPie [IMP] 2021.10 (Background Music for RetroPie and More):
emulationstation --no-splash#auto
Current version of IMP Setup has been updated to adjust for the issue @hopwon experienced with multiple emulationstation entries in autostart .sh.
The installer was already configured to look for [--no-splash #auto], but Not [emulationstation --no-splash#auto].
@hopwon I don't know if it was a typo or not, but I'm pretty sure there's supposed to be a SPACE before #auto in your entry here:
emulationstation --no-splash#auto
emulationstation --no-splash #autoI'd venture to guess you are probably still seeing the ES splash screen without that space before #auto.
Either way, IMP Setup will now accommodate this scenario, and correct it. -
@RapidEdwin08 said in Integrated Music Player for RetroPie [IMP] 2021.10 (Background Music for RetroPie and More):
@hopwon I don't know if it was a typo or not, but I'm pretty sure there's supposed to be a SPACE before #auto in your entry here:
emulationstation --no-splash#auto
emulationstation --no-splash #autoNo, a space is not required after the parameters. If your detection script tries to look for the line where
emulationstation
command is started, either look for^emulationstation
or#auto
to find it, both should work fine. -
@mitu said
No, a space is not required after the parameters. If your detection script tries to look for the line where
emulationstation
command is started, either look for^emulationstation
or#auto
to find it, both should work fine.@mitu Thanks for the feedback (and everything else you do for the community), it's always appreciated.
I've seen some Pi Images where emulationstation is not at the beginning of the line, so I do not use ^ for the detection here.Also, I thought the same thing about the space not making an impact, until I added it to my autostart .sh for testing the issue previously experienced by @hopwon.
In my case, on a stock retropie 4.8 build, the ES Splash screen still displays when there's no space in [emulationstation --no-splash#auto]. -
[v2023.03] Released
LITE Mode Now Retains Last Track/Position at Poweroff if Properly Shutdown.
New Feature 0ptional User Gamelist (imp-user-gamelist.xml)
Added x2 More [SomaFM] Internet Radio Stations to [Streams] (cliqhop,darkzone)
Various Visual Tweaks Added to Utilities Menu and Main Menu
Tweaks to Installer applying to [autostart .sh] (emulationstation --no-splash)Again, Thanks All for the Feedback...
-
@RapidEdwin08 Quick question, will it play VGM, SPC etc. like Naprosnia's player? I use it for that feature as they're small files and I can have authentic game music in EmulationStation.
Thanks for all your work on this, looks ace!
-
@segasonic No...
IMP uses mpg123 as the main player, so only mp3 support + .pls and m3u.
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.