MiSTer BGM - Background Music for the MiSTer Menu

Kernel, Main, Utilities & Applications, Miscellaneous Devices.
User avatar
wizzo
Scripting Wizard
Posts: 183
Joined: Sat Mar 12, 2022 11:32 am
Has thanked: 15 times
Been thanked: 240 times

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by wizzo »

djvj wrote: Sun May 01, 2022 3:57 am They are named like this:
/media/fat/music/_Sega Dreamcast - Boot.mp3
/media/fat/music/_Sony PS1 - Boot.mp3

My playlists are in subfolders with a pls file. Everything else works great. The boot sounds need to be in a playlist as well? I thought they just need to be prefixed with an underscore.
These 2 files in particular look good. So when I say playlist I mean the subfolders. You should only have .pls files for internet radio.

For those 2 boot sounds to play, your playlist in the BGM GUI needs to be set to "none". If you have a different subfolder set as your playlist, you'd need to have the boot sounds in that subfolder for them to run on boot.

Does that make sense? I'm realising it's a bit confusing now so maybe it needs some changes to be more intuitive.

If you've got everything set correctly and they're still not playing, can you add the line "debug = yes" to the bottom of your bgm.ini file. Then reboot. And then upload a copy here of the file "/tmp/bgm.log" and that'll show some more detail. You need to copy it off your mister while it's on. The file gets deleted on shut down
djvj
Posts: 3
Joined: Mon May 25, 2020 5:45 pm

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by djvj »

That isn't very intuitive to be honest. Way everything is setup now with playlists and folders for diff music is great. I can launch bgm and tell it what playlist to use, whether local files or internet radio. Only thing I wanted to tack on was a boot sound for that one time at boot only. I want a folder with all diff boot sounds and for it to choose a random one. After that, then move onto the playlist I had set last.

Doesn't sound like that's possible w/o duplicating all those boot sounds in each folder, which I have like 30 or so. How about designate a /music/boot/ folder for boot sounds and whatever is in there it will randomly pick one then move onto the normal playlist the user had set?
User avatar
Wave
Posts: 129
Joined: Tue Jan 04, 2022 6:57 pm
Has thanked: 85 times
Been thanked: 40 times

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by Wave »

To slightly modify the above suggestion, perhaps the script could look at a specific /bootsounds folder first, but then also look for any additional boot-designated sounds in the current "playlist" folder. Maximum flexibility that way.
she/her
blacklistedcard
Posts: 77
Joined: Mon Jun 08, 2020 1:54 am
Has thanked: 3 times
Been thanked: 9 times

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by blacklistedcard »

Using the script. It's working great for Internet Radio
User avatar
kirabate
Posts: 16
Joined: Wed Sep 16, 2020 2:37 am
Has thanked: 4 times
Been thanked: 6 times

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by kirabate »

It's me or the script is broken after the least update?
User avatar
wizzo
Scripting Wizard
Posts: 183
Joined: Sat Mar 12, 2022 11:32 am
Has thanked: 15 times
Been thanked: 240 times

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by wizzo »

kirabate wrote: Wed May 18, 2022 4:04 am It's me or the script is broken after the least update?
I have another person on github having issues since an update as well but was not sure what's going on with it. What happens when you try to run bgm from the script menu? Does it show any error message?

I can't reproduce the problem. It works fine for me with a fully updated mister and no need to reinstall.

I will try my best to help but I'm super busy with work atm and haven't got much time to work on the scripts for a while.
User avatar
kirabate
Posts: 16
Joined: Wed Sep 16, 2020 2:37 am
Has thanked: 4 times
Been thanked: 6 times

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by kirabate »

The sound is off, and sometimes can't reproduce anything, i Will try to reinstall.
User avatar
Juri
Posts: 46
Joined: Sun May 24, 2020 6:49 pm
Has thanked: 12 times
Been thanked: 4 times

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by Juri »

Hi i removed the old version and copied the new bgm.sh to scripts folder, but when i run it from script menu i get this:

Code: Select all

