Background Music [Continued from Help/Support]
-
@Brigane Using the USB sound card device is likely the reason. I'm curious, what advantage is there for using one?
Regardless, you can probably workaround the issue by doing the following instead of the original instructions in step 3 & 4:
- edit /opt/retropie/configs/all/runcommand-onstart.sh
pkill mpg123
- edit /opt/retropie/configs/all/runcommand-onend.sh
mpg123 -Z /home/pi/bgm/*.mp3 >/dev/null 2>&1 &
-
@synack
Works perfectly now. Thanks a bunch :)
I'm currently experimenting with my Raspberry Pi Zero, and it doesn't have a soundcard integrated. -
Nice Work m8 :)
-
Me too.
-
I'm having a hard time figuring out how to add the script file to my Pi. Is this something I should be doing outside the Pi? I'm really new to all this so I apologize if I misread something.
-
@SaraSodaPop Oh whoops I didn't think Synack's post was a different method ha I decided to give that a try and oh wow it works so well! Nice work! Although there are some kinks I gotta mess with but I am very happy. :)
-
do the process names that check the process need to be equal or a wildcard is enough?
"mame" matches advmame, mame2003, lr-mame, etc? if not, can i use mame or regular expressions?
-
@synack
This is brilliant, I couldn't get Livewires to work at all but yours worked immediately I entered the code! I just can't figure out how to keep the music playing after reboot, I'm a bit of a noob to coding but I understand enough of it to know how what everything does. -
@ZingZonZot Glad to hear it. In regards to your problem, review the file
/opt/retropie/configs/all/autostart.sh
, make sure the mpg123 line comes before the emulationstation line. -
@synack ok cool I got it working thanks! but can I delay the music somehow for a boot screen?
-
@ZingZonZot in the same file (
/opt/retropie/configs/all/autostart.sh
), make sure the following line comes before the mpg123 line.while pgrep omxplayer >/dev/null; do sleep 1; done
-
yeah that's what I figured but wanted to be sure, I would set the do sleep xxx correct?
-
@ZingZonZot You shouldn't need to change the sleep amount. That one-liner is checking every 1 second if the intro video is playing. As soon as it stops playing, it allows the next commands to be executed (the mp3 player and emulationstation)
-
ah ok, I'll get back to you if I have any problems with it when I install a custom boot screen since the music starts immediately as soon as the original ES splash screen starts up.
-
@ZingZonZot Yeah, the script was intended to start playing music as soon as the emulationstation screen comes up. If you want to delay that from happening, you can use the following line (replacing the other mpg123 command) in the autostart.sh file
(sleep 10; mpg123 -Z /home/pi/bgm/*.mp3 >/dev/null 2>&1) &
Here, you would adjust the sleep amount to the desired amount.
-
@synack, Alright, awesome I'll try it out thanks for the help man! I'm trying to get this done before Christmas making my brother a retropie box, and at the same time getting calls from clients to been busy lol.
Btw I start a game the music stops but in game audio is cut off.. 🤔
-
I'm new to the community so I'd first like to say thank you all for sharing your knowledge with us newbies. It definitely helps us a ton and I personally really appreciate it. Introductions aside, I just had a simple question before I go ahead with this process, will the music stop when ES goes to standby/sleep mode? I will have my Retropie on at all times. I read the entire thread and didn't see anything about standby. Thank you!
-
@smellslikekimchi I can confirm that, I just quit EMU station and the music stops as soon as it goes back to the CLI, but upon restarting EMU station it still plays.
-
@ZingZonZot thank you for the instant reply! So to be clear, it stopped when you shut down ES? I was actually referring to when you just let it sit for a while and it goes to sleep.
-
@smellslikekimchi the short answer is no, it will keep playing and since that dimming/sleep mode is not externally indicated.
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.