Kites Circuit Sword menu background music

Having trouble with your GBZ build? Ask your questions here!
Post Reply
Jakewd
Posts: 8
Joined: Tue Oct 17, 2017 8:34 pm
Has thanked: 3 times
Been thanked: 3 times

Kites Circuit Sword menu background music

Post by Jakewd » Mon Mar 12, 2018 7:02 am

Hi, I’ve been trying to get background music during the selection menu working properly on my Circuit Sword. I’ve been able to start a song after boot and it stops when I select a game and resumes when I exit a game.

The problem I’m having is that I cannot hear the game music once the game loads.

Has anybody been able to successfully make a menu screen with background music? If so can you give me some pointers on what I’m doing wrong?

I’ve tried using the Python script method and the mpg123 package method, both have had this same issue.

Online
User avatar
kite
Posts: 926
Joined: Thu May 12, 2016 4:30 am
Location: UK
Has thanked: 236 times
Been thanked: 305 times
Contact:

Re: Kites Circuit Sword menu background music

Post by kite » Mon Mar 12, 2018 7:05 am

If you're searching for stuff, it's specifically about using USB audio that it relates to. So that may open up new search results for you..

Jakewd
Posts: 8
Joined: Tue Oct 17, 2017 8:34 pm
Has thanked: 3 times
Been thanked: 3 times

Re: Kites Circuit Sword menu background music

Post by Jakewd » Tue Mar 13, 2018 3:48 pm

kite wrote:
Mon Mar 12, 2018 7:05 am
If you're searching for stuff, it's specifically about using USB audio that it relates to. So that may open up new search results for you..
Thanks for the advise Kite. One thing I did find when using the "common" tutorials is I get and error message right as my game boots up. Its hard to read but I was able to get this from it...

Code: Select all

AudioManager Error - Unable to open SDL audio: ALSA: Couldn't (Blocked by wifi/battery/screen runoff)
device: Device or resource busy
The problem is that the sound is triggered on and off by the runcommand-onstart/onend.sh files and all it does is stop the sound from playing but I don't believe it unhooks mpg123 from the sound card. The guide I'm following is herehttps://www.reddit.com/r/RetroPie/comme ... _music_to/ and you can see the process.

Im not sure if its possible using this method but if I can also unhook mpg123 when turning off the music I think that would fix the problem, but I'm not sure how to do it.

User avatar
dirtybeagles
Posts: 386
Joined: Thu May 05, 2016 6:04 am
Has thanked: 34 times
Been thanked: 63 times

Re: Kites Circuit Sword menu background music

Post by dirtybeagles » Sat Dec 15, 2018 8:48 pm

Did you ever find a solution? I am also looking at adding bg music and tried mpg123 as well as python scripts but they all seem to have this same issue.

User avatar
dirtybeagles
Posts: 386
Joined: Thu May 05, 2016 6:04 am
Has thanked: 34 times
Been thanked: 63 times

Re: Kites Circuit Sword menu background music

Post by dirtybeagles » Sun Dec 16, 2018 8:42 am

K, I believe I may have found a solution. Try this: https://retropie.org.uk/forum/topic/546 ... ence-mp3/3

Seems to work with Super-AIO Kite Board running Pi0.

Now, before I did this, I did run a retropie update and made sure I had the latest Kite Adrino update from his Wiki. Not sure if that did anything though.

User avatar
dirtybeagles
Posts: 386
Joined: Thu May 05, 2016 6:04 am
Has thanked: 34 times
Been thanked: 63 times

Re: Kites Circuit Sword menu background music

Post by dirtybeagles » Sun Dec 16, 2018 1:44 pm

:lol: k, that last method was not the best... because the script checks ever 2 seconds to enable game audio.. not really the best and probably only 90% reliable. So.. I believe I found the best solution for mpg123 script method.
Credit goes to: https://retropie.org.uk/forum/topic/546 ... nce-mp3/23

#Step 1.
Install mpg123

Code: Select all

sudo apt-get install mpg123
When prompted, type "y" and hit enter and it should install quickly.

#Step 2.
Edit autostart.sh (note: this is not meant to be a link)

Code: Select all

sudo nano /opt/retropie/configs/all/autostart.sh
Once in nano, hit enter to create a line break above emulationstation #auto. Go up to the blank line and type/paste the following:

Code: Select all

while pgrep omxplayer >/dev/null; do sleep 1; done
(sleep 10; mpg123 -Z /home/pi/bgm/*.mp3 >/dev/null 2>&1) &
NOTE: You can delay how long it takes for mpg123 to begin playing music on boot, which is handy for those with splashscreens. Just replace the 10 in the second line(sleep 10; with any value in seconds you'd like. As shown, it's currently set to a 10 second delay.

Hit CTRL+O followed by Enter to save the file and CTRL+X to quit nano back to terminal.

#Step 3.
Create and edit the runcommand-onstart and onend files.

Code: Select all

sudo nano /opt/retropie/configs/all/runcommand-onstart.sh
Once inside, type/paste the following:
This is where I modified the original post because when you added pkill -STOP mpg123, the game sound would never start but this should fix that.

Code: Select all

pkill mpg123 > /dev/null 2>&1
Hit CTRL+O followed by Enter to save the file and CTRL+X to quit nano back to terminal.

Code: Select all

sudo nano /opt/retropie/configs/all/runcommand-onend.sh
Once inside, type/paste the following:
Also modified...from original posting.

Code: Select all

mpg123 -Z /home/pi/bgm/*.mp3 > /dev/null 2>&1 &
Hit CTRL+O followed by Enter to save the file and CTRL+X to quit nano back to terminal.
At the terminal, type/paste:

Code: Select all

sudo chmod a+x /opt/retropie/configs/all/runcommand-onstart.sh
Followed by:

Code: Select all

sudo chmod a+x /opt/retropie/configs/all/runcommand-onend.sh
#Step 4.
Edit .bashrc

Code: Select all

sudo nano /home/pi/.bashrc
Once inside, scroll to the very bottom of the file and create a line break under retropie_welcome but above # RETROPIE PROFILE END and type/paste the following:

Code: Select all

s[[ $(tty) == "/dev/tty1" ]] && pkill mpg123
Hit CTRL+O followed by Enter to save the file and CTRL+X to quit nano back to terminal.

#Step 5.
Create the folder /home/pi/bgm

Code: Select all

mkdir /home/pi/bgm
Move your MP3 music to the new bgm directory, And you're finished! Make sure you reboot.

User avatar
Ludaris
Posts: 25
Joined: Sun Jun 17, 2018 3:51 pm
Has thanked: 11 times
Been thanked: 4 times
Contact:

Re: Kites Circuit Sword menu background music

Post by Ludaris » Sun Mar 03, 2019 12:43 pm

@dirtybeagles

Worked for me!
Thank you very much! :)

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest