Hello! It's been a while since I last posted something here!
I've been receiving some reports about the built-in synthesizer messing around with OmniMIDI, by either preventing it from opening a stream or by just making it crash the entire program (OmniMIDI fails to initialize the output and it crashes).
Would it be possible to only initialize BASS when the built-in synthesizer is enabled, and to free up the DLLs once it's not needed anymore?
That would fix the issue without actually requiring lots of code rework for both ends.
I tried making OmniMIDI not load its own DLLs and to just make it get a handle to yours through GetModuleHandle, but it still won't work properly.
Initialize BASS only when the Built-In Synthesizer is enabled
Search the forum before posting your idea.
No explicit, hateful, or hurtful language. Nothing illegal.
No explicit, hateful, or hurtful language. Nothing illegal.
-
- Posts: 58
Yeah it is.
I disabled all the MIDI output devices, then restarted Synthesia, and it still loads the DLLs to memory.
I know it's not OmniMIDI because both the DLLs are from Synthesia's folder, and OM loads some more DLLs other than BASS and BASSMIDI.
Ah ha, you are correct. It uses the presence of the DLL files on the search path (and whether each of the required methods can be resolved) to determine whether to even show the built-in synth in the list.
If you remove the DLLs from Synthesia's folder (and the rest of the search path), that should prevent them from being loaded.
If you remove the DLLs from Synthesia's folder (and the rest of the search path), that should prevent them from being loaded.
-
- Posts: 58
Yeah, but that's a "hack".
I honestly don't want to tell each user to remove the BASS libraries from Synthesia's main folder, just to get OmniMIDI to work.
You could check if the DLLs are valid on boot-up, then unload them once they're not needed anymore.
I honestly don't want to tell each user to remove the BASS libraries from Synthesia's main folder, just to get OmniMIDI to work.
You could check if the DLLs are valid on boot-up, then unload them once they're not needed anymore.
Unloading and re-loading the DLLs repeatedly to work around this issue also sounds like a hack.
VirtualMIDISynth doesn't appear to suffer from the same issue: I was able to have both loaded simultaneously without any trouble. Are you sure the bug isn't more of an OmniMIDI issue than a multiply-loaded BASS issue?
VirtualMIDISynth doesn't appear to suffer from the same issue: I was able to have both loaded simultaneously without any trouble. Are you sure the bug isn't more of an OmniMIDI issue than a multiply-loaded BASS issue?
-
- Posts: 58
VirtualMIDISynth 2.x has a separate rendering process, so it won't be affected by the issue, since it will load BASS externally to the app.
You will definitely get the same issue by installing VirtualMIDISynth 1.x, which will try to load BASS and either have no audio or crash.
OmniMIDI seems to behave fine, it loads and unloads the libs as it should (or get a reference if GetModuleHandle finds them in memory, and of course OM doesn't call FreeLibrary on the pointers ), but BASS doesnt know what to do during the OM initialization process because BASS_Init has been already called somewhere else.
I made OM free BASS (BASS_Free) before reinitializing it, but that still doesn't seem to fix the issue.
You will definitely get the same issue by installing VirtualMIDISynth 1.x, which will try to load BASS and either have no audio or crash.
OmniMIDI seems to behave fine, it loads and unloads the libs as it should (or get a reference if GetModuleHandle finds them in memory, and of course OM doesn't call FreeLibrary on the pointers ), but BASS doesnt know what to do during the OM initialization process because BASS_Init has been already called somewhere else.
I made OM free BASS (BASS_Free) before reinitializing it, but that still doesn't seem to fix the issue.
This sounds like a pretty useful scheme to avoid the problem.KaleidonKep99 wrote: ↑02-25-21 12:39 amVirtualMIDISynth 2.x has a separate rendering process, so it won't be affected by the issue, since it will load BASS externally to the app.
We both chose a library that should only be initialized once. I chose it for a stand-alone app. You chose it for one that hooks into other apps. (So presumably you'd run into the same trouble in every MIDI app if the user also had VirtualMIDISynth 1.x installed on the same machine, right?) It sounds like a separate rendering process for OmniMIDI would solve all possible versions of this problem in the future.