Traceback (most recent call last):
 File "/media/fat/Scripts/bgm.sh", line 750, in <module>
   if player.total_tracks(include_boot=True) == 0:
 File "/media/fat/Scripts/bgm.sh", line 257, in total_tracks
   return len(self.get_tracks(playlist, include_boot=include_boot))
 File "/media/fat/Scripts/bgm.sh", line 249, in get_tracks
   for root, dirs, files in os.walk(folder):
 File "/media/fat/Scripts/bgm.sh", line 342, in walk
TypeError: expected str, bytes or os.PathLike object, not NoneType
whet's wrong?
thanks
JF
User avatar
wizzo
Scripting Wizard
Posts: 183
Joined: Sat Mar 12, 2022 11:32 am
Has thanked: 15 times
Been thanked: 240 times

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by wizzo »

Juri wrote: Fri Jun 17, 2022 12:27 pm Hi i removed the old version and copied the new bgm.sh to scripts folder, but when i run it from script menu i get this:
If you haven't updated in a long time you should probably delete the bgm.ini file in the music folder and try run it again. If that doesn't work, try rename your music folder to something else and run the script, see what it says

I'm not quite sure what this error message means. It looks like something has slipped through my checks
tr88
Posts: 1
Joined: Fri Jun 24, 2022 7:11 pm

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by tr88 »

wizzo wrote: Fri Jun 17, 2022 12:39 pm
Juri wrote: Fri Jun 17, 2022 12:27 pm Hi i removed the old version and copied the new bgm.sh to scripts folder, but when i run it from script menu i get this:
If you haven't updated in a long time you should probably delete the bgm.ini file in the music folder and try run it again. If that doesn't work, try rename your music folder to something else and run the script, see what it says

I'm not quite sure what this error message means. It looks like something has slipped through my checks
I was having the same problem. I deleted the bgm.ini and remade the music folder, but the music would not play. I had to make a subfolder first (I called it playlist). There was no music in this subfolder, but adding it allowed the music to start playing again.
User avatar
wizzo
Scripting Wizard
Posts: 183
Joined: Sat Mar 12, 2022 11:32 am
Has thanked: 15 times
Been thanked: 240 times

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by wizzo »

I've released an update for BGM. This fixes some minor bugs, adds some compatibility stuff needed for SAM and adds a couple new requested boot sound features.

You can now create a folder called "boot" in the music folder and put tracks in there. They will be included in the pool of boot tracks used in any playlist, rather than just being restricted to the current active playlist.

I've also added the ability to add core-specific boot sounds. So let's say you launch the SNES core, you can make it play a boot sound while that's launching (and then stop playing music like normal).

Check the docs for more details on how these work. They won't affect any existing setups people have, so don't worry about them if you don't wanna use em.
tr88 wrote: Fri Jun 24, 2022 7:14 pm I was having the same problem. I deleted the bgm.ini and remade the music folder, but the music would not play. I had to make a subfolder first (I called it playlist). There was no music in this subfolder, but adding it allowed the music to start playing again.
Thanks for the tip but unfortunately I still could not reproduce this. I've added some error handling for the specific error Juri posted, which might help, but it's hard to say. At the very least the script will no longer crash at this point and might give some more hints.
User avatar
PistolsAtDawn
Posts: 336
Joined: Fri Feb 18, 2022 7:29 pm
Has thanked: 232 times
Been thanked: 90 times

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by PistolsAtDawn »

wizzo wrote: Sun Jun 26, 2022 3:25 pm I've also added the ability to add core-specific boot sounds. So let's say you launch the SNES core, you can make it play a boot sound while that's launching (and then stop playing music like normal).
I appreciate this project, and I especially like this addition. I'm thinking that first up is something like a sample of Solid Snake dialogue for the PlayStation core boot sound.

Thank you!
warham
Posts: 31
Joined: Sat Aug 01, 2020 11:29 pm
Been thanked: 7 times

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by warham »

love this. especially the mister boot up sound option.. scares my wife every time she hears the police yelling open up this is the police haha
blacklistedcard
Posts: 77
Joined: Mon Jun 08, 2020 1:54 am
Has thanked: 3 times
Been thanked: 9 times

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by blacklistedcard »

Still enjoying the background music. So far I'm fully updated and have not experienced any problems. It plays the internet streams perfectly.

Thanks for this effort.
User avatar
eLLuiGi
Posts: 18
Joined: Tue Jul 05, 2022 8:55 am
Has thanked: 11 times
Been thanked: 11 times

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by eLLuiGi »

Any ini example for playing internet stream please ;-)
User avatar
prom
Posts: 1
Joined: Sat Apr 16, 2022 8:49 am
Has thanked: 4 times

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by prom »

User avatar
wizzo
Scripting Wizard
Posts: 183
Joined: Sat Mar 12, 2022 11:32 am
Has thanked: 15 times
Been thanked: 240 times

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by wizzo »

Thank you for the feedback!
eLLuiGi wrote: Mon Aug 15, 2022 8:36 am Any ini example for playing internet stream please ;-)
If you check the readme page on github in the Supported files section there's an explanation for this. Basically make a new playlist folder and put a .pls file in there. No ini changes required
Tritopher
Posts: 6
Joined: Wed Nov 30, 2022 7:07 am

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by Tritopher »

So the BGM script won't start automatically after a reboot, is there something else I need to do to configure it? I'm having a similar issue with SAM, wondering if there's something basic I messed up that might interfere

User avatar
wizzo
Scripting Wizard
Posts: 183
Joined: Sat Mar 12, 2022 11:32 am
Has thanked: 15 times
Been thanked: 240 times

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by wizzo »

Tritopher wrote: Thu Dec 01, 2022 2:36 am

So the BGM script won't start automatically after a reboot, is there something else I need to do to configure it? I'm having a similar issue with SAM, wondering if there's something basic I messed up that might interfere

Hi mate. It should just be automatic. Can you please post the contents of your user-startup.sh file? it should be in the linux folder on the sd card if you check on your computer or /media/fat/linux/user-startup.sh if you're going over the network.

Tritopher
Posts: 6
Joined: Wed Nov 30, 2022 7:07 am

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by Tritopher »

Thanks, this is what I have in the file:

#!/bin/sh

Startup MiSTer_SAM - Super Attract Mode

[[ -e /media/fat/Scripts/.MiSTer_SAM/MiSTer_SAM_init ]] && /media/fat/Scripts/.MiSTer_SAM/MiSTer_SAM_init $1

Startup BGM

[[ -e /media/fat/Scripts/bgm.sh ]] && /media/fat/Scripts/bgm.sh $1

Tritopher
Posts: 6
Joined: Wed Nov 30, 2022 7:07 am

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by Tritopher »

So I had bought a preconfigured MiSTer, I decided to try just doing a fresh install on a new SD card with the newest versions of everything and it worked no problem. Thanks for the replies, still wondering what the issue was but happy to have it working as expected.

blacklistedcard
Posts: 77
Joined: Mon Jun 08, 2020 1:54 am
Has thanked: 3 times
Been thanked: 9 times

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by blacklistedcard »

eLLuiGi wrote: Mon Aug 15, 2022 8:36 am

Any ini example for playing internet stream please ;-)

Check out the zipfile on the "2" tab in this thread. It has examples that I'm using.

User avatar
mrchrister
Posts: 230
Joined: Tue Mar 30, 2021 6:23 pm
Location: Canada
Has thanked: 16 times
Been thanked: 78 times

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by mrchrister »

80.pls

Code: Select all

[playlist]
NumberOfEntries=1
File1=http://server5.radio-streams.net:8001/live
Length1=-1

This is the stream Super Attract Mode is playing when enabling BGM.

pbsk8
Posts: 257
Joined: Mon Dec 28, 2020 4:23 pm
Has thanked: 67 times
Been thanked: 32 times

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by pbsk8 »

prom wrote: Mon Aug 15, 2022 12:27 pm

Try this for a selection of synthwave : https://hubble.shoutca.st:2199/tunein/synthwave.pls

I played it in my pc this playlist, looks nice recommendation

User avatar
Yopachi
Posts: 6
Joined: Mon Feb 22, 2021 4:15 am
Has thanked: 19 times
Been thanked: 3 times

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by Yopachi »

I've started using BGM and I have some questions. I downloaded:
Blank Banshee - Music For Menus
from bandcamp. The _boot mp3 plays followed by a random looping track. Super super cool!

  1. The music is almost twice as loud as the cores but the BGM volume is controlled by the master volume. Is there a way to change volume to the main menu core?

  2. The boot mp3 and music take some time to start, 20 seconds. The wifi and other mister features all seem to come on at the same time with the music. Is there a way to start it sooner?

