Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Feature request) Compatibility with MiSTer BGM? #120

Closed
felleg opened this issue Apr 16, 2022 · 20 comments
Closed

(Feature request) Compatibility with MiSTer BGM? #120

felleg opened this issue Apr 16, 2022 · 20 comments

Comments

@felleg
Copy link
Contributor

felleg commented Apr 16, 2022

A new script was created (MiSTer BGM) that allows playing music in the main menu of MiSTer. I was wondering if for MiSTer SAM it would be possible to run SAM with MiSTer BGM audio instead of (or over?) the cores' audio.

In my opinion, this would make the "screensaver" aspect of SAM even more soothing, or rockin', depending on the intended mood.

@mrchrisster
Copy link
Owner

Unfortunately afaik we don't have control over the core's audio from the Linux side. This would be great I hear you. If somebody knows how to control audio from Linux, I'd love to hear it!

@seascape
Copy link

seascape commented Apr 17, 2022

MiSTer BGM script can play audio while cores are loaded, right? (I've not tried this.) If yes and you do that, and reduce the core-specific volume level, is the MiSTer BGM volume affected too? I suspect it is, but if not, then you could have MiSTer BGM at listenable volume while the core volume is zeroed. Could do that for all cores you want to have MiSTer SAM + MiSTer BGM work together on.

Again though, I suspect MiSTer BGM's volume will get zeroed too.

@mrchrisster
Copy link
Owner

How do you reduce core specific volume level from shell? Even if it doesn't play nicely with BGM it would be great to have no sounds playing while SAM is active.

@seascape
Copy link

seascape commented Apr 17, 2022

I'm referring to the "core volume" level control that is in the left-most menu screen of any loaded core. Below it is "global volume". And I'm suggesting the user would have to zero the volumes in each core they want SAM to use ahead of time. (Maybe it could even be done semi-programmatically by copying in a core config file that has the volume pre-zeroed. Kinda messy though.)

Edit: Expanded my answer a bit.

@mrchrisster
Copy link
Owner

I understand. SAM would need to be able to control volume though.

@mrchrisster
Copy link
Owner

Your comment got me thinking. I just pushed a new feature to SAM, which mutes global volume while SAM is active. Please reset and update (to pull a fresh ini) and report any issues. If this works than the next step could be to integrate BGM.

@mrchrisster
Copy link
Owner

Getting close to a release for this

@mrchrisster
Copy link
Owner

BGM support is now implemented. You can update and then enable it in the menu "Background Music Player"

@felleg
Copy link
Contributor Author

felleg commented Jun 24, 2022

Thanks! I tried it this morning. I love where this is going, but I have 1 major issue.

The script correctly does everything, including downloading 80s.pls, muting the core, etc. but for some reason the music is not playing while SAM is running. The core is correctly muted, however, and I hear my music upon rebooting the MiSTer. As soon as SAM launches a core, what I get is silence (and the core's sound at very low volume).

@felleg
Copy link
Contributor Author

felleg commented Jun 24, 2022

I just noticed this error log when I run MiSTer_SAM_on.sh to enable bgm mode:

 BGM script is installed already. Continuing with setup.
 Resetting BGM
 Updating MiSTer_SAM.ini to use Mute=Core
Traceback (most recent call last):
  File "/media/fat/Scripts/bgm.sh", line 766, in <module>
    display_gui()
  File "/media/fat/Scripts/bgm.sh", line 644, in display_gui
    status = get_status()
  File "/media/fat/Scripts/bgm.sh", line 549, in get_status
    return send_socket("status").split("\t")
AttributeError: 'NoneType' object has no attribute 'split'
 Downloading from https://github.com/mrchrisster/MiSTer_SAM/blob/main/Media/80s.pls to /media/fat/music/... Done!
 All Done. Starting SAM now.
 Stopping other running instances of MiSTer_SAM_on.sh... Done!
 Starting SAM in the background.

Seems to be an error in the bgm.sh?

@mrchrisster
Copy link
Owner

Maybe it's an older version? Can you try the disable BGM option and then try the enable again?

@mrchrisster
Copy link
Owner

Unfortunately it's a limitation of MiSTer that you can't fully mute a core, you can just turn the volume low. I hope this will change in future versions of MiSTer main. I'll put in a feature request.

@felleg
Copy link
Contributor Author

felleg commented Jun 24, 2022

Maybe it's an older version? Can you try the disable BGM option and then try the enable again?

Actually, I did mv /media/fat/Scripts/bgm* /root/junk/ and enabled bgm to make sure this wasn't the case, and that's when the error happened the first time

Unfortunately it's a limitation of MiSTer that you can't fully mute a core, you can just turn the volume low. I hope this will change in future versions of MiSTer main. I'll put in a feature request.

Honestly, I think I prefer it as it is than full mute! It would let some characteristic sound effects bleed through, and I think that could potentially be very interesting.

@mrchrisster
Copy link
Owner

Strange, I'm now getting similar error messages after a reboot. Let me look into it and thanks for testing!

@mrchrisster
Copy link
Owner

Looks like there is a bug in bgm.sh if startup is set to no but i was able to work around it. Just pushed the changes so if you update SAM, it should hopefully work now.
Interesting take on letting game sounds bleed through. You're right, it's not super distracting.

@felleg
Copy link
Contributor Author

felleg commented Jun 27, 2022

Looks like it is working great now! For my own needs, this will suffice. Here I point out some slight instabilities / nitpicks, but thanks again for your great work!

  • When trying to access the global volume setting via OSD, the sound frequently cuts
  • When skipping a game via MiSTer_SAM_on.sh, the sound cuts

Other feedback:

  • The 80s playlist works fine, but seem to take precedence over the *.mp3 files I put in /media/fat/music. I can rm 80s.pls to fix this issue, but I fear this will initially confuse some users.

@mrchrisster
Copy link
Owner

Great, thanks for your feedback. I don't have mp3s in my music folder so that's great to know. I'll add some notes in the menu.

The sound cutting is because of core changes and the fpga reconfiguring. Unfortunately that is not something we can mitigate.
Not sure I understand your first feedback point. What exactly happens when accessing global volume?

@felleg
Copy link
Contributor Author

felleg commented Jun 27, 2022

The sound cutting is because of core changes and the fpga reconfiguring. Unfortunately that is not something we can mitigate.

My bad, I wasn't being clear: I mean the sound cuts and stays cut, i.e. the music gets turned off permanently ;)

Not sure I understand your first feedback point. What exactly happens when accessing global volume?

This means when I open the OSD, press left then up to reach the global volume setting, the music gets turned off apparently.

@mrchrisster
Copy link
Owner

Skip command should now not end bgm anymore. wizzo from the BGM project was nice enough to write some control feature for SAM.
You can update BGM from SAM's menu, hopefully it works now. I can't replicate the OSD issue you are having.

@felleg
Copy link
Contributor Author

felleg commented Jul 1, 2022

Awesome work!! Thanks so much!

I can live with my issue of sound cutting. In particular, I will study the bgm.sh script more closely and create an issue if needed.

Closing this issue.

@felleg felleg closed this as completed Jul 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants