Skip to content

Only a Single Emulator Core Can Play Audio at Once #28

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

Open
Enverex opened this issue Feb 14, 2025 · 4 comments
Open

Only a Single Emulator Core Can Play Audio at Once #28

Enverex opened this issue Feb 14, 2025 · 4 comments

Comments

@Enverex
Copy link

Enverex commented Feb 14, 2025

So I'm trying to set up a handful of arcade machines next to each other and that itself works, they boot and run fine, but it seems only the last machine to start actually outputs audio (I've set it to use Unity audio otherwise it's not positional when it uses NAudio).

Is there some way of making them all play nice together and all outputting their own sound?

@Skurdt
Copy link
Owner

Skurdt commented Feb 15, 2025

It sounds like you are using an older version of the repo as both the ability to start multiple instances (IL2CPP issues) and the NAudio implementation (replaced by SDL) were removed.

If that's the case, while multiple cores could run, the older Unity Audio implementation directly altered the global audio settings (sample rate and channel count). Which makes it impossible to play multiple audio sources properly. Although, if the core and game are the same (or use the same audio config) on both instances, I think it worked back then... but it's been a while.
I have a hacky way to send positional audio to sdl but that's not commited yet, and starting multiple instances still isn't done.

You could replace the old audio processor with the new code, which uses burst and basic resampling without touching the global settings, not a simple copy paste but it should work with a little bit of troubleshooting...

@Enverex
Copy link
Author

Enverex commented Feb 15, 2025

Ah, I was running the reference example (LibretroUnityFE) which I assume is on the old code then (I thought they were in sync). I'll try and shoehorn in the new audio code and see if that works.

Definitely looking forward to being able to do this normally though as being able to put together an arcade like that would be amazing.

@Skurdt
Copy link
Owner

Skurdt commented Feb 15, 2025

LibretroUnityFE doesn't contain any previous version of the lib, it directly depends on SK.Libretro using the package manager/manifest.
Updating from a previous version does require clicking the update button in the package manager (or pull again in an empty folder).
Although there are a couple of key fixes on the current version, you will loose the ability to start multiple roms at once...

Keep in mind that running multiple cores is quite performance heavy depending on the emulator, especially the more complicated the rest of the unity scene gets. The most common used trick is to play videos or images on other cabs and only actually emulate the current selection.

@Enverex
Copy link
Author

Enverex commented Feb 15, 2025

Odd, I only installed it (FE) for the first time a few days ago, so I would have expected it to be the latest version, unless it's explicitly pulling in an older version.

Videos on cabs and swapping to the real one on-demand was my original idea and is still my fallback concept. Regarding emulation - They were all going to be light systems running in the first place - I already had 4 running simultaneously with only very little overhead. I'll probably just stick to the single system and swap it around, even just for sanity's sake in the long run..

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

2 participants