Sorry if I'm asking something already covered in the github, I'm more artist than engineer :ugeek: I could edit the mp3s in audacity if I really need to change the volume. Xox great script regardless!!

User avatar
neogeo81
Posts: 374
Joined: Fri Apr 16, 2021 1:52 pm
Has thanked: 32 times
Been thanked: 45 times

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by neogeo81 »

I have also the same issue with the volume.

The starting time is something that can't be changed i think as the mister needs to startup befor the scripts start running.

User avatar
wizzo
Scripting Wizard
Posts: 183
Joined: Sat Mar 12, 2022 11:32 am
Has thanked: 15 times
Been thanked: 240 times

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by wizzo »

Yopachi wrote: Fri Dec 30, 2022 9:14 am
  1. The music is almost twice as loud as the cores but the BGM volume is controlled by the master volume. Is there a way to change volume to the main menu core?

  2. The boot mp3 and music take some time to start, 20 seconds. The wifi and other mister features all seem to come on at the same time with the music. Is there a way to start it sooner?

Hi. Glad it is mostly working well for you.

For number 1: I believe there actually is a way now to control the main volume via script, so this may finally be fixed. I have to investigate the best way to handle it though, because I still need to make the script manually manage the main volume, and make a decision on how to best decide that volume or receive an input for a setting. Anyway, quickest solution is to change the volume on all your songs manually, but watch this space.

2: Nothing I can do about that one from my end sorry. It's just the nature of mister's current boot process. I think you could probably make it start faster yourself, maybe by moving the scripts launch to inittab or making a custom service file. Problem with this is that your changes may disappear after a linux update, and on my end it's actually a good thing to wait for the network to come up because some people use radio streams with the script.

Malor
Top Contributor
Posts: 860
Joined: Wed Feb 09, 2022 11:50 pm
Has thanked: 64 times
Been thanked: 194 times

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by Malor »

If you're starting the music player with a script in /etc/init.d, just renaming it would change the boot order. The scripts are run in SXXscriptname order, so that S30dbus runs before S40network. If you rename the music player script to be something like S39whatever, it will launch before the network script runs.

However, between Linux updates and whatever wizzo's management script is doing, these changes could disappear, or end up launching the player twice. Expect pain if you start dabbling.

User avatar
Yopachi
Posts: 6
Joined: Mon Feb 22, 2021 4:15 am
Has thanked: 19 times
Been thanked: 3 times

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by Yopachi »

If anyone else is editing their mp3s in Audacity, I used the dropdown for "Effects" then "Amplify" -13 db
Dropping my tracks about 13 decibels seemed to match the other cores for me. I'm getting used to the music starting with wifi. It's a nice audio que that I can start transferring files ;)

User avatar
wizzo
Scripting Wizard
Posts: 183
Joined: Sat Mar 12, 2022 11:32 am
Has thanked: 15 times
Been thanked: 240 times

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by wizzo »

Recently I added support for BGM to change the global volume at core/menu launch. So you can set a custom volume while in the menu. This is a workaround for the problem where people's music plays too loud/quiet compared to the cores.

See here for instructions to use it: https://github.com/wizzomafizzo/MiSTer_ ... me-control

Basically just update bgm to latest version, turn your mister off and on again, then set the 2 new "Menu volume" and "Default volume" settings from the bgm gui.

This has been buggy, so I'm curious for feedback about it. I have had a report that the feature introduces a "popping" noise on core launch that I can't reproduce. In general it works well though.

Malor wrote: Tue Jan 03, 2023 12:03 am

However, between Linux updates and whatever wizzo's management script is doing, these changes could disappear, or end up launching the player twice. Expect pain if you start dabbling.

For me, all I do is add a line to user-startup.sh to launch the BGM script as a daemon. It checks if it's running already, so I think should be no harm my end messing about and trying to make a new init script without any other changes. I did actually try to do this a long time ago, but for some reason it the script still didn't start playing until network came up, and I gave up. I don't know if I goofed something up or if it was some other issue.

If someone made a working init script that launches before bluetooth and network I would be happy to add it to the repo and mention in the docs about it as an option.

Post Reply